1// Copyright 2021 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	// See, edit, configure, and delete your Google Cloud Platform data
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] billingAccounts/[BILLING_ACCOUNT_ID]
1247	// folders/[FOLDER_ID]May alternatively be one or more views:
1248	// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view
1249	// s/[VIEW_ID]
1250	// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE
1251	// T_ID]/views/[VIEW_ID]
1252	// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[
1253	// BUCKET_ID]/views/[VIEW_ID]
1254	// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/
1255	// [VIEW_ID]Projects listed in the project_ids field are added to this
1256	// 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, us-central1, us-east1, us-west1,
1599	// asia-east1, europe-west1.For the location of global it is unspecified
1600	// where logs are actually stored. Once a bucket has been created, the
1601	// location can not be changed.
1602	Name string `json:"name,omitempty"`
1603
1604	// RestrictedFields: Log entry field paths that are denied access in
1605	// this bucket. The following fields and their children are eligible:
1606	// textPayload, jsonPayload, protoPayload, httpRequest, labels,
1607	// sourceLocation. Restricting a repeated field will restrict all
1608	// values. Adding a parent will block all child fields e.g. foo.bar will
1609	// block foo.bar.baz.
1610	RestrictedFields []string `json:"restrictedFields,omitempty"`
1611
1612	// RetentionDays: Logs will be retained by default for this amount of
1613	// time, after which they will automatically be deleted. The minimum
1614	// retention period is 1 day. If this value is set to zero at bucket
1615	// creation time, the default time of 30 days will be used.
1616	RetentionDays int64 `json:"retentionDays,omitempty"`
1617
1618	// UpdateTime: Output only. The last update timestamp of the bucket.
1619	UpdateTime string `json:"updateTime,omitempty"`
1620
1621	// ServerResponse contains the HTTP response code and headers from the
1622	// server.
1623	googleapi.ServerResponse `json:"-"`
1624
1625	// ForceSendFields is a list of field names (e.g. "CreateTime") to
1626	// unconditionally include in API requests. By default, fields with
1627	// empty values are omitted from API requests. However, any non-pointer,
1628	// non-interface field appearing in ForceSendFields will be sent to the
1629	// server regardless of whether the field is empty or not. This may be
1630	// used to include empty fields in Patch requests.
1631	ForceSendFields []string `json:"-"`
1632
1633	// NullFields is a list of field names (e.g. "CreateTime") to include in
1634	// API requests with the JSON null value. By default, fields with empty
1635	// values are omitted from API requests. However, any field with an
1636	// empty value appearing in NullFields will be sent to the server as
1637	// null. It is an error if a field in this list has a non-empty value.
1638	// This may be used to include null fields in Patch requests.
1639	NullFields []string `json:"-"`
1640}
1641
1642func (s *LogBucket) MarshalJSON() ([]byte, error) {
1643	type NoMethod LogBucket
1644	raw := NoMethod(*s)
1645	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1646}
1647
1648// LogEntry: An individual entry in a log.
1649type LogEntry struct {
1650	// HttpRequest: Optional. Information about the HTTP request associated
1651	// with this log entry, if applicable.
1652	HttpRequest *HttpRequest `json:"httpRequest,omitempty"`
1653
1654	// InsertId: Optional. A unique identifier for the log entry. If you
1655	// provide a value, then Logging considers other log entries in the same
1656	// project, with the same timestamp, and with the same insert_id to be
1657	// duplicates which are removed in a single query result. However, there
1658	// are no guarantees of de-duplication in the export of logs.If the
1659	// insert_id is omitted when writing a log entry, the Logging API
1660	// assigns its own unique identifier in this field.In queries, the
1661	// insert_id is also used to order log entries that have the same
1662	// log_name and timestamp values.
1663	InsertId string `json:"insertId,omitempty"`
1664
1665	// JsonPayload: The log entry payload, represented as a structure that
1666	// is expressed as a JSON object.
1667	JsonPayload googleapi.RawMessage `json:"jsonPayload,omitempty"`
1668
1669	// Labels: Optional. A set of user-defined (key, value) data that
1670	// provides additional information about the log entry.Cloud Logging
1671	// truncates label keys that exceed 512 B and label values that exceed
1672	// 64 KB upon their associated log entry being written. The truncation
1673	// is indicated by an ellipsis at the end of the character string.
1674	Labels map[string]string `json:"labels,omitempty"`
1675
1676	// LogName: Required. The resource name of the log to which this log
1677	// entry belongs: "projects/[PROJECT_ID]/logs/[LOG_ID]"
1678	// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
1679	// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
1680	// "folders/[FOLDER_ID]/logs/[LOG_ID]" A project number may be used in
1681	// place of PROJECT_ID. The project number is translated to its
1682	// corresponding PROJECT_ID internally and the log_name field will
1683	// contain PROJECT_ID in queries and exports.[LOG_ID] must be
1684	// URL-encoded within log_name. Example:
1685	// "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Fa
1686	// ctivity". [LOG_ID] must be less than 512 characters long and can only
1687	// include the following characters: upper and lower case alphanumeric
1688	// characters, forward-slash, underscore, hyphen, and period.For
1689	// backward compatibility, if log_name begins with a forward-slash, such
1690	// as /projects/..., then the log entry is ingested as usual but the
1691	// forward-slash is removed. Listing the log entry will not show the
1692	// leading slash and filtering for a log name with a leading slash will
1693	// never return any results.
1694	LogName string `json:"logName,omitempty"`
1695
1696	// Metadata: Output only. Deprecated. Additional metadata about the
1697	// monitored resource.Only k8s_container, k8s_pod, and k8s_node
1698	// MonitoredResources have this field populated for GKE versions older
1699	// than 1.12.6. For GKE versions 1.12.6 and above, the metadata field
1700	// has been deprecated. The Kubernetes pod labels that used to be in
1701	// metadata.userLabels will now be present in the labels field with a
1702	// key prefix of k8s-pod/. The system labels that were present in the
1703	// metadata.systemLabels field will no longer be available in the log
1704	// entry.
1705	Metadata *MonitoredResourceMetadata `json:"metadata,omitempty"`
1706
1707	// Operation: Optional. Information about an operation associated with
1708	// the log entry, if applicable.
1709	Operation *LogEntryOperation `json:"operation,omitempty"`
1710
1711	// ProtoPayload: The log entry payload, represented as a protocol
1712	// buffer. Some Google Cloud Platform services use this field for their
1713	// log entry payloads.The following protocol buffer types are supported;
1714	// user-defined types are not
1715	// supported:"type.googleapis.com/google.cloud.audit.AuditLog"
1716	// "type.googleapis.com/google.appengine.logging.v1.RequestLog"
1717	ProtoPayload googleapi.RawMessage `json:"protoPayload,omitempty"`
1718
1719	// ReceiveTimestamp: Output only. The time the log entry was received by
1720	// Logging.
1721	ReceiveTimestamp string `json:"receiveTimestamp,omitempty"`
1722
1723	// Resource: Required. The monitored resource that produced this log
1724	// entry.Example: a log entry that reports a database error would be
1725	// associated with the monitored resource designating the particular
1726	// database that reported the error.
1727	Resource *MonitoredResource `json:"resource,omitempty"`
1728
1729	// Severity: Optional. The severity of the log entry. The default value
1730	// is LogSeverity.DEFAULT.
1731	//
1732	// Possible values:
1733	//   "DEFAULT" - (0) The log entry has no assigned severity level.
1734	//   "DEBUG" - (100) Debug or trace information.
1735	//   "INFO" - (200) Routine information, such as ongoing status or
1736	// performance.
1737	//   "NOTICE" - (300) Normal but significant events, such as start up,
1738	// shut down, or a configuration change.
1739	//   "WARNING" - (400) Warning events might cause problems.
1740	//   "ERROR" - (500) Error events are likely to cause problems.
1741	//   "CRITICAL" - (600) Critical events cause more severe problems or
1742	// outages.
1743	//   "ALERT" - (700) A person must take an action immediately.
1744	//   "EMERGENCY" - (800) One or more systems are unusable.
1745	Severity string `json:"severity,omitempty"`
1746
1747	// SourceLocation: Optional. Source code location information associated
1748	// with the log entry, if any.
1749	SourceLocation *LogEntrySourceLocation `json:"sourceLocation,omitempty"`
1750
1751	// SpanId: Optional. The span ID within the trace associated with the
1752	// log entry.For Trace spans, this is the same format that the Trace API
1753	// v2 uses: a 16-character hexadecimal encoding of an 8-byte array, such
1754	// as 000000000000004a.
1755	SpanId string `json:"spanId,omitempty"`
1756
1757	// TextPayload: The log entry payload, represented as a Unicode string
1758	// (UTF-8).
1759	TextPayload string `json:"textPayload,omitempty"`
1760
1761	// Timestamp: Optional. The time the event described by the log entry
1762	// occurred. This time is used to compute the log entry's age and to
1763	// enforce the logs retention period. If this field is omitted in a new
1764	// log entry, then Logging assigns it the current time. Timestamps have
1765	// nanosecond accuracy, but trailing zeros in the fractional seconds
1766	// might be omitted when the timestamp is displayed.Incoming log entries
1767	// must have timestamps that don't exceed the logs retention period
1768	// (https://cloud.google.com/logging/quotas#logs_retention_periods) in
1769	// the past, and that don't exceed 24 hours in the future. Log entries
1770	// outside those time boundaries aren't ingested by Logging.
1771	Timestamp string `json:"timestamp,omitempty"`
1772
1773	// Trace: Optional. Resource name of the trace associated with the log
1774	// entry, if any. If it contains a relative resource name, the name is
1775	// assumed to be relative to //tracing.googleapis.com. Example:
1776	// projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824
1777	Trace string `json:"trace,omitempty"`
1778
1779	// TraceSampled: Optional. The sampling decision of the trace associated
1780	// with the log entry.True means that the trace resource name in the
1781	// trace field was sampled for storage in a trace backend. False means
1782	// that the trace was not sampled for storage when this log entry was
1783	// written, or the sampling decision was unknown at the time. A
1784	// non-sampled trace value is still useful as a request correlation
1785	// identifier. The default is False.
1786	TraceSampled bool `json:"traceSampled,omitempty"`
1787
1788	// ForceSendFields is a list of field names (e.g. "HttpRequest") to
1789	// unconditionally include in API requests. By default, fields with
1790	// empty values are omitted from API requests. However, any non-pointer,
1791	// non-interface field appearing in ForceSendFields will be sent to the
1792	// server regardless of whether the field is empty or not. This may be
1793	// used to include empty fields in Patch requests.
1794	ForceSendFields []string `json:"-"`
1795
1796	// NullFields is a list of field names (e.g. "HttpRequest") to include
1797	// in API requests with the JSON null value. By default, fields with
1798	// empty values are omitted from API requests. However, any field with
1799	// an empty value appearing in NullFields will be sent to the server as
1800	// null. It is an error if a field in this list has a non-empty value.
1801	// This may be used to include null fields in Patch requests.
1802	NullFields []string `json:"-"`
1803}
1804
1805func (s *LogEntry) MarshalJSON() ([]byte, error) {
1806	type NoMethod LogEntry
1807	raw := NoMethod(*s)
1808	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1809}
1810
1811// LogEntryOperation: Additional information about a potentially
1812// long-running operation with which a log entry is associated.
1813type LogEntryOperation struct {
1814	// First: Optional. Set this to True if this is the first log entry in
1815	// the operation.
1816	First bool `json:"first,omitempty"`
1817
1818	// Id: Optional. An arbitrary operation identifier. Log entries with the
1819	// same identifier are assumed to be part of the same operation.
1820	Id string `json:"id,omitempty"`
1821
1822	// Last: Optional. Set this to True if this is the last log entry in the
1823	// operation.
1824	Last bool `json:"last,omitempty"`
1825
1826	// Producer: Optional. An arbitrary producer identifier. The combination
1827	// of id and producer must be globally unique. Examples for producer:
1828	// "MyDivision.MyBigCompany.com", "github.com/MyProject/MyApplication".
1829	Producer string `json:"producer,omitempty"`
1830
1831	// ForceSendFields is a list of field names (e.g. "First") to
1832	// unconditionally include in API requests. By default, fields with
1833	// empty values are omitted from API requests. However, any non-pointer,
1834	// non-interface field appearing in ForceSendFields will be sent to the
1835	// server regardless of whether the field is empty or not. This may be
1836	// used to include empty fields in Patch requests.
1837	ForceSendFields []string `json:"-"`
1838
1839	// NullFields is a list of field names (e.g. "First") to include in API
1840	// requests with the JSON null value. By default, fields with empty
1841	// values are omitted from API requests. However, any field with an
1842	// empty value appearing in NullFields will be sent to the server as
1843	// null. It is an error if a field in this list has a non-empty value.
1844	// This may be used to include null fields in Patch requests.
1845	NullFields []string `json:"-"`
1846}
1847
1848func (s *LogEntryOperation) MarshalJSON() ([]byte, error) {
1849	type NoMethod LogEntryOperation
1850	raw := NoMethod(*s)
1851	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1852}
1853
1854// LogEntrySourceLocation: Additional information about the source code
1855// location that produced the log entry.
1856type LogEntrySourceLocation struct {
1857	// File: Optional. Source file name. Depending on the runtime
1858	// environment, this might be a simple name or a fully-qualified name.
1859	File string `json:"file,omitempty"`
1860
1861	// Function: Optional. Human-readable name of the function or method
1862	// being invoked, with optional context such as the class or package
1863	// name. This information may be used in contexts such as the logs
1864	// viewer, where a file and line number are less meaningful. The format
1865	// can vary by language. For example: qual.if.ied.Class.method (Java),
1866	// dir/package.func (Go), function (Python).
1867	Function string `json:"function,omitempty"`
1868
1869	// Line: Optional. Line within the source file. 1-based; 0 indicates no
1870	// line number available.
1871	Line int64 `json:"line,omitempty,string"`
1872
1873	// ForceSendFields is a list of field names (e.g. "File") to
1874	// unconditionally include in API requests. By default, fields with
1875	// empty values are omitted from API requests. However, any non-pointer,
1876	// non-interface field appearing in ForceSendFields will be sent to the
1877	// server regardless of whether the field is empty or not. This may be
1878	// used to include empty fields in Patch requests.
1879	ForceSendFields []string `json:"-"`
1880
1881	// NullFields is a list of field names (e.g. "File") to include in API
1882	// requests with the JSON null value. By default, fields with empty
1883	// values are omitted from API requests. However, any field with an
1884	// empty value appearing in NullFields will be sent to the server as
1885	// null. It is an error if a field in this list has a non-empty value.
1886	// This may be used to include null fields in Patch requests.
1887	NullFields []string `json:"-"`
1888}
1889
1890func (s *LogEntrySourceLocation) MarshalJSON() ([]byte, error) {
1891	type NoMethod LogEntrySourceLocation
1892	raw := NoMethod(*s)
1893	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1894}
1895
1896// LogExclusion: Specifies a set of log entries that are not to be
1897// stored in Logging. If your GCP resource receives a large volume of
1898// logs, you can use exclusions to reduce your chargeable logs.
1899// Exclusions are processed after log sinks, so you can export log
1900// entries before they are excluded. Note that organization-level and
1901// folder-level exclusions don't apply to child resources, and that you
1902// can't exclude audit log entries.
1903type LogExclusion struct {
1904	// CreateTime: Output only. The creation timestamp of the exclusion.This
1905	// field may not be present for older exclusions.
1906	CreateTime string `json:"createTime,omitempty"`
1907
1908	// Description: Optional. A description of this exclusion.
1909	Description string `json:"description,omitempty"`
1910
1911	// Disabled: Optional. If set to True, then this exclusion is disabled
1912	// and it does not exclude any log entries. You can update an exclusion
1913	// to change the value of this field.
1914	Disabled bool `json:"disabled,omitempty"`
1915
1916	// Filter: Required. An advanced logs filter
1917	// (https://cloud.google.com/logging/docs/view/advanced-queries) that
1918	// matches the log entries to be excluded. By using the sample function
1919	// (https://cloud.google.com/logging/docs/view/advanced-queries#sample),
1920	// you can exclude less than 100% of the matching log entries. For
1921	// example, the following query matches 99% of low-severity log entries
1922	// from Google Cloud Storage buckets:"resource.type=gcs_bucket
1923	// severity<ERROR sample(insertId, 0.99)"
1924	Filter string `json:"filter,omitempty"`
1925
1926	// Name: Required. A client-assigned identifier, such as
1927	// "load-balancer-exclusion". Identifiers are limited to 100 characters
1928	// and can include only letters, digits, underscores, hyphens, and
1929	// periods. First character has to be alphanumeric.
1930	Name string `json:"name,omitempty"`
1931
1932	// UpdateTime: Output only. The last update timestamp of the
1933	// exclusion.This field may not be present for older exclusions.
1934	UpdateTime string `json:"updateTime,omitempty"`
1935
1936	// ServerResponse contains the HTTP response code and headers from the
1937	// server.
1938	googleapi.ServerResponse `json:"-"`
1939
1940	// ForceSendFields is a list of field names (e.g. "CreateTime") to
1941	// unconditionally include in API requests. By default, fields with
1942	// empty values are omitted from API requests. However, any non-pointer,
1943	// non-interface field appearing in ForceSendFields will be sent to the
1944	// server regardless of whether the field is empty or not. This may be
1945	// used to include empty fields in Patch requests.
1946	ForceSendFields []string `json:"-"`
1947
1948	// NullFields is a list of field names (e.g. "CreateTime") to include in
1949	// API requests with the JSON null value. By default, fields with empty
1950	// values are omitted from API requests. However, any field with an
1951	// empty value appearing in NullFields will be sent to the server as
1952	// null. It is an error if a field in this list has a non-empty value.
1953	// This may be used to include null fields in Patch requests.
1954	NullFields []string `json:"-"`
1955}
1956
1957func (s *LogExclusion) MarshalJSON() ([]byte, error) {
1958	type NoMethod LogExclusion
1959	raw := NoMethod(*s)
1960	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1961}
1962
1963// LogLine: Application log line emitted while processing a request.
1964type LogLine struct {
1965	// LogMessage: App-provided log message.
1966	LogMessage string `json:"logMessage,omitempty"`
1967
1968	// Severity: Severity of this log entry.
1969	//
1970	// Possible values:
1971	//   "DEFAULT" - (0) The log entry has no assigned severity level.
1972	//   "DEBUG" - (100) Debug or trace information.
1973	//   "INFO" - (200) Routine information, such as ongoing status or
1974	// performance.
1975	//   "NOTICE" - (300) Normal but significant events, such as start up,
1976	// shut down, or a configuration change.
1977	//   "WARNING" - (400) Warning events might cause problems.
1978	//   "ERROR" - (500) Error events are likely to cause problems.
1979	//   "CRITICAL" - (600) Critical events cause more severe problems or
1980	// outages.
1981	//   "ALERT" - (700) A person must take an action immediately.
1982	//   "EMERGENCY" - (800) One or more systems are unusable.
1983	Severity string `json:"severity,omitempty"`
1984
1985	// SourceLocation: Where in the source code this log message was
1986	// written.
1987	SourceLocation *SourceLocation `json:"sourceLocation,omitempty"`
1988
1989	// Time: Approximate time when this log entry was made.
1990	Time string `json:"time,omitempty"`
1991
1992	// ForceSendFields is a list of field names (e.g. "LogMessage") to
1993	// unconditionally include in API requests. By default, fields with
1994	// empty values are omitted from API requests. However, any non-pointer,
1995	// non-interface field appearing in ForceSendFields will be sent to the
1996	// server regardless of whether the field is empty or not. This may be
1997	// used to include empty fields in Patch requests.
1998	ForceSendFields []string `json:"-"`
1999
2000	// NullFields is a list of field names (e.g. "LogMessage") to include in
2001	// API requests with the JSON null value. By default, fields with empty
2002	// values are omitted from API requests. However, any field with an
2003	// empty value appearing in NullFields will be sent to the server as
2004	// null. It is an error if a field in this list has a non-empty value.
2005	// This may be used to include null fields in Patch requests.
2006	NullFields []string `json:"-"`
2007}
2008
2009func (s *LogLine) MarshalJSON() ([]byte, error) {
2010	type NoMethod LogLine
2011	raw := NoMethod(*s)
2012	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2013}
2014
2015// LogMetric: Describes a logs-based metric. The value of the metric is
2016// the number of log entries that match a logs filter in a given time
2017// interval.Logs-based metrics can also be used to extract values from
2018// logs and create a distribution of the values. The distribution
2019// records the statistics of the extracted values along with an optional
2020// histogram of the values as specified by the bucket options.
2021type LogMetric struct {
2022	// BucketOptions: Optional. The bucket_options are required when the
2023	// logs-based metric is using a DISTRIBUTION value type and it describes
2024	// the bucket boundaries used to create a histogram of the extracted
2025	// values.
2026	BucketOptions *BucketOptions `json:"bucketOptions,omitempty"`
2027
2028	// CreateTime: Output only. The creation timestamp of the metric.This
2029	// field may not be present for older metrics.
2030	CreateTime string `json:"createTime,omitempty"`
2031
2032	// Description: Optional. A description of this metric, which is used in
2033	// documentation. The maximum length of the description is 8000
2034	// characters.
2035	Description string `json:"description,omitempty"`
2036
2037	// Filter: Required. An advanced logs filter
2038	// (https://cloud.google.com/logging/docs/view/advanced_filters) which
2039	// is used to match log entries. Example: "resource.type=gae_app AND
2040	// severity>=ERROR" The maximum length of the filter is 20000
2041	// characters.
2042	Filter string `json:"filter,omitempty"`
2043
2044	// LabelExtractors: Optional. A map from a label key string to an
2045	// extractor expression which is used to extract data from a log entry
2046	// field and assign as the label value. Each label key specified in the
2047	// LabelDescriptor must have an associated extractor expression in this
2048	// map. The syntax of the extractor expression is the same as for the
2049	// value_extractor field.The extracted value is converted to the type
2050	// defined in the label descriptor. If the either the extraction or the
2051	// type conversion fails, the label will have a default value. The
2052	// default value for a string label is an empty string, for an integer
2053	// label its 0, and for a boolean label its false.Note that there are
2054	// upper bounds on the maximum number of labels and the number of active
2055	// time series that are allowed in a project.
2056	LabelExtractors map[string]string `json:"labelExtractors,omitempty"`
2057
2058	// MetricDescriptor: Optional. The metric descriptor associated with the
2059	// logs-based metric. If unspecified, it uses a default metric
2060	// descriptor with a DELTA metric kind, INT64 value type, with no labels
2061	// and a unit of "1". Such a metric counts the number of log entries
2062	// matching the filter expression.The name, type, and description fields
2063	// in the metric_descriptor are output only, and is constructed using
2064	// the name and description field in the LogMetric.To create a
2065	// logs-based metric that records a distribution of log values, a DELTA
2066	// metric kind with a DISTRIBUTION value type must be used along with a
2067	// value_extractor expression in the LogMetric.Each label in the metric
2068	// descriptor must have a matching label name as the key and an
2069	// extractor expression as the value in the label_extractors map.The
2070	// metric_kind and value_type fields in the metric_descriptor cannot be
2071	// updated once initially configured. New labels can be added in the
2072	// metric_descriptor, but existing labels cannot be modified except for
2073	// their description.
2074	MetricDescriptor *MetricDescriptor `json:"metricDescriptor,omitempty"`
2075
2076	// Name: Required. The client-assigned metric identifier. Examples:
2077	// "error_count", "nginx/requests".Metric identifiers are limited to 100
2078	// characters and can include only the following characters: A-Z, a-z,
2079	// 0-9, and the special characters _-.,+!*',()%/. The forward-slash
2080	// character (/) denotes a hierarchy of name pieces, and it cannot be
2081	// the first character of the name.The metric identifier in this field
2082	// must not be URL-encoded
2083	// (https://en.wikipedia.org/wiki/Percent-encoding). However, when the
2084	// metric identifier appears as the [METRIC_ID] part of a metric_name
2085	// API parameter, then the metric identifier must be URL-encoded.
2086	// Example: "projects/my-project/metrics/nginx%2Frequests".
2087	Name string `json:"name,omitempty"`
2088
2089	// UpdateTime: Output only. The last update timestamp of the metric.This
2090	// field may not be present for older metrics.
2091	UpdateTime string `json:"updateTime,omitempty"`
2092
2093	// ValueExtractor: Optional. A value_extractor is required when using a
2094	// distribution logs-based metric to extract the values to record from a
2095	// log entry. Two functions are supported for value extraction:
2096	// EXTRACT(field) or REGEXP_EXTRACT(field, regex). The argument are: 1.
2097	// field: The name of the log entry field from which the value is to be
2098	// extracted. 2. regex: A regular expression using the Google RE2 syntax
2099	// (https://github.com/google/re2/wiki/Syntax) with a single capture
2100	// group to extract data from the specified log entry field. The value
2101	// of the field is converted to a string before applying the regex. It
2102	// is an error to specify a regex that does not include exactly one
2103	// capture group.The result of the extraction must be convertible to a
2104	// double type, as the distribution always records double values. If
2105	// either the extraction or the conversion to double fails, then those
2106	// values are not recorded in the distribution.Example:
2107	// REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")
2108	ValueExtractor string `json:"valueExtractor,omitempty"`
2109
2110	// Version: Deprecated. The API version that created or updated this
2111	// metric. The v2 format is used by default and cannot be changed.
2112	//
2113	// Possible values:
2114	//   "V2" - Logging API v2.
2115	//   "V1" - Logging API v1.
2116	Version string `json:"version,omitempty"`
2117
2118	// ServerResponse contains the HTTP response code and headers from the
2119	// server.
2120	googleapi.ServerResponse `json:"-"`
2121
2122	// ForceSendFields is a list of field names (e.g. "BucketOptions") to
2123	// unconditionally include in API requests. By default, fields with
2124	// empty values are omitted from API requests. However, any non-pointer,
2125	// non-interface field appearing in ForceSendFields will be sent to the
2126	// server regardless of whether the field is empty or not. This may be
2127	// used to include empty fields in Patch requests.
2128	ForceSendFields []string `json:"-"`
2129
2130	// NullFields is a list of field names (e.g. "BucketOptions") to include
2131	// in API requests with the JSON null value. By default, fields with
2132	// empty values are omitted from API requests. However, any field with
2133	// an empty value appearing in NullFields will be sent to the server as
2134	// null. It is an error if a field in this list has a non-empty value.
2135	// This may be used to include null fields in Patch requests.
2136	NullFields []string `json:"-"`
2137}
2138
2139func (s *LogMetric) MarshalJSON() ([]byte, error) {
2140	type NoMethod LogMetric
2141	raw := NoMethod(*s)
2142	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2143}
2144
2145// LogSink: Describes a sink used to export log entries to one of the
2146// following destinations in any project: a Cloud Storage bucket, a
2147// BigQuery dataset, a Cloud Pub/Sub topic or a Cloud Logging Bucket. A
2148// logs filter controls which log entries are exported. The sink must be
2149// created within a project, organization, billing account, or folder.
2150type LogSink struct {
2151	// BigqueryOptions: Optional. Options that affect sinks exporting data
2152	// to BigQuery.
2153	BigqueryOptions *BigQueryOptions `json:"bigqueryOptions,omitempty"`
2154
2155	// CreateTime: Output only. The creation timestamp of the sink.This
2156	// field may not be present for older sinks.
2157	CreateTime string `json:"createTime,omitempty"`
2158
2159	// Description: Optional. A description of this sink. The maximum length
2160	// of the description is 8000 characters.
2161	Description string `json:"description,omitempty"`
2162
2163	// Destination: Required. The export destination:
2164	// "storage.googleapis.com/[GCS_BUCKET]"
2165	// "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
2166	// "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" The
2167	// sink's writer_identity, set when the sink is created, must have
2168	// permission to write to the destination or else the log entries are
2169	// not exported. For more information, see Exporting Logs with Sinks
2170	// (https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
2171	Destination string `json:"destination,omitempty"`
2172
2173	// Disabled: Optional. If set to True, then this sink is disabled and it
2174	// does not export any log entries.
2175	Disabled bool `json:"disabled,omitempty"`
2176
2177	// Exclusions: Optional. Log entries that match any of the exclusion
2178	// filters will not be exported. If a log entry is matched by both
2179	// filter and one of exclusion_filters it will not be exported.
2180	Exclusions []*LogExclusion `json:"exclusions,omitempty"`
2181
2182	// Filter: Optional. An advanced logs filter
2183	// (https://cloud.google.com/logging/docs/view/advanced-queries). The
2184	// only exported log entries are those that are in the resource owning
2185	// the sink and that match the filter. For example:
2186	// logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR
2187	Filter string `json:"filter,omitempty"`
2188
2189	// IncludeChildren: Optional. This field applies only to sinks owned by
2190	// organizations and folders. If the field is false, the default, only
2191	// the logs owned by the sink's parent resource are available for
2192	// export. If the field is true, then logs from all the projects,
2193	// folders, and billing accounts contained in the sink's parent resource
2194	// are also available for export. Whether a particular log entry from
2195	// the children is exported depends on the sink's filter expression. For
2196	// example, if this field is true, then the filter
2197	// resource.type=gce_instance would export all Compute Engine VM
2198	// instance log entries from all projects in the sink's parent. To only
2199	// export entries from certain child projects, filter on the project
2200	// part of the log name: logName:("projects/test-project1/" OR
2201	// "projects/test-project2/") AND resource.type=gce_instance
2202	IncludeChildren bool `json:"includeChildren,omitempty"`
2203
2204	// Name: Required. The client-assigned sink identifier, unique within
2205	// the project. Example: "my-syslog-errors-to-pubsub". Sink identifiers
2206	// are limited to 100 characters and can include only the following
2207	// characters: upper and lower-case alphanumeric characters,
2208	// underscores, hyphens, and periods. First character has to be
2209	// alphanumeric.
2210	Name string `json:"name,omitempty"`
2211
2212	// OutputVersionFormat: Deprecated. This field is unused.
2213	//
2214	// Possible values:
2215	//   "VERSION_FORMAT_UNSPECIFIED" - An unspecified format version that
2216	// will default to V2.
2217	//   "V2" - LogEntry version 2 format.
2218	//   "V1" - LogEntry version 1 format.
2219	OutputVersionFormat string `json:"outputVersionFormat,omitempty"`
2220
2221	// UpdateTime: Output only. The last update timestamp of the sink.This
2222	// field may not be present for older sinks.
2223	UpdateTime string `json:"updateTime,omitempty"`
2224
2225	// WriterIdentity: Output only. An IAM identity—a service account or
2226	// group—under which Logging writes the exported log entries to the
2227	// sink's destination. This field is set by sinks.create and
2228	// sinks.update based on the value of unique_writer_identity in those
2229	// methods.Until you grant this identity write-access to the
2230	// destination, log entry exports from this sink will fail. For more
2231	// information, see Granting Access for a Resource
2232	// (https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
2233	// Consult the destination service's documentation to determine the
2234	// appropriate IAM roles to assign to the identity.
2235	WriterIdentity string `json:"writerIdentity,omitempty"`
2236
2237	// ServerResponse contains the HTTP response code and headers from the
2238	// server.
2239	googleapi.ServerResponse `json:"-"`
2240
2241	// ForceSendFields is a list of field names (e.g. "BigqueryOptions") to
2242	// unconditionally include in API requests. By default, fields with
2243	// empty values are omitted from API requests. However, any non-pointer,
2244	// non-interface field appearing in ForceSendFields will be sent to the
2245	// server regardless of whether the field is empty or not. This may be
2246	// used to include empty fields in Patch requests.
2247	ForceSendFields []string `json:"-"`
2248
2249	// NullFields is a list of field names (e.g. "BigqueryOptions") to
2250	// include in API requests with the JSON null value. By default, fields
2251	// with empty values are omitted from API requests. However, any field
2252	// with an empty value appearing in NullFields will be sent to the
2253	// server as null. It is an error if a field in this list has a
2254	// non-empty value. This may be used to include null fields in Patch
2255	// requests.
2256	NullFields []string `json:"-"`
2257}
2258
2259func (s *LogSink) MarshalJSON() ([]byte, error) {
2260	type NoMethod LogSink
2261	raw := NoMethod(*s)
2262	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2263}
2264
2265// LogView: Describes a view over logs in a bucket.
2266type LogView struct {
2267	// CreateTime: Output only. The creation timestamp of the view.
2268	CreateTime string `json:"createTime,omitempty"`
2269
2270	// Description: Describes this view.
2271	Description string `json:"description,omitempty"`
2272
2273	// Filter: Filter that restricts which log entries in a bucket are
2274	// visible in this view. Filters are restricted to be a logical AND of
2275	// ==/!= of any of the following: originating
2276	// project/folder/organization/billing account. resource type log id
2277	// Example: SOURCE("projects/myproject") AND resource.type =
2278	// "gce_instance" AND LOG_ID("stdout")
2279	Filter string `json:"filter,omitempty"`
2280
2281	// Name: The resource name of the view. For example
2282	// "projects/my-project-id/locations/my-location/buckets/my-bucket-id/vie
2283	// ws/my-view
2284	Name string `json:"name,omitempty"`
2285
2286	// UpdateTime: Output only. The last update timestamp of the view.
2287	UpdateTime string `json:"updateTime,omitempty"`
2288
2289	// ServerResponse contains the HTTP response code and headers from the
2290	// server.
2291	googleapi.ServerResponse `json:"-"`
2292
2293	// ForceSendFields is a list of field names (e.g. "CreateTime") to
2294	// unconditionally include in API requests. By default, fields with
2295	// empty values are omitted from API requests. However, any non-pointer,
2296	// non-interface field appearing in ForceSendFields will be sent to the
2297	// server regardless of whether the field is empty or not. This may be
2298	// used to include empty fields in Patch requests.
2299	ForceSendFields []string `json:"-"`
2300
2301	// NullFields is a list of field names (e.g. "CreateTime") to include in
2302	// API requests with the JSON null value. By default, fields with empty
2303	// values are omitted from API requests. However, any field with an
2304	// empty value appearing in NullFields will be sent to the server as
2305	// null. It is an error if a field in this list has a non-empty value.
2306	// This may be used to include null fields in Patch requests.
2307	NullFields []string `json:"-"`
2308}
2309
2310func (s *LogView) MarshalJSON() ([]byte, error) {
2311	type NoMethod LogView
2312	raw := NoMethod(*s)
2313	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2314}
2315
2316// MetricDescriptor: Defines a metric type and its schema. Once a metric
2317// descriptor is created, deleting or altering it stops data collection
2318// and makes the metric type's existing data unusable.
2319type MetricDescriptor struct {
2320	// Description: A detailed description of the metric, which can be used
2321	// in documentation.
2322	Description string `json:"description,omitempty"`
2323
2324	// DisplayName: A concise name for the metric, which can be displayed in
2325	// user interfaces. Use sentence case without an ending period, for
2326	// example "Request count". This field is optional but it is recommended
2327	// to be set for any metrics associated with user-visible concepts, such
2328	// as Quota.
2329	DisplayName string `json:"displayName,omitempty"`
2330
2331	// Labels: The set of labels that can be used to describe a specific
2332	// instance of this metric type. For example, the
2333	// appengine.googleapis.com/http/server/response_latencies metric type
2334	// has a label for the HTTP response code, response_code, so you can
2335	// look at latencies for successful responses or just for responses that
2336	// failed.
2337	Labels []*LabelDescriptor `json:"labels,omitempty"`
2338
2339	// LaunchStage: Optional. The launch stage of the metric definition.
2340	//
2341	// Possible values:
2342	//   "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value.
2343	//   "UNIMPLEMENTED" - The feature is not yet implemented. Users can not
2344	// use it.
2345	//   "PRELAUNCH" - Prelaunch features are hidden from users and are only
2346	// visible internally.
2347	//   "EARLY_ACCESS" - Early Access features are limited to a closed
2348	// group of testers. To use these features, you must sign up in advance
2349	// and sign a Trusted Tester agreement (which includes confidentiality
2350	// provisions). These features may be unstable, changed in
2351	// backward-incompatible ways, and are not guaranteed to be released.
2352	//   "ALPHA" - Alpha is a limited availability test for releases before
2353	// they are cleared for widespread use. By Alpha, all significant design
2354	// issues are resolved and we are in the process of verifying
2355	// functionality. Alpha customers need to apply for access, agree to
2356	// applicable terms, and have their projects allowlisted. Alpha releases
2357	// don’t have to be feature complete, no SLAs are provided, and there
2358	// are no technical support obligations, but they will be far enough
2359	// along that customers can actually use them in test environments or
2360	// for limited-use tests -- just like they would in normal production
2361	// cases.
2362	//   "BETA" - Beta is the point at which we are ready to open a release
2363	// for any customer to use. There are no SLA or technical support
2364	// obligations in a Beta release. Products will be complete from a
2365	// feature perspective, but may have some open outstanding issues. Beta
2366	// releases are suitable for limited production use cases.
2367	//   "GA" - GA features are open to all developers and are considered
2368	// stable and fully qualified for production use.
2369	//   "DEPRECATED" - Deprecated features are scheduled to be shut down
2370	// and removed. For more information, see the “Deprecation Policy”
2371	// section of our Terms of Service (https://cloud.google.com/terms/) and
2372	// the Google Cloud Platform Subject to the Deprecation Policy
2373	// (https://cloud.google.com/terms/deprecation) documentation.
2374	LaunchStage string `json:"launchStage,omitempty"`
2375
2376	// Metadata: Optional. Metadata which can be used to guide usage of the
2377	// metric.
2378	Metadata *MetricDescriptorMetadata `json:"metadata,omitempty"`
2379
2380	// MetricKind: Whether the metric records instantaneous values, changes
2381	// to a value, etc. Some combinations of metric_kind and value_type
2382	// might not be supported.
2383	//
2384	// Possible values:
2385	//   "METRIC_KIND_UNSPECIFIED" - Do not use this default value.
2386	//   "GAUGE" - An instantaneous measurement of a value.
2387	//   "DELTA" - The change in a value during a time interval.
2388	//   "CUMULATIVE" - A value accumulated over a time interval. Cumulative
2389	// measurements in a time series should have the same start time and
2390	// increasing end times, until an event resets the cumulative value to
2391	// zero and sets a new start time for the following points.
2392	MetricKind string `json:"metricKind,omitempty"`
2393
2394	// MonitoredResourceTypes: Read-only. If present, then a time series,
2395	// which is identified partially by a metric type and a
2396	// MonitoredResourceDescriptor, that is associated with this metric type
2397	// can only be associated with one of the monitored resource types
2398	// listed here.
2399	MonitoredResourceTypes []string `json:"monitoredResourceTypes,omitempty"`
2400
2401	// Name: The resource name of the metric descriptor.
2402	Name string `json:"name,omitempty"`
2403
2404	// Type: The metric type, including its DNS name prefix. The type is not
2405	// URL-encoded. All user-defined metric types have the DNS name
2406	// custom.googleapis.com or external.googleapis.com. Metric types should
2407	// use a natural hierarchical grouping. For example:
2408	// "custom.googleapis.com/invoice/paid/amount"
2409	// "external.googleapis.com/prometheus/up"
2410	// "appengine.googleapis.com/http/server/response_latencies"
2411	Type string `json:"type,omitempty"`
2412
2413	// Unit: The units in which the metric value is reported. It is only
2414	// applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The
2415	// unit defines the representation of the stored metric values.Different
2416	// systems might scale the values to be more easily displayed (so a
2417	// value of 0.02kBy might be displayed as 20By, and a value of 3523kBy
2418	// might be displayed as 3.5MBy). However, if the unit is kBy, then the
2419	// value of the metric is always in thousands of bytes, no matter how it
2420	// might be displayed.If you want a custom metric to record the exact
2421	// number of CPU-seconds used by a job, you can create an INT64
2422	// CUMULATIVE metric whose unit is s{CPU} (or equivalently 1s{CPU} or
2423	// just s). If the job uses 12,005 CPU-seconds, then the value is
2424	// written as 12005.Alternatively, if you want a custom metric to record
2425	// data in a more granular way, you can create a DOUBLE CUMULATIVE
2426	// metric whose unit is ks{CPU}, and then write the value 12.005 (which
2427	// is 12005/1000), or use Kis{CPU} and write 11.723 (which is
2428	// 12005/1024).The supported units are a subset of The Unified Code for
2429	// Units of Measure (https://unitsofmeasure.org/ucum.html)
2430	// standard:Basic units (UNIT) bit bit By byte s second min minute h
2431	// hour d day 1 dimensionlessPrefixes (PREFIX) k kilo (10^3) M mega
2432	// (10^6) G giga (10^9) T tera (10^12) P peta (10^15) E exa (10^18) Z
2433	// zetta (10^21) Y yotta (10^24) m milli (10^-3) u micro (10^-6) n nano
2434	// (10^-9) p pico (10^-12) f femto (10^-15) a atto (10^-18) z zepto
2435	// (10^-21) y yocto (10^-24) Ki kibi (2^10) Mi mebi (2^20) Gi gibi
2436	// (2^30) Ti tebi (2^40) Pi pebi (2^50)GrammarThe grammar also includes
2437	// these connectors: / division or ratio (as an infix operator). For
2438	// examples, kBy/{email} or MiBy/10ms (although you should almost never
2439	// have /s in a metric unit; rates should always be computed at query
2440	// time from the underlying cumulative or delta value). . multiplication
2441	// or composition (as an infix operator). For examples, GBy.d or
2442	// k{watt}.h.The grammar for a unit is as follows: Expression =
2443	// Component { "." Component } { "/" Component } ; Component = ( [
2444	// PREFIX ] UNIT | "%" ) [ Annotation ] | Annotation | "1" ; Annotation
2445	// = "{" NAME "}" ; Notes: Annotation is just a comment if it follows a
2446	// UNIT. If the annotation is used alone, then the unit is equivalent to
2447	// 1. For examples, {request}/s == 1/s, By{transmitted}/s == By/s. NAME
2448	// is a sequence of non-blank printable ASCII characters not containing
2449	// { or }. 1 represents a unitary dimensionless unit
2450	// (https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such as
2451	// in 1/s. It is typically used when none of the basic units are
2452	// appropriate. For example, "new users per day" can be represented as
2453	// 1/d or {new-users}/d (and a metric value 5 would mean "5 new users).
2454	// Alternatively, "thousands of page views per day" would be represented
2455	// as 1000/d or k1/d or k{page_views}/d (and a metric value of 5.3 would
2456	// mean "5300 page views per day"). % represents dimensionless value of
2457	// 1/100, and annotates values giving a percentage (so the metric values
2458	// are typically in the range of 0..100, and a metric value 3 means "3
2459	// percent"). 10^2.% indicates a metric contains a ratio, typically in
2460	// the range 0..1, that will be multiplied by 100 and displayed as a
2461	// percentage (so a metric value 0.03 means "3 percent").
2462	Unit string `json:"unit,omitempty"`
2463
2464	// ValueType: Whether the measurement is an integer, a floating-point
2465	// number, etc. Some combinations of metric_kind and value_type might
2466	// not be supported.
2467	//
2468	// Possible values:
2469	//   "VALUE_TYPE_UNSPECIFIED" - Do not use this default value.
2470	//   "BOOL" - The value is a boolean. This value type can be used only
2471	// if the metric kind is GAUGE.
2472	//   "INT64" - The value is a signed 64-bit integer.
2473	//   "DOUBLE" - The value is a double precision floating point number.
2474	//   "STRING" - The value is a text string. This value type can be used
2475	// only if the metric kind is GAUGE.
2476	//   "DISTRIBUTION" - The value is a Distribution.
2477	//   "MONEY" - The value is money.
2478	ValueType string `json:"valueType,omitempty"`
2479
2480	// ForceSendFields is a list of field names (e.g. "Description") to
2481	// unconditionally include in API requests. By default, fields with
2482	// empty values are omitted from API requests. However, any non-pointer,
2483	// non-interface field appearing in ForceSendFields will be sent to the
2484	// server regardless of whether the field is empty or not. This may be
2485	// used to include empty fields in Patch requests.
2486	ForceSendFields []string `json:"-"`
2487
2488	// NullFields is a list of field names (e.g. "Description") to include
2489	// in API requests with the JSON null value. By default, fields with
2490	// empty values are omitted from API requests. However, any field with
2491	// an empty value appearing in NullFields will be sent to the server as
2492	// null. It is an error if a field in this list has a non-empty value.
2493	// This may be used to include null fields in Patch requests.
2494	NullFields []string `json:"-"`
2495}
2496
2497func (s *MetricDescriptor) MarshalJSON() ([]byte, error) {
2498	type NoMethod MetricDescriptor
2499	raw := NoMethod(*s)
2500	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2501}
2502
2503// MetricDescriptorMetadata: Additional annotations that can be used to
2504// guide the usage of a metric.
2505type MetricDescriptorMetadata struct {
2506	// IngestDelay: The delay of data points caused by ingestion. Data
2507	// points older than this age are guaranteed to be ingested and
2508	// available to be read, excluding data loss due to errors.
2509	IngestDelay string `json:"ingestDelay,omitempty"`
2510
2511	// LaunchStage: Deprecated. Must use the MetricDescriptor.launch_stage
2512	// instead.
2513	//
2514	// Possible values:
2515	//   "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value.
2516	//   "UNIMPLEMENTED" - The feature is not yet implemented. Users can not
2517	// use it.
2518	//   "PRELAUNCH" - Prelaunch features are hidden from users and are only
2519	// visible internally.
2520	//   "EARLY_ACCESS" - Early Access features are limited to a closed
2521	// group of testers. To use these features, you must sign up in advance
2522	// and sign a Trusted Tester agreement (which includes confidentiality
2523	// provisions). These features may be unstable, changed in
2524	// backward-incompatible ways, and are not guaranteed to be released.
2525	//   "ALPHA" - Alpha is a limited availability test for releases before
2526	// they are cleared for widespread use. By Alpha, all significant design
2527	// issues are resolved and we are in the process of verifying
2528	// functionality. Alpha customers need to apply for access, agree to
2529	// applicable terms, and have their projects allowlisted. Alpha releases
2530	// don’t have to be feature complete, no SLAs are provided, and there
2531	// are no technical support obligations, but they will be far enough
2532	// along that customers can actually use them in test environments or
2533	// for limited-use tests -- just like they would in normal production
2534	// cases.
2535	//   "BETA" - Beta is the point at which we are ready to open a release
2536	// for any customer to use. There are no SLA or technical support
2537	// obligations in a Beta release. Products will be complete from a
2538	// feature perspective, but may have some open outstanding issues. Beta
2539	// releases are suitable for limited production use cases.
2540	//   "GA" - GA features are open to all developers and are considered
2541	// stable and fully qualified for production use.
2542	//   "DEPRECATED" - Deprecated features are scheduled to be shut down
2543	// and removed. For more information, see the “Deprecation Policy”
2544	// section of our Terms of Service (https://cloud.google.com/terms/) and
2545	// the Google Cloud Platform Subject to the Deprecation Policy
2546	// (https://cloud.google.com/terms/deprecation) documentation.
2547	LaunchStage string `json:"launchStage,omitempty"`
2548
2549	// SamplePeriod: The sampling period of metric data points. For metrics
2550	// which are written periodically, consecutive data points are stored at
2551	// this time interval, excluding data loss due to errors. Metrics with a
2552	// higher granularity have a smaller sampling period.
2553	SamplePeriod string `json:"samplePeriod,omitempty"`
2554
2555	// ForceSendFields is a list of field names (e.g. "IngestDelay") to
2556	// unconditionally include in API requests. By default, fields with
2557	// empty values are omitted from API requests. However, any non-pointer,
2558	// non-interface field appearing in ForceSendFields will be sent to the
2559	// server regardless of whether the field is empty or not. This may be
2560	// used to include empty fields in Patch requests.
2561	ForceSendFields []string `json:"-"`
2562
2563	// NullFields is a list of field names (e.g. "IngestDelay") to include
2564	// in API requests with the JSON null value. By default, fields with
2565	// empty values are omitted from API requests. However, any field with
2566	// an empty value appearing in NullFields will be sent to the server as
2567	// null. It is an error if a field in this list has a non-empty value.
2568	// This may be used to include null fields in Patch requests.
2569	NullFields []string `json:"-"`
2570}
2571
2572func (s *MetricDescriptorMetadata) MarshalJSON() ([]byte, error) {
2573	type NoMethod MetricDescriptorMetadata
2574	raw := NoMethod(*s)
2575	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2576}
2577
2578// MonitoredResource: An object representing a resource that can be used
2579// for monitoring, logging, billing, or other purposes. Examples include
2580// virtual machine instances, databases, and storage devices such as
2581// disks. The type field identifies a MonitoredResourceDescriptor object
2582// that describes the resource's schema. Information in the labels field
2583// identifies the actual resource and its attributes according to the
2584// schema. For example, a particular Compute Engine VM instance could be
2585// represented by the following object, because the
2586// MonitoredResourceDescriptor for "gce_instance" has labels
2587// "instance_id" and "zone": { "type": "gce_instance", "labels": {
2588// "instance_id": "12345678901234", "zone": "us-central1-a" }}
2589type MonitoredResource struct {
2590	// Labels: Required. Values for all of the labels listed in the
2591	// associated monitored resource descriptor. For example, Compute Engine
2592	// VM instances use the labels "project_id", "instance_id", and "zone".
2593	Labels map[string]string `json:"labels,omitempty"`
2594
2595	// Type: Required. The monitored resource type. This field must match
2596	// the type field of a MonitoredResourceDescriptor object. For example,
2597	// the type of a Compute Engine VM instance is gce_instance.
2598	Type string `json:"type,omitempty"`
2599
2600	// ForceSendFields is a list of field names (e.g. "Labels") to
2601	// unconditionally include in API requests. By default, fields with
2602	// empty values are omitted from API requests. However, any non-pointer,
2603	// non-interface field appearing in ForceSendFields will be sent to the
2604	// server regardless of whether the field is empty or not. This may be
2605	// used to include empty fields in Patch requests.
2606	ForceSendFields []string `json:"-"`
2607
2608	// NullFields is a list of field names (e.g. "Labels") to include in API
2609	// requests with the JSON null value. By default, fields with empty
2610	// values are omitted from API requests. However, any field with an
2611	// empty value appearing in NullFields will be sent to the server as
2612	// null. It is an error if a field in this list has a non-empty value.
2613	// This may be used to include null fields in Patch requests.
2614	NullFields []string `json:"-"`
2615}
2616
2617func (s *MonitoredResource) MarshalJSON() ([]byte, error) {
2618	type NoMethod MonitoredResource
2619	raw := NoMethod(*s)
2620	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2621}
2622
2623// MonitoredResourceDescriptor: An object that describes the schema of a
2624// MonitoredResource object using a type name and a set of labels. For
2625// example, the monitored resource descriptor for Google Compute Engine
2626// VM instances has a type of "gce_instance" and specifies the use of
2627// the labels "instance_id" and "zone" to identify particular VM
2628// instances.Different APIs can support different monitored resource
2629// types. APIs generally provide a list method that returns the
2630// monitored resource descriptors used by the API.
2631type MonitoredResourceDescriptor struct {
2632	// Description: Optional. A detailed description of the monitored
2633	// resource type that might be used in documentation.
2634	Description string `json:"description,omitempty"`
2635
2636	// DisplayName: Optional. A concise name for the monitored resource type
2637	// that might be displayed in user interfaces. It should be a Title
2638	// Cased Noun Phrase, without any article or other determiners. For
2639	// example, "Google Cloud SQL Database".
2640	DisplayName string `json:"displayName,omitempty"`
2641
2642	// Labels: Required. A set of labels used to describe instances of this
2643	// monitored resource type. For example, an individual Google Cloud SQL
2644	// database is identified by values for the labels "database_id" and
2645	// "zone".
2646	Labels []*LabelDescriptor `json:"labels,omitempty"`
2647
2648	// LaunchStage: Optional. The launch stage of the monitored resource
2649	// definition.
2650	//
2651	// Possible values:
2652	//   "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value.
2653	//   "UNIMPLEMENTED" - The feature is not yet implemented. Users can not
2654	// use it.
2655	//   "PRELAUNCH" - Prelaunch features are hidden from users and are only
2656	// visible internally.
2657	//   "EARLY_ACCESS" - Early Access features are limited to a closed
2658	// group of testers. To use these features, you must sign up in advance
2659	// and sign a Trusted Tester agreement (which includes confidentiality
2660	// provisions). These features may be unstable, changed in
2661	// backward-incompatible ways, and are not guaranteed to be released.
2662	//   "ALPHA" - Alpha is a limited availability test for releases before
2663	// they are cleared for widespread use. By Alpha, all significant design
2664	// issues are resolved and we are in the process of verifying
2665	// functionality. Alpha customers need to apply for access, agree to
2666	// applicable terms, and have their projects allowlisted. Alpha releases
2667	// don’t have to be feature complete, no SLAs are provided, and there
2668	// are no technical support obligations, but they will be far enough
2669	// along that customers can actually use them in test environments or
2670	// for limited-use tests -- just like they would in normal production
2671	// cases.
2672	//   "BETA" - Beta is the point at which we are ready to open a release
2673	// for any customer to use. There are no SLA or technical support
2674	// obligations in a Beta release. Products will be complete from a
2675	// feature perspective, but may have some open outstanding issues. Beta
2676	// releases are suitable for limited production use cases.
2677	//   "GA" - GA features are open to all developers and are considered
2678	// stable and fully qualified for production use.
2679	//   "DEPRECATED" - Deprecated features are scheduled to be shut down
2680	// and removed. For more information, see the “Deprecation Policy”
2681	// section of our Terms of Service (https://cloud.google.com/terms/) and
2682	// the Google Cloud Platform Subject to the Deprecation Policy
2683	// (https://cloud.google.com/terms/deprecation) documentation.
2684	LaunchStage string `json:"launchStage,omitempty"`
2685
2686	// Name: Optional. The resource name of the monitored resource
2687	// descriptor:
2688	// "projects/{project_id}/monitoredResourceDescriptors/{type}" where
2689	// {type} is the value of the type field in this object and {project_id}
2690	// is a project ID that provides API-specific context for accessing the
2691	// type. APIs that do not use project information can use the resource
2692	// name format "monitoredResourceDescriptors/{type}".
2693	Name string `json:"name,omitempty"`
2694
2695	// Type: Required. The monitored resource type. For example, the type
2696	// "cloudsql_database" represents databases in Google Cloud SQL.
2697	Type string `json:"type,omitempty"`
2698
2699	// ForceSendFields is a list of field names (e.g. "Description") to
2700	// unconditionally include in API requests. By default, fields with
2701	// empty values are omitted from API requests. However, any non-pointer,
2702	// non-interface field appearing in ForceSendFields will be sent to the
2703	// server regardless of whether the field is empty or not. This may be
2704	// used to include empty fields in Patch requests.
2705	ForceSendFields []string `json:"-"`
2706
2707	// NullFields is a list of field names (e.g. "Description") to include
2708	// in API requests with the JSON null value. By default, fields with
2709	// empty values are omitted from API requests. However, any field with
2710	// an empty value appearing in NullFields will be sent to the server as
2711	// null. It is an error if a field in this list has a non-empty value.
2712	// This may be used to include null fields in Patch requests.
2713	NullFields []string `json:"-"`
2714}
2715
2716func (s *MonitoredResourceDescriptor) MarshalJSON() ([]byte, error) {
2717	type NoMethod MonitoredResourceDescriptor
2718	raw := NoMethod(*s)
2719	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2720}
2721
2722// MonitoredResourceMetadata: Auxiliary metadata for a MonitoredResource
2723// object. MonitoredResource objects contain the minimum set of
2724// information to uniquely identify a monitored resource instance. There
2725// is some other useful auxiliary metadata. Monitoring and Logging use
2726// an ingestion pipeline to extract metadata for cloud resources of all
2727// types, and store the metadata in this message.
2728type MonitoredResourceMetadata struct {
2729	// SystemLabels: Output only. Values for predefined system metadata
2730	// labels. System labels are a kind of metadata extracted by Google,
2731	// including "machine_image", "vpc", "subnet_id", "security_group",
2732	// "name", etc. System label values can be only strings, Boolean values,
2733	// or a list of strings. For example: { "name": "my-test-instance",
2734	// "security_group": ["a", "b", "c"], "spot_instance": false }
2735	SystemLabels googleapi.RawMessage `json:"systemLabels,omitempty"`
2736
2737	// UserLabels: Output only. A map of user-defined metadata labels.
2738	UserLabels map[string]string `json:"userLabels,omitempty"`
2739
2740	// ForceSendFields is a list of field names (e.g. "SystemLabels") to
2741	// unconditionally include in API requests. By default, fields with
2742	// empty values are omitted from API requests. However, any non-pointer,
2743	// non-interface field appearing in ForceSendFields will be sent to the
2744	// server regardless of whether the field is empty or not. This may be
2745	// used to include empty fields in Patch requests.
2746	ForceSendFields []string `json:"-"`
2747
2748	// NullFields is a list of field names (e.g. "SystemLabels") to include
2749	// in API requests with the JSON null value. By default, fields with
2750	// empty values are omitted from API requests. However, any field with
2751	// an empty value appearing in NullFields will be sent to the server as
2752	// null. It is an error if a field in this list has a non-empty value.
2753	// This may be used to include null fields in Patch requests.
2754	NullFields []string `json:"-"`
2755}
2756
2757func (s *MonitoredResourceMetadata) MarshalJSON() ([]byte, error) {
2758	type NoMethod MonitoredResourceMetadata
2759	raw := NoMethod(*s)
2760	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2761}
2762
2763// RequestLog: Complete log information about a single HTTP request to
2764// an App Engine application.
2765type RequestLog struct {
2766	// AppEngineRelease: App Engine release version.
2767	AppEngineRelease string `json:"appEngineRelease,omitempty"`
2768
2769	// AppId: Application that handled this request.
2770	AppId string `json:"appId,omitempty"`
2771
2772	// Cost: An indication of the relative cost of serving this request.
2773	Cost float64 `json:"cost,omitempty"`
2774
2775	// EndTime: Time when the request finished.
2776	EndTime string `json:"endTime,omitempty"`
2777
2778	// Finished: Whether this request is finished or active.
2779	Finished bool `json:"finished,omitempty"`
2780
2781	// First: Whether this is the first RequestLog entry for this request.
2782	// If an active request has several RequestLog entries written to
2783	// Stackdriver Logging, then this field will be set for one of them.
2784	First bool `json:"first,omitempty"`
2785
2786	// Host: Internet host and port number of the resource being requested.
2787	Host string `json:"host,omitempty"`
2788
2789	// HttpVersion: HTTP version of request. Example: "HTTP/1.1".
2790	HttpVersion string `json:"httpVersion,omitempty"`
2791
2792	// InstanceId: An identifier for the instance that handled the request.
2793	InstanceId string `json:"instanceId,omitempty"`
2794
2795	// InstanceIndex: If the instance processing this request belongs to a
2796	// manually scaled module, then this is the 0-based index of the
2797	// instance. Otherwise, this value is -1.
2798	InstanceIndex int64 `json:"instanceIndex,omitempty"`
2799
2800	// Ip: Origin IP address.
2801	Ip string `json:"ip,omitempty"`
2802
2803	// Latency: Latency of the request.
2804	Latency string `json:"latency,omitempty"`
2805
2806	// Line: A list of log lines emitted by the application while serving
2807	// this request.
2808	Line []*LogLine `json:"line,omitempty"`
2809
2810	// MegaCycles: Number of CPU megacycles used to process request.
2811	MegaCycles int64 `json:"megaCycles,omitempty,string"`
2812
2813	// Method: Request method. Example: "GET", "HEAD", "PUT", "POST",
2814	// "DELETE".
2815	Method string `json:"method,omitempty"`
2816
2817	// ModuleId: Module of the application that handled this request.
2818	ModuleId string `json:"moduleId,omitempty"`
2819
2820	// Nickname: The logged-in user who made the request.Most likely, this
2821	// is the part of the user's email before the @ sign. The field value is
2822	// the same for different requests from the same user, but different
2823	// users can have similar names. This information is also available to
2824	// the application via the App Engine Users API.This field will be
2825	// populated starting with App Engine 1.9.21.
2826	Nickname string `json:"nickname,omitempty"`
2827
2828	// PendingTime: Time this request spent in the pending request queue.
2829	PendingTime string `json:"pendingTime,omitempty"`
2830
2831	// Referrer: Referrer URL of request.
2832	Referrer string `json:"referrer,omitempty"`
2833
2834	// RequestId: Globally unique identifier for a request, which is based
2835	// on the request start time. Request IDs for requests which started
2836	// later will compare greater as strings than those for requests which
2837	// started earlier.
2838	RequestId string `json:"requestId,omitempty"`
2839
2840	// Resource: Contains the path and query portion of the URL that was
2841	// requested. For example, if the URL was
2842	// "http://example.com/app?name=val", the resource would be
2843	// "/app?name=val". The fragment identifier, which is identified by the
2844	// # character, is not included.
2845	Resource string `json:"resource,omitempty"`
2846
2847	// ResponseSize: Size in bytes sent back to client by request.
2848	ResponseSize int64 `json:"responseSize,omitempty,string"`
2849
2850	// SourceReference: Source code for the application that handled this
2851	// request. There can be more than one source reference per deployed
2852	// application if source code is distributed among multiple
2853	// repositories.
2854	SourceReference []*SourceReference `json:"sourceReference,omitempty"`
2855
2856	// StartTime: Time when the request started.
2857	StartTime string `json:"startTime,omitempty"`
2858
2859	// Status: HTTP response status code. Example: 200, 404.
2860	Status int64 `json:"status,omitempty"`
2861
2862	// TaskName: Task name of the request, in the case of an offline
2863	// request.
2864	TaskName string `json:"taskName,omitempty"`
2865
2866	// TaskQueueName: Queue name of the request, in the case of an offline
2867	// request.
2868	TaskQueueName string `json:"taskQueueName,omitempty"`
2869
2870	// TraceId: Stackdriver Trace identifier for this request.
2871	TraceId string `json:"traceId,omitempty"`
2872
2873	// TraceSampled: If true, the value in the 'trace_id' field was sampled
2874	// for storage in a trace backend.
2875	TraceSampled bool `json:"traceSampled,omitempty"`
2876
2877	// UrlMapEntry: File or class that handled the request.
2878	UrlMapEntry string `json:"urlMapEntry,omitempty"`
2879
2880	// UserAgent: User agent that made the request.
2881	UserAgent string `json:"userAgent,omitempty"`
2882
2883	// VersionId: Version of the application that handled this request.
2884	VersionId string `json:"versionId,omitempty"`
2885
2886	// WasLoadingRequest: Whether this was a loading request for the
2887	// instance.
2888	WasLoadingRequest bool `json:"wasLoadingRequest,omitempty"`
2889
2890	// ForceSendFields is a list of field names (e.g. "AppEngineRelease") to
2891	// unconditionally include in API requests. By default, fields with
2892	// empty values are omitted from API requests. However, any non-pointer,
2893	// non-interface field appearing in ForceSendFields will be sent to the
2894	// server regardless of whether the field is empty or not. This may be
2895	// used to include empty fields in Patch requests.
2896	ForceSendFields []string `json:"-"`
2897
2898	// NullFields is a list of field names (e.g. "AppEngineRelease") to
2899	// include in API requests with the JSON null value. By default, fields
2900	// with empty values are omitted from API requests. However, any field
2901	// with an empty value appearing in NullFields will be sent to the
2902	// server as null. It is an error if a field in this list has a
2903	// non-empty value. This may be used to include null fields in Patch
2904	// requests.
2905	NullFields []string `json:"-"`
2906}
2907
2908func (s *RequestLog) MarshalJSON() ([]byte, error) {
2909	type NoMethod RequestLog
2910	raw := NoMethod(*s)
2911	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2912}
2913
2914func (s *RequestLog) UnmarshalJSON(data []byte) error {
2915	type NoMethod RequestLog
2916	var s1 struct {
2917		Cost gensupport.JSONFloat64 `json:"cost"`
2918		*NoMethod
2919	}
2920	s1.NoMethod = (*NoMethod)(s)
2921	if err := json.Unmarshal(data, &s1); err != nil {
2922		return err
2923	}
2924	s.Cost = float64(s1.Cost)
2925	return nil
2926}
2927
2928// SourceLocation: Specifies a location in a source code file.
2929type SourceLocation struct {
2930	// File: Source file name. Depending on the runtime environment, this
2931	// might be a simple name or a fully-qualified name.
2932	File string `json:"file,omitempty"`
2933
2934	// FunctionName: Human-readable name of the function or method being
2935	// invoked, with optional context such as the class or package name.
2936	// This information is used in contexts such as the logs viewer, where a
2937	// file and line number are less meaningful. The format can vary by
2938	// language. For example: qual.if.ied.Class.method (Java),
2939	// dir/package.func (Go), function (Python).
2940	FunctionName string `json:"functionName,omitempty"`
2941
2942	// Line: Line within the source file.
2943	Line int64 `json:"line,omitempty,string"`
2944
2945	// ForceSendFields is a list of field names (e.g. "File") to
2946	// unconditionally include in API requests. By default, fields with
2947	// empty values are omitted from API requests. However, any non-pointer,
2948	// non-interface field appearing in ForceSendFields will be sent to the
2949	// server regardless of whether the field is empty or not. This may be
2950	// used to include empty fields in Patch requests.
2951	ForceSendFields []string `json:"-"`
2952
2953	// NullFields is a list of field names (e.g. "File") to include in API
2954	// requests with the JSON null value. By default, fields with empty
2955	// values are omitted from API requests. However, any field with an
2956	// empty value appearing in NullFields will be sent to the server as
2957	// null. It is an error if a field in this list has a non-empty value.
2958	// This may be used to include null fields in Patch requests.
2959	NullFields []string `json:"-"`
2960}
2961
2962func (s *SourceLocation) MarshalJSON() ([]byte, error) {
2963	type NoMethod SourceLocation
2964	raw := NoMethod(*s)
2965	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2966}
2967
2968// SourceReference: A reference to a particular snapshot of the source
2969// tree used to build and deploy an application.
2970type SourceReference struct {
2971	// Repository: Optional. A URI string identifying the repository.
2972	// Example: "https://github.com/GoogleCloudPlatform/kubernetes.git"
2973	Repository string `json:"repository,omitempty"`
2974
2975	// RevisionId: The canonical and persistent identifier of the deployed
2976	// revision. Example (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b"
2977	RevisionId string `json:"revisionId,omitempty"`
2978
2979	// ForceSendFields is a list of field names (e.g. "Repository") to
2980	// unconditionally include in API requests. By default, fields with
2981	// empty values are omitted from API requests. However, any non-pointer,
2982	// non-interface field appearing in ForceSendFields will be sent to the
2983	// server regardless of whether the field is empty or not. This may be
2984	// used to include empty fields in Patch requests.
2985	ForceSendFields []string `json:"-"`
2986
2987	// NullFields is a list of field names (e.g. "Repository") to include in
2988	// API requests with the JSON null value. By default, fields with empty
2989	// values are omitted from API requests. However, any field with an
2990	// empty value appearing in NullFields will be sent to the server as
2991	// null. It is an error if a field in this list has a non-empty value.
2992	// This may be used to include null fields in Patch requests.
2993	NullFields []string `json:"-"`
2994}
2995
2996func (s *SourceReference) MarshalJSON() ([]byte, error) {
2997	type NoMethod SourceReference
2998	raw := NoMethod(*s)
2999	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3000}
3001
3002// SuppressionInfo: Information about entries that were omitted from the
3003// session.
3004type SuppressionInfo struct {
3005	// Reason: The reason that entries were omitted from the session.
3006	//
3007	// Possible values:
3008	//   "REASON_UNSPECIFIED" - Unexpected default.
3009	//   "RATE_LIMIT" - Indicates suppression occurred due to relevant
3010	// entries being received in excess of rate limits. For quotas and
3011	// limits, see Logging API quotas and limits
3012	// (https://cloud.google.com/logging/quotas#api-limits).
3013	//   "NOT_CONSUMED" - Indicates suppression occurred due to the client
3014	// not consuming responses quickly enough.
3015	Reason string `json:"reason,omitempty"`
3016
3017	// SuppressedCount: A lower bound on the count of entries omitted due to
3018	// reason.
3019	SuppressedCount int64 `json:"suppressedCount,omitempty"`
3020
3021	// ForceSendFields is a list of field names (e.g. "Reason") to
3022	// unconditionally include in API requests. By default, fields with
3023	// empty values are omitted from API requests. However, any non-pointer,
3024	// non-interface field appearing in ForceSendFields will be sent to the
3025	// server regardless of whether the field is empty or not. This may be
3026	// used to include empty fields in Patch requests.
3027	ForceSendFields []string `json:"-"`
3028
3029	// NullFields is a list of field names (e.g. "Reason") to include in API
3030	// requests with the JSON null value. By default, fields with empty
3031	// values are omitted from API requests. However, any field with an
3032	// empty value appearing in NullFields will be sent to the server as
3033	// null. It is an error if a field in this list has a non-empty value.
3034	// This may be used to include null fields in Patch requests.
3035	NullFields []string `json:"-"`
3036}
3037
3038func (s *SuppressionInfo) MarshalJSON() ([]byte, error) {
3039	type NoMethod SuppressionInfo
3040	raw := NoMethod(*s)
3041	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3042}
3043
3044// TailLogEntriesRequest: The parameters to TailLogEntries.
3045type TailLogEntriesRequest struct {
3046	// BufferWindow: Optional. The amount of time to buffer log entries at
3047	// the server before being returned to prevent out of order results due
3048	// to late arriving log entries. Valid values are between 0-60000
3049	// milliseconds. Defaults to 2000 milliseconds.
3050	BufferWindow string `json:"bufferWindow,omitempty"`
3051
3052	// Filter: Optional. A filter that chooses which log entries to return.
3053	// See Advanced Logs Filters
3054	// (https://cloud.google.com/logging/docs/view/advanced_filters). Only
3055	// log entries that match the filter are returned. An empty filter
3056	// matches all log entries in the resources listed in resource_names.
3057	// Referencing a parent resource that is not in resource_names will
3058	// cause the filter to return no results. The maximum length of the
3059	// filter is 20000 characters.
3060	Filter string `json:"filter,omitempty"`
3061
3062	// ResourceNames: Required. Name of a parent resource from which to
3063	// retrieve log entries: projects/[PROJECT_ID]
3064	// organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID]
3065	// folders/[FOLDER_ID]May alternatively be one or more views:
3066	// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view
3067	// s/[VIEW_ID]
3068	// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE
3069	// T_ID]/views/[VIEW_ID]
3070	// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[
3071	// BUCKET_ID]/views/[VIEW_ID]
3072	// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/
3073	// [VIEW_ID]
3074	ResourceNames []string `json:"resourceNames,omitempty"`
3075
3076	// ForceSendFields is a list of field names (e.g. "BufferWindow") to
3077	// unconditionally include in API requests. By default, fields with
3078	// empty values are omitted from API requests. However, any non-pointer,
3079	// non-interface field appearing in ForceSendFields will be sent to the
3080	// server regardless of whether the field is empty or not. This may be
3081	// used to include empty fields in Patch requests.
3082	ForceSendFields []string `json:"-"`
3083
3084	// NullFields is a list of field names (e.g. "BufferWindow") to include
3085	// in API requests with the JSON null value. By default, fields with
3086	// empty values are omitted from API requests. However, any field with
3087	// an empty value appearing in NullFields will be sent to the server as
3088	// null. It is an error if a field in this list has a non-empty value.
3089	// This may be used to include null fields in Patch requests.
3090	NullFields []string `json:"-"`
3091}
3092
3093func (s *TailLogEntriesRequest) MarshalJSON() ([]byte, error) {
3094	type NoMethod TailLogEntriesRequest
3095	raw := NoMethod(*s)
3096	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3097}
3098
3099// TailLogEntriesResponse: Result returned from TailLogEntries.
3100type TailLogEntriesResponse struct {
3101	// Entries: A list of log entries. Each response in the stream will
3102	// order entries with increasing values of LogEntry.timestamp. Ordering
3103	// is not guaranteed between separate responses.
3104	Entries []*LogEntry `json:"entries,omitempty"`
3105
3106	// SuppressionInfo: If entries that otherwise would have been included
3107	// in the session were not sent back to the client, counts of relevant
3108	// entries omitted from the session with the reason that they were not
3109	// included. There will be at most one of each reason per response. The
3110	// counts represent the number of suppressed entries since the last
3111	// streamed response.
3112	SuppressionInfo []*SuppressionInfo `json:"suppressionInfo,omitempty"`
3113
3114	// ServerResponse contains the HTTP response code and headers from the
3115	// server.
3116	googleapi.ServerResponse `json:"-"`
3117
3118	// ForceSendFields is a list of field names (e.g. "Entries") to
3119	// unconditionally include in API requests. By default, fields with
3120	// empty values are omitted from API requests. However, any non-pointer,
3121	// non-interface field appearing in ForceSendFields will be sent to the
3122	// server regardless of whether the field is empty or not. This may be
3123	// used to include empty fields in Patch requests.
3124	ForceSendFields []string `json:"-"`
3125
3126	// NullFields is a list of field names (e.g. "Entries") to include in
3127	// API requests with the JSON null value. By default, fields with empty
3128	// values are omitted from API requests. However, any field with an
3129	// empty value appearing in NullFields will be sent to the server as
3130	// null. It is an error if a field in this list has a non-empty value.
3131	// This may be used to include null fields in Patch requests.
3132	NullFields []string `json:"-"`
3133}
3134
3135func (s *TailLogEntriesResponse) MarshalJSON() ([]byte, error) {
3136	type NoMethod TailLogEntriesResponse
3137	raw := NoMethod(*s)
3138	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3139}
3140
3141// UndeleteBucketRequest: The parameters to UndeleteBucket.
3142type UndeleteBucketRequest struct {
3143}
3144
3145// WriteLogEntriesRequest: The parameters to WriteLogEntries.
3146type WriteLogEntriesRequest struct {
3147	// DryRun: Optional. If true, the request should expect normal response,
3148	// but the entries won't be persisted nor exported. Useful for checking
3149	// whether the logging API endpoints are working properly before sending
3150	// valuable data.
3151	DryRun bool `json:"dryRun,omitempty"`
3152
3153	// Entries: Required. The log entries to send to Logging. The order of
3154	// log entries in this list does not matter. Values supplied in this
3155	// method's log_name, resource, and labels fields are copied into those
3156	// log entries in this list that do not include values for their
3157	// corresponding fields. For more information, see the LogEntry type.If
3158	// the timestamp or insert_id fields are missing in log entries, then
3159	// this method supplies the current time or a unique identifier,
3160	// respectively. The supplied values are chosen so that, among the log
3161	// entries that did not supply their own values, the entries earlier in
3162	// the list will sort before the entries later in the list. See the
3163	// entries.list method.Log entries with timestamps that are more than
3164	// the logs retention period
3165	// (https://cloud.google.com/logging/quota-policy) in the past or more
3166	// than 24 hours in the future will not be available when calling
3167	// entries.list. However, those log entries can still be exported with
3168	// LogSinks
3169	// (https://cloud.google.com/logging/docs/api/tasks/exporting-logs).To
3170	// improve throughput and to avoid exceeding the quota limit
3171	// (https://cloud.google.com/logging/quota-policy) for calls to
3172	// entries.write, you should try to include several log entries in this
3173	// list, rather than calling this method for each individual log entry.
3174	Entries []*LogEntry `json:"entries,omitempty"`
3175
3176	// Labels: Optional. Default labels that are added to the labels field
3177	// of all log entries in entries. If a log entry already has a label
3178	// with the same key as a label in this parameter, then the log entry's
3179	// label is not changed. See LogEntry.
3180	Labels map[string]string `json:"labels,omitempty"`
3181
3182	// LogName: Optional. A default log resource name that is assigned to
3183	// all log entries in entries that do not specify a value for log_name:
3184	// projects/[PROJECT_ID]/logs/[LOG_ID]
3185	// organizations/[ORGANIZATION_ID]/logs/[LOG_ID]
3186	// billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]
3187	// folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For
3188	// example: "projects/my-project-id/logs/syslog"
3189	// "organizations/123/logs/cloudaudit.googleapis.com%2Factivity" The
3190	// permission logging.logEntries.create is needed on each project,
3191	// organization, billing account, or folder that is receiving new log
3192	// entries, whether the resource is specified in logName or in an
3193	// individual log entry.
3194	LogName string `json:"logName,omitempty"`
3195
3196	// PartialSuccess: Optional. Whether valid entries should be written
3197	// even if some other entries fail due to INVALID_ARGUMENT or
3198	// PERMISSION_DENIED errors. If any entry is not written, then the
3199	// response status is the error associated with one of the failed
3200	// entries and the response includes error details keyed by the entries'
3201	// zero-based index in the entries.write method.
3202	PartialSuccess bool `json:"partialSuccess,omitempty"`
3203
3204	// Resource: Optional. A default monitored resource object that is
3205	// assigned to all log entries in entries that do not specify a value
3206	// for resource. Example: { "type": "gce_instance", "labels": { "zone":
3207	// "us-central1-a", "instance_id": "00000000000000000000" }} See
3208	// LogEntry.
3209	Resource *MonitoredResource `json:"resource,omitempty"`
3210
3211	// ForceSendFields is a list of field names (e.g. "DryRun") to
3212	// unconditionally include in API requests. By default, fields with
3213	// empty values are omitted from API requests. However, any non-pointer,
3214	// non-interface field appearing in ForceSendFields will be sent to the
3215	// server regardless of whether the field is empty or not. This may be
3216	// used to include empty fields in Patch requests.
3217	ForceSendFields []string `json:"-"`
3218
3219	// NullFields is a list of field names (e.g. "DryRun") to include in API
3220	// requests with the JSON null value. By default, fields with empty
3221	// values are omitted from API requests. However, any field with an
3222	// empty value appearing in NullFields will be sent to the server as
3223	// null. It is an error if a field in this list has a non-empty value.
3224	// This may be used to include null fields in Patch requests.
3225	NullFields []string `json:"-"`
3226}
3227
3228func (s *WriteLogEntriesRequest) MarshalJSON() ([]byte, error) {
3229	type NoMethod WriteLogEntriesRequest
3230	raw := NoMethod(*s)
3231	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3232}
3233
3234// WriteLogEntriesResponse: Result returned from WriteLogEntries.
3235type WriteLogEntriesResponse struct {
3236	// ServerResponse contains the HTTP response code and headers from the
3237	// server.
3238	googleapi.ServerResponse `json:"-"`
3239}
3240
3241// method id "logging.billingAccounts.buckets.get":
3242
3243type BillingAccountsBucketsGetCall struct {
3244	s            *Service
3245	name         string
3246	urlParams_   gensupport.URLParams
3247	ifNoneMatch_ string
3248	ctx_         context.Context
3249	header_      http.Header
3250}
3251
3252// Get: Gets a bucket.
3253//
3254// - name: The resource name of the bucket:
3255//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
3256//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
3257//   CKET_ID]"
3258//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
3259//   s/[BUCKET_ID]"
3260//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
3261//   Example:
3262//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id".
3263func (r *BillingAccountsBucketsService) Get(name string) *BillingAccountsBucketsGetCall {
3264	c := &BillingAccountsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3265	c.name = name
3266	return c
3267}
3268
3269// Fields allows partial responses to be retrieved. See
3270// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3271// for more information.
3272func (c *BillingAccountsBucketsGetCall) Fields(s ...googleapi.Field) *BillingAccountsBucketsGetCall {
3273	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3274	return c
3275}
3276
3277// IfNoneMatch sets the optional parameter which makes the operation
3278// fail if the object's ETag matches the given value. This is useful for
3279// getting updates only after the object has changed since the last
3280// request. Use googleapi.IsNotModified to check whether the response
3281// error from Do is the result of In-None-Match.
3282func (c *BillingAccountsBucketsGetCall) IfNoneMatch(entityTag string) *BillingAccountsBucketsGetCall {
3283	c.ifNoneMatch_ = entityTag
3284	return c
3285}
3286
3287// Context sets the context to be used in this call's Do method. Any
3288// pending HTTP request will be aborted if the provided context is
3289// canceled.
3290func (c *BillingAccountsBucketsGetCall) Context(ctx context.Context) *BillingAccountsBucketsGetCall {
3291	c.ctx_ = ctx
3292	return c
3293}
3294
3295// Header returns an http.Header that can be modified by the caller to
3296// add HTTP headers to the request.
3297func (c *BillingAccountsBucketsGetCall) Header() http.Header {
3298	if c.header_ == nil {
3299		c.header_ = make(http.Header)
3300	}
3301	return c.header_
3302}
3303
3304func (c *BillingAccountsBucketsGetCall) doRequest(alt string) (*http.Response, error) {
3305	reqHeaders := make(http.Header)
3306	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
3307	for k, v := range c.header_ {
3308		reqHeaders[k] = v
3309	}
3310	reqHeaders.Set("User-Agent", c.s.userAgent())
3311	if c.ifNoneMatch_ != "" {
3312		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3313	}
3314	var body io.Reader = nil
3315	c.urlParams_.Set("alt", alt)
3316	c.urlParams_.Set("prettyPrint", "false")
3317	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
3318	urls += "?" + c.urlParams_.Encode()
3319	req, err := http.NewRequest("GET", urls, body)
3320	if err != nil {
3321		return nil, err
3322	}
3323	req.Header = reqHeaders
3324	googleapi.Expand(req.URL, map[string]string{
3325		"name": c.name,
3326	})
3327	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3328}
3329
3330// Do executes the "logging.billingAccounts.buckets.get" call.
3331// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
3332// status code is an error. Response headers are in either
3333// *LogBucket.ServerResponse.Header or (if a response was returned at
3334// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
3335// to check whether the returned error was because
3336// http.StatusNotModified was returned.
3337func (c *BillingAccountsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
3338	gensupport.SetOptions(c.urlParams_, opts...)
3339	res, err := c.doRequest("json")
3340	if res != nil && res.StatusCode == http.StatusNotModified {
3341		if res.Body != nil {
3342			res.Body.Close()
3343		}
3344		return nil, &googleapi.Error{
3345			Code:   res.StatusCode,
3346			Header: res.Header,
3347		}
3348	}
3349	if err != nil {
3350		return nil, err
3351	}
3352	defer googleapi.CloseBody(res)
3353	if err := googleapi.CheckResponse(res); err != nil {
3354		return nil, err
3355	}
3356	ret := &LogBucket{
3357		ServerResponse: googleapi.ServerResponse{
3358			Header:         res.Header,
3359			HTTPStatusCode: res.StatusCode,
3360		},
3361	}
3362	target := &ret
3363	if err := gensupport.DecodeResponse(target, res); err != nil {
3364		return nil, err
3365	}
3366	return ret, nil
3367	// {
3368	//   "description": "Gets a bucket.",
3369	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/buckets/{bucketsId}",
3370	//   "httpMethod": "GET",
3371	//   "id": "logging.billingAccounts.buckets.get",
3372	//   "parameterOrder": [
3373	//     "name"
3374	//   ],
3375	//   "parameters": {
3376	//     "name": {
3377	//       "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\".",
3378	//       "location": "path",
3379	//       "pattern": "^billingAccounts/[^/]+/buckets/[^/]+$",
3380	//       "required": true,
3381	//       "type": "string"
3382	//     }
3383	//   },
3384	//   "path": "v2/{+name}",
3385	//   "response": {
3386	//     "$ref": "LogBucket"
3387	//   },
3388	//   "scopes": [
3389	//     "https://www.googleapis.com/auth/cloud-platform",
3390	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
3391	//     "https://www.googleapis.com/auth/logging.admin",
3392	//     "https://www.googleapis.com/auth/logging.read"
3393	//   ]
3394	// }
3395
3396}
3397
3398// method id "logging.billingAccounts.buckets.views.get":
3399
3400type BillingAccountsBucketsViewsGetCall struct {
3401	s            *Service
3402	name         string
3403	urlParams_   gensupport.URLParams
3404	ifNoneMatch_ string
3405	ctx_         context.Context
3406	header_      http.Header
3407}
3408
3409// Get: Gets a view.
3410//
3411// - name: The resource name of the policy:
3412//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
3413//   iews/[VIEW_ID]" Example:
3414//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id/v
3415//   iews/my-view-id".
3416func (r *BillingAccountsBucketsViewsService) Get(name string) *BillingAccountsBucketsViewsGetCall {
3417	c := &BillingAccountsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3418	c.name = name
3419	return c
3420}
3421
3422// Fields allows partial responses to be retrieved. See
3423// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3424// for more information.
3425func (c *BillingAccountsBucketsViewsGetCall) Fields(s ...googleapi.Field) *BillingAccountsBucketsViewsGetCall {
3426	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3427	return c
3428}
3429
3430// IfNoneMatch sets the optional parameter which makes the operation
3431// fail if the object's ETag matches the given value. This is useful for
3432// getting updates only after the object has changed since the last
3433// request. Use googleapi.IsNotModified to check whether the response
3434// error from Do is the result of In-None-Match.
3435func (c *BillingAccountsBucketsViewsGetCall) IfNoneMatch(entityTag string) *BillingAccountsBucketsViewsGetCall {
3436	c.ifNoneMatch_ = entityTag
3437	return c
3438}
3439
3440// Context sets the context to be used in this call's Do method. Any
3441// pending HTTP request will be aborted if the provided context is
3442// canceled.
3443func (c *BillingAccountsBucketsViewsGetCall) Context(ctx context.Context) *BillingAccountsBucketsViewsGetCall {
3444	c.ctx_ = ctx
3445	return c
3446}
3447
3448// Header returns an http.Header that can be modified by the caller to
3449// add HTTP headers to the request.
3450func (c *BillingAccountsBucketsViewsGetCall) Header() http.Header {
3451	if c.header_ == nil {
3452		c.header_ = make(http.Header)
3453	}
3454	return c.header_
3455}
3456
3457func (c *BillingAccountsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) {
3458	reqHeaders := make(http.Header)
3459	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
3460	for k, v := range c.header_ {
3461		reqHeaders[k] = v
3462	}
3463	reqHeaders.Set("User-Agent", c.s.userAgent())
3464	if c.ifNoneMatch_ != "" {
3465		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3466	}
3467	var body io.Reader = nil
3468	c.urlParams_.Set("alt", alt)
3469	c.urlParams_.Set("prettyPrint", "false")
3470	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
3471	urls += "?" + c.urlParams_.Encode()
3472	req, err := http.NewRequest("GET", urls, body)
3473	if err != nil {
3474		return nil, err
3475	}
3476	req.Header = reqHeaders
3477	googleapi.Expand(req.URL, map[string]string{
3478		"name": c.name,
3479	})
3480	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3481}
3482
3483// Do executes the "logging.billingAccounts.buckets.views.get" call.
3484// Exactly one of *LogView or error will be non-nil. Any non-2xx status
3485// code is an error. Response headers are in either
3486// *LogView.ServerResponse.Header or (if a response was returned at all)
3487// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3488// check whether the returned error was because http.StatusNotModified
3489// was returned.
3490func (c *BillingAccountsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
3491	gensupport.SetOptions(c.urlParams_, opts...)
3492	res, err := c.doRequest("json")
3493	if res != nil && res.StatusCode == http.StatusNotModified {
3494		if res.Body != nil {
3495			res.Body.Close()
3496		}
3497		return nil, &googleapi.Error{
3498			Code:   res.StatusCode,
3499			Header: res.Header,
3500		}
3501	}
3502	if err != nil {
3503		return nil, err
3504	}
3505	defer googleapi.CloseBody(res)
3506	if err := googleapi.CheckResponse(res); err != nil {
3507		return nil, err
3508	}
3509	ret := &LogView{
3510		ServerResponse: googleapi.ServerResponse{
3511			Header:         res.Header,
3512			HTTPStatusCode: res.StatusCode,
3513		},
3514	}
3515	target := &ret
3516	if err := gensupport.DecodeResponse(target, res); err != nil {
3517		return nil, err
3518	}
3519	return ret, nil
3520	// {
3521	//   "description": "Gets a view.",
3522	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/buckets/{bucketsId}/views/{viewsId}",
3523	//   "httpMethod": "GET",
3524	//   "id": "logging.billingAccounts.buckets.views.get",
3525	//   "parameterOrder": [
3526	//     "name"
3527	//   ],
3528	//   "parameters": {
3529	//     "name": {
3530	//       "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\".",
3531	//       "location": "path",
3532	//       "pattern": "^billingAccounts/[^/]+/buckets/[^/]+/views/[^/]+$",
3533	//       "required": true,
3534	//       "type": "string"
3535	//     }
3536	//   },
3537	//   "path": "v2/{+name}",
3538	//   "response": {
3539	//     "$ref": "LogView"
3540	//   },
3541	//   "scopes": [
3542	//     "https://www.googleapis.com/auth/cloud-platform",
3543	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
3544	//     "https://www.googleapis.com/auth/logging.admin",
3545	//     "https://www.googleapis.com/auth/logging.read"
3546	//   ]
3547	// }
3548
3549}
3550
3551// method id "logging.billingAccounts.exclusions.create":
3552
3553type BillingAccountsExclusionsCreateCall struct {
3554	s            *Service
3555	parent       string
3556	logexclusion *LogExclusion
3557	urlParams_   gensupport.URLParams
3558	ctx_         context.Context
3559	header_      http.Header
3560}
3561
3562// Create: Creates a new exclusion in a specified parent resource. Only
3563// log entries belonging to that resource can be excluded. You can have
3564// up to 10 exclusions in a resource.
3565//
3566// - parent: The parent resource in which to create the exclusion:
3567//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
3568//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
3569//   Examples: "projects/my-logging-project", "organizations/123456789".
3570func (r *BillingAccountsExclusionsService) Create(parent string, logexclusion *LogExclusion) *BillingAccountsExclusionsCreateCall {
3571	c := &BillingAccountsExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3572	c.parent = parent
3573	c.logexclusion = logexclusion
3574	return c
3575}
3576
3577// Fields allows partial responses to be retrieved. See
3578// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3579// for more information.
3580func (c *BillingAccountsExclusionsCreateCall) Fields(s ...googleapi.Field) *BillingAccountsExclusionsCreateCall {
3581	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3582	return c
3583}
3584
3585// Context sets the context to be used in this call's Do method. Any
3586// pending HTTP request will be aborted if the provided context is
3587// canceled.
3588func (c *BillingAccountsExclusionsCreateCall) Context(ctx context.Context) *BillingAccountsExclusionsCreateCall {
3589	c.ctx_ = ctx
3590	return c
3591}
3592
3593// Header returns an http.Header that can be modified by the caller to
3594// add HTTP headers to the request.
3595func (c *BillingAccountsExclusionsCreateCall) Header() http.Header {
3596	if c.header_ == nil {
3597		c.header_ = make(http.Header)
3598	}
3599	return c.header_
3600}
3601
3602func (c *BillingAccountsExclusionsCreateCall) doRequest(alt string) (*http.Response, error) {
3603	reqHeaders := make(http.Header)
3604	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
3605	for k, v := range c.header_ {
3606		reqHeaders[k] = v
3607	}
3608	reqHeaders.Set("User-Agent", c.s.userAgent())
3609	var body io.Reader = nil
3610	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
3611	if err != nil {
3612		return nil, err
3613	}
3614	reqHeaders.Set("Content-Type", "application/json")
3615	c.urlParams_.Set("alt", alt)
3616	c.urlParams_.Set("prettyPrint", "false")
3617	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
3618	urls += "?" + c.urlParams_.Encode()
3619	req, err := http.NewRequest("POST", urls, body)
3620	if err != nil {
3621		return nil, err
3622	}
3623	req.Header = reqHeaders
3624	googleapi.Expand(req.URL, map[string]string{
3625		"parent": c.parent,
3626	})
3627	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3628}
3629
3630// Do executes the "logging.billingAccounts.exclusions.create" call.
3631// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
3632// status code is an error. Response headers are in either
3633// *LogExclusion.ServerResponse.Header or (if a response was returned at
3634// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
3635// to check whether the returned error was because
3636// http.StatusNotModified was returned.
3637func (c *BillingAccountsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
3638	gensupport.SetOptions(c.urlParams_, opts...)
3639	res, err := c.doRequest("json")
3640	if res != nil && res.StatusCode == http.StatusNotModified {
3641		if res.Body != nil {
3642			res.Body.Close()
3643		}
3644		return nil, &googleapi.Error{
3645			Code:   res.StatusCode,
3646			Header: res.Header,
3647		}
3648	}
3649	if err != nil {
3650		return nil, err
3651	}
3652	defer googleapi.CloseBody(res)
3653	if err := googleapi.CheckResponse(res); err != nil {
3654		return nil, err
3655	}
3656	ret := &LogExclusion{
3657		ServerResponse: googleapi.ServerResponse{
3658			Header:         res.Header,
3659			HTTPStatusCode: res.StatusCode,
3660		},
3661	}
3662	target := &ret
3663	if err := gensupport.DecodeResponse(target, res); err != nil {
3664		return nil, err
3665	}
3666	return ret, nil
3667	// {
3668	//   "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.",
3669	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions",
3670	//   "httpMethod": "POST",
3671	//   "id": "logging.billingAccounts.exclusions.create",
3672	//   "parameterOrder": [
3673	//     "parent"
3674	//   ],
3675	//   "parameters": {
3676	//     "parent": {
3677	//       "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\".",
3678	//       "location": "path",
3679	//       "pattern": "^billingAccounts/[^/]+$",
3680	//       "required": true,
3681	//       "type": "string"
3682	//     }
3683	//   },
3684	//   "path": "v2/{+parent}/exclusions",
3685	//   "request": {
3686	//     "$ref": "LogExclusion"
3687	//   },
3688	//   "response": {
3689	//     "$ref": "LogExclusion"
3690	//   },
3691	//   "scopes": [
3692	//     "https://www.googleapis.com/auth/cloud-platform",
3693	//     "https://www.googleapis.com/auth/logging.admin"
3694	//   ]
3695	// }
3696
3697}
3698
3699// method id "logging.billingAccounts.exclusions.delete":
3700
3701type BillingAccountsExclusionsDeleteCall struct {
3702	s          *Service
3703	name       string
3704	urlParams_ gensupport.URLParams
3705	ctx_       context.Context
3706	header_    http.Header
3707}
3708
3709// Delete: Deletes an exclusion.
3710//
3711// - name: The resource name of an existing exclusion to delete:
3712//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
3713//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
3714//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
3715//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example:
3716//   "projects/my-project-id/exclusions/my-exclusion-id".
3717func (r *BillingAccountsExclusionsService) Delete(name string) *BillingAccountsExclusionsDeleteCall {
3718	c := &BillingAccountsExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3719	c.name = name
3720	return c
3721}
3722
3723// Fields allows partial responses to be retrieved. See
3724// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3725// for more information.
3726func (c *BillingAccountsExclusionsDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsExclusionsDeleteCall {
3727	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3728	return c
3729}
3730
3731// Context sets the context to be used in this call's Do method. Any
3732// pending HTTP request will be aborted if the provided context is
3733// canceled.
3734func (c *BillingAccountsExclusionsDeleteCall) Context(ctx context.Context) *BillingAccountsExclusionsDeleteCall {
3735	c.ctx_ = ctx
3736	return c
3737}
3738
3739// Header returns an http.Header that can be modified by the caller to
3740// add HTTP headers to the request.
3741func (c *BillingAccountsExclusionsDeleteCall) Header() http.Header {
3742	if c.header_ == nil {
3743		c.header_ = make(http.Header)
3744	}
3745	return c.header_
3746}
3747
3748func (c *BillingAccountsExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) {
3749	reqHeaders := make(http.Header)
3750	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
3751	for k, v := range c.header_ {
3752		reqHeaders[k] = v
3753	}
3754	reqHeaders.Set("User-Agent", c.s.userAgent())
3755	var body io.Reader = nil
3756	c.urlParams_.Set("alt", alt)
3757	c.urlParams_.Set("prettyPrint", "false")
3758	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
3759	urls += "?" + c.urlParams_.Encode()
3760	req, err := http.NewRequest("DELETE", urls, body)
3761	if err != nil {
3762		return nil, err
3763	}
3764	req.Header = reqHeaders
3765	googleapi.Expand(req.URL, map[string]string{
3766		"name": c.name,
3767	})
3768	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3769}
3770
3771// Do executes the "logging.billingAccounts.exclusions.delete" call.
3772// Exactly one of *Empty or error will be non-nil. Any non-2xx status
3773// code is an error. Response headers are in either
3774// *Empty.ServerResponse.Header or (if a response was returned at all)
3775// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3776// check whether the returned error was because http.StatusNotModified
3777// was returned.
3778func (c *BillingAccountsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
3779	gensupport.SetOptions(c.urlParams_, opts...)
3780	res, err := c.doRequest("json")
3781	if res != nil && res.StatusCode == http.StatusNotModified {
3782		if res.Body != nil {
3783			res.Body.Close()
3784		}
3785		return nil, &googleapi.Error{
3786			Code:   res.StatusCode,
3787			Header: res.Header,
3788		}
3789	}
3790	if err != nil {
3791		return nil, err
3792	}
3793	defer googleapi.CloseBody(res)
3794	if err := googleapi.CheckResponse(res); err != nil {
3795		return nil, err
3796	}
3797	ret := &Empty{
3798		ServerResponse: googleapi.ServerResponse{
3799			Header:         res.Header,
3800			HTTPStatusCode: res.StatusCode,
3801		},
3802	}
3803	target := &ret
3804	if err := gensupport.DecodeResponse(target, res); err != nil {
3805		return nil, err
3806	}
3807	return ret, nil
3808	// {
3809	//   "description": "Deletes an exclusion.",
3810	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions/{exclusionsId}",
3811	//   "httpMethod": "DELETE",
3812	//   "id": "logging.billingAccounts.exclusions.delete",
3813	//   "parameterOrder": [
3814	//     "name"
3815	//   ],
3816	//   "parameters": {
3817	//     "name": {
3818	//       "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\".",
3819	//       "location": "path",
3820	//       "pattern": "^billingAccounts/[^/]+/exclusions/[^/]+$",
3821	//       "required": true,
3822	//       "type": "string"
3823	//     }
3824	//   },
3825	//   "path": "v2/{+name}",
3826	//   "response": {
3827	//     "$ref": "Empty"
3828	//   },
3829	//   "scopes": [
3830	//     "https://www.googleapis.com/auth/cloud-platform",
3831	//     "https://www.googleapis.com/auth/logging.admin"
3832	//   ]
3833	// }
3834
3835}
3836
3837// method id "logging.billingAccounts.exclusions.get":
3838
3839type BillingAccountsExclusionsGetCall struct {
3840	s            *Service
3841	name         string
3842	urlParams_   gensupport.URLParams
3843	ifNoneMatch_ string
3844	ctx_         context.Context
3845	header_      http.Header
3846}
3847
3848// Get: Gets the description of an exclusion.
3849//
3850// - name: The resource name of an existing exclusion:
3851//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
3852//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
3853//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
3854//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example:
3855//   "projects/my-project-id/exclusions/my-exclusion-id".
3856func (r *BillingAccountsExclusionsService) Get(name string) *BillingAccountsExclusionsGetCall {
3857	c := &BillingAccountsExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3858	c.name = name
3859	return c
3860}
3861
3862// Fields allows partial responses to be retrieved. See
3863// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3864// for more information.
3865func (c *BillingAccountsExclusionsGetCall) Fields(s ...googleapi.Field) *BillingAccountsExclusionsGetCall {
3866	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3867	return c
3868}
3869
3870// IfNoneMatch sets the optional parameter which makes the operation
3871// fail if the object's ETag matches the given value. This is useful for
3872// getting updates only after the object has changed since the last
3873// request. Use googleapi.IsNotModified to check whether the response
3874// error from Do is the result of In-None-Match.
3875func (c *BillingAccountsExclusionsGetCall) IfNoneMatch(entityTag string) *BillingAccountsExclusionsGetCall {
3876	c.ifNoneMatch_ = entityTag
3877	return c
3878}
3879
3880// Context sets the context to be used in this call's Do method. Any
3881// pending HTTP request will be aborted if the provided context is
3882// canceled.
3883func (c *BillingAccountsExclusionsGetCall) Context(ctx context.Context) *BillingAccountsExclusionsGetCall {
3884	c.ctx_ = ctx
3885	return c
3886}
3887
3888// Header returns an http.Header that can be modified by the caller to
3889// add HTTP headers to the request.
3890func (c *BillingAccountsExclusionsGetCall) Header() http.Header {
3891	if c.header_ == nil {
3892		c.header_ = make(http.Header)
3893	}
3894	return c.header_
3895}
3896
3897func (c *BillingAccountsExclusionsGetCall) doRequest(alt string) (*http.Response, error) {
3898	reqHeaders := make(http.Header)
3899	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
3900	for k, v := range c.header_ {
3901		reqHeaders[k] = v
3902	}
3903	reqHeaders.Set("User-Agent", c.s.userAgent())
3904	if c.ifNoneMatch_ != "" {
3905		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3906	}
3907	var body io.Reader = nil
3908	c.urlParams_.Set("alt", alt)
3909	c.urlParams_.Set("prettyPrint", "false")
3910	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
3911	urls += "?" + c.urlParams_.Encode()
3912	req, err := http.NewRequest("GET", urls, body)
3913	if err != nil {
3914		return nil, err
3915	}
3916	req.Header = reqHeaders
3917	googleapi.Expand(req.URL, map[string]string{
3918		"name": c.name,
3919	})
3920	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3921}
3922
3923// Do executes the "logging.billingAccounts.exclusions.get" call.
3924// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
3925// status code is an error. Response headers are in either
3926// *LogExclusion.ServerResponse.Header or (if a response was returned at
3927// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
3928// to check whether the returned error was because
3929// http.StatusNotModified was returned.
3930func (c *BillingAccountsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
3931	gensupport.SetOptions(c.urlParams_, opts...)
3932	res, err := c.doRequest("json")
3933	if res != nil && res.StatusCode == http.StatusNotModified {
3934		if res.Body != nil {
3935			res.Body.Close()
3936		}
3937		return nil, &googleapi.Error{
3938			Code:   res.StatusCode,
3939			Header: res.Header,
3940		}
3941	}
3942	if err != nil {
3943		return nil, err
3944	}
3945	defer googleapi.CloseBody(res)
3946	if err := googleapi.CheckResponse(res); err != nil {
3947		return nil, err
3948	}
3949	ret := &LogExclusion{
3950		ServerResponse: googleapi.ServerResponse{
3951			Header:         res.Header,
3952			HTTPStatusCode: res.StatusCode,
3953		},
3954	}
3955	target := &ret
3956	if err := gensupport.DecodeResponse(target, res); err != nil {
3957		return nil, err
3958	}
3959	return ret, nil
3960	// {
3961	//   "description": "Gets the description of an exclusion.",
3962	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions/{exclusionsId}",
3963	//   "httpMethod": "GET",
3964	//   "id": "logging.billingAccounts.exclusions.get",
3965	//   "parameterOrder": [
3966	//     "name"
3967	//   ],
3968	//   "parameters": {
3969	//     "name": {
3970	//       "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\".",
3971	//       "location": "path",
3972	//       "pattern": "^billingAccounts/[^/]+/exclusions/[^/]+$",
3973	//       "required": true,
3974	//       "type": "string"
3975	//     }
3976	//   },
3977	//   "path": "v2/{+name}",
3978	//   "response": {
3979	//     "$ref": "LogExclusion"
3980	//   },
3981	//   "scopes": [
3982	//     "https://www.googleapis.com/auth/cloud-platform",
3983	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
3984	//     "https://www.googleapis.com/auth/logging.admin",
3985	//     "https://www.googleapis.com/auth/logging.read"
3986	//   ]
3987	// }
3988
3989}
3990
3991// method id "logging.billingAccounts.exclusions.list":
3992
3993type BillingAccountsExclusionsListCall struct {
3994	s            *Service
3995	parent       string
3996	urlParams_   gensupport.URLParams
3997	ifNoneMatch_ string
3998	ctx_         context.Context
3999	header_      http.Header
4000}
4001
4002// List: Lists all the exclusions in a parent resource.
4003//
4004// - parent: The parent resource whose exclusions are to be listed.
4005//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
4006//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]".
4007func (r *BillingAccountsExclusionsService) List(parent string) *BillingAccountsExclusionsListCall {
4008	c := &BillingAccountsExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4009	c.parent = parent
4010	return c
4011}
4012
4013// PageSize sets the optional parameter "pageSize": The maximum number
4014// of results to return from this request. Non-positive values are
4015// ignored. The presence of nextPageToken in the response indicates that
4016// more results might be available.
4017func (c *BillingAccountsExclusionsListCall) PageSize(pageSize int64) *BillingAccountsExclusionsListCall {
4018	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4019	return c
4020}
4021
4022// PageToken sets the optional parameter "pageToken": If present, then
4023// retrieve the next batch of results from the preceding call to this
4024// method. pageToken must be the value of nextPageToken from the
4025// previous response. The values of other method parameters should be
4026// identical to those in the previous call.
4027func (c *BillingAccountsExclusionsListCall) PageToken(pageToken string) *BillingAccountsExclusionsListCall {
4028	c.urlParams_.Set("pageToken", pageToken)
4029	return c
4030}
4031
4032// Fields allows partial responses to be retrieved. See
4033// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4034// for more information.
4035func (c *BillingAccountsExclusionsListCall) Fields(s ...googleapi.Field) *BillingAccountsExclusionsListCall {
4036	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4037	return c
4038}
4039
4040// IfNoneMatch sets the optional parameter which makes the operation
4041// fail if the object's ETag matches the given value. This is useful for
4042// getting updates only after the object has changed since the last
4043// request. Use googleapi.IsNotModified to check whether the response
4044// error from Do is the result of In-None-Match.
4045func (c *BillingAccountsExclusionsListCall) IfNoneMatch(entityTag string) *BillingAccountsExclusionsListCall {
4046	c.ifNoneMatch_ = entityTag
4047	return c
4048}
4049
4050// Context sets the context to be used in this call's Do method. Any
4051// pending HTTP request will be aborted if the provided context is
4052// canceled.
4053func (c *BillingAccountsExclusionsListCall) Context(ctx context.Context) *BillingAccountsExclusionsListCall {
4054	c.ctx_ = ctx
4055	return c
4056}
4057
4058// Header returns an http.Header that can be modified by the caller to
4059// add HTTP headers to the request.
4060func (c *BillingAccountsExclusionsListCall) Header() http.Header {
4061	if c.header_ == nil {
4062		c.header_ = make(http.Header)
4063	}
4064	return c.header_
4065}
4066
4067func (c *BillingAccountsExclusionsListCall) doRequest(alt string) (*http.Response, error) {
4068	reqHeaders := make(http.Header)
4069	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
4070	for k, v := range c.header_ {
4071		reqHeaders[k] = v
4072	}
4073	reqHeaders.Set("User-Agent", c.s.userAgent())
4074	if c.ifNoneMatch_ != "" {
4075		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4076	}
4077	var body io.Reader = nil
4078	c.urlParams_.Set("alt", alt)
4079	c.urlParams_.Set("prettyPrint", "false")
4080	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
4081	urls += "?" + c.urlParams_.Encode()
4082	req, err := http.NewRequest("GET", urls, body)
4083	if err != nil {
4084		return nil, err
4085	}
4086	req.Header = reqHeaders
4087	googleapi.Expand(req.URL, map[string]string{
4088		"parent": c.parent,
4089	})
4090	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4091}
4092
4093// Do executes the "logging.billingAccounts.exclusions.list" call.
4094// Exactly one of *ListExclusionsResponse or error will be non-nil. Any
4095// non-2xx status code is an error. Response headers are in either
4096// *ListExclusionsResponse.ServerResponse.Header or (if a response was
4097// returned at all) in error.(*googleapi.Error).Header. Use
4098// googleapi.IsNotModified to check whether the returned error was
4099// because http.StatusNotModified was returned.
4100func (c *BillingAccountsExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) {
4101	gensupport.SetOptions(c.urlParams_, opts...)
4102	res, err := c.doRequest("json")
4103	if res != nil && res.StatusCode == http.StatusNotModified {
4104		if res.Body != nil {
4105			res.Body.Close()
4106		}
4107		return nil, &googleapi.Error{
4108			Code:   res.StatusCode,
4109			Header: res.Header,
4110		}
4111	}
4112	if err != nil {
4113		return nil, err
4114	}
4115	defer googleapi.CloseBody(res)
4116	if err := googleapi.CheckResponse(res); err != nil {
4117		return nil, err
4118	}
4119	ret := &ListExclusionsResponse{
4120		ServerResponse: googleapi.ServerResponse{
4121			Header:         res.Header,
4122			HTTPStatusCode: res.StatusCode,
4123		},
4124	}
4125	target := &ret
4126	if err := gensupport.DecodeResponse(target, res); err != nil {
4127		return nil, err
4128	}
4129	return ret, nil
4130	// {
4131	//   "description": "Lists all the exclusions in a parent resource.",
4132	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions",
4133	//   "httpMethod": "GET",
4134	//   "id": "logging.billingAccounts.exclusions.list",
4135	//   "parameterOrder": [
4136	//     "parent"
4137	//   ],
4138	//   "parameters": {
4139	//     "pageSize": {
4140	//       "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.",
4141	//       "format": "int32",
4142	//       "location": "query",
4143	//       "type": "integer"
4144	//     },
4145	//     "pageToken": {
4146	//       "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.",
4147	//       "location": "query",
4148	//       "type": "string"
4149	//     },
4150	//     "parent": {
4151	//       "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
4152	//       "location": "path",
4153	//       "pattern": "^billingAccounts/[^/]+$",
4154	//       "required": true,
4155	//       "type": "string"
4156	//     }
4157	//   },
4158	//   "path": "v2/{+parent}/exclusions",
4159	//   "response": {
4160	//     "$ref": "ListExclusionsResponse"
4161	//   },
4162	//   "scopes": [
4163	//     "https://www.googleapis.com/auth/cloud-platform",
4164	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
4165	//     "https://www.googleapis.com/auth/logging.admin",
4166	//     "https://www.googleapis.com/auth/logging.read"
4167	//   ]
4168	// }
4169
4170}
4171
4172// Pages invokes f for each page of results.
4173// A non-nil error returned from f will halt the iteration.
4174// The provided context supersedes any context provided to the Context method.
4175func (c *BillingAccountsExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error {
4176	c.ctx_ = ctx
4177	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
4178	for {
4179		x, err := c.Do()
4180		if err != nil {
4181			return err
4182		}
4183		if err := f(x); err != nil {
4184			return err
4185		}
4186		if x.NextPageToken == "" {
4187			return nil
4188		}
4189		c.PageToken(x.NextPageToken)
4190	}
4191}
4192
4193// method id "logging.billingAccounts.exclusions.patch":
4194
4195type BillingAccountsExclusionsPatchCall struct {
4196	s            *Service
4197	name         string
4198	logexclusion *LogExclusion
4199	urlParams_   gensupport.URLParams
4200	ctx_         context.Context
4201	header_      http.Header
4202}
4203
4204// Patch: Changes one or more properties of an existing exclusion.
4205//
4206// - name: The resource name of the exclusion to update:
4207//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
4208//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
4209//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
4210//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example:
4211//   "projects/my-project-id/exclusions/my-exclusion-id".
4212func (r *BillingAccountsExclusionsService) Patch(name string, logexclusion *LogExclusion) *BillingAccountsExclusionsPatchCall {
4213	c := &BillingAccountsExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4214	c.name = name
4215	c.logexclusion = logexclusion
4216	return c
4217}
4218
4219// UpdateMask sets the optional parameter "updateMask": Required. A
4220// non-empty list of fields to change in the existing exclusion. New
4221// values for the fields are taken from the corresponding fields in the
4222// LogExclusion included in this request. Fields not mentioned in
4223// update_mask are not changed and are ignored in the request.For
4224// example, to change the filter and description of an exclusion,
4225// specify an update_mask of "filter,description".
4226func (c *BillingAccountsExclusionsPatchCall) UpdateMask(updateMask string) *BillingAccountsExclusionsPatchCall {
4227	c.urlParams_.Set("updateMask", updateMask)
4228	return c
4229}
4230
4231// Fields allows partial responses to be retrieved. See
4232// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4233// for more information.
4234func (c *BillingAccountsExclusionsPatchCall) Fields(s ...googleapi.Field) *BillingAccountsExclusionsPatchCall {
4235	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4236	return c
4237}
4238
4239// Context sets the context to be used in this call's Do method. Any
4240// pending HTTP request will be aborted if the provided context is
4241// canceled.
4242func (c *BillingAccountsExclusionsPatchCall) Context(ctx context.Context) *BillingAccountsExclusionsPatchCall {
4243	c.ctx_ = ctx
4244	return c
4245}
4246
4247// Header returns an http.Header that can be modified by the caller to
4248// add HTTP headers to the request.
4249func (c *BillingAccountsExclusionsPatchCall) Header() http.Header {
4250	if c.header_ == nil {
4251		c.header_ = make(http.Header)
4252	}
4253	return c.header_
4254}
4255
4256func (c *BillingAccountsExclusionsPatchCall) doRequest(alt string) (*http.Response, error) {
4257	reqHeaders := make(http.Header)
4258	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
4259	for k, v := range c.header_ {
4260		reqHeaders[k] = v
4261	}
4262	reqHeaders.Set("User-Agent", c.s.userAgent())
4263	var body io.Reader = nil
4264	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
4265	if err != nil {
4266		return nil, err
4267	}
4268	reqHeaders.Set("Content-Type", "application/json")
4269	c.urlParams_.Set("alt", alt)
4270	c.urlParams_.Set("prettyPrint", "false")
4271	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
4272	urls += "?" + c.urlParams_.Encode()
4273	req, err := http.NewRequest("PATCH", urls, body)
4274	if err != nil {
4275		return nil, err
4276	}
4277	req.Header = reqHeaders
4278	googleapi.Expand(req.URL, map[string]string{
4279		"name": c.name,
4280	})
4281	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4282}
4283
4284// Do executes the "logging.billingAccounts.exclusions.patch" call.
4285// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
4286// status code is an error. Response headers are in either
4287// *LogExclusion.ServerResponse.Header or (if a response was returned at
4288// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4289// to check whether the returned error was because
4290// http.StatusNotModified was returned.
4291func (c *BillingAccountsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
4292	gensupport.SetOptions(c.urlParams_, opts...)
4293	res, err := c.doRequest("json")
4294	if res != nil && res.StatusCode == http.StatusNotModified {
4295		if res.Body != nil {
4296			res.Body.Close()
4297		}
4298		return nil, &googleapi.Error{
4299			Code:   res.StatusCode,
4300			Header: res.Header,
4301		}
4302	}
4303	if err != nil {
4304		return nil, err
4305	}
4306	defer googleapi.CloseBody(res)
4307	if err := googleapi.CheckResponse(res); err != nil {
4308		return nil, err
4309	}
4310	ret := &LogExclusion{
4311		ServerResponse: googleapi.ServerResponse{
4312			Header:         res.Header,
4313			HTTPStatusCode: res.StatusCode,
4314		},
4315	}
4316	target := &ret
4317	if err := gensupport.DecodeResponse(target, res); err != nil {
4318		return nil, err
4319	}
4320	return ret, nil
4321	// {
4322	//   "description": "Changes one or more properties of an existing exclusion.",
4323	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions/{exclusionsId}",
4324	//   "httpMethod": "PATCH",
4325	//   "id": "logging.billingAccounts.exclusions.patch",
4326	//   "parameterOrder": [
4327	//     "name"
4328	//   ],
4329	//   "parameters": {
4330	//     "name": {
4331	//       "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\".",
4332	//       "location": "path",
4333	//       "pattern": "^billingAccounts/[^/]+/exclusions/[^/]+$",
4334	//       "required": true,
4335	//       "type": "string"
4336	//     },
4337	//     "updateMask": {
4338	//       "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\".",
4339	//       "format": "google-fieldmask",
4340	//       "location": "query",
4341	//       "type": "string"
4342	//     }
4343	//   },
4344	//   "path": "v2/{+name}",
4345	//   "request": {
4346	//     "$ref": "LogExclusion"
4347	//   },
4348	//   "response": {
4349	//     "$ref": "LogExclusion"
4350	//   },
4351	//   "scopes": [
4352	//     "https://www.googleapis.com/auth/cloud-platform",
4353	//     "https://www.googleapis.com/auth/logging.admin"
4354	//   ]
4355	// }
4356
4357}
4358
4359// method id "logging.billingAccounts.locations.get":
4360
4361type BillingAccountsLocationsGetCall struct {
4362	s            *Service
4363	name         string
4364	urlParams_   gensupport.URLParams
4365	ifNoneMatch_ string
4366	ctx_         context.Context
4367	header_      http.Header
4368}
4369
4370// Get: Gets information about a location.
4371//
4372// - name: Resource name for the location.
4373func (r *BillingAccountsLocationsService) Get(name string) *BillingAccountsLocationsGetCall {
4374	c := &BillingAccountsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4375	c.name = name
4376	return c
4377}
4378
4379// Fields allows partial responses to be retrieved. See
4380// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4381// for more information.
4382func (c *BillingAccountsLocationsGetCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsGetCall {
4383	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4384	return c
4385}
4386
4387// IfNoneMatch sets the optional parameter which makes the operation
4388// fail if the object's ETag matches the given value. This is useful for
4389// getting updates only after the object has changed since the last
4390// request. Use googleapi.IsNotModified to check whether the response
4391// error from Do is the result of In-None-Match.
4392func (c *BillingAccountsLocationsGetCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsGetCall {
4393	c.ifNoneMatch_ = entityTag
4394	return c
4395}
4396
4397// Context sets the context to be used in this call's Do method. Any
4398// pending HTTP request will be aborted if the provided context is
4399// canceled.
4400func (c *BillingAccountsLocationsGetCall) Context(ctx context.Context) *BillingAccountsLocationsGetCall {
4401	c.ctx_ = ctx
4402	return c
4403}
4404
4405// Header returns an http.Header that can be modified by the caller to
4406// add HTTP headers to the request.
4407func (c *BillingAccountsLocationsGetCall) Header() http.Header {
4408	if c.header_ == nil {
4409		c.header_ = make(http.Header)
4410	}
4411	return c.header_
4412}
4413
4414func (c *BillingAccountsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
4415	reqHeaders := make(http.Header)
4416	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
4417	for k, v := range c.header_ {
4418		reqHeaders[k] = v
4419	}
4420	reqHeaders.Set("User-Agent", c.s.userAgent())
4421	if c.ifNoneMatch_ != "" {
4422		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4423	}
4424	var body io.Reader = nil
4425	c.urlParams_.Set("alt", alt)
4426	c.urlParams_.Set("prettyPrint", "false")
4427	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
4428	urls += "?" + c.urlParams_.Encode()
4429	req, err := http.NewRequest("GET", urls, body)
4430	if err != nil {
4431		return nil, err
4432	}
4433	req.Header = reqHeaders
4434	googleapi.Expand(req.URL, map[string]string{
4435		"name": c.name,
4436	})
4437	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4438}
4439
4440// Do executes the "logging.billingAccounts.locations.get" call.
4441// Exactly one of *Location or error will be non-nil. Any non-2xx status
4442// code is an error. Response headers are in either
4443// *Location.ServerResponse.Header or (if a response was returned at
4444// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4445// to check whether the returned error was because
4446// http.StatusNotModified was returned.
4447func (c *BillingAccountsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
4448	gensupport.SetOptions(c.urlParams_, opts...)
4449	res, err := c.doRequest("json")
4450	if res != nil && res.StatusCode == http.StatusNotModified {
4451		if res.Body != nil {
4452			res.Body.Close()
4453		}
4454		return nil, &googleapi.Error{
4455			Code:   res.StatusCode,
4456			Header: res.Header,
4457		}
4458	}
4459	if err != nil {
4460		return nil, err
4461	}
4462	defer googleapi.CloseBody(res)
4463	if err := googleapi.CheckResponse(res); err != nil {
4464		return nil, err
4465	}
4466	ret := &Location{
4467		ServerResponse: googleapi.ServerResponse{
4468			Header:         res.Header,
4469			HTTPStatusCode: res.StatusCode,
4470		},
4471	}
4472	target := &ret
4473	if err := gensupport.DecodeResponse(target, res); err != nil {
4474		return nil, err
4475	}
4476	return ret, nil
4477	// {
4478	//   "description": "Gets information about a location.",
4479	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}",
4480	//   "httpMethod": "GET",
4481	//   "id": "logging.billingAccounts.locations.get",
4482	//   "parameterOrder": [
4483	//     "name"
4484	//   ],
4485	//   "parameters": {
4486	//     "name": {
4487	//       "description": "Resource name for the location.",
4488	//       "location": "path",
4489	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+$",
4490	//       "required": true,
4491	//       "type": "string"
4492	//     }
4493	//   },
4494	//   "path": "v2/{+name}",
4495	//   "response": {
4496	//     "$ref": "Location"
4497	//   },
4498	//   "scopes": [
4499	//     "https://www.googleapis.com/auth/cloud-platform",
4500	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
4501	//     "https://www.googleapis.com/auth/logging.admin",
4502	//     "https://www.googleapis.com/auth/logging.read"
4503	//   ]
4504	// }
4505
4506}
4507
4508// method id "logging.billingAccounts.locations.list":
4509
4510type BillingAccountsLocationsListCall struct {
4511	s            *Service
4512	name         string
4513	urlParams_   gensupport.URLParams
4514	ifNoneMatch_ string
4515	ctx_         context.Context
4516	header_      http.Header
4517}
4518
4519// List: Lists information about the supported locations for this
4520// service.
4521//
4522// - name: The resource that owns the locations collection, if
4523//   applicable.
4524func (r *BillingAccountsLocationsService) List(name string) *BillingAccountsLocationsListCall {
4525	c := &BillingAccountsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4526	c.name = name
4527	return c
4528}
4529
4530// Filter sets the optional parameter "filter": A filter to narrow down
4531// results to a preferred subset. The filtering language accepts strings
4532// like "displayName=tokyo", and is documented in more detail in AIP-160
4533// (https://google.aip.dev/160).
4534func (c *BillingAccountsLocationsListCall) Filter(filter string) *BillingAccountsLocationsListCall {
4535	c.urlParams_.Set("filter", filter)
4536	return c
4537}
4538
4539// PageSize sets the optional parameter "pageSize": The maximum number
4540// of results to return. If not set, the service selects a default.
4541func (c *BillingAccountsLocationsListCall) PageSize(pageSize int64) *BillingAccountsLocationsListCall {
4542	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4543	return c
4544}
4545
4546// PageToken sets the optional parameter "pageToken": A page token
4547// received from the next_page_token field in the response. Send that
4548// page token to receive the subsequent page.
4549func (c *BillingAccountsLocationsListCall) PageToken(pageToken string) *BillingAccountsLocationsListCall {
4550	c.urlParams_.Set("pageToken", pageToken)
4551	return c
4552}
4553
4554// Fields allows partial responses to be retrieved. See
4555// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4556// for more information.
4557func (c *BillingAccountsLocationsListCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsListCall {
4558	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4559	return c
4560}
4561
4562// IfNoneMatch sets the optional parameter which makes the operation
4563// fail if the object's ETag matches the given value. This is useful for
4564// getting updates only after the object has changed since the last
4565// request. Use googleapi.IsNotModified to check whether the response
4566// error from Do is the result of In-None-Match.
4567func (c *BillingAccountsLocationsListCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsListCall {
4568	c.ifNoneMatch_ = entityTag
4569	return c
4570}
4571
4572// Context sets the context to be used in this call's Do method. Any
4573// pending HTTP request will be aborted if the provided context is
4574// canceled.
4575func (c *BillingAccountsLocationsListCall) Context(ctx context.Context) *BillingAccountsLocationsListCall {
4576	c.ctx_ = ctx
4577	return c
4578}
4579
4580// Header returns an http.Header that can be modified by the caller to
4581// add HTTP headers to the request.
4582func (c *BillingAccountsLocationsListCall) Header() http.Header {
4583	if c.header_ == nil {
4584		c.header_ = make(http.Header)
4585	}
4586	return c.header_
4587}
4588
4589func (c *BillingAccountsLocationsListCall) doRequest(alt string) (*http.Response, error) {
4590	reqHeaders := make(http.Header)
4591	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
4592	for k, v := range c.header_ {
4593		reqHeaders[k] = v
4594	}
4595	reqHeaders.Set("User-Agent", c.s.userAgent())
4596	if c.ifNoneMatch_ != "" {
4597		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4598	}
4599	var body io.Reader = nil
4600	c.urlParams_.Set("alt", alt)
4601	c.urlParams_.Set("prettyPrint", "false")
4602	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations")
4603	urls += "?" + c.urlParams_.Encode()
4604	req, err := http.NewRequest("GET", urls, body)
4605	if err != nil {
4606		return nil, err
4607	}
4608	req.Header = reqHeaders
4609	googleapi.Expand(req.URL, map[string]string{
4610		"name": c.name,
4611	})
4612	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4613}
4614
4615// Do executes the "logging.billingAccounts.locations.list" call.
4616// Exactly one of *ListLocationsResponse or error will be non-nil. Any
4617// non-2xx status code is an error. Response headers are in either
4618// *ListLocationsResponse.ServerResponse.Header or (if a response was
4619// returned at all) in error.(*googleapi.Error).Header. Use
4620// googleapi.IsNotModified to check whether the returned error was
4621// because http.StatusNotModified was returned.
4622func (c *BillingAccountsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
4623	gensupport.SetOptions(c.urlParams_, opts...)
4624	res, err := c.doRequest("json")
4625	if res != nil && res.StatusCode == http.StatusNotModified {
4626		if res.Body != nil {
4627			res.Body.Close()
4628		}
4629		return nil, &googleapi.Error{
4630			Code:   res.StatusCode,
4631			Header: res.Header,
4632		}
4633	}
4634	if err != nil {
4635		return nil, err
4636	}
4637	defer googleapi.CloseBody(res)
4638	if err := googleapi.CheckResponse(res); err != nil {
4639		return nil, err
4640	}
4641	ret := &ListLocationsResponse{
4642		ServerResponse: googleapi.ServerResponse{
4643			Header:         res.Header,
4644			HTTPStatusCode: res.StatusCode,
4645		},
4646	}
4647	target := &ret
4648	if err := gensupport.DecodeResponse(target, res); err != nil {
4649		return nil, err
4650	}
4651	return ret, nil
4652	// {
4653	//   "description": "Lists information about the supported locations for this service.",
4654	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations",
4655	//   "httpMethod": "GET",
4656	//   "id": "logging.billingAccounts.locations.list",
4657	//   "parameterOrder": [
4658	//     "name"
4659	//   ],
4660	//   "parameters": {
4661	//     "filter": {
4662	//       "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like \"displayName=tokyo\", and is documented in more detail in AIP-160 (https://google.aip.dev/160).",
4663	//       "location": "query",
4664	//       "type": "string"
4665	//     },
4666	//     "name": {
4667	//       "description": "The resource that owns the locations collection, if applicable.",
4668	//       "location": "path",
4669	//       "pattern": "^billingAccounts/[^/]+$",
4670	//       "required": true,
4671	//       "type": "string"
4672	//     },
4673	//     "pageSize": {
4674	//       "description": "The maximum number of results to return. If not set, the service selects a default.",
4675	//       "format": "int32",
4676	//       "location": "query",
4677	//       "type": "integer"
4678	//     },
4679	//     "pageToken": {
4680	//       "description": "A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.",
4681	//       "location": "query",
4682	//       "type": "string"
4683	//     }
4684	//   },
4685	//   "path": "v2/{+name}/locations",
4686	//   "response": {
4687	//     "$ref": "ListLocationsResponse"
4688	//   },
4689	//   "scopes": [
4690	//     "https://www.googleapis.com/auth/cloud-platform",
4691	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
4692	//     "https://www.googleapis.com/auth/logging.admin",
4693	//     "https://www.googleapis.com/auth/logging.read"
4694	//   ]
4695	// }
4696
4697}
4698
4699// Pages invokes f for each page of results.
4700// A non-nil error returned from f will halt the iteration.
4701// The provided context supersedes any context provided to the Context method.
4702func (c *BillingAccountsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
4703	c.ctx_ = ctx
4704	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
4705	for {
4706		x, err := c.Do()
4707		if err != nil {
4708			return err
4709		}
4710		if err := f(x); err != nil {
4711			return err
4712		}
4713		if x.NextPageToken == "" {
4714			return nil
4715		}
4716		c.PageToken(x.NextPageToken)
4717	}
4718}
4719
4720// method id "logging.billingAccounts.locations.buckets.create":
4721
4722type BillingAccountsLocationsBucketsCreateCall struct {
4723	s          *Service
4724	parent     string
4725	logbucket  *LogBucket
4726	urlParams_ gensupport.URLParams
4727	ctx_       context.Context
4728	header_    http.Header
4729}
4730
4731// Create: Creates a bucket that can be used to store log entries. Once
4732// a bucket has been created, the region cannot be changed.
4733//
4734// - parent: The resource in which to create the bucket:
4735//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]" Example:
4736//   "projects/my-logging-project/locations/global".
4737func (r *BillingAccountsLocationsBucketsService) Create(parent string, logbucket *LogBucket) *BillingAccountsLocationsBucketsCreateCall {
4738	c := &BillingAccountsLocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4739	c.parent = parent
4740	c.logbucket = logbucket
4741	return c
4742}
4743
4744// BucketId sets the optional parameter "bucketId": Required. A
4745// client-assigned identifier such as "my-bucket". Identifiers are
4746// limited to 100 characters and can include only letters, digits,
4747// underscores, hyphens, and periods.
4748func (c *BillingAccountsLocationsBucketsCreateCall) BucketId(bucketId string) *BillingAccountsLocationsBucketsCreateCall {
4749	c.urlParams_.Set("bucketId", bucketId)
4750	return c
4751}
4752
4753// Fields allows partial responses to be retrieved. See
4754// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4755// for more information.
4756func (c *BillingAccountsLocationsBucketsCreateCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsCreateCall {
4757	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4758	return c
4759}
4760
4761// Context sets the context to be used in this call's Do method. Any
4762// pending HTTP request will be aborted if the provided context is
4763// canceled.
4764func (c *BillingAccountsLocationsBucketsCreateCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsCreateCall {
4765	c.ctx_ = ctx
4766	return c
4767}
4768
4769// Header returns an http.Header that can be modified by the caller to
4770// add HTTP headers to the request.
4771func (c *BillingAccountsLocationsBucketsCreateCall) Header() http.Header {
4772	if c.header_ == nil {
4773		c.header_ = make(http.Header)
4774	}
4775	return c.header_
4776}
4777
4778func (c *BillingAccountsLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) {
4779	reqHeaders := make(http.Header)
4780	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
4781	for k, v := range c.header_ {
4782		reqHeaders[k] = v
4783	}
4784	reqHeaders.Set("User-Agent", c.s.userAgent())
4785	var body io.Reader = nil
4786	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
4787	if err != nil {
4788		return nil, err
4789	}
4790	reqHeaders.Set("Content-Type", "application/json")
4791	c.urlParams_.Set("alt", alt)
4792	c.urlParams_.Set("prettyPrint", "false")
4793	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
4794	urls += "?" + c.urlParams_.Encode()
4795	req, err := http.NewRequest("POST", urls, body)
4796	if err != nil {
4797		return nil, err
4798	}
4799	req.Header = reqHeaders
4800	googleapi.Expand(req.URL, map[string]string{
4801		"parent": c.parent,
4802	})
4803	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4804}
4805
4806// Do executes the "logging.billingAccounts.locations.buckets.create" call.
4807// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
4808// status code is an error. Response headers are in either
4809// *LogBucket.ServerResponse.Header or (if a response was returned at
4810// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4811// to check whether the returned error was because
4812// http.StatusNotModified was returned.
4813func (c *BillingAccountsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
4814	gensupport.SetOptions(c.urlParams_, opts...)
4815	res, err := c.doRequest("json")
4816	if res != nil && res.StatusCode == http.StatusNotModified {
4817		if res.Body != nil {
4818			res.Body.Close()
4819		}
4820		return nil, &googleapi.Error{
4821			Code:   res.StatusCode,
4822			Header: res.Header,
4823		}
4824	}
4825	if err != nil {
4826		return nil, err
4827	}
4828	defer googleapi.CloseBody(res)
4829	if err := googleapi.CheckResponse(res); err != nil {
4830		return nil, err
4831	}
4832	ret := &LogBucket{
4833		ServerResponse: googleapi.ServerResponse{
4834			Header:         res.Header,
4835			HTTPStatusCode: res.StatusCode,
4836		},
4837	}
4838	target := &ret
4839	if err := gensupport.DecodeResponse(target, res); err != nil {
4840		return nil, err
4841	}
4842	return ret, nil
4843	// {
4844	//   "description": "Creates a bucket that can be used to store log entries. Once a bucket has been created, the region cannot be changed.",
4845	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets",
4846	//   "httpMethod": "POST",
4847	//   "id": "logging.billingAccounts.locations.buckets.create",
4848	//   "parameterOrder": [
4849	//     "parent"
4850	//   ],
4851	//   "parameters": {
4852	//     "bucketId": {
4853	//       "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.",
4854	//       "location": "query",
4855	//       "type": "string"
4856	//     },
4857	//     "parent": {
4858	//       "description": "Required. The resource in which to create the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" Example: \"projects/my-logging-project/locations/global\"",
4859	//       "location": "path",
4860	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+$",
4861	//       "required": true,
4862	//       "type": "string"
4863	//     }
4864	//   },
4865	//   "path": "v2/{+parent}/buckets",
4866	//   "request": {
4867	//     "$ref": "LogBucket"
4868	//   },
4869	//   "response": {
4870	//     "$ref": "LogBucket"
4871	//   },
4872	//   "scopes": [
4873	//     "https://www.googleapis.com/auth/cloud-platform",
4874	//     "https://www.googleapis.com/auth/logging.admin"
4875	//   ]
4876	// }
4877
4878}
4879
4880// method id "logging.billingAccounts.locations.buckets.delete":
4881
4882type BillingAccountsLocationsBucketsDeleteCall struct {
4883	s          *Service
4884	name       string
4885	urlParams_ gensupport.URLParams
4886	ctx_       context.Context
4887	header_    http.Header
4888}
4889
4890// Delete: Deletes a bucket. Moves the bucket to the DELETE_REQUESTED
4891// state. After 7 days, the bucket will be purged and all logs in the
4892// bucket will be permanently deleted.
4893//
4894// - name: The full resource name of the bucket to delete.
4895//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
4896//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
4897//   CKET_ID]"
4898//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
4899//   s/[BUCKET_ID]"
4900//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
4901//   Example:
4902//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id".
4903func (r *BillingAccountsLocationsBucketsService) Delete(name string) *BillingAccountsLocationsBucketsDeleteCall {
4904	c := &BillingAccountsLocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4905	c.name = name
4906	return c
4907}
4908
4909// Fields allows partial responses to be retrieved. See
4910// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4911// for more information.
4912func (c *BillingAccountsLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsDeleteCall {
4913	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4914	return c
4915}
4916
4917// Context sets the context to be used in this call's Do method. Any
4918// pending HTTP request will be aborted if the provided context is
4919// canceled.
4920func (c *BillingAccountsLocationsBucketsDeleteCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsDeleteCall {
4921	c.ctx_ = ctx
4922	return c
4923}
4924
4925// Header returns an http.Header that can be modified by the caller to
4926// add HTTP headers to the request.
4927func (c *BillingAccountsLocationsBucketsDeleteCall) Header() http.Header {
4928	if c.header_ == nil {
4929		c.header_ = make(http.Header)
4930	}
4931	return c.header_
4932}
4933
4934func (c *BillingAccountsLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
4935	reqHeaders := make(http.Header)
4936	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
4937	for k, v := range c.header_ {
4938		reqHeaders[k] = v
4939	}
4940	reqHeaders.Set("User-Agent", c.s.userAgent())
4941	var body io.Reader = nil
4942	c.urlParams_.Set("alt", alt)
4943	c.urlParams_.Set("prettyPrint", "false")
4944	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
4945	urls += "?" + c.urlParams_.Encode()
4946	req, err := http.NewRequest("DELETE", urls, body)
4947	if err != nil {
4948		return nil, err
4949	}
4950	req.Header = reqHeaders
4951	googleapi.Expand(req.URL, map[string]string{
4952		"name": c.name,
4953	})
4954	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4955}
4956
4957// Do executes the "logging.billingAccounts.locations.buckets.delete" call.
4958// Exactly one of *Empty or error will be non-nil. Any non-2xx status
4959// code is an error. Response headers are in either
4960// *Empty.ServerResponse.Header or (if a response was returned at all)
4961// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4962// check whether the returned error was because http.StatusNotModified
4963// was returned.
4964func (c *BillingAccountsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
4965	gensupport.SetOptions(c.urlParams_, opts...)
4966	res, err := c.doRequest("json")
4967	if res != nil && res.StatusCode == http.StatusNotModified {
4968		if res.Body != nil {
4969			res.Body.Close()
4970		}
4971		return nil, &googleapi.Error{
4972			Code:   res.StatusCode,
4973			Header: res.Header,
4974		}
4975	}
4976	if err != nil {
4977		return nil, err
4978	}
4979	defer googleapi.CloseBody(res)
4980	if err := googleapi.CheckResponse(res); err != nil {
4981		return nil, err
4982	}
4983	ret := &Empty{
4984		ServerResponse: googleapi.ServerResponse{
4985			Header:         res.Header,
4986			HTTPStatusCode: res.StatusCode,
4987		},
4988	}
4989	target := &ret
4990	if err := gensupport.DecodeResponse(target, res); err != nil {
4991		return nil, err
4992	}
4993	return ret, nil
4994	// {
4995	//   "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.",
4996	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}",
4997	//   "httpMethod": "DELETE",
4998	//   "id": "logging.billingAccounts.locations.buckets.delete",
4999	//   "parameterOrder": [
5000	//     "name"
5001	//   ],
5002	//   "parameters": {
5003	//     "name": {
5004	//       "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\".",
5005	//       "location": "path",
5006	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+$",
5007	//       "required": true,
5008	//       "type": "string"
5009	//     }
5010	//   },
5011	//   "path": "v2/{+name}",
5012	//   "response": {
5013	//     "$ref": "Empty"
5014	//   },
5015	//   "scopes": [
5016	//     "https://www.googleapis.com/auth/cloud-platform",
5017	//     "https://www.googleapis.com/auth/logging.admin"
5018	//   ]
5019	// }
5020
5021}
5022
5023// method id "logging.billingAccounts.locations.buckets.list":
5024
5025type BillingAccountsLocationsBucketsListCall struct {
5026	s            *Service
5027	parent       string
5028	urlParams_   gensupport.URLParams
5029	ifNoneMatch_ string
5030	ctx_         context.Context
5031	header_      http.Header
5032}
5033
5034// List: Lists buckets.
5035//
5036// - parent: The parent resource whose buckets are to be listed:
5037//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
5038//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
5039//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
5040//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations
5041//   portion of the resource must be specified, but supplying the
5042//   character - in place of LOCATION_ID will return all buckets.
5043func (r *BillingAccountsLocationsBucketsService) List(parent string) *BillingAccountsLocationsBucketsListCall {
5044	c := &BillingAccountsLocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5045	c.parent = parent
5046	return c
5047}
5048
5049// PageSize sets the optional parameter "pageSize": The maximum number
5050// of results to return from this request. Non-positive values are
5051// ignored. The presence of nextPageToken in the response indicates that
5052// more results might be available.
5053func (c *BillingAccountsLocationsBucketsListCall) PageSize(pageSize int64) *BillingAccountsLocationsBucketsListCall {
5054	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5055	return c
5056}
5057
5058// PageToken sets the optional parameter "pageToken": If present, then
5059// retrieve the next batch of results from the preceding call to this
5060// method. pageToken must be the value of nextPageToken from the
5061// previous response. The values of other method parameters should be
5062// identical to those in the previous call.
5063func (c *BillingAccountsLocationsBucketsListCall) PageToken(pageToken string) *BillingAccountsLocationsBucketsListCall {
5064	c.urlParams_.Set("pageToken", pageToken)
5065	return c
5066}
5067
5068// Fields allows partial responses to be retrieved. See
5069// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5070// for more information.
5071func (c *BillingAccountsLocationsBucketsListCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsListCall {
5072	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5073	return c
5074}
5075
5076// IfNoneMatch sets the optional parameter which makes the operation
5077// fail if the object's ETag matches the given value. This is useful for
5078// getting updates only after the object has changed since the last
5079// request. Use googleapi.IsNotModified to check whether the response
5080// error from Do is the result of In-None-Match.
5081func (c *BillingAccountsLocationsBucketsListCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsBucketsListCall {
5082	c.ifNoneMatch_ = entityTag
5083	return c
5084}
5085
5086// Context sets the context to be used in this call's Do method. Any
5087// pending HTTP request will be aborted if the provided context is
5088// canceled.
5089func (c *BillingAccountsLocationsBucketsListCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsListCall {
5090	c.ctx_ = ctx
5091	return c
5092}
5093
5094// Header returns an http.Header that can be modified by the caller to
5095// add HTTP headers to the request.
5096func (c *BillingAccountsLocationsBucketsListCall) Header() http.Header {
5097	if c.header_ == nil {
5098		c.header_ = make(http.Header)
5099	}
5100	return c.header_
5101}
5102
5103func (c *BillingAccountsLocationsBucketsListCall) doRequest(alt string) (*http.Response, error) {
5104	reqHeaders := make(http.Header)
5105	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
5106	for k, v := range c.header_ {
5107		reqHeaders[k] = v
5108	}
5109	reqHeaders.Set("User-Agent", c.s.userAgent())
5110	if c.ifNoneMatch_ != "" {
5111		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5112	}
5113	var body io.Reader = nil
5114	c.urlParams_.Set("alt", alt)
5115	c.urlParams_.Set("prettyPrint", "false")
5116	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
5117	urls += "?" + c.urlParams_.Encode()
5118	req, err := http.NewRequest("GET", urls, body)
5119	if err != nil {
5120		return nil, err
5121	}
5122	req.Header = reqHeaders
5123	googleapi.Expand(req.URL, map[string]string{
5124		"parent": c.parent,
5125	})
5126	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5127}
5128
5129// Do executes the "logging.billingAccounts.locations.buckets.list" call.
5130// Exactly one of *ListBucketsResponse or error will be non-nil. Any
5131// non-2xx status code is an error. Response headers are in either
5132// *ListBucketsResponse.ServerResponse.Header or (if a response was
5133// returned at all) in error.(*googleapi.Error).Header. Use
5134// googleapi.IsNotModified to check whether the returned error was
5135// because http.StatusNotModified was returned.
5136func (c *BillingAccountsLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) {
5137	gensupport.SetOptions(c.urlParams_, opts...)
5138	res, err := c.doRequest("json")
5139	if res != nil && res.StatusCode == http.StatusNotModified {
5140		if res.Body != nil {
5141			res.Body.Close()
5142		}
5143		return nil, &googleapi.Error{
5144			Code:   res.StatusCode,
5145			Header: res.Header,
5146		}
5147	}
5148	if err != nil {
5149		return nil, err
5150	}
5151	defer googleapi.CloseBody(res)
5152	if err := googleapi.CheckResponse(res); err != nil {
5153		return nil, err
5154	}
5155	ret := &ListBucketsResponse{
5156		ServerResponse: googleapi.ServerResponse{
5157			Header:         res.Header,
5158			HTTPStatusCode: res.StatusCode,
5159		},
5160	}
5161	target := &ret
5162	if err := gensupport.DecodeResponse(target, res); err != nil {
5163		return nil, err
5164	}
5165	return ret, nil
5166	// {
5167	//   "description": "Lists buckets.",
5168	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets",
5169	//   "httpMethod": "GET",
5170	//   "id": "logging.billingAccounts.locations.buckets.list",
5171	//   "parameterOrder": [
5172	//     "parent"
5173	//   ],
5174	//   "parameters": {
5175	//     "pageSize": {
5176	//       "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.",
5177	//       "format": "int32",
5178	//       "location": "query",
5179	//       "type": "integer"
5180	//     },
5181	//     "pageToken": {
5182	//       "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.",
5183	//       "location": "query",
5184	//       "type": "string"
5185	//     },
5186	//     "parent": {
5187	//       "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.",
5188	//       "location": "path",
5189	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+$",
5190	//       "required": true,
5191	//       "type": "string"
5192	//     }
5193	//   },
5194	//   "path": "v2/{+parent}/buckets",
5195	//   "response": {
5196	//     "$ref": "ListBucketsResponse"
5197	//   },
5198	//   "scopes": [
5199	//     "https://www.googleapis.com/auth/cloud-platform",
5200	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
5201	//     "https://www.googleapis.com/auth/logging.admin",
5202	//     "https://www.googleapis.com/auth/logging.read"
5203	//   ]
5204	// }
5205
5206}
5207
5208// Pages invokes f for each page of results.
5209// A non-nil error returned from f will halt the iteration.
5210// The provided context supersedes any context provided to the Context method.
5211func (c *BillingAccountsLocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error {
5212	c.ctx_ = ctx
5213	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
5214	for {
5215		x, err := c.Do()
5216		if err != nil {
5217			return err
5218		}
5219		if err := f(x); err != nil {
5220			return err
5221		}
5222		if x.NextPageToken == "" {
5223			return nil
5224		}
5225		c.PageToken(x.NextPageToken)
5226	}
5227}
5228
5229// method id "logging.billingAccounts.locations.buckets.patch":
5230
5231type BillingAccountsLocationsBucketsPatchCall struct {
5232	s          *Service
5233	name       string
5234	logbucket  *LogBucket
5235	urlParams_ gensupport.URLParams
5236	ctx_       context.Context
5237	header_    http.Header
5238}
5239
5240// Patch: Updates a bucket. This method replaces the following fields in
5241// the existing bucket with values from the new bucket:
5242// retention_periodIf the retention period is decreased and the bucket
5243// is locked, FAILED_PRECONDITION will be returned.If the bucket has a
5244// LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be
5245// returned.A buckets region may not be modified after it is created.
5246//
5247// - name: The full resource name of the bucket to update.
5248//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
5249//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
5250//   CKET_ID]"
5251//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
5252//   s/[BUCKET_ID]"
5253//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
5254//   Example:
5255//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id".
5256//    Also requires permission "resourcemanager.projects.updateLiens" to
5257//   set the locked property.
5258func (r *BillingAccountsLocationsBucketsService) Patch(name string, logbucket *LogBucket) *BillingAccountsLocationsBucketsPatchCall {
5259	c := &BillingAccountsLocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5260	c.name = name
5261	c.logbucket = logbucket
5262	return c
5263}
5264
5265// UpdateMask sets the optional parameter "updateMask": Required. Field
5266// mask that specifies the fields in bucket that need an update. A
5267// bucket field will be overwritten if, and only if, it is in the update
5268// mask. name and output only fields cannot be updated.For a detailed
5269// FieldMask definition, see
5270// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
5271// updateMask=retention_days.
5272func (c *BillingAccountsLocationsBucketsPatchCall) UpdateMask(updateMask string) *BillingAccountsLocationsBucketsPatchCall {
5273	c.urlParams_.Set("updateMask", updateMask)
5274	return c
5275}
5276
5277// Fields allows partial responses to be retrieved. See
5278// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5279// for more information.
5280func (c *BillingAccountsLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsPatchCall {
5281	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5282	return c
5283}
5284
5285// Context sets the context to be used in this call's Do method. Any
5286// pending HTTP request will be aborted if the provided context is
5287// canceled.
5288func (c *BillingAccountsLocationsBucketsPatchCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsPatchCall {
5289	c.ctx_ = ctx
5290	return c
5291}
5292
5293// Header returns an http.Header that can be modified by the caller to
5294// add HTTP headers to the request.
5295func (c *BillingAccountsLocationsBucketsPatchCall) Header() http.Header {
5296	if c.header_ == nil {
5297		c.header_ = make(http.Header)
5298	}
5299	return c.header_
5300}
5301
5302func (c *BillingAccountsLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
5303	reqHeaders := make(http.Header)
5304	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
5305	for k, v := range c.header_ {
5306		reqHeaders[k] = v
5307	}
5308	reqHeaders.Set("User-Agent", c.s.userAgent())
5309	var body io.Reader = nil
5310	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
5311	if err != nil {
5312		return nil, err
5313	}
5314	reqHeaders.Set("Content-Type", "application/json")
5315	c.urlParams_.Set("alt", alt)
5316	c.urlParams_.Set("prettyPrint", "false")
5317	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
5318	urls += "?" + c.urlParams_.Encode()
5319	req, err := http.NewRequest("PATCH", urls, body)
5320	if err != nil {
5321		return nil, err
5322	}
5323	req.Header = reqHeaders
5324	googleapi.Expand(req.URL, map[string]string{
5325		"name": c.name,
5326	})
5327	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5328}
5329
5330// Do executes the "logging.billingAccounts.locations.buckets.patch" call.
5331// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
5332// status code is an error. Response headers are in either
5333// *LogBucket.ServerResponse.Header or (if a response was returned at
5334// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
5335// to check whether the returned error was because
5336// http.StatusNotModified was returned.
5337func (c *BillingAccountsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
5338	gensupport.SetOptions(c.urlParams_, opts...)
5339	res, err := c.doRequest("json")
5340	if res != nil && res.StatusCode == http.StatusNotModified {
5341		if res.Body != nil {
5342			res.Body.Close()
5343		}
5344		return nil, &googleapi.Error{
5345			Code:   res.StatusCode,
5346			Header: res.Header,
5347		}
5348	}
5349	if err != nil {
5350		return nil, err
5351	}
5352	defer googleapi.CloseBody(res)
5353	if err := googleapi.CheckResponse(res); err != nil {
5354		return nil, err
5355	}
5356	ret := &LogBucket{
5357		ServerResponse: googleapi.ServerResponse{
5358			Header:         res.Header,
5359			HTTPStatusCode: res.StatusCode,
5360		},
5361	}
5362	target := &ret
5363	if err := gensupport.DecodeResponse(target, res); err != nil {
5364		return nil, err
5365	}
5366	return ret, nil
5367	// {
5368	//   "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.",
5369	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}",
5370	//   "httpMethod": "PATCH",
5371	//   "id": "logging.billingAccounts.locations.buckets.patch",
5372	//   "parameterOrder": [
5373	//     "name"
5374	//   ],
5375	//   "parameters": {
5376	//     "name": {
5377	//       "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",
5378	//       "location": "path",
5379	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+$",
5380	//       "required": true,
5381	//       "type": "string"
5382	//     },
5383	//     "updateMask": {
5384	//       "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.",
5385	//       "format": "google-fieldmask",
5386	//       "location": "query",
5387	//       "type": "string"
5388	//     }
5389	//   },
5390	//   "path": "v2/{+name}",
5391	//   "request": {
5392	//     "$ref": "LogBucket"
5393	//   },
5394	//   "response": {
5395	//     "$ref": "LogBucket"
5396	//   },
5397	//   "scopes": [
5398	//     "https://www.googleapis.com/auth/cloud-platform",
5399	//     "https://www.googleapis.com/auth/logging.admin"
5400	//   ]
5401	// }
5402
5403}
5404
5405// method id "logging.billingAccounts.locations.buckets.undelete":
5406
5407type BillingAccountsLocationsBucketsUndeleteCall struct {
5408	s                     *Service
5409	name                  string
5410	undeletebucketrequest *UndeleteBucketRequest
5411	urlParams_            gensupport.URLParams
5412	ctx_                  context.Context
5413	header_               http.Header
5414}
5415
5416// Undelete: Undeletes a bucket. A bucket that has been deleted may be
5417// undeleted within the grace period of 7 days.
5418//
5419// - name: The full resource name of the bucket to undelete.
5420//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
5421//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
5422//   CKET_ID]"
5423//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
5424//   s/[BUCKET_ID]"
5425//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
5426//   Example:
5427//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id".
5428func (r *BillingAccountsLocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *BillingAccountsLocationsBucketsUndeleteCall {
5429	c := &BillingAccountsLocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5430	c.name = name
5431	c.undeletebucketrequest = undeletebucketrequest
5432	return c
5433}
5434
5435// Fields allows partial responses to be retrieved. See
5436// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5437// for more information.
5438func (c *BillingAccountsLocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsUndeleteCall {
5439	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5440	return c
5441}
5442
5443// Context sets the context to be used in this call's Do method. Any
5444// pending HTTP request will be aborted if the provided context is
5445// canceled.
5446func (c *BillingAccountsLocationsBucketsUndeleteCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsUndeleteCall {
5447	c.ctx_ = ctx
5448	return c
5449}
5450
5451// Header returns an http.Header that can be modified by the caller to
5452// add HTTP headers to the request.
5453func (c *BillingAccountsLocationsBucketsUndeleteCall) Header() http.Header {
5454	if c.header_ == nil {
5455		c.header_ = make(http.Header)
5456	}
5457	return c.header_
5458}
5459
5460func (c *BillingAccountsLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) {
5461	reqHeaders := make(http.Header)
5462	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
5463	for k, v := range c.header_ {
5464		reqHeaders[k] = v
5465	}
5466	reqHeaders.Set("User-Agent", c.s.userAgent())
5467	var body io.Reader = nil
5468	body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest)
5469	if err != nil {
5470		return nil, err
5471	}
5472	reqHeaders.Set("Content-Type", "application/json")
5473	c.urlParams_.Set("alt", alt)
5474	c.urlParams_.Set("prettyPrint", "false")
5475	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete")
5476	urls += "?" + c.urlParams_.Encode()
5477	req, err := http.NewRequest("POST", urls, body)
5478	if err != nil {
5479		return nil, err
5480	}
5481	req.Header = reqHeaders
5482	googleapi.Expand(req.URL, map[string]string{
5483		"name": c.name,
5484	})
5485	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5486}
5487
5488// Do executes the "logging.billingAccounts.locations.buckets.undelete" call.
5489// Exactly one of *Empty or error will be non-nil. Any non-2xx status
5490// code is an error. Response headers are in either
5491// *Empty.ServerResponse.Header or (if a response was returned at all)
5492// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5493// check whether the returned error was because http.StatusNotModified
5494// was returned.
5495func (c *BillingAccountsLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
5496	gensupport.SetOptions(c.urlParams_, opts...)
5497	res, err := c.doRequest("json")
5498	if res != nil && res.StatusCode == http.StatusNotModified {
5499		if res.Body != nil {
5500			res.Body.Close()
5501		}
5502		return nil, &googleapi.Error{
5503			Code:   res.StatusCode,
5504			Header: res.Header,
5505		}
5506	}
5507	if err != nil {
5508		return nil, err
5509	}
5510	defer googleapi.CloseBody(res)
5511	if err := googleapi.CheckResponse(res); err != nil {
5512		return nil, err
5513	}
5514	ret := &Empty{
5515		ServerResponse: googleapi.ServerResponse{
5516			Header:         res.Header,
5517			HTTPStatusCode: res.StatusCode,
5518		},
5519	}
5520	target := &ret
5521	if err := gensupport.DecodeResponse(target, res); err != nil {
5522		return nil, err
5523	}
5524	return ret, nil
5525	// {
5526	//   "description": "Undeletes a bucket. A bucket that has been deleted may be undeleted within the grace period of 7 days.",
5527	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}:undelete",
5528	//   "httpMethod": "POST",
5529	//   "id": "logging.billingAccounts.locations.buckets.undelete",
5530	//   "parameterOrder": [
5531	//     "name"
5532	//   ],
5533	//   "parameters": {
5534	//     "name": {
5535	//       "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\".",
5536	//       "location": "path",
5537	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+$",
5538	//       "required": true,
5539	//       "type": "string"
5540	//     }
5541	//   },
5542	//   "path": "v2/{+name}:undelete",
5543	//   "request": {
5544	//     "$ref": "UndeleteBucketRequest"
5545	//   },
5546	//   "response": {
5547	//     "$ref": "Empty"
5548	//   },
5549	//   "scopes": [
5550	//     "https://www.googleapis.com/auth/cloud-platform",
5551	//     "https://www.googleapis.com/auth/logging.admin"
5552	//   ]
5553	// }
5554
5555}
5556
5557// method id "logging.billingAccounts.locations.buckets.views.create":
5558
5559type BillingAccountsLocationsBucketsViewsCreateCall struct {
5560	s          *Service
5561	parent     string
5562	logview    *LogView
5563	urlParams_ gensupport.URLParams
5564	ctx_       context.Context
5565	header_    http.Header
5566}
5567
5568// Create: Creates a view over logs in a bucket. A bucket may contain a
5569// maximum of 50 views.
5570//
5571// - parent: The bucket in which to create the view
5572//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
5573//   Example:
5574//   "projects/my-logging-project/locations/my-location/buckets/my-bucket
5575//   ".
5576func (r *BillingAccountsLocationsBucketsViewsService) Create(parent string, logview *LogView) *BillingAccountsLocationsBucketsViewsCreateCall {
5577	c := &BillingAccountsLocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5578	c.parent = parent
5579	c.logview = logview
5580	return c
5581}
5582
5583// ViewId sets the optional parameter "viewId": Required. The id to use
5584// for this view.
5585func (c *BillingAccountsLocationsBucketsViewsCreateCall) ViewId(viewId string) *BillingAccountsLocationsBucketsViewsCreateCall {
5586	c.urlParams_.Set("viewId", viewId)
5587	return c
5588}
5589
5590// Fields allows partial responses to be retrieved. See
5591// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5592// for more information.
5593func (c *BillingAccountsLocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsCreateCall {
5594	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5595	return c
5596}
5597
5598// Context sets the context to be used in this call's Do method. Any
5599// pending HTTP request will be aborted if the provided context is
5600// canceled.
5601func (c *BillingAccountsLocationsBucketsViewsCreateCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsCreateCall {
5602	c.ctx_ = ctx
5603	return c
5604}
5605
5606// Header returns an http.Header that can be modified by the caller to
5607// add HTTP headers to the request.
5608func (c *BillingAccountsLocationsBucketsViewsCreateCall) Header() http.Header {
5609	if c.header_ == nil {
5610		c.header_ = make(http.Header)
5611	}
5612	return c.header_
5613}
5614
5615func (c *BillingAccountsLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) {
5616	reqHeaders := make(http.Header)
5617	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
5618	for k, v := range c.header_ {
5619		reqHeaders[k] = v
5620	}
5621	reqHeaders.Set("User-Agent", c.s.userAgent())
5622	var body io.Reader = nil
5623	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
5624	if err != nil {
5625		return nil, err
5626	}
5627	reqHeaders.Set("Content-Type", "application/json")
5628	c.urlParams_.Set("alt", alt)
5629	c.urlParams_.Set("prettyPrint", "false")
5630	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
5631	urls += "?" + c.urlParams_.Encode()
5632	req, err := http.NewRequest("POST", urls, body)
5633	if err != nil {
5634		return nil, err
5635	}
5636	req.Header = reqHeaders
5637	googleapi.Expand(req.URL, map[string]string{
5638		"parent": c.parent,
5639	})
5640	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5641}
5642
5643// Do executes the "logging.billingAccounts.locations.buckets.views.create" call.
5644// Exactly one of *LogView or error will be non-nil. Any non-2xx status
5645// code is an error. Response headers are in either
5646// *LogView.ServerResponse.Header or (if a response was returned at all)
5647// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5648// check whether the returned error was because http.StatusNotModified
5649// was returned.
5650func (c *BillingAccountsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
5651	gensupport.SetOptions(c.urlParams_, opts...)
5652	res, err := c.doRequest("json")
5653	if res != nil && res.StatusCode == http.StatusNotModified {
5654		if res.Body != nil {
5655			res.Body.Close()
5656		}
5657		return nil, &googleapi.Error{
5658			Code:   res.StatusCode,
5659			Header: res.Header,
5660		}
5661	}
5662	if err != nil {
5663		return nil, err
5664	}
5665	defer googleapi.CloseBody(res)
5666	if err := googleapi.CheckResponse(res); err != nil {
5667		return nil, err
5668	}
5669	ret := &LogView{
5670		ServerResponse: googleapi.ServerResponse{
5671			Header:         res.Header,
5672			HTTPStatusCode: res.StatusCode,
5673		},
5674	}
5675	target := &ret
5676	if err := gensupport.DecodeResponse(target, res); err != nil {
5677		return nil, err
5678	}
5679	return ret, nil
5680	// {
5681	//   "description": "Creates a view over logs in a bucket. A bucket may contain a maximum of 50 views.",
5682	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views",
5683	//   "httpMethod": "POST",
5684	//   "id": "logging.billingAccounts.locations.buckets.views.create",
5685	//   "parameterOrder": [
5686	//     "parent"
5687	//   ],
5688	//   "parameters": {
5689	//     "parent": {
5690	//       "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\"",
5691	//       "location": "path",
5692	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+$",
5693	//       "required": true,
5694	//       "type": "string"
5695	//     },
5696	//     "viewId": {
5697	//       "description": "Required. The id to use for this view.",
5698	//       "location": "query",
5699	//       "type": "string"
5700	//     }
5701	//   },
5702	//   "path": "v2/{+parent}/views",
5703	//   "request": {
5704	//     "$ref": "LogView"
5705	//   },
5706	//   "response": {
5707	//     "$ref": "LogView"
5708	//   },
5709	//   "scopes": [
5710	//     "https://www.googleapis.com/auth/cloud-platform",
5711	//     "https://www.googleapis.com/auth/logging.admin"
5712	//   ]
5713	// }
5714
5715}
5716
5717// method id "logging.billingAccounts.locations.buckets.views.delete":
5718
5719type BillingAccountsLocationsBucketsViewsDeleteCall struct {
5720	s          *Service
5721	name       string
5722	urlParams_ gensupport.URLParams
5723	ctx_       context.Context
5724	header_    http.Header
5725}
5726
5727// Delete: Deletes a view from a bucket.
5728//
5729// - name: The full resource name of the view to delete:
5730//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
5731//   iews/[VIEW_ID]" Example:
5732//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id/v
5733//   iews/my-view-id".
5734func (r *BillingAccountsLocationsBucketsViewsService) Delete(name string) *BillingAccountsLocationsBucketsViewsDeleteCall {
5735	c := &BillingAccountsLocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5736	c.name = name
5737	return c
5738}
5739
5740// Fields allows partial responses to be retrieved. See
5741// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5742// for more information.
5743func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsDeleteCall {
5744	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5745	return c
5746}
5747
5748// Context sets the context to be used in this call's Do method. Any
5749// pending HTTP request will be aborted if the provided context is
5750// canceled.
5751func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsDeleteCall {
5752	c.ctx_ = ctx
5753	return c
5754}
5755
5756// Header returns an http.Header that can be modified by the caller to
5757// add HTTP headers to the request.
5758func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Header() http.Header {
5759	if c.header_ == nil {
5760		c.header_ = make(http.Header)
5761	}
5762	return c.header_
5763}
5764
5765func (c *BillingAccountsLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) {
5766	reqHeaders := make(http.Header)
5767	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
5768	for k, v := range c.header_ {
5769		reqHeaders[k] = v
5770	}
5771	reqHeaders.Set("User-Agent", c.s.userAgent())
5772	var body io.Reader = nil
5773	c.urlParams_.Set("alt", alt)
5774	c.urlParams_.Set("prettyPrint", "false")
5775	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
5776	urls += "?" + c.urlParams_.Encode()
5777	req, err := http.NewRequest("DELETE", urls, body)
5778	if err != nil {
5779		return nil, err
5780	}
5781	req.Header = reqHeaders
5782	googleapi.Expand(req.URL, map[string]string{
5783		"name": c.name,
5784	})
5785	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5786}
5787
5788// Do executes the "logging.billingAccounts.locations.buckets.views.delete" call.
5789// Exactly one of *Empty or error will be non-nil. Any non-2xx status
5790// code is an error. Response headers are in either
5791// *Empty.ServerResponse.Header or (if a response was returned at all)
5792// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5793// check whether the returned error was because http.StatusNotModified
5794// was returned.
5795func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
5796	gensupport.SetOptions(c.urlParams_, opts...)
5797	res, err := c.doRequest("json")
5798	if res != nil && res.StatusCode == http.StatusNotModified {
5799		if res.Body != nil {
5800			res.Body.Close()
5801		}
5802		return nil, &googleapi.Error{
5803			Code:   res.StatusCode,
5804			Header: res.Header,
5805		}
5806	}
5807	if err != nil {
5808		return nil, err
5809	}
5810	defer googleapi.CloseBody(res)
5811	if err := googleapi.CheckResponse(res); err != nil {
5812		return nil, err
5813	}
5814	ret := &Empty{
5815		ServerResponse: googleapi.ServerResponse{
5816			Header:         res.Header,
5817			HTTPStatusCode: res.StatusCode,
5818		},
5819	}
5820	target := &ret
5821	if err := gensupport.DecodeResponse(target, res); err != nil {
5822		return nil, err
5823	}
5824	return ret, nil
5825	// {
5826	//   "description": "Deletes a view from a bucket.",
5827	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
5828	//   "httpMethod": "DELETE",
5829	//   "id": "logging.billingAccounts.locations.buckets.views.delete",
5830	//   "parameterOrder": [
5831	//     "name"
5832	//   ],
5833	//   "parameters": {
5834	//     "name": {
5835	//       "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\".",
5836	//       "location": "path",
5837	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
5838	//       "required": true,
5839	//       "type": "string"
5840	//     }
5841	//   },
5842	//   "path": "v2/{+name}",
5843	//   "response": {
5844	//     "$ref": "Empty"
5845	//   },
5846	//   "scopes": [
5847	//     "https://www.googleapis.com/auth/cloud-platform",
5848	//     "https://www.googleapis.com/auth/logging.admin"
5849	//   ]
5850	// }
5851
5852}
5853
5854// method id "logging.billingAccounts.locations.buckets.views.list":
5855
5856type BillingAccountsLocationsBucketsViewsListCall struct {
5857	s            *Service
5858	parent       string
5859	urlParams_   gensupport.URLParams
5860	ifNoneMatch_ string
5861	ctx_         context.Context
5862	header_      http.Header
5863}
5864
5865// List: Lists views on a bucket.
5866//
5867// - parent: The bucket whose views are to be listed:
5868//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]".
5869func (r *BillingAccountsLocationsBucketsViewsService) List(parent string) *BillingAccountsLocationsBucketsViewsListCall {
5870	c := &BillingAccountsLocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5871	c.parent = parent
5872	return c
5873}
5874
5875// PageSize sets the optional parameter "pageSize": The maximum number
5876// of results to return from this request. Non-positive values are
5877// ignored. The presence of nextPageToken in the response indicates that
5878// more results might be available.
5879func (c *BillingAccountsLocationsBucketsViewsListCall) PageSize(pageSize int64) *BillingAccountsLocationsBucketsViewsListCall {
5880	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5881	return c
5882}
5883
5884// PageToken sets the optional parameter "pageToken": If present, then
5885// retrieve the next batch of results from the preceding call to this
5886// method. pageToken must be the value of nextPageToken from the
5887// previous response. The values of other method parameters should be
5888// identical to those in the previous call.
5889func (c *BillingAccountsLocationsBucketsViewsListCall) PageToken(pageToken string) *BillingAccountsLocationsBucketsViewsListCall {
5890	c.urlParams_.Set("pageToken", pageToken)
5891	return c
5892}
5893
5894// Fields allows partial responses to be retrieved. See
5895// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5896// for more information.
5897func (c *BillingAccountsLocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsListCall {
5898	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5899	return c
5900}
5901
5902// IfNoneMatch sets the optional parameter which makes the operation
5903// fail if the object's ETag matches the given value. This is useful for
5904// getting updates only after the object has changed since the last
5905// request. Use googleapi.IsNotModified to check whether the response
5906// error from Do is the result of In-None-Match.
5907func (c *BillingAccountsLocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsBucketsViewsListCall {
5908	c.ifNoneMatch_ = entityTag
5909	return c
5910}
5911
5912// Context sets the context to be used in this call's Do method. Any
5913// pending HTTP request will be aborted if the provided context is
5914// canceled.
5915func (c *BillingAccountsLocationsBucketsViewsListCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsListCall {
5916	c.ctx_ = ctx
5917	return c
5918}
5919
5920// Header returns an http.Header that can be modified by the caller to
5921// add HTTP headers to the request.
5922func (c *BillingAccountsLocationsBucketsViewsListCall) Header() http.Header {
5923	if c.header_ == nil {
5924		c.header_ = make(http.Header)
5925	}
5926	return c.header_
5927}
5928
5929func (c *BillingAccountsLocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) {
5930	reqHeaders := make(http.Header)
5931	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
5932	for k, v := range c.header_ {
5933		reqHeaders[k] = v
5934	}
5935	reqHeaders.Set("User-Agent", c.s.userAgent())
5936	if c.ifNoneMatch_ != "" {
5937		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5938	}
5939	var body io.Reader = nil
5940	c.urlParams_.Set("alt", alt)
5941	c.urlParams_.Set("prettyPrint", "false")
5942	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
5943	urls += "?" + c.urlParams_.Encode()
5944	req, err := http.NewRequest("GET", urls, body)
5945	if err != nil {
5946		return nil, err
5947	}
5948	req.Header = reqHeaders
5949	googleapi.Expand(req.URL, map[string]string{
5950		"parent": c.parent,
5951	})
5952	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5953}
5954
5955// Do executes the "logging.billingAccounts.locations.buckets.views.list" call.
5956// Exactly one of *ListViewsResponse or error will be non-nil. Any
5957// non-2xx status code is an error. Response headers are in either
5958// *ListViewsResponse.ServerResponse.Header or (if a response was
5959// returned at all) in error.(*googleapi.Error).Header. Use
5960// googleapi.IsNotModified to check whether the returned error was
5961// because http.StatusNotModified was returned.
5962func (c *BillingAccountsLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) {
5963	gensupport.SetOptions(c.urlParams_, opts...)
5964	res, err := c.doRequest("json")
5965	if res != nil && res.StatusCode == http.StatusNotModified {
5966		if res.Body != nil {
5967			res.Body.Close()
5968		}
5969		return nil, &googleapi.Error{
5970			Code:   res.StatusCode,
5971			Header: res.Header,
5972		}
5973	}
5974	if err != nil {
5975		return nil, err
5976	}
5977	defer googleapi.CloseBody(res)
5978	if err := googleapi.CheckResponse(res); err != nil {
5979		return nil, err
5980	}
5981	ret := &ListViewsResponse{
5982		ServerResponse: googleapi.ServerResponse{
5983			Header:         res.Header,
5984			HTTPStatusCode: res.StatusCode,
5985		},
5986	}
5987	target := &ret
5988	if err := gensupport.DecodeResponse(target, res); err != nil {
5989		return nil, err
5990	}
5991	return ret, nil
5992	// {
5993	//   "description": "Lists views on a bucket.",
5994	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views",
5995	//   "httpMethod": "GET",
5996	//   "id": "logging.billingAccounts.locations.buckets.views.list",
5997	//   "parameterOrder": [
5998	//     "parent"
5999	//   ],
6000	//   "parameters": {
6001	//     "pageSize": {
6002	//       "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.",
6003	//       "format": "int32",
6004	//       "location": "query",
6005	//       "type": "integer"
6006	//     },
6007	//     "pageToken": {
6008	//       "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.",
6009	//       "location": "query",
6010	//       "type": "string"
6011	//     },
6012	//     "parent": {
6013	//       "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ",
6014	//       "location": "path",
6015	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+$",
6016	//       "required": true,
6017	//       "type": "string"
6018	//     }
6019	//   },
6020	//   "path": "v2/{+parent}/views",
6021	//   "response": {
6022	//     "$ref": "ListViewsResponse"
6023	//   },
6024	//   "scopes": [
6025	//     "https://www.googleapis.com/auth/cloud-platform",
6026	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
6027	//     "https://www.googleapis.com/auth/logging.admin",
6028	//     "https://www.googleapis.com/auth/logging.read"
6029	//   ]
6030	// }
6031
6032}
6033
6034// Pages invokes f for each page of results.
6035// A non-nil error returned from f will halt the iteration.
6036// The provided context supersedes any context provided to the Context method.
6037func (c *BillingAccountsLocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error {
6038	c.ctx_ = ctx
6039	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
6040	for {
6041		x, err := c.Do()
6042		if err != nil {
6043			return err
6044		}
6045		if err := f(x); err != nil {
6046			return err
6047		}
6048		if x.NextPageToken == "" {
6049			return nil
6050		}
6051		c.PageToken(x.NextPageToken)
6052	}
6053}
6054
6055// method id "logging.billingAccounts.locations.buckets.views.patch":
6056
6057type BillingAccountsLocationsBucketsViewsPatchCall struct {
6058	s          *Service
6059	name       string
6060	logview    *LogView
6061	urlParams_ gensupport.URLParams
6062	ctx_       context.Context
6063	header_    http.Header
6064}
6065
6066// Patch: Updates a view. This method replaces the following fields in
6067// the existing view with values from the new view: filter.
6068//
6069// - name: The full resource name of the view to update
6070//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
6071//   iews/[VIEW_ID]" Example:
6072//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id/v
6073//   iews/my-view-id".
6074func (r *BillingAccountsLocationsBucketsViewsService) Patch(name string, logview *LogView) *BillingAccountsLocationsBucketsViewsPatchCall {
6075	c := &BillingAccountsLocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6076	c.name = name
6077	c.logview = logview
6078	return c
6079}
6080
6081// UpdateMask sets the optional parameter "updateMask": Field mask that
6082// specifies the fields in view that need an update. A field will be
6083// overwritten if, and only if, it is in the update mask. name and
6084// output only fields cannot be updated.For a detailed FieldMask
6085// definition, see
6086// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
6087// updateMask=filter.
6088func (c *BillingAccountsLocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *BillingAccountsLocationsBucketsViewsPatchCall {
6089	c.urlParams_.Set("updateMask", updateMask)
6090	return c
6091}
6092
6093// Fields allows partial responses to be retrieved. See
6094// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6095// for more information.
6096func (c *BillingAccountsLocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsPatchCall {
6097	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6098	return c
6099}
6100
6101// Context sets the context to be used in this call's Do method. Any
6102// pending HTTP request will be aborted if the provided context is
6103// canceled.
6104func (c *BillingAccountsLocationsBucketsViewsPatchCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsPatchCall {
6105	c.ctx_ = ctx
6106	return c
6107}
6108
6109// Header returns an http.Header that can be modified by the caller to
6110// add HTTP headers to the request.
6111func (c *BillingAccountsLocationsBucketsViewsPatchCall) Header() http.Header {
6112	if c.header_ == nil {
6113		c.header_ = make(http.Header)
6114	}
6115	return c.header_
6116}
6117
6118func (c *BillingAccountsLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) {
6119	reqHeaders := make(http.Header)
6120	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
6121	for k, v := range c.header_ {
6122		reqHeaders[k] = v
6123	}
6124	reqHeaders.Set("User-Agent", c.s.userAgent())
6125	var body io.Reader = nil
6126	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
6127	if err != nil {
6128		return nil, err
6129	}
6130	reqHeaders.Set("Content-Type", "application/json")
6131	c.urlParams_.Set("alt", alt)
6132	c.urlParams_.Set("prettyPrint", "false")
6133	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
6134	urls += "?" + c.urlParams_.Encode()
6135	req, err := http.NewRequest("PATCH", urls, body)
6136	if err != nil {
6137		return nil, err
6138	}
6139	req.Header = reqHeaders
6140	googleapi.Expand(req.URL, map[string]string{
6141		"name": c.name,
6142	})
6143	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6144}
6145
6146// Do executes the "logging.billingAccounts.locations.buckets.views.patch" call.
6147// Exactly one of *LogView or error will be non-nil. Any non-2xx status
6148// code is an error. Response headers are in either
6149// *LogView.ServerResponse.Header or (if a response was returned at all)
6150// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
6151// check whether the returned error was because http.StatusNotModified
6152// was returned.
6153func (c *BillingAccountsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
6154	gensupport.SetOptions(c.urlParams_, opts...)
6155	res, err := c.doRequest("json")
6156	if res != nil && res.StatusCode == http.StatusNotModified {
6157		if res.Body != nil {
6158			res.Body.Close()
6159		}
6160		return nil, &googleapi.Error{
6161			Code:   res.StatusCode,
6162			Header: res.Header,
6163		}
6164	}
6165	if err != nil {
6166		return nil, err
6167	}
6168	defer googleapi.CloseBody(res)
6169	if err := googleapi.CheckResponse(res); err != nil {
6170		return nil, err
6171	}
6172	ret := &LogView{
6173		ServerResponse: googleapi.ServerResponse{
6174			Header:         res.Header,
6175			HTTPStatusCode: res.StatusCode,
6176		},
6177	}
6178	target := &ret
6179	if err := gensupport.DecodeResponse(target, res); err != nil {
6180		return nil, err
6181	}
6182	return ret, nil
6183	// {
6184	//   "description": "Updates a view. This method replaces the following fields in the existing view with values from the new view: filter.",
6185	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
6186	//   "httpMethod": "PATCH",
6187	//   "id": "logging.billingAccounts.locations.buckets.views.patch",
6188	//   "parameterOrder": [
6189	//     "name"
6190	//   ],
6191	//   "parameters": {
6192	//     "name": {
6193	//       "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\".",
6194	//       "location": "path",
6195	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
6196	//       "required": true,
6197	//       "type": "string"
6198	//     },
6199	//     "updateMask": {
6200	//       "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.",
6201	//       "format": "google-fieldmask",
6202	//       "location": "query",
6203	//       "type": "string"
6204	//     }
6205	//   },
6206	//   "path": "v2/{+name}",
6207	//   "request": {
6208	//     "$ref": "LogView"
6209	//   },
6210	//   "response": {
6211	//     "$ref": "LogView"
6212	//   },
6213	//   "scopes": [
6214	//     "https://www.googleapis.com/auth/cloud-platform",
6215	//     "https://www.googleapis.com/auth/logging.admin"
6216	//   ]
6217	// }
6218
6219}
6220
6221// method id "logging.billingAccounts.logs.delete":
6222
6223type BillingAccountsLogsDeleteCall struct {
6224	s          *Service
6225	logName    string
6226	urlParams_ gensupport.URLParams
6227	ctx_       context.Context
6228	header_    http.Header
6229}
6230
6231// Delete: Deletes all the log entries in a log for the _Default Log
6232// Bucket. The log reappears if it receives new entries. Log entries
6233// written shortly before the delete operation might not be deleted.
6234// Entries received after the delete operation with a timestamp before
6235// the operation will be deleted.
6236//
6237// - logName: The resource name of the log to delete:
6238//   projects/[PROJECT_ID]/logs/[LOG_ID]
6239//   organizations/[ORGANIZATION_ID]/logs/[LOG_ID]
6240//   billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]
6241//   folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For
6242//   example, "projects/my-project-id/logs/syslog",
6243//   "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For
6244//   more information about log names, see LogEntry.
6245func (r *BillingAccountsLogsService) Delete(logName string) *BillingAccountsLogsDeleteCall {
6246	c := &BillingAccountsLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6247	c.logName = logName
6248	return c
6249}
6250
6251// Fields allows partial responses to be retrieved. See
6252// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6253// for more information.
6254func (c *BillingAccountsLogsDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsLogsDeleteCall {
6255	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6256	return c
6257}
6258
6259// Context sets the context to be used in this call's Do method. Any
6260// pending HTTP request will be aborted if the provided context is
6261// canceled.
6262func (c *BillingAccountsLogsDeleteCall) Context(ctx context.Context) *BillingAccountsLogsDeleteCall {
6263	c.ctx_ = ctx
6264	return c
6265}
6266
6267// Header returns an http.Header that can be modified by the caller to
6268// add HTTP headers to the request.
6269func (c *BillingAccountsLogsDeleteCall) Header() http.Header {
6270	if c.header_ == nil {
6271		c.header_ = make(http.Header)
6272	}
6273	return c.header_
6274}
6275
6276func (c *BillingAccountsLogsDeleteCall) doRequest(alt string) (*http.Response, error) {
6277	reqHeaders := make(http.Header)
6278	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
6279	for k, v := range c.header_ {
6280		reqHeaders[k] = v
6281	}
6282	reqHeaders.Set("User-Agent", c.s.userAgent())
6283	var body io.Reader = nil
6284	c.urlParams_.Set("alt", alt)
6285	c.urlParams_.Set("prettyPrint", "false")
6286	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}")
6287	urls += "?" + c.urlParams_.Encode()
6288	req, err := http.NewRequest("DELETE", urls, body)
6289	if err != nil {
6290		return nil, err
6291	}
6292	req.Header = reqHeaders
6293	googleapi.Expand(req.URL, map[string]string{
6294		"logName": c.logName,
6295	})
6296	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6297}
6298
6299// Do executes the "logging.billingAccounts.logs.delete" call.
6300// Exactly one of *Empty or error will be non-nil. Any non-2xx status
6301// code is an error. Response headers are in either
6302// *Empty.ServerResponse.Header or (if a response was returned at all)
6303// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
6304// check whether the returned error was because http.StatusNotModified
6305// was returned.
6306func (c *BillingAccountsLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
6307	gensupport.SetOptions(c.urlParams_, opts...)
6308	res, err := c.doRequest("json")
6309	if res != nil && res.StatusCode == http.StatusNotModified {
6310		if res.Body != nil {
6311			res.Body.Close()
6312		}
6313		return nil, &googleapi.Error{
6314			Code:   res.StatusCode,
6315			Header: res.Header,
6316		}
6317	}
6318	if err != nil {
6319		return nil, err
6320	}
6321	defer googleapi.CloseBody(res)
6322	if err := googleapi.CheckResponse(res); err != nil {
6323		return nil, err
6324	}
6325	ret := &Empty{
6326		ServerResponse: googleapi.ServerResponse{
6327			Header:         res.Header,
6328			HTTPStatusCode: res.StatusCode,
6329		},
6330	}
6331	target := &ret
6332	if err := gensupport.DecodeResponse(target, res); err != nil {
6333		return nil, err
6334	}
6335	return ret, nil
6336	// {
6337	//   "description": "Deletes all the log entries in a log for the _Default Log Bucket. 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.",
6338	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/logs/{logsId}",
6339	//   "httpMethod": "DELETE",
6340	//   "id": "logging.billingAccounts.logs.delete",
6341	//   "parameterOrder": [
6342	//     "logName"
6343	//   ],
6344	//   "parameters": {
6345	//     "logName": {
6346	//       "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/123/logs/cloudaudit.googleapis.com%2Factivity\".For more information about log names, see LogEntry.",
6347	//       "location": "path",
6348	//       "pattern": "^billingAccounts/[^/]+/logs/[^/]+$",
6349	//       "required": true,
6350	//       "type": "string"
6351	//     }
6352	//   },
6353	//   "path": "v2/{+logName}",
6354	//   "response": {
6355	//     "$ref": "Empty"
6356	//   },
6357	//   "scopes": [
6358	//     "https://www.googleapis.com/auth/cloud-platform",
6359	//     "https://www.googleapis.com/auth/logging.admin"
6360	//   ]
6361	// }
6362
6363}
6364
6365// method id "logging.billingAccounts.logs.list":
6366
6367type BillingAccountsLogsListCall struct {
6368	s            *Service
6369	parent       string
6370	urlParams_   gensupport.URLParams
6371	ifNoneMatch_ string
6372	ctx_         context.Context
6373	header_      http.Header
6374}
6375
6376// List: Lists the logs in projects, organizations, folders, or billing
6377// accounts. Only logs that have entries are listed.
6378//
6379// - parent: The resource name that owns the logs: projects/[PROJECT_ID]
6380//   organizations/[ORGANIZATION_ID]
6381//   billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID].
6382func (r *BillingAccountsLogsService) List(parent string) *BillingAccountsLogsListCall {
6383	c := &BillingAccountsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6384	c.parent = parent
6385	return c
6386}
6387
6388// PageSize sets the optional parameter "pageSize": The maximum number
6389// of results to return from this request. Non-positive values are
6390// ignored. The presence of nextPageToken in the response indicates that
6391// more results might be available.
6392func (c *BillingAccountsLogsListCall) PageSize(pageSize int64) *BillingAccountsLogsListCall {
6393	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
6394	return c
6395}
6396
6397// PageToken sets the optional parameter "pageToken": If present, then
6398// retrieve the next batch of results from the preceding call to this
6399// method. pageToken must be the value of nextPageToken from the
6400// previous response. The values of other method parameters should be
6401// identical to those in the previous call.
6402func (c *BillingAccountsLogsListCall) PageToken(pageToken string) *BillingAccountsLogsListCall {
6403	c.urlParams_.Set("pageToken", pageToken)
6404	return c
6405}
6406
6407// ResourceNames sets the optional parameter "resourceNames": The
6408// resource name that owns the logs:
6409// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view
6410// s/[VIEW_ID]
6411// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE
6412// T_ID]/views/[VIEW_ID]
6413// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[
6414// BUCKET_ID]/views/[VIEW_ID]
6415// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/
6416// [VIEW_ID]To support legacy queries, it could also be:
6417// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID]
6418// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]
6419func (c *BillingAccountsLogsListCall) ResourceNames(resourceNames ...string) *BillingAccountsLogsListCall {
6420	c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...))
6421	return c
6422}
6423
6424// Fields allows partial responses to be retrieved. See
6425// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6426// for more information.
6427func (c *BillingAccountsLogsListCall) Fields(s ...googleapi.Field) *BillingAccountsLogsListCall {
6428	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6429	return c
6430}
6431
6432// IfNoneMatch sets the optional parameter which makes the operation
6433// fail if the object's ETag matches the given value. This is useful for
6434// getting updates only after the object has changed since the last
6435// request. Use googleapi.IsNotModified to check whether the response
6436// error from Do is the result of In-None-Match.
6437func (c *BillingAccountsLogsListCall) IfNoneMatch(entityTag string) *BillingAccountsLogsListCall {
6438	c.ifNoneMatch_ = entityTag
6439	return c
6440}
6441
6442// Context sets the context to be used in this call's Do method. Any
6443// pending HTTP request will be aborted if the provided context is
6444// canceled.
6445func (c *BillingAccountsLogsListCall) Context(ctx context.Context) *BillingAccountsLogsListCall {
6446	c.ctx_ = ctx
6447	return c
6448}
6449
6450// Header returns an http.Header that can be modified by the caller to
6451// add HTTP headers to the request.
6452func (c *BillingAccountsLogsListCall) Header() http.Header {
6453	if c.header_ == nil {
6454		c.header_ = make(http.Header)
6455	}
6456	return c.header_
6457}
6458
6459func (c *BillingAccountsLogsListCall) doRequest(alt string) (*http.Response, error) {
6460	reqHeaders := make(http.Header)
6461	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
6462	for k, v := range c.header_ {
6463		reqHeaders[k] = v
6464	}
6465	reqHeaders.Set("User-Agent", c.s.userAgent())
6466	if c.ifNoneMatch_ != "" {
6467		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6468	}
6469	var body io.Reader = nil
6470	c.urlParams_.Set("alt", alt)
6471	c.urlParams_.Set("prettyPrint", "false")
6472	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs")
6473	urls += "?" + c.urlParams_.Encode()
6474	req, err := http.NewRequest("GET", urls, body)
6475	if err != nil {
6476		return nil, err
6477	}
6478	req.Header = reqHeaders
6479	googleapi.Expand(req.URL, map[string]string{
6480		"parent": c.parent,
6481	})
6482	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6483}
6484
6485// Do executes the "logging.billingAccounts.logs.list" call.
6486// Exactly one of *ListLogsResponse or error will be non-nil. Any
6487// non-2xx status code is an error. Response headers are in either
6488// *ListLogsResponse.ServerResponse.Header or (if a response was
6489// returned at all) in error.(*googleapi.Error).Header. Use
6490// googleapi.IsNotModified to check whether the returned error was
6491// because http.StatusNotModified was returned.
6492func (c *BillingAccountsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) {
6493	gensupport.SetOptions(c.urlParams_, opts...)
6494	res, err := c.doRequest("json")
6495	if res != nil && res.StatusCode == http.StatusNotModified {
6496		if res.Body != nil {
6497			res.Body.Close()
6498		}
6499		return nil, &googleapi.Error{
6500			Code:   res.StatusCode,
6501			Header: res.Header,
6502		}
6503	}
6504	if err != nil {
6505		return nil, err
6506	}
6507	defer googleapi.CloseBody(res)
6508	if err := googleapi.CheckResponse(res); err != nil {
6509		return nil, err
6510	}
6511	ret := &ListLogsResponse{
6512		ServerResponse: googleapi.ServerResponse{
6513			Header:         res.Header,
6514			HTTPStatusCode: res.StatusCode,
6515		},
6516	}
6517	target := &ret
6518	if err := gensupport.DecodeResponse(target, res); err != nil {
6519		return nil, err
6520	}
6521	return ret, nil
6522	// {
6523	//   "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.",
6524	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/logs",
6525	//   "httpMethod": "GET",
6526	//   "id": "logging.billingAccounts.logs.list",
6527	//   "parameterOrder": [
6528	//     "parent"
6529	//   ],
6530	//   "parameters": {
6531	//     "pageSize": {
6532	//       "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.",
6533	//       "format": "int32",
6534	//       "location": "query",
6535	//       "type": "integer"
6536	//     },
6537	//     "pageToken": {
6538	//       "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.",
6539	//       "location": "query",
6540	//       "type": "string"
6541	//     },
6542	//     "parent": {
6543	//       "description": "Required. The resource name that owns the logs: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]",
6544	//       "location": "path",
6545	//       "pattern": "^billingAccounts/[^/]+$",
6546	//       "required": true,
6547	//       "type": "string"
6548	//     },
6549	//     "resourceNames": {
6550	//       "description": "Optional. The resource name that owns the logs: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[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_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]",
6551	//       "location": "query",
6552	//       "repeated": true,
6553	//       "type": "string"
6554	//     }
6555	//   },
6556	//   "path": "v2/{+parent}/logs",
6557	//   "response": {
6558	//     "$ref": "ListLogsResponse"
6559	//   },
6560	//   "scopes": [
6561	//     "https://www.googleapis.com/auth/cloud-platform",
6562	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
6563	//     "https://www.googleapis.com/auth/logging.admin",
6564	//     "https://www.googleapis.com/auth/logging.read"
6565	//   ]
6566	// }
6567
6568}
6569
6570// Pages invokes f for each page of results.
6571// A non-nil error returned from f will halt the iteration.
6572// The provided context supersedes any context provided to the Context method.
6573func (c *BillingAccountsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error {
6574	c.ctx_ = ctx
6575	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
6576	for {
6577		x, err := c.Do()
6578		if err != nil {
6579			return err
6580		}
6581		if err := f(x); err != nil {
6582			return err
6583		}
6584		if x.NextPageToken == "" {
6585			return nil
6586		}
6587		c.PageToken(x.NextPageToken)
6588	}
6589}
6590
6591// method id "logging.billingAccounts.sinks.create":
6592
6593type BillingAccountsSinksCreateCall struct {
6594	s          *Service
6595	parent     string
6596	logsink    *LogSink
6597	urlParams_ gensupport.URLParams
6598	ctx_       context.Context
6599	header_    http.Header
6600}
6601
6602// Create: Creates a sink that exports specified log entries to a
6603// destination. The export of newly-ingested log entries begins
6604// immediately, unless the sink's writer_identity is not permitted to
6605// write to the destination. A sink can export log entries only from the
6606// resource owning the sink.
6607//
6608// - parent: The resource in which to create the sink:
6609//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
6610//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
6611//   Examples: "projects/my-logging-project", "organizations/123456789".
6612func (r *BillingAccountsSinksService) Create(parent string, logsink *LogSink) *BillingAccountsSinksCreateCall {
6613	c := &BillingAccountsSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6614	c.parent = parent
6615	c.logsink = logsink
6616	return c
6617}
6618
6619// UniqueWriterIdentity sets the optional parameter
6620// "uniqueWriterIdentity": Determines the kind of IAM identity returned
6621// as writer_identity in the new sink. If this value is omitted or set
6622// to false, and if the sink's parent is a project, then the value
6623// returned as writer_identity is the same group or service account used
6624// by Logging before the addition of writer identities to this API. The
6625// sink's destination must be in the same project as the sink itself.If
6626// this field is set to true, or if the sink is owned by a non-project
6627// resource such as an organization, then the value of writer_identity
6628// will be a unique service account used only for exports from the new
6629// sink. For more information, see writer_identity in LogSink.
6630func (c *BillingAccountsSinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *BillingAccountsSinksCreateCall {
6631	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
6632	return c
6633}
6634
6635// Fields allows partial responses to be retrieved. See
6636// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6637// for more information.
6638func (c *BillingAccountsSinksCreateCall) Fields(s ...googleapi.Field) *BillingAccountsSinksCreateCall {
6639	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6640	return c
6641}
6642
6643// Context sets the context to be used in this call's Do method. Any
6644// pending HTTP request will be aborted if the provided context is
6645// canceled.
6646func (c *BillingAccountsSinksCreateCall) Context(ctx context.Context) *BillingAccountsSinksCreateCall {
6647	c.ctx_ = ctx
6648	return c
6649}
6650
6651// Header returns an http.Header that can be modified by the caller to
6652// add HTTP headers to the request.
6653func (c *BillingAccountsSinksCreateCall) Header() http.Header {
6654	if c.header_ == nil {
6655		c.header_ = make(http.Header)
6656	}
6657	return c.header_
6658}
6659
6660func (c *BillingAccountsSinksCreateCall) doRequest(alt string) (*http.Response, error) {
6661	reqHeaders := make(http.Header)
6662	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
6663	for k, v := range c.header_ {
6664		reqHeaders[k] = v
6665	}
6666	reqHeaders.Set("User-Agent", c.s.userAgent())
6667	var body io.Reader = nil
6668	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
6669	if err != nil {
6670		return nil, err
6671	}
6672	reqHeaders.Set("Content-Type", "application/json")
6673	c.urlParams_.Set("alt", alt)
6674	c.urlParams_.Set("prettyPrint", "false")
6675	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
6676	urls += "?" + c.urlParams_.Encode()
6677	req, err := http.NewRequest("POST", urls, body)
6678	if err != nil {
6679		return nil, err
6680	}
6681	req.Header = reqHeaders
6682	googleapi.Expand(req.URL, map[string]string{
6683		"parent": c.parent,
6684	})
6685	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6686}
6687
6688// Do executes the "logging.billingAccounts.sinks.create" call.
6689// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
6690// code is an error. Response headers are in either
6691// *LogSink.ServerResponse.Header or (if a response was returned at all)
6692// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
6693// check whether the returned error was because http.StatusNotModified
6694// was returned.
6695func (c *BillingAccountsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
6696	gensupport.SetOptions(c.urlParams_, opts...)
6697	res, err := c.doRequest("json")
6698	if res != nil && res.StatusCode == http.StatusNotModified {
6699		if res.Body != nil {
6700			res.Body.Close()
6701		}
6702		return nil, &googleapi.Error{
6703			Code:   res.StatusCode,
6704			Header: res.Header,
6705		}
6706	}
6707	if err != nil {
6708		return nil, err
6709	}
6710	defer googleapi.CloseBody(res)
6711	if err := googleapi.CheckResponse(res); err != nil {
6712		return nil, err
6713	}
6714	ret := &LogSink{
6715		ServerResponse: googleapi.ServerResponse{
6716			Header:         res.Header,
6717			HTTPStatusCode: res.StatusCode,
6718		},
6719	}
6720	target := &ret
6721	if err := gensupport.DecodeResponse(target, res); err != nil {
6722		return nil, err
6723	}
6724	return ret, nil
6725	// {
6726	//   "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.",
6727	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks",
6728	//   "httpMethod": "POST",
6729	//   "id": "logging.billingAccounts.sinks.create",
6730	//   "parameterOrder": [
6731	//     "parent"
6732	//   ],
6733	//   "parameters": {
6734	//     "parent": {
6735	//       "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\".",
6736	//       "location": "path",
6737	//       "pattern": "^billingAccounts/[^/]+$",
6738	//       "required": true,
6739	//       "type": "string"
6740	//     },
6741	//     "uniqueWriterIdentity": {
6742	//       "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.",
6743	//       "location": "query",
6744	//       "type": "boolean"
6745	//     }
6746	//   },
6747	//   "path": "v2/{+parent}/sinks",
6748	//   "request": {
6749	//     "$ref": "LogSink"
6750	//   },
6751	//   "response": {
6752	//     "$ref": "LogSink"
6753	//   },
6754	//   "scopes": [
6755	//     "https://www.googleapis.com/auth/cloud-platform",
6756	//     "https://www.googleapis.com/auth/logging.admin"
6757	//   ]
6758	// }
6759
6760}
6761
6762// method id "logging.billingAccounts.sinks.delete":
6763
6764type BillingAccountsSinksDeleteCall struct {
6765	s          *Service
6766	sinkNameid string
6767	urlParams_ gensupport.URLParams
6768	ctx_       context.Context
6769	header_    http.Header
6770}
6771
6772// Delete: Deletes a sink. If the sink has a unique writer_identity,
6773// then that service account is also deleted.
6774//
6775// - sinkName: The full resource name of the sink to delete, including
6776//   the parent resource and the sink identifier:
6777//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
6778//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
6779//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
6780//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example:
6781//   "projects/my-project-id/sinks/my-sink-id".
6782func (r *BillingAccountsSinksService) Delete(sinkNameid string) *BillingAccountsSinksDeleteCall {
6783	c := &BillingAccountsSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6784	c.sinkNameid = sinkNameid
6785	return c
6786}
6787
6788// Fields allows partial responses to be retrieved. See
6789// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6790// for more information.
6791func (c *BillingAccountsSinksDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsSinksDeleteCall {
6792	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6793	return c
6794}
6795
6796// Context sets the context to be used in this call's Do method. Any
6797// pending HTTP request will be aborted if the provided context is
6798// canceled.
6799func (c *BillingAccountsSinksDeleteCall) Context(ctx context.Context) *BillingAccountsSinksDeleteCall {
6800	c.ctx_ = ctx
6801	return c
6802}
6803
6804// Header returns an http.Header that can be modified by the caller to
6805// add HTTP headers to the request.
6806func (c *BillingAccountsSinksDeleteCall) Header() http.Header {
6807	if c.header_ == nil {
6808		c.header_ = make(http.Header)
6809	}
6810	return c.header_
6811}
6812
6813func (c *BillingAccountsSinksDeleteCall) doRequest(alt string) (*http.Response, error) {
6814	reqHeaders := make(http.Header)
6815	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
6816	for k, v := range c.header_ {
6817		reqHeaders[k] = v
6818	}
6819	reqHeaders.Set("User-Agent", c.s.userAgent())
6820	var body io.Reader = nil
6821	c.urlParams_.Set("alt", alt)
6822	c.urlParams_.Set("prettyPrint", "false")
6823	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
6824	urls += "?" + c.urlParams_.Encode()
6825	req, err := http.NewRequest("DELETE", urls, body)
6826	if err != nil {
6827		return nil, err
6828	}
6829	req.Header = reqHeaders
6830	googleapi.Expand(req.URL, map[string]string{
6831		"sinkName": c.sinkNameid,
6832	})
6833	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6834}
6835
6836// Do executes the "logging.billingAccounts.sinks.delete" call.
6837// Exactly one of *Empty or error will be non-nil. Any non-2xx status
6838// code is an error. Response headers are in either
6839// *Empty.ServerResponse.Header or (if a response was returned at all)
6840// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
6841// check whether the returned error was because http.StatusNotModified
6842// was returned.
6843func (c *BillingAccountsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
6844	gensupport.SetOptions(c.urlParams_, opts...)
6845	res, err := c.doRequest("json")
6846	if res != nil && res.StatusCode == http.StatusNotModified {
6847		if res.Body != nil {
6848			res.Body.Close()
6849		}
6850		return nil, &googleapi.Error{
6851			Code:   res.StatusCode,
6852			Header: res.Header,
6853		}
6854	}
6855	if err != nil {
6856		return nil, err
6857	}
6858	defer googleapi.CloseBody(res)
6859	if err := googleapi.CheckResponse(res); err != nil {
6860		return nil, err
6861	}
6862	ret := &Empty{
6863		ServerResponse: googleapi.ServerResponse{
6864			Header:         res.Header,
6865			HTTPStatusCode: res.StatusCode,
6866		},
6867	}
6868	target := &ret
6869	if err := gensupport.DecodeResponse(target, res); err != nil {
6870		return nil, err
6871	}
6872	return ret, nil
6873	// {
6874	//   "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.",
6875	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}",
6876	//   "httpMethod": "DELETE",
6877	//   "id": "logging.billingAccounts.sinks.delete",
6878	//   "parameterOrder": [
6879	//     "sinkName"
6880	//   ],
6881	//   "parameters": {
6882	//     "sinkName": {
6883	//       "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\".",
6884	//       "location": "path",
6885	//       "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$",
6886	//       "required": true,
6887	//       "type": "string"
6888	//     }
6889	//   },
6890	//   "path": "v2/{+sinkName}",
6891	//   "response": {
6892	//     "$ref": "Empty"
6893	//   },
6894	//   "scopes": [
6895	//     "https://www.googleapis.com/auth/cloud-platform",
6896	//     "https://www.googleapis.com/auth/logging.admin"
6897	//   ]
6898	// }
6899
6900}
6901
6902// method id "logging.billingAccounts.sinks.get":
6903
6904type BillingAccountsSinksGetCall struct {
6905	s            *Service
6906	sinkName     string
6907	urlParams_   gensupport.URLParams
6908	ifNoneMatch_ string
6909	ctx_         context.Context
6910	header_      http.Header
6911}
6912
6913// Get: Gets a sink.
6914//
6915// - sinkName: The resource name of the sink:
6916//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
6917//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
6918//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
6919//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example:
6920//   "projects/my-project-id/sinks/my-sink-id".
6921func (r *BillingAccountsSinksService) Get(sinkName string) *BillingAccountsSinksGetCall {
6922	c := &BillingAccountsSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6923	c.sinkName = sinkName
6924	return c
6925}
6926
6927// Fields allows partial responses to be retrieved. See
6928// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6929// for more information.
6930func (c *BillingAccountsSinksGetCall) Fields(s ...googleapi.Field) *BillingAccountsSinksGetCall {
6931	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6932	return c
6933}
6934
6935// IfNoneMatch sets the optional parameter which makes the operation
6936// fail if the object's ETag matches the given value. This is useful for
6937// getting updates only after the object has changed since the last
6938// request. Use googleapi.IsNotModified to check whether the response
6939// error from Do is the result of In-None-Match.
6940func (c *BillingAccountsSinksGetCall) IfNoneMatch(entityTag string) *BillingAccountsSinksGetCall {
6941	c.ifNoneMatch_ = entityTag
6942	return c
6943}
6944
6945// Context sets the context to be used in this call's Do method. Any
6946// pending HTTP request will be aborted if the provided context is
6947// canceled.
6948func (c *BillingAccountsSinksGetCall) Context(ctx context.Context) *BillingAccountsSinksGetCall {
6949	c.ctx_ = ctx
6950	return c
6951}
6952
6953// Header returns an http.Header that can be modified by the caller to
6954// add HTTP headers to the request.
6955func (c *BillingAccountsSinksGetCall) Header() http.Header {
6956	if c.header_ == nil {
6957		c.header_ = make(http.Header)
6958	}
6959	return c.header_
6960}
6961
6962func (c *BillingAccountsSinksGetCall) doRequest(alt string) (*http.Response, error) {
6963	reqHeaders := make(http.Header)
6964	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
6965	for k, v := range c.header_ {
6966		reqHeaders[k] = v
6967	}
6968	reqHeaders.Set("User-Agent", c.s.userAgent())
6969	if c.ifNoneMatch_ != "" {
6970		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6971	}
6972	var body io.Reader = nil
6973	c.urlParams_.Set("alt", alt)
6974	c.urlParams_.Set("prettyPrint", "false")
6975	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
6976	urls += "?" + c.urlParams_.Encode()
6977	req, err := http.NewRequest("GET", urls, body)
6978	if err != nil {
6979		return nil, err
6980	}
6981	req.Header = reqHeaders
6982	googleapi.Expand(req.URL, map[string]string{
6983		"sinkName": c.sinkName,
6984	})
6985	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6986}
6987
6988// Do executes the "logging.billingAccounts.sinks.get" call.
6989// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
6990// code is an error. Response headers are in either
6991// *LogSink.ServerResponse.Header or (if a response was returned at all)
6992// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
6993// check whether the returned error was because http.StatusNotModified
6994// was returned.
6995func (c *BillingAccountsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
6996	gensupport.SetOptions(c.urlParams_, opts...)
6997	res, err := c.doRequest("json")
6998	if res != nil && res.StatusCode == http.StatusNotModified {
6999		if res.Body != nil {
7000			res.Body.Close()
7001		}
7002		return nil, &googleapi.Error{
7003			Code:   res.StatusCode,
7004			Header: res.Header,
7005		}
7006	}
7007	if err != nil {
7008		return nil, err
7009	}
7010	defer googleapi.CloseBody(res)
7011	if err := googleapi.CheckResponse(res); err != nil {
7012		return nil, err
7013	}
7014	ret := &LogSink{
7015		ServerResponse: googleapi.ServerResponse{
7016			Header:         res.Header,
7017			HTTPStatusCode: res.StatusCode,
7018		},
7019	}
7020	target := &ret
7021	if err := gensupport.DecodeResponse(target, res); err != nil {
7022		return nil, err
7023	}
7024	return ret, nil
7025	// {
7026	//   "description": "Gets a sink.",
7027	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}",
7028	//   "httpMethod": "GET",
7029	//   "id": "logging.billingAccounts.sinks.get",
7030	//   "parameterOrder": [
7031	//     "sinkName"
7032	//   ],
7033	//   "parameters": {
7034	//     "sinkName": {
7035	//       "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\".",
7036	//       "location": "path",
7037	//       "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$",
7038	//       "required": true,
7039	//       "type": "string"
7040	//     }
7041	//   },
7042	//   "path": "v2/{+sinkName}",
7043	//   "response": {
7044	//     "$ref": "LogSink"
7045	//   },
7046	//   "scopes": [
7047	//     "https://www.googleapis.com/auth/cloud-platform",
7048	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
7049	//     "https://www.googleapis.com/auth/logging.admin",
7050	//     "https://www.googleapis.com/auth/logging.read"
7051	//   ]
7052	// }
7053
7054}
7055
7056// method id "logging.billingAccounts.sinks.list":
7057
7058type BillingAccountsSinksListCall struct {
7059	s            *Service
7060	parent       string
7061	urlParams_   gensupport.URLParams
7062	ifNoneMatch_ string
7063	ctx_         context.Context
7064	header_      http.Header
7065}
7066
7067// List: Lists sinks.
7068//
7069// - parent: The parent resource whose sinks are to be listed:
7070//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
7071//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]".
7072func (r *BillingAccountsSinksService) List(parent string) *BillingAccountsSinksListCall {
7073	c := &BillingAccountsSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7074	c.parent = parent
7075	return c
7076}
7077
7078// PageSize sets the optional parameter "pageSize": The maximum number
7079// of results to return from this request. Non-positive values are
7080// ignored. The presence of nextPageToken in the response indicates that
7081// more results might be available.
7082func (c *BillingAccountsSinksListCall) PageSize(pageSize int64) *BillingAccountsSinksListCall {
7083	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
7084	return c
7085}
7086
7087// PageToken sets the optional parameter "pageToken": If present, then
7088// retrieve the next batch of results from the preceding call to this
7089// method. pageToken must be the value of nextPageToken from the
7090// previous response. The values of other method parameters should be
7091// identical to those in the previous call.
7092func (c *BillingAccountsSinksListCall) PageToken(pageToken string) *BillingAccountsSinksListCall {
7093	c.urlParams_.Set("pageToken", pageToken)
7094	return c
7095}
7096
7097// Fields allows partial responses to be retrieved. See
7098// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7099// for more information.
7100func (c *BillingAccountsSinksListCall) Fields(s ...googleapi.Field) *BillingAccountsSinksListCall {
7101	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7102	return c
7103}
7104
7105// IfNoneMatch sets the optional parameter which makes the operation
7106// fail if the object's ETag matches the given value. This is useful for
7107// getting updates only after the object has changed since the last
7108// request. Use googleapi.IsNotModified to check whether the response
7109// error from Do is the result of In-None-Match.
7110func (c *BillingAccountsSinksListCall) IfNoneMatch(entityTag string) *BillingAccountsSinksListCall {
7111	c.ifNoneMatch_ = entityTag
7112	return c
7113}
7114
7115// Context sets the context to be used in this call's Do method. Any
7116// pending HTTP request will be aborted if the provided context is
7117// canceled.
7118func (c *BillingAccountsSinksListCall) Context(ctx context.Context) *BillingAccountsSinksListCall {
7119	c.ctx_ = ctx
7120	return c
7121}
7122
7123// Header returns an http.Header that can be modified by the caller to
7124// add HTTP headers to the request.
7125func (c *BillingAccountsSinksListCall) Header() http.Header {
7126	if c.header_ == nil {
7127		c.header_ = make(http.Header)
7128	}
7129	return c.header_
7130}
7131
7132func (c *BillingAccountsSinksListCall) doRequest(alt string) (*http.Response, error) {
7133	reqHeaders := make(http.Header)
7134	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
7135	for k, v := range c.header_ {
7136		reqHeaders[k] = v
7137	}
7138	reqHeaders.Set("User-Agent", c.s.userAgent())
7139	if c.ifNoneMatch_ != "" {
7140		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7141	}
7142	var body io.Reader = nil
7143	c.urlParams_.Set("alt", alt)
7144	c.urlParams_.Set("prettyPrint", "false")
7145	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
7146	urls += "?" + c.urlParams_.Encode()
7147	req, err := http.NewRequest("GET", urls, body)
7148	if err != nil {
7149		return nil, err
7150	}
7151	req.Header = reqHeaders
7152	googleapi.Expand(req.URL, map[string]string{
7153		"parent": c.parent,
7154	})
7155	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7156}
7157
7158// Do executes the "logging.billingAccounts.sinks.list" call.
7159// Exactly one of *ListSinksResponse or error will be non-nil. Any
7160// non-2xx status code is an error. Response headers are in either
7161// *ListSinksResponse.ServerResponse.Header or (if a response was
7162// returned at all) in error.(*googleapi.Error).Header. Use
7163// googleapi.IsNotModified to check whether the returned error was
7164// because http.StatusNotModified was returned.
7165func (c *BillingAccountsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) {
7166	gensupport.SetOptions(c.urlParams_, opts...)
7167	res, err := c.doRequest("json")
7168	if res != nil && res.StatusCode == http.StatusNotModified {
7169		if res.Body != nil {
7170			res.Body.Close()
7171		}
7172		return nil, &googleapi.Error{
7173			Code:   res.StatusCode,
7174			Header: res.Header,
7175		}
7176	}
7177	if err != nil {
7178		return nil, err
7179	}
7180	defer googleapi.CloseBody(res)
7181	if err := googleapi.CheckResponse(res); err != nil {
7182		return nil, err
7183	}
7184	ret := &ListSinksResponse{
7185		ServerResponse: googleapi.ServerResponse{
7186			Header:         res.Header,
7187			HTTPStatusCode: res.StatusCode,
7188		},
7189	}
7190	target := &ret
7191	if err := gensupport.DecodeResponse(target, res); err != nil {
7192		return nil, err
7193	}
7194	return ret, nil
7195	// {
7196	//   "description": "Lists sinks.",
7197	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks",
7198	//   "httpMethod": "GET",
7199	//   "id": "logging.billingAccounts.sinks.list",
7200	//   "parameterOrder": [
7201	//     "parent"
7202	//   ],
7203	//   "parameters": {
7204	//     "pageSize": {
7205	//       "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.",
7206	//       "format": "int32",
7207	//       "location": "query",
7208	//       "type": "integer"
7209	//     },
7210	//     "pageToken": {
7211	//       "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.",
7212	//       "location": "query",
7213	//       "type": "string"
7214	//     },
7215	//     "parent": {
7216	//       "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
7217	//       "location": "path",
7218	//       "pattern": "^billingAccounts/[^/]+$",
7219	//       "required": true,
7220	//       "type": "string"
7221	//     }
7222	//   },
7223	//   "path": "v2/{+parent}/sinks",
7224	//   "response": {
7225	//     "$ref": "ListSinksResponse"
7226	//   },
7227	//   "scopes": [
7228	//     "https://www.googleapis.com/auth/cloud-platform",
7229	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
7230	//     "https://www.googleapis.com/auth/logging.admin",
7231	//     "https://www.googleapis.com/auth/logging.read"
7232	//   ]
7233	// }
7234
7235}
7236
7237// Pages invokes f for each page of results.
7238// A non-nil error returned from f will halt the iteration.
7239// The provided context supersedes any context provided to the Context method.
7240func (c *BillingAccountsSinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error {
7241	c.ctx_ = ctx
7242	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
7243	for {
7244		x, err := c.Do()
7245		if err != nil {
7246			return err
7247		}
7248		if err := f(x); err != nil {
7249			return err
7250		}
7251		if x.NextPageToken == "" {
7252			return nil
7253		}
7254		c.PageToken(x.NextPageToken)
7255	}
7256}
7257
7258// method id "logging.billingAccounts.sinks.patch":
7259
7260type BillingAccountsSinksPatchCall struct {
7261	s          *Service
7262	sinkNameid string
7263	logsink    *LogSink
7264	urlParams_ gensupport.URLParams
7265	ctx_       context.Context
7266	header_    http.Header
7267}
7268
7269// Patch: Updates a sink. This method replaces the following fields in
7270// the existing sink with values from the new sink: destination, and
7271// filter.The updated sink might also have a new writer_identity; see
7272// the unique_writer_identity field.
7273//
7274// - sinkName: The full resource name of the sink to update, including
7275//   the parent resource and the sink identifier:
7276//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
7277//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
7278//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
7279//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example:
7280//   "projects/my-project-id/sinks/my-sink-id".
7281func (r *BillingAccountsSinksService) Patch(sinkNameid string, logsink *LogSink) *BillingAccountsSinksPatchCall {
7282	c := &BillingAccountsSinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7283	c.sinkNameid = sinkNameid
7284	c.logsink = logsink
7285	return c
7286}
7287
7288// UniqueWriterIdentity sets the optional parameter
7289// "uniqueWriterIdentity": See sinks.create for a description of this
7290// field. When updating a sink, the effect of this field on the value of
7291// writer_identity in the updated sink depends on both the old and new
7292// values of this field: If the old and new values of this field are
7293// both false or both true, then there is no change to the sink's
7294// writer_identity. If the old value is false and the new value is true,
7295// then writer_identity is changed to a unique service account. It is an
7296// error if the old value is true and the new value is set to false or
7297// defaulted to false.
7298func (c *BillingAccountsSinksPatchCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *BillingAccountsSinksPatchCall {
7299	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
7300	return c
7301}
7302
7303// UpdateMask sets the optional parameter "updateMask": Field mask that
7304// specifies the fields in sink that need an update. A sink field will
7305// be overwritten if, and only if, it is in the update mask. name and
7306// output only fields cannot be updated.An empty updateMask is
7307// temporarily treated as using the following mask for backwards
7308// compatibility purposes: destination,filter,includeChildren At some
7309// point in the future, behavior will be removed and specifying an empty
7310// updateMask will be an error.For a detailed FieldMask definition, see
7311// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
7312// updateMask=filter.
7313func (c *BillingAccountsSinksPatchCall) UpdateMask(updateMask string) *BillingAccountsSinksPatchCall {
7314	c.urlParams_.Set("updateMask", updateMask)
7315	return c
7316}
7317
7318// Fields allows partial responses to be retrieved. See
7319// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7320// for more information.
7321func (c *BillingAccountsSinksPatchCall) Fields(s ...googleapi.Field) *BillingAccountsSinksPatchCall {
7322	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7323	return c
7324}
7325
7326// Context sets the context to be used in this call's Do method. Any
7327// pending HTTP request will be aborted if the provided context is
7328// canceled.
7329func (c *BillingAccountsSinksPatchCall) Context(ctx context.Context) *BillingAccountsSinksPatchCall {
7330	c.ctx_ = ctx
7331	return c
7332}
7333
7334// Header returns an http.Header that can be modified by the caller to
7335// add HTTP headers to the request.
7336func (c *BillingAccountsSinksPatchCall) Header() http.Header {
7337	if c.header_ == nil {
7338		c.header_ = make(http.Header)
7339	}
7340	return c.header_
7341}
7342
7343func (c *BillingAccountsSinksPatchCall) doRequest(alt string) (*http.Response, error) {
7344	reqHeaders := make(http.Header)
7345	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
7346	for k, v := range c.header_ {
7347		reqHeaders[k] = v
7348	}
7349	reqHeaders.Set("User-Agent", c.s.userAgent())
7350	var body io.Reader = nil
7351	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
7352	if err != nil {
7353		return nil, err
7354	}
7355	reqHeaders.Set("Content-Type", "application/json")
7356	c.urlParams_.Set("alt", alt)
7357	c.urlParams_.Set("prettyPrint", "false")
7358	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
7359	urls += "?" + c.urlParams_.Encode()
7360	req, err := http.NewRequest("PATCH", urls, body)
7361	if err != nil {
7362		return nil, err
7363	}
7364	req.Header = reqHeaders
7365	googleapi.Expand(req.URL, map[string]string{
7366		"sinkName": c.sinkNameid,
7367	})
7368	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7369}
7370
7371// Do executes the "logging.billingAccounts.sinks.patch" call.
7372// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
7373// code is an error. Response headers are in either
7374// *LogSink.ServerResponse.Header or (if a response was returned at all)
7375// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
7376// check whether the returned error was because http.StatusNotModified
7377// was returned.
7378func (c *BillingAccountsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
7379	gensupport.SetOptions(c.urlParams_, opts...)
7380	res, err := c.doRequest("json")
7381	if res != nil && res.StatusCode == http.StatusNotModified {
7382		if res.Body != nil {
7383			res.Body.Close()
7384		}
7385		return nil, &googleapi.Error{
7386			Code:   res.StatusCode,
7387			Header: res.Header,
7388		}
7389	}
7390	if err != nil {
7391		return nil, err
7392	}
7393	defer googleapi.CloseBody(res)
7394	if err := googleapi.CheckResponse(res); err != nil {
7395		return nil, err
7396	}
7397	ret := &LogSink{
7398		ServerResponse: googleapi.ServerResponse{
7399			Header:         res.Header,
7400			HTTPStatusCode: res.StatusCode,
7401		},
7402	}
7403	target := &ret
7404	if err := gensupport.DecodeResponse(target, res); err != nil {
7405		return nil, err
7406	}
7407	return ret, nil
7408	// {
7409	//   "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.",
7410	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}",
7411	//   "httpMethod": "PATCH",
7412	//   "id": "logging.billingAccounts.sinks.patch",
7413	//   "parameterOrder": [
7414	//     "sinkName"
7415	//   ],
7416	//   "parameters": {
7417	//     "sinkName": {
7418	//       "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\".",
7419	//       "location": "path",
7420	//       "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$",
7421	//       "required": true,
7422	//       "type": "string"
7423	//     },
7424	//     "uniqueWriterIdentity": {
7425	//       "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.",
7426	//       "location": "query",
7427	//       "type": "boolean"
7428	//     },
7429	//     "updateMask": {
7430	//       "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.",
7431	//       "format": "google-fieldmask",
7432	//       "location": "query",
7433	//       "type": "string"
7434	//     }
7435	//   },
7436	//   "path": "v2/{+sinkName}",
7437	//   "request": {
7438	//     "$ref": "LogSink"
7439	//   },
7440	//   "response": {
7441	//     "$ref": "LogSink"
7442	//   },
7443	//   "scopes": [
7444	//     "https://www.googleapis.com/auth/cloud-platform",
7445	//     "https://www.googleapis.com/auth/logging.admin"
7446	//   ]
7447	// }
7448
7449}
7450
7451// method id "logging.billingAccounts.sinks.update":
7452
7453type BillingAccountsSinksUpdateCall struct {
7454	s          *Service
7455	sinkNameid string
7456	logsink    *LogSink
7457	urlParams_ gensupport.URLParams
7458	ctx_       context.Context
7459	header_    http.Header
7460}
7461
7462// Update: Updates a sink. This method replaces the following fields in
7463// the existing sink with values from the new sink: destination, and
7464// filter.The updated sink might also have a new writer_identity; see
7465// the unique_writer_identity field.
7466//
7467// - sinkName: The full resource name of the sink to update, including
7468//   the parent resource and the sink identifier:
7469//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
7470//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
7471//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
7472//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example:
7473//   "projects/my-project-id/sinks/my-sink-id".
7474func (r *BillingAccountsSinksService) Update(sinkNameid string, logsink *LogSink) *BillingAccountsSinksUpdateCall {
7475	c := &BillingAccountsSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7476	c.sinkNameid = sinkNameid
7477	c.logsink = logsink
7478	return c
7479}
7480
7481// UniqueWriterIdentity sets the optional parameter
7482// "uniqueWriterIdentity": See sinks.create for a description of this
7483// field. When updating a sink, the effect of this field on the value of
7484// writer_identity in the updated sink depends on both the old and new
7485// values of this field: If the old and new values of this field are
7486// both false or both true, then there is no change to the sink's
7487// writer_identity. If the old value is false and the new value is true,
7488// then writer_identity is changed to a unique service account. It is an
7489// error if the old value is true and the new value is set to false or
7490// defaulted to false.
7491func (c *BillingAccountsSinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *BillingAccountsSinksUpdateCall {
7492	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
7493	return c
7494}
7495
7496// UpdateMask sets the optional parameter "updateMask": Field mask that
7497// specifies the fields in sink that need an update. A sink field will
7498// be overwritten if, and only if, it is in the update mask. name and
7499// output only fields cannot be updated.An empty updateMask is
7500// temporarily treated as using the following mask for backwards
7501// compatibility purposes: destination,filter,includeChildren At some
7502// point in the future, behavior will be removed and specifying an empty
7503// updateMask will be an error.For a detailed FieldMask definition, see
7504// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
7505// updateMask=filter.
7506func (c *BillingAccountsSinksUpdateCall) UpdateMask(updateMask string) *BillingAccountsSinksUpdateCall {
7507	c.urlParams_.Set("updateMask", updateMask)
7508	return c
7509}
7510
7511// Fields allows partial responses to be retrieved. See
7512// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7513// for more information.
7514func (c *BillingAccountsSinksUpdateCall) Fields(s ...googleapi.Field) *BillingAccountsSinksUpdateCall {
7515	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7516	return c
7517}
7518
7519// Context sets the context to be used in this call's Do method. Any
7520// pending HTTP request will be aborted if the provided context is
7521// canceled.
7522func (c *BillingAccountsSinksUpdateCall) Context(ctx context.Context) *BillingAccountsSinksUpdateCall {
7523	c.ctx_ = ctx
7524	return c
7525}
7526
7527// Header returns an http.Header that can be modified by the caller to
7528// add HTTP headers to the request.
7529func (c *BillingAccountsSinksUpdateCall) Header() http.Header {
7530	if c.header_ == nil {
7531		c.header_ = make(http.Header)
7532	}
7533	return c.header_
7534}
7535
7536func (c *BillingAccountsSinksUpdateCall) doRequest(alt string) (*http.Response, error) {
7537	reqHeaders := make(http.Header)
7538	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
7539	for k, v := range c.header_ {
7540		reqHeaders[k] = v
7541	}
7542	reqHeaders.Set("User-Agent", c.s.userAgent())
7543	var body io.Reader = nil
7544	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
7545	if err != nil {
7546		return nil, err
7547	}
7548	reqHeaders.Set("Content-Type", "application/json")
7549	c.urlParams_.Set("alt", alt)
7550	c.urlParams_.Set("prettyPrint", "false")
7551	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
7552	urls += "?" + c.urlParams_.Encode()
7553	req, err := http.NewRequest("PUT", urls, body)
7554	if err != nil {
7555		return nil, err
7556	}
7557	req.Header = reqHeaders
7558	googleapi.Expand(req.URL, map[string]string{
7559		"sinkName": c.sinkNameid,
7560	})
7561	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7562}
7563
7564// Do executes the "logging.billingAccounts.sinks.update" call.
7565// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
7566// code is an error. Response headers are in either
7567// *LogSink.ServerResponse.Header or (if a response was returned at all)
7568// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
7569// check whether the returned error was because http.StatusNotModified
7570// was returned.
7571func (c *BillingAccountsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
7572	gensupport.SetOptions(c.urlParams_, opts...)
7573	res, err := c.doRequest("json")
7574	if res != nil && res.StatusCode == http.StatusNotModified {
7575		if res.Body != nil {
7576			res.Body.Close()
7577		}
7578		return nil, &googleapi.Error{
7579			Code:   res.StatusCode,
7580			Header: res.Header,
7581		}
7582	}
7583	if err != nil {
7584		return nil, err
7585	}
7586	defer googleapi.CloseBody(res)
7587	if err := googleapi.CheckResponse(res); err != nil {
7588		return nil, err
7589	}
7590	ret := &LogSink{
7591		ServerResponse: googleapi.ServerResponse{
7592			Header:         res.Header,
7593			HTTPStatusCode: res.StatusCode,
7594		},
7595	}
7596	target := &ret
7597	if err := gensupport.DecodeResponse(target, res); err != nil {
7598		return nil, err
7599	}
7600	return ret, nil
7601	// {
7602	//   "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.",
7603	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}",
7604	//   "httpMethod": "PUT",
7605	//   "id": "logging.billingAccounts.sinks.update",
7606	//   "parameterOrder": [
7607	//     "sinkName"
7608	//   ],
7609	//   "parameters": {
7610	//     "sinkName": {
7611	//       "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\".",
7612	//       "location": "path",
7613	//       "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$",
7614	//       "required": true,
7615	//       "type": "string"
7616	//     },
7617	//     "uniqueWriterIdentity": {
7618	//       "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.",
7619	//       "location": "query",
7620	//       "type": "boolean"
7621	//     },
7622	//     "updateMask": {
7623	//       "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.",
7624	//       "format": "google-fieldmask",
7625	//       "location": "query",
7626	//       "type": "string"
7627	//     }
7628	//   },
7629	//   "path": "v2/{+sinkName}",
7630	//   "request": {
7631	//     "$ref": "LogSink"
7632	//   },
7633	//   "response": {
7634	//     "$ref": "LogSink"
7635	//   },
7636	//   "scopes": [
7637	//     "https://www.googleapis.com/auth/cloud-platform",
7638	//     "https://www.googleapis.com/auth/logging.admin"
7639	//   ]
7640	// }
7641
7642}
7643
7644// method id "logging.entries.list":
7645
7646type EntriesListCall struct {
7647	s                     *Service
7648	listlogentriesrequest *ListLogEntriesRequest
7649	urlParams_            gensupport.URLParams
7650	ctx_                  context.Context
7651	header_               http.Header
7652}
7653
7654// List: Lists log entries. Use this method to retrieve log entries that
7655// originated from a project/folder/organization/billing account. For
7656// ways to export log entries, see Exporting Logs
7657// (https://cloud.google.com/logging/docs/export).
7658func (r *EntriesService) List(listlogentriesrequest *ListLogEntriesRequest) *EntriesListCall {
7659	c := &EntriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7660	c.listlogentriesrequest = listlogentriesrequest
7661	return c
7662}
7663
7664// Fields allows partial responses to be retrieved. See
7665// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7666// for more information.
7667func (c *EntriesListCall) Fields(s ...googleapi.Field) *EntriesListCall {
7668	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7669	return c
7670}
7671
7672// Context sets the context to be used in this call's Do method. Any
7673// pending HTTP request will be aborted if the provided context is
7674// canceled.
7675func (c *EntriesListCall) Context(ctx context.Context) *EntriesListCall {
7676	c.ctx_ = ctx
7677	return c
7678}
7679
7680// Header returns an http.Header that can be modified by the caller to
7681// add HTTP headers to the request.
7682func (c *EntriesListCall) Header() http.Header {
7683	if c.header_ == nil {
7684		c.header_ = make(http.Header)
7685	}
7686	return c.header_
7687}
7688
7689func (c *EntriesListCall) doRequest(alt string) (*http.Response, error) {
7690	reqHeaders := make(http.Header)
7691	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
7692	for k, v := range c.header_ {
7693		reqHeaders[k] = v
7694	}
7695	reqHeaders.Set("User-Agent", c.s.userAgent())
7696	var body io.Reader = nil
7697	body, err := googleapi.WithoutDataWrapper.JSONReader(c.listlogentriesrequest)
7698	if err != nil {
7699		return nil, err
7700	}
7701	reqHeaders.Set("Content-Type", "application/json")
7702	c.urlParams_.Set("alt", alt)
7703	c.urlParams_.Set("prettyPrint", "false")
7704	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/entries:list")
7705	urls += "?" + c.urlParams_.Encode()
7706	req, err := http.NewRequest("POST", urls, body)
7707	if err != nil {
7708		return nil, err
7709	}
7710	req.Header = reqHeaders
7711	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7712}
7713
7714// Do executes the "logging.entries.list" call.
7715// Exactly one of *ListLogEntriesResponse or error will be non-nil. Any
7716// non-2xx status code is an error. Response headers are in either
7717// *ListLogEntriesResponse.ServerResponse.Header or (if a response was
7718// returned at all) in error.(*googleapi.Error).Header. Use
7719// googleapi.IsNotModified to check whether the returned error was
7720// because http.StatusNotModified was returned.
7721func (c *EntriesListCall) Do(opts ...googleapi.CallOption) (*ListLogEntriesResponse, error) {
7722	gensupport.SetOptions(c.urlParams_, opts...)
7723	res, err := c.doRequest("json")
7724	if res != nil && res.StatusCode == http.StatusNotModified {
7725		if res.Body != nil {
7726			res.Body.Close()
7727		}
7728		return nil, &googleapi.Error{
7729			Code:   res.StatusCode,
7730			Header: res.Header,
7731		}
7732	}
7733	if err != nil {
7734		return nil, err
7735	}
7736	defer googleapi.CloseBody(res)
7737	if err := googleapi.CheckResponse(res); err != nil {
7738		return nil, err
7739	}
7740	ret := &ListLogEntriesResponse{
7741		ServerResponse: googleapi.ServerResponse{
7742			Header:         res.Header,
7743			HTTPStatusCode: res.StatusCode,
7744		},
7745	}
7746	target := &ret
7747	if err := gensupport.DecodeResponse(target, res); err != nil {
7748		return nil, err
7749	}
7750	return ret, nil
7751	// {
7752	//   "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).",
7753	//   "flatPath": "v2/entries:list",
7754	//   "httpMethod": "POST",
7755	//   "id": "logging.entries.list",
7756	//   "parameterOrder": [],
7757	//   "parameters": {},
7758	//   "path": "v2/entries:list",
7759	//   "request": {
7760	//     "$ref": "ListLogEntriesRequest"
7761	//   },
7762	//   "response": {
7763	//     "$ref": "ListLogEntriesResponse"
7764	//   },
7765	//   "scopes": [
7766	//     "https://www.googleapis.com/auth/cloud-platform",
7767	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
7768	//     "https://www.googleapis.com/auth/logging.admin",
7769	//     "https://www.googleapis.com/auth/logging.read"
7770	//   ]
7771	// }
7772
7773}
7774
7775// Pages invokes f for each page of results.
7776// A non-nil error returned from f will halt the iteration.
7777// The provided context supersedes any context provided to the Context method.
7778func (c *EntriesListCall) Pages(ctx context.Context, f func(*ListLogEntriesResponse) error) error {
7779	c.ctx_ = ctx
7780	defer func(pt string) { c.listlogentriesrequest.PageToken = pt }(c.listlogentriesrequest.PageToken) // reset paging to original point
7781	for {
7782		x, err := c.Do()
7783		if err != nil {
7784			return err
7785		}
7786		if err := f(x); err != nil {
7787			return err
7788		}
7789		if x.NextPageToken == "" {
7790			return nil
7791		}
7792		c.listlogentriesrequest.PageToken = x.NextPageToken
7793	}
7794}
7795
7796// method id "logging.entries.tail":
7797
7798type EntriesTailCall struct {
7799	s                     *Service
7800	taillogentriesrequest *TailLogEntriesRequest
7801	urlParams_            gensupport.URLParams
7802	ctx_                  context.Context
7803	header_               http.Header
7804}
7805
7806// Tail: Streaming read of log entries as they are ingested. Until the
7807// stream is terminated, it will continue reading logs.
7808func (r *EntriesService) Tail(taillogentriesrequest *TailLogEntriesRequest) *EntriesTailCall {
7809	c := &EntriesTailCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7810	c.taillogentriesrequest = taillogentriesrequest
7811	return c
7812}
7813
7814// Fields allows partial responses to be retrieved. See
7815// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7816// for more information.
7817func (c *EntriesTailCall) Fields(s ...googleapi.Field) *EntriesTailCall {
7818	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7819	return c
7820}
7821
7822// Context sets the context to be used in this call's Do method. Any
7823// pending HTTP request will be aborted if the provided context is
7824// canceled.
7825func (c *EntriesTailCall) Context(ctx context.Context) *EntriesTailCall {
7826	c.ctx_ = ctx
7827	return c
7828}
7829
7830// Header returns an http.Header that can be modified by the caller to
7831// add HTTP headers to the request.
7832func (c *EntriesTailCall) Header() http.Header {
7833	if c.header_ == nil {
7834		c.header_ = make(http.Header)
7835	}
7836	return c.header_
7837}
7838
7839func (c *EntriesTailCall) doRequest(alt string) (*http.Response, error) {
7840	reqHeaders := make(http.Header)
7841	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
7842	for k, v := range c.header_ {
7843		reqHeaders[k] = v
7844	}
7845	reqHeaders.Set("User-Agent", c.s.userAgent())
7846	var body io.Reader = nil
7847	body, err := googleapi.WithoutDataWrapper.JSONReader(c.taillogentriesrequest)
7848	if err != nil {
7849		return nil, err
7850	}
7851	reqHeaders.Set("Content-Type", "application/json")
7852	c.urlParams_.Set("alt", alt)
7853	c.urlParams_.Set("prettyPrint", "false")
7854	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/entries:tail")
7855	urls += "?" + c.urlParams_.Encode()
7856	req, err := http.NewRequest("POST", urls, body)
7857	if err != nil {
7858		return nil, err
7859	}
7860	req.Header = reqHeaders
7861	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7862}
7863
7864// Do executes the "logging.entries.tail" call.
7865// Exactly one of *TailLogEntriesResponse or error will be non-nil. Any
7866// non-2xx status code is an error. Response headers are in either
7867// *TailLogEntriesResponse.ServerResponse.Header or (if a response was
7868// returned at all) in error.(*googleapi.Error).Header. Use
7869// googleapi.IsNotModified to check whether the returned error was
7870// because http.StatusNotModified was returned.
7871func (c *EntriesTailCall) Do(opts ...googleapi.CallOption) (*TailLogEntriesResponse, error) {
7872	gensupport.SetOptions(c.urlParams_, opts...)
7873	res, err := c.doRequest("json")
7874	if res != nil && res.StatusCode == http.StatusNotModified {
7875		if res.Body != nil {
7876			res.Body.Close()
7877		}
7878		return nil, &googleapi.Error{
7879			Code:   res.StatusCode,
7880			Header: res.Header,
7881		}
7882	}
7883	if err != nil {
7884		return nil, err
7885	}
7886	defer googleapi.CloseBody(res)
7887	if err := googleapi.CheckResponse(res); err != nil {
7888		return nil, err
7889	}
7890	ret := &TailLogEntriesResponse{
7891		ServerResponse: googleapi.ServerResponse{
7892			Header:         res.Header,
7893			HTTPStatusCode: res.StatusCode,
7894		},
7895	}
7896	target := &ret
7897	if err := gensupport.DecodeResponse(target, res); err != nil {
7898		return nil, err
7899	}
7900	return ret, nil
7901	// {
7902	//   "description": "Streaming read of log entries as they are ingested. Until the stream is terminated, it will continue reading logs.",
7903	//   "flatPath": "v2/entries:tail",
7904	//   "httpMethod": "POST",
7905	//   "id": "logging.entries.tail",
7906	//   "parameterOrder": [],
7907	//   "parameters": {},
7908	//   "path": "v2/entries:tail",
7909	//   "request": {
7910	//     "$ref": "TailLogEntriesRequest"
7911	//   },
7912	//   "response": {
7913	//     "$ref": "TailLogEntriesResponse"
7914	//   },
7915	//   "scopes": [
7916	//     "https://www.googleapis.com/auth/cloud-platform",
7917	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
7918	//     "https://www.googleapis.com/auth/logging.admin",
7919	//     "https://www.googleapis.com/auth/logging.read"
7920	//   ]
7921	// }
7922
7923}
7924
7925// method id "logging.entries.write":
7926
7927type EntriesWriteCall struct {
7928	s                      *Service
7929	writelogentriesrequest *WriteLogEntriesRequest
7930	urlParams_             gensupport.URLParams
7931	ctx_                   context.Context
7932	header_                http.Header
7933}
7934
7935// Write: Writes log entries to Logging. This API method is the only way
7936// to send log entries to Logging. This method is used, directly or
7937// indirectly, by the Logging agent (fluentd) and all logging libraries
7938// configured to use Logging. A single request may contain log entries
7939// for a maximum of 1000 different resources (projects, organizations,
7940// billing accounts or folders)
7941func (r *EntriesService) Write(writelogentriesrequest *WriteLogEntriesRequest) *EntriesWriteCall {
7942	c := &EntriesWriteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7943	c.writelogentriesrequest = writelogentriesrequest
7944	return c
7945}
7946
7947// Fields allows partial responses to be retrieved. See
7948// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7949// for more information.
7950func (c *EntriesWriteCall) Fields(s ...googleapi.Field) *EntriesWriteCall {
7951	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7952	return c
7953}
7954
7955// Context sets the context to be used in this call's Do method. Any
7956// pending HTTP request will be aborted if the provided context is
7957// canceled.
7958func (c *EntriesWriteCall) Context(ctx context.Context) *EntriesWriteCall {
7959	c.ctx_ = ctx
7960	return c
7961}
7962
7963// Header returns an http.Header that can be modified by the caller to
7964// add HTTP headers to the request.
7965func (c *EntriesWriteCall) Header() http.Header {
7966	if c.header_ == nil {
7967		c.header_ = make(http.Header)
7968	}
7969	return c.header_
7970}
7971
7972func (c *EntriesWriteCall) doRequest(alt string) (*http.Response, error) {
7973	reqHeaders := make(http.Header)
7974	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
7975	for k, v := range c.header_ {
7976		reqHeaders[k] = v
7977	}
7978	reqHeaders.Set("User-Agent", c.s.userAgent())
7979	var body io.Reader = nil
7980	body, err := googleapi.WithoutDataWrapper.JSONReader(c.writelogentriesrequest)
7981	if err != nil {
7982		return nil, err
7983	}
7984	reqHeaders.Set("Content-Type", "application/json")
7985	c.urlParams_.Set("alt", alt)
7986	c.urlParams_.Set("prettyPrint", "false")
7987	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/entries:write")
7988	urls += "?" + c.urlParams_.Encode()
7989	req, err := http.NewRequest("POST", urls, body)
7990	if err != nil {
7991		return nil, err
7992	}
7993	req.Header = reqHeaders
7994	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7995}
7996
7997// Do executes the "logging.entries.write" call.
7998// Exactly one of *WriteLogEntriesResponse or error will be non-nil. Any
7999// non-2xx status code is an error. Response headers are in either
8000// *WriteLogEntriesResponse.ServerResponse.Header or (if a response was
8001// returned at all) in error.(*googleapi.Error).Header. Use
8002// googleapi.IsNotModified to check whether the returned error was
8003// because http.StatusNotModified was returned.
8004func (c *EntriesWriteCall) Do(opts ...googleapi.CallOption) (*WriteLogEntriesResponse, error) {
8005	gensupport.SetOptions(c.urlParams_, opts...)
8006	res, err := c.doRequest("json")
8007	if res != nil && res.StatusCode == http.StatusNotModified {
8008		if res.Body != nil {
8009			res.Body.Close()
8010		}
8011		return nil, &googleapi.Error{
8012			Code:   res.StatusCode,
8013			Header: res.Header,
8014		}
8015	}
8016	if err != nil {
8017		return nil, err
8018	}
8019	defer googleapi.CloseBody(res)
8020	if err := googleapi.CheckResponse(res); err != nil {
8021		return nil, err
8022	}
8023	ret := &WriteLogEntriesResponse{
8024		ServerResponse: googleapi.ServerResponse{
8025			Header:         res.Header,
8026			HTTPStatusCode: res.StatusCode,
8027		},
8028	}
8029	target := &ret
8030	if err := gensupport.DecodeResponse(target, res); err != nil {
8031		return nil, err
8032	}
8033	return ret, nil
8034	// {
8035	//   "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)",
8036	//   "flatPath": "v2/entries:write",
8037	//   "httpMethod": "POST",
8038	//   "id": "logging.entries.write",
8039	//   "parameterOrder": [],
8040	//   "parameters": {},
8041	//   "path": "v2/entries:write",
8042	//   "request": {
8043	//     "$ref": "WriteLogEntriesRequest"
8044	//   },
8045	//   "response": {
8046	//     "$ref": "WriteLogEntriesResponse"
8047	//   },
8048	//   "scopes": [
8049	//     "https://www.googleapis.com/auth/cloud-platform",
8050	//     "https://www.googleapis.com/auth/logging.admin",
8051	//     "https://www.googleapis.com/auth/logging.write"
8052	//   ]
8053	// }
8054
8055}
8056
8057// method id "logging.exclusions.create":
8058
8059type ExclusionsCreateCall struct {
8060	s            *Service
8061	parent       string
8062	logexclusion *LogExclusion
8063	urlParams_   gensupport.URLParams
8064	ctx_         context.Context
8065	header_      http.Header
8066}
8067
8068// Create: Creates a new exclusion in a specified parent resource. Only
8069// log entries belonging to that resource can be excluded. You can have
8070// up to 10 exclusions in a resource.
8071//
8072// - parent: The parent resource in which to create the exclusion:
8073//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
8074//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
8075//   Examples: "projects/my-logging-project", "organizations/123456789".
8076func (r *ExclusionsService) Create(parent string, logexclusion *LogExclusion) *ExclusionsCreateCall {
8077	c := &ExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8078	c.parent = parent
8079	c.logexclusion = logexclusion
8080	return c
8081}
8082
8083// Fields allows partial responses to be retrieved. See
8084// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8085// for more information.
8086func (c *ExclusionsCreateCall) Fields(s ...googleapi.Field) *ExclusionsCreateCall {
8087	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8088	return c
8089}
8090
8091// Context sets the context to be used in this call's Do method. Any
8092// pending HTTP request will be aborted if the provided context is
8093// canceled.
8094func (c *ExclusionsCreateCall) Context(ctx context.Context) *ExclusionsCreateCall {
8095	c.ctx_ = ctx
8096	return c
8097}
8098
8099// Header returns an http.Header that can be modified by the caller to
8100// add HTTP headers to the request.
8101func (c *ExclusionsCreateCall) Header() http.Header {
8102	if c.header_ == nil {
8103		c.header_ = make(http.Header)
8104	}
8105	return c.header_
8106}
8107
8108func (c *ExclusionsCreateCall) doRequest(alt string) (*http.Response, error) {
8109	reqHeaders := make(http.Header)
8110	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
8111	for k, v := range c.header_ {
8112		reqHeaders[k] = v
8113	}
8114	reqHeaders.Set("User-Agent", c.s.userAgent())
8115	var body io.Reader = nil
8116	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
8117	if err != nil {
8118		return nil, err
8119	}
8120	reqHeaders.Set("Content-Type", "application/json")
8121	c.urlParams_.Set("alt", alt)
8122	c.urlParams_.Set("prettyPrint", "false")
8123	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
8124	urls += "?" + c.urlParams_.Encode()
8125	req, err := http.NewRequest("POST", urls, body)
8126	if err != nil {
8127		return nil, err
8128	}
8129	req.Header = reqHeaders
8130	googleapi.Expand(req.URL, map[string]string{
8131		"parent": c.parent,
8132	})
8133	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8134}
8135
8136// Do executes the "logging.exclusions.create" call.
8137// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
8138// status code is an error. Response headers are in either
8139// *LogExclusion.ServerResponse.Header or (if a response was returned at
8140// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
8141// to check whether the returned error was because
8142// http.StatusNotModified was returned.
8143func (c *ExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
8144	gensupport.SetOptions(c.urlParams_, opts...)
8145	res, err := c.doRequest("json")
8146	if res != nil && res.StatusCode == http.StatusNotModified {
8147		if res.Body != nil {
8148			res.Body.Close()
8149		}
8150		return nil, &googleapi.Error{
8151			Code:   res.StatusCode,
8152			Header: res.Header,
8153		}
8154	}
8155	if err != nil {
8156		return nil, err
8157	}
8158	defer googleapi.CloseBody(res)
8159	if err := googleapi.CheckResponse(res); err != nil {
8160		return nil, err
8161	}
8162	ret := &LogExclusion{
8163		ServerResponse: googleapi.ServerResponse{
8164			Header:         res.Header,
8165			HTTPStatusCode: res.StatusCode,
8166		},
8167	}
8168	target := &ret
8169	if err := gensupport.DecodeResponse(target, res); err != nil {
8170		return nil, err
8171	}
8172	return ret, nil
8173	// {
8174	//   "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.",
8175	//   "flatPath": "v2/{v2Id}/{v2Id1}/exclusions",
8176	//   "httpMethod": "POST",
8177	//   "id": "logging.exclusions.create",
8178	//   "parameterOrder": [
8179	//     "parent"
8180	//   ],
8181	//   "parameters": {
8182	//     "parent": {
8183	//       "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\".",
8184	//       "location": "path",
8185	//       "pattern": "^[^/]+/[^/]+$",
8186	//       "required": true,
8187	//       "type": "string"
8188	//     }
8189	//   },
8190	//   "path": "v2/{+parent}/exclusions",
8191	//   "request": {
8192	//     "$ref": "LogExclusion"
8193	//   },
8194	//   "response": {
8195	//     "$ref": "LogExclusion"
8196	//   },
8197	//   "scopes": [
8198	//     "https://www.googleapis.com/auth/cloud-platform",
8199	//     "https://www.googleapis.com/auth/logging.admin"
8200	//   ]
8201	// }
8202
8203}
8204
8205// method id "logging.exclusions.delete":
8206
8207type ExclusionsDeleteCall struct {
8208	s          *Service
8209	name       string
8210	urlParams_ gensupport.URLParams
8211	ctx_       context.Context
8212	header_    http.Header
8213}
8214
8215// Delete: Deletes an exclusion.
8216//
8217// - name: The resource name of an existing exclusion to delete:
8218//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
8219//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
8220//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
8221//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example:
8222//   "projects/my-project-id/exclusions/my-exclusion-id".
8223func (r *ExclusionsService) Delete(name string) *ExclusionsDeleteCall {
8224	c := &ExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8225	c.name = name
8226	return c
8227}
8228
8229// Fields allows partial responses to be retrieved. See
8230// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8231// for more information.
8232func (c *ExclusionsDeleteCall) Fields(s ...googleapi.Field) *ExclusionsDeleteCall {
8233	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8234	return c
8235}
8236
8237// Context sets the context to be used in this call's Do method. Any
8238// pending HTTP request will be aborted if the provided context is
8239// canceled.
8240func (c *ExclusionsDeleteCall) Context(ctx context.Context) *ExclusionsDeleteCall {
8241	c.ctx_ = ctx
8242	return c
8243}
8244
8245// Header returns an http.Header that can be modified by the caller to
8246// add HTTP headers to the request.
8247func (c *ExclusionsDeleteCall) Header() http.Header {
8248	if c.header_ == nil {
8249		c.header_ = make(http.Header)
8250	}
8251	return c.header_
8252}
8253
8254func (c *ExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) {
8255	reqHeaders := make(http.Header)
8256	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
8257	for k, v := range c.header_ {
8258		reqHeaders[k] = v
8259	}
8260	reqHeaders.Set("User-Agent", c.s.userAgent())
8261	var body io.Reader = nil
8262	c.urlParams_.Set("alt", alt)
8263	c.urlParams_.Set("prettyPrint", "false")
8264	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
8265	urls += "?" + c.urlParams_.Encode()
8266	req, err := http.NewRequest("DELETE", urls, body)
8267	if err != nil {
8268		return nil, err
8269	}
8270	req.Header = reqHeaders
8271	googleapi.Expand(req.URL, map[string]string{
8272		"name": c.name,
8273	})
8274	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8275}
8276
8277// Do executes the "logging.exclusions.delete" call.
8278// Exactly one of *Empty or error will be non-nil. Any non-2xx status
8279// code is an error. Response headers are in either
8280// *Empty.ServerResponse.Header or (if a response was returned at all)
8281// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8282// check whether the returned error was because http.StatusNotModified
8283// was returned.
8284func (c *ExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
8285	gensupport.SetOptions(c.urlParams_, opts...)
8286	res, err := c.doRequest("json")
8287	if res != nil && res.StatusCode == http.StatusNotModified {
8288		if res.Body != nil {
8289			res.Body.Close()
8290		}
8291		return nil, &googleapi.Error{
8292			Code:   res.StatusCode,
8293			Header: res.Header,
8294		}
8295	}
8296	if err != nil {
8297		return nil, err
8298	}
8299	defer googleapi.CloseBody(res)
8300	if err := googleapi.CheckResponse(res); err != nil {
8301		return nil, err
8302	}
8303	ret := &Empty{
8304		ServerResponse: googleapi.ServerResponse{
8305			Header:         res.Header,
8306			HTTPStatusCode: res.StatusCode,
8307		},
8308	}
8309	target := &ret
8310	if err := gensupport.DecodeResponse(target, res); err != nil {
8311		return nil, err
8312	}
8313	return ret, nil
8314	// {
8315	//   "description": "Deletes an exclusion.",
8316	//   "flatPath": "v2/{v2Id}/{v2Id1}/exclusions/{exclusionsId}",
8317	//   "httpMethod": "DELETE",
8318	//   "id": "logging.exclusions.delete",
8319	//   "parameterOrder": [
8320	//     "name"
8321	//   ],
8322	//   "parameters": {
8323	//     "name": {
8324	//       "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\".",
8325	//       "location": "path",
8326	//       "pattern": "^[^/]+/[^/]+/exclusions/[^/]+$",
8327	//       "required": true,
8328	//       "type": "string"
8329	//     }
8330	//   },
8331	//   "path": "v2/{+name}",
8332	//   "response": {
8333	//     "$ref": "Empty"
8334	//   },
8335	//   "scopes": [
8336	//     "https://www.googleapis.com/auth/cloud-platform",
8337	//     "https://www.googleapis.com/auth/logging.admin"
8338	//   ]
8339	// }
8340
8341}
8342
8343// method id "logging.exclusions.get":
8344
8345type ExclusionsGetCall struct {
8346	s            *Service
8347	name         string
8348	urlParams_   gensupport.URLParams
8349	ifNoneMatch_ string
8350	ctx_         context.Context
8351	header_      http.Header
8352}
8353
8354// Get: Gets the description of an exclusion.
8355//
8356// - name: The resource name of an existing exclusion:
8357//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
8358//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
8359//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
8360//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example:
8361//   "projects/my-project-id/exclusions/my-exclusion-id".
8362func (r *ExclusionsService) Get(name string) *ExclusionsGetCall {
8363	c := &ExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8364	c.name = name
8365	return c
8366}
8367
8368// Fields allows partial responses to be retrieved. See
8369// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8370// for more information.
8371func (c *ExclusionsGetCall) Fields(s ...googleapi.Field) *ExclusionsGetCall {
8372	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8373	return c
8374}
8375
8376// IfNoneMatch sets the optional parameter which makes the operation
8377// fail if the object's ETag matches the given value. This is useful for
8378// getting updates only after the object has changed since the last
8379// request. Use googleapi.IsNotModified to check whether the response
8380// error from Do is the result of In-None-Match.
8381func (c *ExclusionsGetCall) IfNoneMatch(entityTag string) *ExclusionsGetCall {
8382	c.ifNoneMatch_ = entityTag
8383	return c
8384}
8385
8386// Context sets the context to be used in this call's Do method. Any
8387// pending HTTP request will be aborted if the provided context is
8388// canceled.
8389func (c *ExclusionsGetCall) Context(ctx context.Context) *ExclusionsGetCall {
8390	c.ctx_ = ctx
8391	return c
8392}
8393
8394// Header returns an http.Header that can be modified by the caller to
8395// add HTTP headers to the request.
8396func (c *ExclusionsGetCall) Header() http.Header {
8397	if c.header_ == nil {
8398		c.header_ = make(http.Header)
8399	}
8400	return c.header_
8401}
8402
8403func (c *ExclusionsGetCall) doRequest(alt string) (*http.Response, error) {
8404	reqHeaders := make(http.Header)
8405	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
8406	for k, v := range c.header_ {
8407		reqHeaders[k] = v
8408	}
8409	reqHeaders.Set("User-Agent", c.s.userAgent())
8410	if c.ifNoneMatch_ != "" {
8411		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8412	}
8413	var body io.Reader = nil
8414	c.urlParams_.Set("alt", alt)
8415	c.urlParams_.Set("prettyPrint", "false")
8416	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
8417	urls += "?" + c.urlParams_.Encode()
8418	req, err := http.NewRequest("GET", urls, body)
8419	if err != nil {
8420		return nil, err
8421	}
8422	req.Header = reqHeaders
8423	googleapi.Expand(req.URL, map[string]string{
8424		"name": c.name,
8425	})
8426	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8427}
8428
8429// Do executes the "logging.exclusions.get" call.
8430// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
8431// status code is an error. Response headers are in either
8432// *LogExclusion.ServerResponse.Header or (if a response was returned at
8433// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
8434// to check whether the returned error was because
8435// http.StatusNotModified was returned.
8436func (c *ExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
8437	gensupport.SetOptions(c.urlParams_, opts...)
8438	res, err := c.doRequest("json")
8439	if res != nil && res.StatusCode == http.StatusNotModified {
8440		if res.Body != nil {
8441			res.Body.Close()
8442		}
8443		return nil, &googleapi.Error{
8444			Code:   res.StatusCode,
8445			Header: res.Header,
8446		}
8447	}
8448	if err != nil {
8449		return nil, err
8450	}
8451	defer googleapi.CloseBody(res)
8452	if err := googleapi.CheckResponse(res); err != nil {
8453		return nil, err
8454	}
8455	ret := &LogExclusion{
8456		ServerResponse: googleapi.ServerResponse{
8457			Header:         res.Header,
8458			HTTPStatusCode: res.StatusCode,
8459		},
8460	}
8461	target := &ret
8462	if err := gensupport.DecodeResponse(target, res); err != nil {
8463		return nil, err
8464	}
8465	return ret, nil
8466	// {
8467	//   "description": "Gets the description of an exclusion.",
8468	//   "flatPath": "v2/{v2Id}/{v2Id1}/exclusions/{exclusionsId}",
8469	//   "httpMethod": "GET",
8470	//   "id": "logging.exclusions.get",
8471	//   "parameterOrder": [
8472	//     "name"
8473	//   ],
8474	//   "parameters": {
8475	//     "name": {
8476	//       "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\".",
8477	//       "location": "path",
8478	//       "pattern": "^[^/]+/[^/]+/exclusions/[^/]+$",
8479	//       "required": true,
8480	//       "type": "string"
8481	//     }
8482	//   },
8483	//   "path": "v2/{+name}",
8484	//   "response": {
8485	//     "$ref": "LogExclusion"
8486	//   },
8487	//   "scopes": [
8488	//     "https://www.googleapis.com/auth/cloud-platform",
8489	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
8490	//     "https://www.googleapis.com/auth/logging.admin",
8491	//     "https://www.googleapis.com/auth/logging.read"
8492	//   ]
8493	// }
8494
8495}
8496
8497// method id "logging.exclusions.list":
8498
8499type ExclusionsListCall struct {
8500	s            *Service
8501	parent       string
8502	urlParams_   gensupport.URLParams
8503	ifNoneMatch_ string
8504	ctx_         context.Context
8505	header_      http.Header
8506}
8507
8508// List: Lists all the exclusions in a parent resource.
8509//
8510// - parent: The parent resource whose exclusions are to be listed.
8511//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
8512//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]".
8513func (r *ExclusionsService) List(parent string) *ExclusionsListCall {
8514	c := &ExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8515	c.parent = parent
8516	return c
8517}
8518
8519// PageSize sets the optional parameter "pageSize": The maximum number
8520// of results to return from this request. Non-positive values are
8521// ignored. The presence of nextPageToken in the response indicates that
8522// more results might be available.
8523func (c *ExclusionsListCall) PageSize(pageSize int64) *ExclusionsListCall {
8524	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
8525	return c
8526}
8527
8528// PageToken sets the optional parameter "pageToken": If present, then
8529// retrieve the next batch of results from the preceding call to this
8530// method. pageToken must be the value of nextPageToken from the
8531// previous response. The values of other method parameters should be
8532// identical to those in the previous call.
8533func (c *ExclusionsListCall) PageToken(pageToken string) *ExclusionsListCall {
8534	c.urlParams_.Set("pageToken", pageToken)
8535	return c
8536}
8537
8538// Fields allows partial responses to be retrieved. See
8539// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8540// for more information.
8541func (c *ExclusionsListCall) Fields(s ...googleapi.Field) *ExclusionsListCall {
8542	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8543	return c
8544}
8545
8546// IfNoneMatch sets the optional parameter which makes the operation
8547// fail if the object's ETag matches the given value. This is useful for
8548// getting updates only after the object has changed since the last
8549// request. Use googleapi.IsNotModified to check whether the response
8550// error from Do is the result of In-None-Match.
8551func (c *ExclusionsListCall) IfNoneMatch(entityTag string) *ExclusionsListCall {
8552	c.ifNoneMatch_ = entityTag
8553	return c
8554}
8555
8556// Context sets the context to be used in this call's Do method. Any
8557// pending HTTP request will be aborted if the provided context is
8558// canceled.
8559func (c *ExclusionsListCall) Context(ctx context.Context) *ExclusionsListCall {
8560	c.ctx_ = ctx
8561	return c
8562}
8563
8564// Header returns an http.Header that can be modified by the caller to
8565// add HTTP headers to the request.
8566func (c *ExclusionsListCall) Header() http.Header {
8567	if c.header_ == nil {
8568		c.header_ = make(http.Header)
8569	}
8570	return c.header_
8571}
8572
8573func (c *ExclusionsListCall) doRequest(alt string) (*http.Response, error) {
8574	reqHeaders := make(http.Header)
8575	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
8576	for k, v := range c.header_ {
8577		reqHeaders[k] = v
8578	}
8579	reqHeaders.Set("User-Agent", c.s.userAgent())
8580	if c.ifNoneMatch_ != "" {
8581		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8582	}
8583	var body io.Reader = nil
8584	c.urlParams_.Set("alt", alt)
8585	c.urlParams_.Set("prettyPrint", "false")
8586	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
8587	urls += "?" + c.urlParams_.Encode()
8588	req, err := http.NewRequest("GET", urls, body)
8589	if err != nil {
8590		return nil, err
8591	}
8592	req.Header = reqHeaders
8593	googleapi.Expand(req.URL, map[string]string{
8594		"parent": c.parent,
8595	})
8596	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8597}
8598
8599// Do executes the "logging.exclusions.list" call.
8600// Exactly one of *ListExclusionsResponse or error will be non-nil. Any
8601// non-2xx status code is an error. Response headers are in either
8602// *ListExclusionsResponse.ServerResponse.Header or (if a response was
8603// returned at all) in error.(*googleapi.Error).Header. Use
8604// googleapi.IsNotModified to check whether the returned error was
8605// because http.StatusNotModified was returned.
8606func (c *ExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) {
8607	gensupport.SetOptions(c.urlParams_, opts...)
8608	res, err := c.doRequest("json")
8609	if res != nil && res.StatusCode == http.StatusNotModified {
8610		if res.Body != nil {
8611			res.Body.Close()
8612		}
8613		return nil, &googleapi.Error{
8614			Code:   res.StatusCode,
8615			Header: res.Header,
8616		}
8617	}
8618	if err != nil {
8619		return nil, err
8620	}
8621	defer googleapi.CloseBody(res)
8622	if err := googleapi.CheckResponse(res); err != nil {
8623		return nil, err
8624	}
8625	ret := &ListExclusionsResponse{
8626		ServerResponse: googleapi.ServerResponse{
8627			Header:         res.Header,
8628			HTTPStatusCode: res.StatusCode,
8629		},
8630	}
8631	target := &ret
8632	if err := gensupport.DecodeResponse(target, res); err != nil {
8633		return nil, err
8634	}
8635	return ret, nil
8636	// {
8637	//   "description": "Lists all the exclusions in a parent resource.",
8638	//   "flatPath": "v2/{v2Id}/{v2Id1}/exclusions",
8639	//   "httpMethod": "GET",
8640	//   "id": "logging.exclusions.list",
8641	//   "parameterOrder": [
8642	//     "parent"
8643	//   ],
8644	//   "parameters": {
8645	//     "pageSize": {
8646	//       "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.",
8647	//       "format": "int32",
8648	//       "location": "query",
8649	//       "type": "integer"
8650	//     },
8651	//     "pageToken": {
8652	//       "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.",
8653	//       "location": "query",
8654	//       "type": "string"
8655	//     },
8656	//     "parent": {
8657	//       "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
8658	//       "location": "path",
8659	//       "pattern": "^[^/]+/[^/]+$",
8660	//       "required": true,
8661	//       "type": "string"
8662	//     }
8663	//   },
8664	//   "path": "v2/{+parent}/exclusions",
8665	//   "response": {
8666	//     "$ref": "ListExclusionsResponse"
8667	//   },
8668	//   "scopes": [
8669	//     "https://www.googleapis.com/auth/cloud-platform",
8670	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
8671	//     "https://www.googleapis.com/auth/logging.admin",
8672	//     "https://www.googleapis.com/auth/logging.read"
8673	//   ]
8674	// }
8675
8676}
8677
8678// Pages invokes f for each page of results.
8679// A non-nil error returned from f will halt the iteration.
8680// The provided context supersedes any context provided to the Context method.
8681func (c *ExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error {
8682	c.ctx_ = ctx
8683	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
8684	for {
8685		x, err := c.Do()
8686		if err != nil {
8687			return err
8688		}
8689		if err := f(x); err != nil {
8690			return err
8691		}
8692		if x.NextPageToken == "" {
8693			return nil
8694		}
8695		c.PageToken(x.NextPageToken)
8696	}
8697}
8698
8699// method id "logging.exclusions.patch":
8700
8701type ExclusionsPatchCall struct {
8702	s            *Service
8703	name         string
8704	logexclusion *LogExclusion
8705	urlParams_   gensupport.URLParams
8706	ctx_         context.Context
8707	header_      http.Header
8708}
8709
8710// Patch: Changes one or more properties of an existing exclusion.
8711//
8712// - name: The resource name of the exclusion to update:
8713//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
8714//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
8715//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
8716//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example:
8717//   "projects/my-project-id/exclusions/my-exclusion-id".
8718func (r *ExclusionsService) Patch(name string, logexclusion *LogExclusion) *ExclusionsPatchCall {
8719	c := &ExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8720	c.name = name
8721	c.logexclusion = logexclusion
8722	return c
8723}
8724
8725// UpdateMask sets the optional parameter "updateMask": Required. A
8726// non-empty list of fields to change in the existing exclusion. New
8727// values for the fields are taken from the corresponding fields in the
8728// LogExclusion included in this request. Fields not mentioned in
8729// update_mask are not changed and are ignored in the request.For
8730// example, to change the filter and description of an exclusion,
8731// specify an update_mask of "filter,description".
8732func (c *ExclusionsPatchCall) UpdateMask(updateMask string) *ExclusionsPatchCall {
8733	c.urlParams_.Set("updateMask", updateMask)
8734	return c
8735}
8736
8737// Fields allows partial responses to be retrieved. See
8738// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8739// for more information.
8740func (c *ExclusionsPatchCall) Fields(s ...googleapi.Field) *ExclusionsPatchCall {
8741	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8742	return c
8743}
8744
8745// Context sets the context to be used in this call's Do method. Any
8746// pending HTTP request will be aborted if the provided context is
8747// canceled.
8748func (c *ExclusionsPatchCall) Context(ctx context.Context) *ExclusionsPatchCall {
8749	c.ctx_ = ctx
8750	return c
8751}
8752
8753// Header returns an http.Header that can be modified by the caller to
8754// add HTTP headers to the request.
8755func (c *ExclusionsPatchCall) Header() http.Header {
8756	if c.header_ == nil {
8757		c.header_ = make(http.Header)
8758	}
8759	return c.header_
8760}
8761
8762func (c *ExclusionsPatchCall) doRequest(alt string) (*http.Response, error) {
8763	reqHeaders := make(http.Header)
8764	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
8765	for k, v := range c.header_ {
8766		reqHeaders[k] = v
8767	}
8768	reqHeaders.Set("User-Agent", c.s.userAgent())
8769	var body io.Reader = nil
8770	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
8771	if err != nil {
8772		return nil, err
8773	}
8774	reqHeaders.Set("Content-Type", "application/json")
8775	c.urlParams_.Set("alt", alt)
8776	c.urlParams_.Set("prettyPrint", "false")
8777	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
8778	urls += "?" + c.urlParams_.Encode()
8779	req, err := http.NewRequest("PATCH", urls, body)
8780	if err != nil {
8781		return nil, err
8782	}
8783	req.Header = reqHeaders
8784	googleapi.Expand(req.URL, map[string]string{
8785		"name": c.name,
8786	})
8787	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8788}
8789
8790// Do executes the "logging.exclusions.patch" call.
8791// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
8792// status code is an error. Response headers are in either
8793// *LogExclusion.ServerResponse.Header or (if a response was returned at
8794// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
8795// to check whether the returned error was because
8796// http.StatusNotModified was returned.
8797func (c *ExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
8798	gensupport.SetOptions(c.urlParams_, opts...)
8799	res, err := c.doRequest("json")
8800	if res != nil && res.StatusCode == http.StatusNotModified {
8801		if res.Body != nil {
8802			res.Body.Close()
8803		}
8804		return nil, &googleapi.Error{
8805			Code:   res.StatusCode,
8806			Header: res.Header,
8807		}
8808	}
8809	if err != nil {
8810		return nil, err
8811	}
8812	defer googleapi.CloseBody(res)
8813	if err := googleapi.CheckResponse(res); err != nil {
8814		return nil, err
8815	}
8816	ret := &LogExclusion{
8817		ServerResponse: googleapi.ServerResponse{
8818			Header:         res.Header,
8819			HTTPStatusCode: res.StatusCode,
8820		},
8821	}
8822	target := &ret
8823	if err := gensupport.DecodeResponse(target, res); err != nil {
8824		return nil, err
8825	}
8826	return ret, nil
8827	// {
8828	//   "description": "Changes one or more properties of an existing exclusion.",
8829	//   "flatPath": "v2/{v2Id}/{v2Id1}/exclusions/{exclusionsId}",
8830	//   "httpMethod": "PATCH",
8831	//   "id": "logging.exclusions.patch",
8832	//   "parameterOrder": [
8833	//     "name"
8834	//   ],
8835	//   "parameters": {
8836	//     "name": {
8837	//       "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\".",
8838	//       "location": "path",
8839	//       "pattern": "^[^/]+/[^/]+/exclusions/[^/]+$",
8840	//       "required": true,
8841	//       "type": "string"
8842	//     },
8843	//     "updateMask": {
8844	//       "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\".",
8845	//       "format": "google-fieldmask",
8846	//       "location": "query",
8847	//       "type": "string"
8848	//     }
8849	//   },
8850	//   "path": "v2/{+name}",
8851	//   "request": {
8852	//     "$ref": "LogExclusion"
8853	//   },
8854	//   "response": {
8855	//     "$ref": "LogExclusion"
8856	//   },
8857	//   "scopes": [
8858	//     "https://www.googleapis.com/auth/cloud-platform",
8859	//     "https://www.googleapis.com/auth/logging.admin"
8860	//   ]
8861	// }
8862
8863}
8864
8865// method id "logging.folders.exclusions.create":
8866
8867type FoldersExclusionsCreateCall struct {
8868	s            *Service
8869	parent       string
8870	logexclusion *LogExclusion
8871	urlParams_   gensupport.URLParams
8872	ctx_         context.Context
8873	header_      http.Header
8874}
8875
8876// Create: Creates a new exclusion in a specified parent resource. Only
8877// log entries belonging to that resource can be excluded. You can have
8878// up to 10 exclusions in a resource.
8879//
8880// - parent: The parent resource in which to create the exclusion:
8881//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
8882//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
8883//   Examples: "projects/my-logging-project", "organizations/123456789".
8884func (r *FoldersExclusionsService) Create(parent string, logexclusion *LogExclusion) *FoldersExclusionsCreateCall {
8885	c := &FoldersExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8886	c.parent = parent
8887	c.logexclusion = logexclusion
8888	return c
8889}
8890
8891// Fields allows partial responses to be retrieved. See
8892// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8893// for more information.
8894func (c *FoldersExclusionsCreateCall) Fields(s ...googleapi.Field) *FoldersExclusionsCreateCall {
8895	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8896	return c
8897}
8898
8899// Context sets the context to be used in this call's Do method. Any
8900// pending HTTP request will be aborted if the provided context is
8901// canceled.
8902func (c *FoldersExclusionsCreateCall) Context(ctx context.Context) *FoldersExclusionsCreateCall {
8903	c.ctx_ = ctx
8904	return c
8905}
8906
8907// Header returns an http.Header that can be modified by the caller to
8908// add HTTP headers to the request.
8909func (c *FoldersExclusionsCreateCall) Header() http.Header {
8910	if c.header_ == nil {
8911		c.header_ = make(http.Header)
8912	}
8913	return c.header_
8914}
8915
8916func (c *FoldersExclusionsCreateCall) doRequest(alt string) (*http.Response, error) {
8917	reqHeaders := make(http.Header)
8918	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
8919	for k, v := range c.header_ {
8920		reqHeaders[k] = v
8921	}
8922	reqHeaders.Set("User-Agent", c.s.userAgent())
8923	var body io.Reader = nil
8924	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
8925	if err != nil {
8926		return nil, err
8927	}
8928	reqHeaders.Set("Content-Type", "application/json")
8929	c.urlParams_.Set("alt", alt)
8930	c.urlParams_.Set("prettyPrint", "false")
8931	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
8932	urls += "?" + c.urlParams_.Encode()
8933	req, err := http.NewRequest("POST", urls, body)
8934	if err != nil {
8935		return nil, err
8936	}
8937	req.Header = reqHeaders
8938	googleapi.Expand(req.URL, map[string]string{
8939		"parent": c.parent,
8940	})
8941	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8942}
8943
8944// Do executes the "logging.folders.exclusions.create" call.
8945// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
8946// status code is an error. Response headers are in either
8947// *LogExclusion.ServerResponse.Header or (if a response was returned at
8948// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
8949// to check whether the returned error was because
8950// http.StatusNotModified was returned.
8951func (c *FoldersExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
8952	gensupport.SetOptions(c.urlParams_, opts...)
8953	res, err := c.doRequest("json")
8954	if res != nil && res.StatusCode == http.StatusNotModified {
8955		if res.Body != nil {
8956			res.Body.Close()
8957		}
8958		return nil, &googleapi.Error{
8959			Code:   res.StatusCode,
8960			Header: res.Header,
8961		}
8962	}
8963	if err != nil {
8964		return nil, err
8965	}
8966	defer googleapi.CloseBody(res)
8967	if err := googleapi.CheckResponse(res); err != nil {
8968		return nil, err
8969	}
8970	ret := &LogExclusion{
8971		ServerResponse: googleapi.ServerResponse{
8972			Header:         res.Header,
8973			HTTPStatusCode: res.StatusCode,
8974		},
8975	}
8976	target := &ret
8977	if err := gensupport.DecodeResponse(target, res); err != nil {
8978		return nil, err
8979	}
8980	return ret, nil
8981	// {
8982	//   "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.",
8983	//   "flatPath": "v2/folders/{foldersId}/exclusions",
8984	//   "httpMethod": "POST",
8985	//   "id": "logging.folders.exclusions.create",
8986	//   "parameterOrder": [
8987	//     "parent"
8988	//   ],
8989	//   "parameters": {
8990	//     "parent": {
8991	//       "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\".",
8992	//       "location": "path",
8993	//       "pattern": "^folders/[^/]+$",
8994	//       "required": true,
8995	//       "type": "string"
8996	//     }
8997	//   },
8998	//   "path": "v2/{+parent}/exclusions",
8999	//   "request": {
9000	//     "$ref": "LogExclusion"
9001	//   },
9002	//   "response": {
9003	//     "$ref": "LogExclusion"
9004	//   },
9005	//   "scopes": [
9006	//     "https://www.googleapis.com/auth/cloud-platform",
9007	//     "https://www.googleapis.com/auth/logging.admin"
9008	//   ]
9009	// }
9010
9011}
9012
9013// method id "logging.folders.exclusions.delete":
9014
9015type FoldersExclusionsDeleteCall struct {
9016	s          *Service
9017	name       string
9018	urlParams_ gensupport.URLParams
9019	ctx_       context.Context
9020	header_    http.Header
9021}
9022
9023// Delete: Deletes an exclusion.
9024//
9025// - name: The resource name of an existing exclusion to delete:
9026//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
9027//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
9028//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
9029//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example:
9030//   "projects/my-project-id/exclusions/my-exclusion-id".
9031func (r *FoldersExclusionsService) Delete(name string) *FoldersExclusionsDeleteCall {
9032	c := &FoldersExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9033	c.name = name
9034	return c
9035}
9036
9037// Fields allows partial responses to be retrieved. See
9038// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9039// for more information.
9040func (c *FoldersExclusionsDeleteCall) Fields(s ...googleapi.Field) *FoldersExclusionsDeleteCall {
9041	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9042	return c
9043}
9044
9045// Context sets the context to be used in this call's Do method. Any
9046// pending HTTP request will be aborted if the provided context is
9047// canceled.
9048func (c *FoldersExclusionsDeleteCall) Context(ctx context.Context) *FoldersExclusionsDeleteCall {
9049	c.ctx_ = ctx
9050	return c
9051}
9052
9053// Header returns an http.Header that can be modified by the caller to
9054// add HTTP headers to the request.
9055func (c *FoldersExclusionsDeleteCall) Header() http.Header {
9056	if c.header_ == nil {
9057		c.header_ = make(http.Header)
9058	}
9059	return c.header_
9060}
9061
9062func (c *FoldersExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) {
9063	reqHeaders := make(http.Header)
9064	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
9065	for k, v := range c.header_ {
9066		reqHeaders[k] = v
9067	}
9068	reqHeaders.Set("User-Agent", c.s.userAgent())
9069	var body io.Reader = nil
9070	c.urlParams_.Set("alt", alt)
9071	c.urlParams_.Set("prettyPrint", "false")
9072	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
9073	urls += "?" + c.urlParams_.Encode()
9074	req, err := http.NewRequest("DELETE", urls, body)
9075	if err != nil {
9076		return nil, err
9077	}
9078	req.Header = reqHeaders
9079	googleapi.Expand(req.URL, map[string]string{
9080		"name": c.name,
9081	})
9082	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9083}
9084
9085// Do executes the "logging.folders.exclusions.delete" call.
9086// Exactly one of *Empty or error will be non-nil. Any non-2xx status
9087// code is an error. Response headers are in either
9088// *Empty.ServerResponse.Header or (if a response was returned at all)
9089// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9090// check whether the returned error was because http.StatusNotModified
9091// was returned.
9092func (c *FoldersExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
9093	gensupport.SetOptions(c.urlParams_, opts...)
9094	res, err := c.doRequest("json")
9095	if res != nil && res.StatusCode == http.StatusNotModified {
9096		if res.Body != nil {
9097			res.Body.Close()
9098		}
9099		return nil, &googleapi.Error{
9100			Code:   res.StatusCode,
9101			Header: res.Header,
9102		}
9103	}
9104	if err != nil {
9105		return nil, err
9106	}
9107	defer googleapi.CloseBody(res)
9108	if err := googleapi.CheckResponse(res); err != nil {
9109		return nil, err
9110	}
9111	ret := &Empty{
9112		ServerResponse: googleapi.ServerResponse{
9113			Header:         res.Header,
9114			HTTPStatusCode: res.StatusCode,
9115		},
9116	}
9117	target := &ret
9118	if err := gensupport.DecodeResponse(target, res); err != nil {
9119		return nil, err
9120	}
9121	return ret, nil
9122	// {
9123	//   "description": "Deletes an exclusion.",
9124	//   "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}",
9125	//   "httpMethod": "DELETE",
9126	//   "id": "logging.folders.exclusions.delete",
9127	//   "parameterOrder": [
9128	//     "name"
9129	//   ],
9130	//   "parameters": {
9131	//     "name": {
9132	//       "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\".",
9133	//       "location": "path",
9134	//       "pattern": "^folders/[^/]+/exclusions/[^/]+$",
9135	//       "required": true,
9136	//       "type": "string"
9137	//     }
9138	//   },
9139	//   "path": "v2/{+name}",
9140	//   "response": {
9141	//     "$ref": "Empty"
9142	//   },
9143	//   "scopes": [
9144	//     "https://www.googleapis.com/auth/cloud-platform",
9145	//     "https://www.googleapis.com/auth/logging.admin"
9146	//   ]
9147	// }
9148
9149}
9150
9151// method id "logging.folders.exclusions.get":
9152
9153type FoldersExclusionsGetCall struct {
9154	s            *Service
9155	name         string
9156	urlParams_   gensupport.URLParams
9157	ifNoneMatch_ string
9158	ctx_         context.Context
9159	header_      http.Header
9160}
9161
9162// Get: Gets the description of an exclusion.
9163//
9164// - name: The resource name of an existing exclusion:
9165//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
9166//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
9167//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
9168//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example:
9169//   "projects/my-project-id/exclusions/my-exclusion-id".
9170func (r *FoldersExclusionsService) Get(name string) *FoldersExclusionsGetCall {
9171	c := &FoldersExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9172	c.name = name
9173	return c
9174}
9175
9176// Fields allows partial responses to be retrieved. See
9177// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9178// for more information.
9179func (c *FoldersExclusionsGetCall) Fields(s ...googleapi.Field) *FoldersExclusionsGetCall {
9180	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9181	return c
9182}
9183
9184// IfNoneMatch sets the optional parameter which makes the operation
9185// fail if the object's ETag matches the given value. This is useful for
9186// getting updates only after the object has changed since the last
9187// request. Use googleapi.IsNotModified to check whether the response
9188// error from Do is the result of In-None-Match.
9189func (c *FoldersExclusionsGetCall) IfNoneMatch(entityTag string) *FoldersExclusionsGetCall {
9190	c.ifNoneMatch_ = entityTag
9191	return c
9192}
9193
9194// Context sets the context to be used in this call's Do method. Any
9195// pending HTTP request will be aborted if the provided context is
9196// canceled.
9197func (c *FoldersExclusionsGetCall) Context(ctx context.Context) *FoldersExclusionsGetCall {
9198	c.ctx_ = ctx
9199	return c
9200}
9201
9202// Header returns an http.Header that can be modified by the caller to
9203// add HTTP headers to the request.
9204func (c *FoldersExclusionsGetCall) Header() http.Header {
9205	if c.header_ == nil {
9206		c.header_ = make(http.Header)
9207	}
9208	return c.header_
9209}
9210
9211func (c *FoldersExclusionsGetCall) doRequest(alt string) (*http.Response, error) {
9212	reqHeaders := make(http.Header)
9213	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
9214	for k, v := range c.header_ {
9215		reqHeaders[k] = v
9216	}
9217	reqHeaders.Set("User-Agent", c.s.userAgent())
9218	if c.ifNoneMatch_ != "" {
9219		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9220	}
9221	var body io.Reader = nil
9222	c.urlParams_.Set("alt", alt)
9223	c.urlParams_.Set("prettyPrint", "false")
9224	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
9225	urls += "?" + c.urlParams_.Encode()
9226	req, err := http.NewRequest("GET", urls, body)
9227	if err != nil {
9228		return nil, err
9229	}
9230	req.Header = reqHeaders
9231	googleapi.Expand(req.URL, map[string]string{
9232		"name": c.name,
9233	})
9234	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9235}
9236
9237// Do executes the "logging.folders.exclusions.get" call.
9238// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
9239// status code is an error. Response headers are in either
9240// *LogExclusion.ServerResponse.Header or (if a response was returned at
9241// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
9242// to check whether the returned error was because
9243// http.StatusNotModified was returned.
9244func (c *FoldersExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
9245	gensupport.SetOptions(c.urlParams_, opts...)
9246	res, err := c.doRequest("json")
9247	if res != nil && res.StatusCode == http.StatusNotModified {
9248		if res.Body != nil {
9249			res.Body.Close()
9250		}
9251		return nil, &googleapi.Error{
9252			Code:   res.StatusCode,
9253			Header: res.Header,
9254		}
9255	}
9256	if err != nil {
9257		return nil, err
9258	}
9259	defer googleapi.CloseBody(res)
9260	if err := googleapi.CheckResponse(res); err != nil {
9261		return nil, err
9262	}
9263	ret := &LogExclusion{
9264		ServerResponse: googleapi.ServerResponse{
9265			Header:         res.Header,
9266			HTTPStatusCode: res.StatusCode,
9267		},
9268	}
9269	target := &ret
9270	if err := gensupport.DecodeResponse(target, res); err != nil {
9271		return nil, err
9272	}
9273	return ret, nil
9274	// {
9275	//   "description": "Gets the description of an exclusion.",
9276	//   "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}",
9277	//   "httpMethod": "GET",
9278	//   "id": "logging.folders.exclusions.get",
9279	//   "parameterOrder": [
9280	//     "name"
9281	//   ],
9282	//   "parameters": {
9283	//     "name": {
9284	//       "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\".",
9285	//       "location": "path",
9286	//       "pattern": "^folders/[^/]+/exclusions/[^/]+$",
9287	//       "required": true,
9288	//       "type": "string"
9289	//     }
9290	//   },
9291	//   "path": "v2/{+name}",
9292	//   "response": {
9293	//     "$ref": "LogExclusion"
9294	//   },
9295	//   "scopes": [
9296	//     "https://www.googleapis.com/auth/cloud-platform",
9297	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
9298	//     "https://www.googleapis.com/auth/logging.admin",
9299	//     "https://www.googleapis.com/auth/logging.read"
9300	//   ]
9301	// }
9302
9303}
9304
9305// method id "logging.folders.exclusions.list":
9306
9307type FoldersExclusionsListCall struct {
9308	s            *Service
9309	parent       string
9310	urlParams_   gensupport.URLParams
9311	ifNoneMatch_ string
9312	ctx_         context.Context
9313	header_      http.Header
9314}
9315
9316// List: Lists all the exclusions in a parent resource.
9317//
9318// - parent: The parent resource whose exclusions are to be listed.
9319//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
9320//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]".
9321func (r *FoldersExclusionsService) List(parent string) *FoldersExclusionsListCall {
9322	c := &FoldersExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9323	c.parent = parent
9324	return c
9325}
9326
9327// PageSize sets the optional parameter "pageSize": The maximum number
9328// of results to return from this request. Non-positive values are
9329// ignored. The presence of nextPageToken in the response indicates that
9330// more results might be available.
9331func (c *FoldersExclusionsListCall) PageSize(pageSize int64) *FoldersExclusionsListCall {
9332	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
9333	return c
9334}
9335
9336// PageToken sets the optional parameter "pageToken": If present, then
9337// retrieve the next batch of results from the preceding call to this
9338// method. pageToken must be the value of nextPageToken from the
9339// previous response. The values of other method parameters should be
9340// identical to those in the previous call.
9341func (c *FoldersExclusionsListCall) PageToken(pageToken string) *FoldersExclusionsListCall {
9342	c.urlParams_.Set("pageToken", pageToken)
9343	return c
9344}
9345
9346// Fields allows partial responses to be retrieved. See
9347// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9348// for more information.
9349func (c *FoldersExclusionsListCall) Fields(s ...googleapi.Field) *FoldersExclusionsListCall {
9350	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9351	return c
9352}
9353
9354// IfNoneMatch sets the optional parameter which makes the operation
9355// fail if the object's ETag matches the given value. This is useful for
9356// getting updates only after the object has changed since the last
9357// request. Use googleapi.IsNotModified to check whether the response
9358// error from Do is the result of In-None-Match.
9359func (c *FoldersExclusionsListCall) IfNoneMatch(entityTag string) *FoldersExclusionsListCall {
9360	c.ifNoneMatch_ = entityTag
9361	return c
9362}
9363
9364// Context sets the context to be used in this call's Do method. Any
9365// pending HTTP request will be aborted if the provided context is
9366// canceled.
9367func (c *FoldersExclusionsListCall) Context(ctx context.Context) *FoldersExclusionsListCall {
9368	c.ctx_ = ctx
9369	return c
9370}
9371
9372// Header returns an http.Header that can be modified by the caller to
9373// add HTTP headers to the request.
9374func (c *FoldersExclusionsListCall) Header() http.Header {
9375	if c.header_ == nil {
9376		c.header_ = make(http.Header)
9377	}
9378	return c.header_
9379}
9380
9381func (c *FoldersExclusionsListCall) doRequest(alt string) (*http.Response, error) {
9382	reqHeaders := make(http.Header)
9383	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
9384	for k, v := range c.header_ {
9385		reqHeaders[k] = v
9386	}
9387	reqHeaders.Set("User-Agent", c.s.userAgent())
9388	if c.ifNoneMatch_ != "" {
9389		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9390	}
9391	var body io.Reader = nil
9392	c.urlParams_.Set("alt", alt)
9393	c.urlParams_.Set("prettyPrint", "false")
9394	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
9395	urls += "?" + c.urlParams_.Encode()
9396	req, err := http.NewRequest("GET", urls, body)
9397	if err != nil {
9398		return nil, err
9399	}
9400	req.Header = reqHeaders
9401	googleapi.Expand(req.URL, map[string]string{
9402		"parent": c.parent,
9403	})
9404	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9405}
9406
9407// Do executes the "logging.folders.exclusions.list" call.
9408// Exactly one of *ListExclusionsResponse or error will be non-nil. Any
9409// non-2xx status code is an error. Response headers are in either
9410// *ListExclusionsResponse.ServerResponse.Header or (if a response was
9411// returned at all) in error.(*googleapi.Error).Header. Use
9412// googleapi.IsNotModified to check whether the returned error was
9413// because http.StatusNotModified was returned.
9414func (c *FoldersExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) {
9415	gensupport.SetOptions(c.urlParams_, opts...)
9416	res, err := c.doRequest("json")
9417	if res != nil && res.StatusCode == http.StatusNotModified {
9418		if res.Body != nil {
9419			res.Body.Close()
9420		}
9421		return nil, &googleapi.Error{
9422			Code:   res.StatusCode,
9423			Header: res.Header,
9424		}
9425	}
9426	if err != nil {
9427		return nil, err
9428	}
9429	defer googleapi.CloseBody(res)
9430	if err := googleapi.CheckResponse(res); err != nil {
9431		return nil, err
9432	}
9433	ret := &ListExclusionsResponse{
9434		ServerResponse: googleapi.ServerResponse{
9435			Header:         res.Header,
9436			HTTPStatusCode: res.StatusCode,
9437		},
9438	}
9439	target := &ret
9440	if err := gensupport.DecodeResponse(target, res); err != nil {
9441		return nil, err
9442	}
9443	return ret, nil
9444	// {
9445	//   "description": "Lists all the exclusions in a parent resource.",
9446	//   "flatPath": "v2/folders/{foldersId}/exclusions",
9447	//   "httpMethod": "GET",
9448	//   "id": "logging.folders.exclusions.list",
9449	//   "parameterOrder": [
9450	//     "parent"
9451	//   ],
9452	//   "parameters": {
9453	//     "pageSize": {
9454	//       "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.",
9455	//       "format": "int32",
9456	//       "location": "query",
9457	//       "type": "integer"
9458	//     },
9459	//     "pageToken": {
9460	//       "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.",
9461	//       "location": "query",
9462	//       "type": "string"
9463	//     },
9464	//     "parent": {
9465	//       "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
9466	//       "location": "path",
9467	//       "pattern": "^folders/[^/]+$",
9468	//       "required": true,
9469	//       "type": "string"
9470	//     }
9471	//   },
9472	//   "path": "v2/{+parent}/exclusions",
9473	//   "response": {
9474	//     "$ref": "ListExclusionsResponse"
9475	//   },
9476	//   "scopes": [
9477	//     "https://www.googleapis.com/auth/cloud-platform",
9478	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
9479	//     "https://www.googleapis.com/auth/logging.admin",
9480	//     "https://www.googleapis.com/auth/logging.read"
9481	//   ]
9482	// }
9483
9484}
9485
9486// Pages invokes f for each page of results.
9487// A non-nil error returned from f will halt the iteration.
9488// The provided context supersedes any context provided to the Context method.
9489func (c *FoldersExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error {
9490	c.ctx_ = ctx
9491	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
9492	for {
9493		x, err := c.Do()
9494		if err != nil {
9495			return err
9496		}
9497		if err := f(x); err != nil {
9498			return err
9499		}
9500		if x.NextPageToken == "" {
9501			return nil
9502		}
9503		c.PageToken(x.NextPageToken)
9504	}
9505}
9506
9507// method id "logging.folders.exclusions.patch":
9508
9509type FoldersExclusionsPatchCall struct {
9510	s            *Service
9511	name         string
9512	logexclusion *LogExclusion
9513	urlParams_   gensupport.URLParams
9514	ctx_         context.Context
9515	header_      http.Header
9516}
9517
9518// Patch: Changes one or more properties of an existing exclusion.
9519//
9520// - name: The resource name of the exclusion to update:
9521//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
9522//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
9523//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
9524//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example:
9525//   "projects/my-project-id/exclusions/my-exclusion-id".
9526func (r *FoldersExclusionsService) Patch(name string, logexclusion *LogExclusion) *FoldersExclusionsPatchCall {
9527	c := &FoldersExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9528	c.name = name
9529	c.logexclusion = logexclusion
9530	return c
9531}
9532
9533// UpdateMask sets the optional parameter "updateMask": Required. A
9534// non-empty list of fields to change in the existing exclusion. New
9535// values for the fields are taken from the corresponding fields in the
9536// LogExclusion included in this request. Fields not mentioned in
9537// update_mask are not changed and are ignored in the request.For
9538// example, to change the filter and description of an exclusion,
9539// specify an update_mask of "filter,description".
9540func (c *FoldersExclusionsPatchCall) UpdateMask(updateMask string) *FoldersExclusionsPatchCall {
9541	c.urlParams_.Set("updateMask", updateMask)
9542	return c
9543}
9544
9545// Fields allows partial responses to be retrieved. See
9546// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9547// for more information.
9548func (c *FoldersExclusionsPatchCall) Fields(s ...googleapi.Field) *FoldersExclusionsPatchCall {
9549	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9550	return c
9551}
9552
9553// Context sets the context to be used in this call's Do method. Any
9554// pending HTTP request will be aborted if the provided context is
9555// canceled.
9556func (c *FoldersExclusionsPatchCall) Context(ctx context.Context) *FoldersExclusionsPatchCall {
9557	c.ctx_ = ctx
9558	return c
9559}
9560
9561// Header returns an http.Header that can be modified by the caller to
9562// add HTTP headers to the request.
9563func (c *FoldersExclusionsPatchCall) Header() http.Header {
9564	if c.header_ == nil {
9565		c.header_ = make(http.Header)
9566	}
9567	return c.header_
9568}
9569
9570func (c *FoldersExclusionsPatchCall) doRequest(alt string) (*http.Response, error) {
9571	reqHeaders := make(http.Header)
9572	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
9573	for k, v := range c.header_ {
9574		reqHeaders[k] = v
9575	}
9576	reqHeaders.Set("User-Agent", c.s.userAgent())
9577	var body io.Reader = nil
9578	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
9579	if err != nil {
9580		return nil, err
9581	}
9582	reqHeaders.Set("Content-Type", "application/json")
9583	c.urlParams_.Set("alt", alt)
9584	c.urlParams_.Set("prettyPrint", "false")
9585	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
9586	urls += "?" + c.urlParams_.Encode()
9587	req, err := http.NewRequest("PATCH", urls, body)
9588	if err != nil {
9589		return nil, err
9590	}
9591	req.Header = reqHeaders
9592	googleapi.Expand(req.URL, map[string]string{
9593		"name": c.name,
9594	})
9595	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9596}
9597
9598// Do executes the "logging.folders.exclusions.patch" call.
9599// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
9600// status code is an error. Response headers are in either
9601// *LogExclusion.ServerResponse.Header or (if a response was returned at
9602// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
9603// to check whether the returned error was because
9604// http.StatusNotModified was returned.
9605func (c *FoldersExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
9606	gensupport.SetOptions(c.urlParams_, opts...)
9607	res, err := c.doRequest("json")
9608	if res != nil && res.StatusCode == http.StatusNotModified {
9609		if res.Body != nil {
9610			res.Body.Close()
9611		}
9612		return nil, &googleapi.Error{
9613			Code:   res.StatusCode,
9614			Header: res.Header,
9615		}
9616	}
9617	if err != nil {
9618		return nil, err
9619	}
9620	defer googleapi.CloseBody(res)
9621	if err := googleapi.CheckResponse(res); err != nil {
9622		return nil, err
9623	}
9624	ret := &LogExclusion{
9625		ServerResponse: googleapi.ServerResponse{
9626			Header:         res.Header,
9627			HTTPStatusCode: res.StatusCode,
9628		},
9629	}
9630	target := &ret
9631	if err := gensupport.DecodeResponse(target, res); err != nil {
9632		return nil, err
9633	}
9634	return ret, nil
9635	// {
9636	//   "description": "Changes one or more properties of an existing exclusion.",
9637	//   "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}",
9638	//   "httpMethod": "PATCH",
9639	//   "id": "logging.folders.exclusions.patch",
9640	//   "parameterOrder": [
9641	//     "name"
9642	//   ],
9643	//   "parameters": {
9644	//     "name": {
9645	//       "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\".",
9646	//       "location": "path",
9647	//       "pattern": "^folders/[^/]+/exclusions/[^/]+$",
9648	//       "required": true,
9649	//       "type": "string"
9650	//     },
9651	//     "updateMask": {
9652	//       "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\".",
9653	//       "format": "google-fieldmask",
9654	//       "location": "query",
9655	//       "type": "string"
9656	//     }
9657	//   },
9658	//   "path": "v2/{+name}",
9659	//   "request": {
9660	//     "$ref": "LogExclusion"
9661	//   },
9662	//   "response": {
9663	//     "$ref": "LogExclusion"
9664	//   },
9665	//   "scopes": [
9666	//     "https://www.googleapis.com/auth/cloud-platform",
9667	//     "https://www.googleapis.com/auth/logging.admin"
9668	//   ]
9669	// }
9670
9671}
9672
9673// method id "logging.folders.locations.get":
9674
9675type FoldersLocationsGetCall struct {
9676	s            *Service
9677	name         string
9678	urlParams_   gensupport.URLParams
9679	ifNoneMatch_ string
9680	ctx_         context.Context
9681	header_      http.Header
9682}
9683
9684// Get: Gets information about a location.
9685//
9686// - name: Resource name for the location.
9687func (r *FoldersLocationsService) Get(name string) *FoldersLocationsGetCall {
9688	c := &FoldersLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9689	c.name = name
9690	return c
9691}
9692
9693// Fields allows partial responses to be retrieved. See
9694// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9695// for more information.
9696func (c *FoldersLocationsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsGetCall {
9697	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9698	return c
9699}
9700
9701// IfNoneMatch sets the optional parameter which makes the operation
9702// fail if the object's ETag matches the given value. This is useful for
9703// getting updates only after the object has changed since the last
9704// request. Use googleapi.IsNotModified to check whether the response
9705// error from Do is the result of In-None-Match.
9706func (c *FoldersLocationsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsGetCall {
9707	c.ifNoneMatch_ = entityTag
9708	return c
9709}
9710
9711// Context sets the context to be used in this call's Do method. Any
9712// pending HTTP request will be aborted if the provided context is
9713// canceled.
9714func (c *FoldersLocationsGetCall) Context(ctx context.Context) *FoldersLocationsGetCall {
9715	c.ctx_ = ctx
9716	return c
9717}
9718
9719// Header returns an http.Header that can be modified by the caller to
9720// add HTTP headers to the request.
9721func (c *FoldersLocationsGetCall) Header() http.Header {
9722	if c.header_ == nil {
9723		c.header_ = make(http.Header)
9724	}
9725	return c.header_
9726}
9727
9728func (c *FoldersLocationsGetCall) doRequest(alt string) (*http.Response, error) {
9729	reqHeaders := make(http.Header)
9730	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
9731	for k, v := range c.header_ {
9732		reqHeaders[k] = v
9733	}
9734	reqHeaders.Set("User-Agent", c.s.userAgent())
9735	if c.ifNoneMatch_ != "" {
9736		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9737	}
9738	var body io.Reader = nil
9739	c.urlParams_.Set("alt", alt)
9740	c.urlParams_.Set("prettyPrint", "false")
9741	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
9742	urls += "?" + c.urlParams_.Encode()
9743	req, err := http.NewRequest("GET", urls, body)
9744	if err != nil {
9745		return nil, err
9746	}
9747	req.Header = reqHeaders
9748	googleapi.Expand(req.URL, map[string]string{
9749		"name": c.name,
9750	})
9751	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9752}
9753
9754// Do executes the "logging.folders.locations.get" call.
9755// Exactly one of *Location or error will be non-nil. Any non-2xx status
9756// code is an error. Response headers are in either
9757// *Location.ServerResponse.Header or (if a response was returned at
9758// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
9759// to check whether the returned error was because
9760// http.StatusNotModified was returned.
9761func (c *FoldersLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
9762	gensupport.SetOptions(c.urlParams_, opts...)
9763	res, err := c.doRequest("json")
9764	if res != nil && res.StatusCode == http.StatusNotModified {
9765		if res.Body != nil {
9766			res.Body.Close()
9767		}
9768		return nil, &googleapi.Error{
9769			Code:   res.StatusCode,
9770			Header: res.Header,
9771		}
9772	}
9773	if err != nil {
9774		return nil, err
9775	}
9776	defer googleapi.CloseBody(res)
9777	if err := googleapi.CheckResponse(res); err != nil {
9778		return nil, err
9779	}
9780	ret := &Location{
9781		ServerResponse: googleapi.ServerResponse{
9782			Header:         res.Header,
9783			HTTPStatusCode: res.StatusCode,
9784		},
9785	}
9786	target := &ret
9787	if err := gensupport.DecodeResponse(target, res); err != nil {
9788		return nil, err
9789	}
9790	return ret, nil
9791	// {
9792	//   "description": "Gets information about a location.",
9793	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}",
9794	//   "httpMethod": "GET",
9795	//   "id": "logging.folders.locations.get",
9796	//   "parameterOrder": [
9797	//     "name"
9798	//   ],
9799	//   "parameters": {
9800	//     "name": {
9801	//       "description": "Resource name for the location.",
9802	//       "location": "path",
9803	//       "pattern": "^folders/[^/]+/locations/[^/]+$",
9804	//       "required": true,
9805	//       "type": "string"
9806	//     }
9807	//   },
9808	//   "path": "v2/{+name}",
9809	//   "response": {
9810	//     "$ref": "Location"
9811	//   },
9812	//   "scopes": [
9813	//     "https://www.googleapis.com/auth/cloud-platform",
9814	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
9815	//     "https://www.googleapis.com/auth/logging.admin",
9816	//     "https://www.googleapis.com/auth/logging.read"
9817	//   ]
9818	// }
9819
9820}
9821
9822// method id "logging.folders.locations.list":
9823
9824type FoldersLocationsListCall struct {
9825	s            *Service
9826	name         string
9827	urlParams_   gensupport.URLParams
9828	ifNoneMatch_ string
9829	ctx_         context.Context
9830	header_      http.Header
9831}
9832
9833// List: Lists information about the supported locations for this
9834// service.
9835//
9836// - name: The resource that owns the locations collection, if
9837//   applicable.
9838func (r *FoldersLocationsService) List(name string) *FoldersLocationsListCall {
9839	c := &FoldersLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9840	c.name = name
9841	return c
9842}
9843
9844// Filter sets the optional parameter "filter": A filter to narrow down
9845// results to a preferred subset. The filtering language accepts strings
9846// like "displayName=tokyo", and is documented in more detail in AIP-160
9847// (https://google.aip.dev/160).
9848func (c *FoldersLocationsListCall) Filter(filter string) *FoldersLocationsListCall {
9849	c.urlParams_.Set("filter", filter)
9850	return c
9851}
9852
9853// PageSize sets the optional parameter "pageSize": The maximum number
9854// of results to return. If not set, the service selects a default.
9855func (c *FoldersLocationsListCall) PageSize(pageSize int64) *FoldersLocationsListCall {
9856	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
9857	return c
9858}
9859
9860// PageToken sets the optional parameter "pageToken": A page token
9861// received from the next_page_token field in the response. Send that
9862// page token to receive the subsequent page.
9863func (c *FoldersLocationsListCall) PageToken(pageToken string) *FoldersLocationsListCall {
9864	c.urlParams_.Set("pageToken", pageToken)
9865	return c
9866}
9867
9868// Fields allows partial responses to be retrieved. See
9869// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9870// for more information.
9871func (c *FoldersLocationsListCall) Fields(s ...googleapi.Field) *FoldersLocationsListCall {
9872	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9873	return c
9874}
9875
9876// IfNoneMatch sets the optional parameter which makes the operation
9877// fail if the object's ETag matches the given value. This is useful for
9878// getting updates only after the object has changed since the last
9879// request. Use googleapi.IsNotModified to check whether the response
9880// error from Do is the result of In-None-Match.
9881func (c *FoldersLocationsListCall) IfNoneMatch(entityTag string) *FoldersLocationsListCall {
9882	c.ifNoneMatch_ = entityTag
9883	return c
9884}
9885
9886// Context sets the context to be used in this call's Do method. Any
9887// pending HTTP request will be aborted if the provided context is
9888// canceled.
9889func (c *FoldersLocationsListCall) Context(ctx context.Context) *FoldersLocationsListCall {
9890	c.ctx_ = ctx
9891	return c
9892}
9893
9894// Header returns an http.Header that can be modified by the caller to
9895// add HTTP headers to the request.
9896func (c *FoldersLocationsListCall) Header() http.Header {
9897	if c.header_ == nil {
9898		c.header_ = make(http.Header)
9899	}
9900	return c.header_
9901}
9902
9903func (c *FoldersLocationsListCall) doRequest(alt string) (*http.Response, error) {
9904	reqHeaders := make(http.Header)
9905	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
9906	for k, v := range c.header_ {
9907		reqHeaders[k] = v
9908	}
9909	reqHeaders.Set("User-Agent", c.s.userAgent())
9910	if c.ifNoneMatch_ != "" {
9911		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9912	}
9913	var body io.Reader = nil
9914	c.urlParams_.Set("alt", alt)
9915	c.urlParams_.Set("prettyPrint", "false")
9916	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations")
9917	urls += "?" + c.urlParams_.Encode()
9918	req, err := http.NewRequest("GET", urls, body)
9919	if err != nil {
9920		return nil, err
9921	}
9922	req.Header = reqHeaders
9923	googleapi.Expand(req.URL, map[string]string{
9924		"name": c.name,
9925	})
9926	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9927}
9928
9929// Do executes the "logging.folders.locations.list" call.
9930// Exactly one of *ListLocationsResponse or error will be non-nil. Any
9931// non-2xx status code is an error. Response headers are in either
9932// *ListLocationsResponse.ServerResponse.Header or (if a response was
9933// returned at all) in error.(*googleapi.Error).Header. Use
9934// googleapi.IsNotModified to check whether the returned error was
9935// because http.StatusNotModified was returned.
9936func (c *FoldersLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
9937	gensupport.SetOptions(c.urlParams_, opts...)
9938	res, err := c.doRequest("json")
9939	if res != nil && res.StatusCode == http.StatusNotModified {
9940		if res.Body != nil {
9941			res.Body.Close()
9942		}
9943		return nil, &googleapi.Error{
9944			Code:   res.StatusCode,
9945			Header: res.Header,
9946		}
9947	}
9948	if err != nil {
9949		return nil, err
9950	}
9951	defer googleapi.CloseBody(res)
9952	if err := googleapi.CheckResponse(res); err != nil {
9953		return nil, err
9954	}
9955	ret := &ListLocationsResponse{
9956		ServerResponse: googleapi.ServerResponse{
9957			Header:         res.Header,
9958			HTTPStatusCode: res.StatusCode,
9959		},
9960	}
9961	target := &ret
9962	if err := gensupport.DecodeResponse(target, res); err != nil {
9963		return nil, err
9964	}
9965	return ret, nil
9966	// {
9967	//   "description": "Lists information about the supported locations for this service.",
9968	//   "flatPath": "v2/folders/{foldersId}/locations",
9969	//   "httpMethod": "GET",
9970	//   "id": "logging.folders.locations.list",
9971	//   "parameterOrder": [
9972	//     "name"
9973	//   ],
9974	//   "parameters": {
9975	//     "filter": {
9976	//       "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like \"displayName=tokyo\", and is documented in more detail in AIP-160 (https://google.aip.dev/160).",
9977	//       "location": "query",
9978	//       "type": "string"
9979	//     },
9980	//     "name": {
9981	//       "description": "The resource that owns the locations collection, if applicable.",
9982	//       "location": "path",
9983	//       "pattern": "^folders/[^/]+$",
9984	//       "required": true,
9985	//       "type": "string"
9986	//     },
9987	//     "pageSize": {
9988	//       "description": "The maximum number of results to return. If not set, the service selects a default.",
9989	//       "format": "int32",
9990	//       "location": "query",
9991	//       "type": "integer"
9992	//     },
9993	//     "pageToken": {
9994	//       "description": "A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.",
9995	//       "location": "query",
9996	//       "type": "string"
9997	//     }
9998	//   },
9999	//   "path": "v2/{+name}/locations",
10000	//   "response": {
10001	//     "$ref": "ListLocationsResponse"
10002	//   },
10003	//   "scopes": [
10004	//     "https://www.googleapis.com/auth/cloud-platform",
10005	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
10006	//     "https://www.googleapis.com/auth/logging.admin",
10007	//     "https://www.googleapis.com/auth/logging.read"
10008	//   ]
10009	// }
10010
10011}
10012
10013// Pages invokes f for each page of results.
10014// A non-nil error returned from f will halt the iteration.
10015// The provided context supersedes any context provided to the Context method.
10016func (c *FoldersLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
10017	c.ctx_ = ctx
10018	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
10019	for {
10020		x, err := c.Do()
10021		if err != nil {
10022			return err
10023		}
10024		if err := f(x); err != nil {
10025			return err
10026		}
10027		if x.NextPageToken == "" {
10028			return nil
10029		}
10030		c.PageToken(x.NextPageToken)
10031	}
10032}
10033
10034// method id "logging.folders.locations.buckets.create":
10035
10036type FoldersLocationsBucketsCreateCall struct {
10037	s          *Service
10038	parent     string
10039	logbucket  *LogBucket
10040	urlParams_ gensupport.URLParams
10041	ctx_       context.Context
10042	header_    http.Header
10043}
10044
10045// Create: Creates a bucket that can be used to store log entries. Once
10046// a bucket has been created, the region cannot be changed.
10047//
10048// - parent: The resource in which to create the bucket:
10049//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]" Example:
10050//   "projects/my-logging-project/locations/global".
10051func (r *FoldersLocationsBucketsService) Create(parent string, logbucket *LogBucket) *FoldersLocationsBucketsCreateCall {
10052	c := &FoldersLocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10053	c.parent = parent
10054	c.logbucket = logbucket
10055	return c
10056}
10057
10058// BucketId sets the optional parameter "bucketId": Required. A
10059// client-assigned identifier such as "my-bucket". Identifiers are
10060// limited to 100 characters and can include only letters, digits,
10061// underscores, hyphens, and periods.
10062func (c *FoldersLocationsBucketsCreateCall) BucketId(bucketId string) *FoldersLocationsBucketsCreateCall {
10063	c.urlParams_.Set("bucketId", bucketId)
10064	return c
10065}
10066
10067// Fields allows partial responses to be retrieved. See
10068// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10069// for more information.
10070func (c *FoldersLocationsBucketsCreateCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsCreateCall {
10071	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10072	return c
10073}
10074
10075// Context sets the context to be used in this call's Do method. Any
10076// pending HTTP request will be aborted if the provided context is
10077// canceled.
10078func (c *FoldersLocationsBucketsCreateCall) Context(ctx context.Context) *FoldersLocationsBucketsCreateCall {
10079	c.ctx_ = ctx
10080	return c
10081}
10082
10083// Header returns an http.Header that can be modified by the caller to
10084// add HTTP headers to the request.
10085func (c *FoldersLocationsBucketsCreateCall) Header() http.Header {
10086	if c.header_ == nil {
10087		c.header_ = make(http.Header)
10088	}
10089	return c.header_
10090}
10091
10092func (c *FoldersLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) {
10093	reqHeaders := make(http.Header)
10094	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
10095	for k, v := range c.header_ {
10096		reqHeaders[k] = v
10097	}
10098	reqHeaders.Set("User-Agent", c.s.userAgent())
10099	var body io.Reader = nil
10100	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
10101	if err != nil {
10102		return nil, err
10103	}
10104	reqHeaders.Set("Content-Type", "application/json")
10105	c.urlParams_.Set("alt", alt)
10106	c.urlParams_.Set("prettyPrint", "false")
10107	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
10108	urls += "?" + c.urlParams_.Encode()
10109	req, err := http.NewRequest("POST", urls, body)
10110	if err != nil {
10111		return nil, err
10112	}
10113	req.Header = reqHeaders
10114	googleapi.Expand(req.URL, map[string]string{
10115		"parent": c.parent,
10116	})
10117	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10118}
10119
10120// Do executes the "logging.folders.locations.buckets.create" call.
10121// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
10122// status code is an error. Response headers are in either
10123// *LogBucket.ServerResponse.Header or (if a response was returned at
10124// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
10125// to check whether the returned error was because
10126// http.StatusNotModified was returned.
10127func (c *FoldersLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
10128	gensupport.SetOptions(c.urlParams_, opts...)
10129	res, err := c.doRequest("json")
10130	if res != nil && res.StatusCode == http.StatusNotModified {
10131		if res.Body != nil {
10132			res.Body.Close()
10133		}
10134		return nil, &googleapi.Error{
10135			Code:   res.StatusCode,
10136			Header: res.Header,
10137		}
10138	}
10139	if err != nil {
10140		return nil, err
10141	}
10142	defer googleapi.CloseBody(res)
10143	if err := googleapi.CheckResponse(res); err != nil {
10144		return nil, err
10145	}
10146	ret := &LogBucket{
10147		ServerResponse: googleapi.ServerResponse{
10148			Header:         res.Header,
10149			HTTPStatusCode: res.StatusCode,
10150		},
10151	}
10152	target := &ret
10153	if err := gensupport.DecodeResponse(target, res); err != nil {
10154		return nil, err
10155	}
10156	return ret, nil
10157	// {
10158	//   "description": "Creates a bucket that can be used to store log entries. Once a bucket has been created, the region cannot be changed.",
10159	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets",
10160	//   "httpMethod": "POST",
10161	//   "id": "logging.folders.locations.buckets.create",
10162	//   "parameterOrder": [
10163	//     "parent"
10164	//   ],
10165	//   "parameters": {
10166	//     "bucketId": {
10167	//       "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.",
10168	//       "location": "query",
10169	//       "type": "string"
10170	//     },
10171	//     "parent": {
10172	//       "description": "Required. The resource in which to create the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" Example: \"projects/my-logging-project/locations/global\"",
10173	//       "location": "path",
10174	//       "pattern": "^folders/[^/]+/locations/[^/]+$",
10175	//       "required": true,
10176	//       "type": "string"
10177	//     }
10178	//   },
10179	//   "path": "v2/{+parent}/buckets",
10180	//   "request": {
10181	//     "$ref": "LogBucket"
10182	//   },
10183	//   "response": {
10184	//     "$ref": "LogBucket"
10185	//   },
10186	//   "scopes": [
10187	//     "https://www.googleapis.com/auth/cloud-platform",
10188	//     "https://www.googleapis.com/auth/logging.admin"
10189	//   ]
10190	// }
10191
10192}
10193
10194// method id "logging.folders.locations.buckets.delete":
10195
10196type FoldersLocationsBucketsDeleteCall struct {
10197	s          *Service
10198	name       string
10199	urlParams_ gensupport.URLParams
10200	ctx_       context.Context
10201	header_    http.Header
10202}
10203
10204// Delete: Deletes a bucket. Moves the bucket to the DELETE_REQUESTED
10205// state. After 7 days, the bucket will be purged and all logs in the
10206// bucket will be permanently deleted.
10207//
10208// - name: The full resource name of the bucket to delete.
10209//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
10210//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
10211//   CKET_ID]"
10212//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
10213//   s/[BUCKET_ID]"
10214//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
10215//   Example:
10216//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id".
10217func (r *FoldersLocationsBucketsService) Delete(name string) *FoldersLocationsBucketsDeleteCall {
10218	c := &FoldersLocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10219	c.name = name
10220	return c
10221}
10222
10223// Fields allows partial responses to be retrieved. See
10224// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10225// for more information.
10226func (c *FoldersLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsDeleteCall {
10227	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10228	return c
10229}
10230
10231// Context sets the context to be used in this call's Do method. Any
10232// pending HTTP request will be aborted if the provided context is
10233// canceled.
10234func (c *FoldersLocationsBucketsDeleteCall) Context(ctx context.Context) *FoldersLocationsBucketsDeleteCall {
10235	c.ctx_ = ctx
10236	return c
10237}
10238
10239// Header returns an http.Header that can be modified by the caller to
10240// add HTTP headers to the request.
10241func (c *FoldersLocationsBucketsDeleteCall) Header() http.Header {
10242	if c.header_ == nil {
10243		c.header_ = make(http.Header)
10244	}
10245	return c.header_
10246}
10247
10248func (c *FoldersLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
10249	reqHeaders := make(http.Header)
10250	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
10251	for k, v := range c.header_ {
10252		reqHeaders[k] = v
10253	}
10254	reqHeaders.Set("User-Agent", c.s.userAgent())
10255	var body io.Reader = nil
10256	c.urlParams_.Set("alt", alt)
10257	c.urlParams_.Set("prettyPrint", "false")
10258	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
10259	urls += "?" + c.urlParams_.Encode()
10260	req, err := http.NewRequest("DELETE", urls, body)
10261	if err != nil {
10262		return nil, err
10263	}
10264	req.Header = reqHeaders
10265	googleapi.Expand(req.URL, map[string]string{
10266		"name": c.name,
10267	})
10268	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10269}
10270
10271// Do executes the "logging.folders.locations.buckets.delete" call.
10272// Exactly one of *Empty or error will be non-nil. Any non-2xx status
10273// code is an error. Response headers are in either
10274// *Empty.ServerResponse.Header or (if a response was returned at all)
10275// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10276// check whether the returned error was because http.StatusNotModified
10277// was returned.
10278func (c *FoldersLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
10279	gensupport.SetOptions(c.urlParams_, opts...)
10280	res, err := c.doRequest("json")
10281	if res != nil && res.StatusCode == http.StatusNotModified {
10282		if res.Body != nil {
10283			res.Body.Close()
10284		}
10285		return nil, &googleapi.Error{
10286			Code:   res.StatusCode,
10287			Header: res.Header,
10288		}
10289	}
10290	if err != nil {
10291		return nil, err
10292	}
10293	defer googleapi.CloseBody(res)
10294	if err := googleapi.CheckResponse(res); err != nil {
10295		return nil, err
10296	}
10297	ret := &Empty{
10298		ServerResponse: googleapi.ServerResponse{
10299			Header:         res.Header,
10300			HTTPStatusCode: res.StatusCode,
10301		},
10302	}
10303	target := &ret
10304	if err := gensupport.DecodeResponse(target, res); err != nil {
10305		return nil, err
10306	}
10307	return ret, nil
10308	// {
10309	//   "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.",
10310	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}",
10311	//   "httpMethod": "DELETE",
10312	//   "id": "logging.folders.locations.buckets.delete",
10313	//   "parameterOrder": [
10314	//     "name"
10315	//   ],
10316	//   "parameters": {
10317	//     "name": {
10318	//       "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\".",
10319	//       "location": "path",
10320	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$",
10321	//       "required": true,
10322	//       "type": "string"
10323	//     }
10324	//   },
10325	//   "path": "v2/{+name}",
10326	//   "response": {
10327	//     "$ref": "Empty"
10328	//   },
10329	//   "scopes": [
10330	//     "https://www.googleapis.com/auth/cloud-platform",
10331	//     "https://www.googleapis.com/auth/logging.admin"
10332	//   ]
10333	// }
10334
10335}
10336
10337// method id "logging.folders.locations.buckets.get":
10338
10339type FoldersLocationsBucketsGetCall struct {
10340	s            *Service
10341	name         string
10342	urlParams_   gensupport.URLParams
10343	ifNoneMatch_ string
10344	ctx_         context.Context
10345	header_      http.Header
10346}
10347
10348// Get: Gets a bucket.
10349//
10350// - name: The resource name of the bucket:
10351//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
10352//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
10353//   CKET_ID]"
10354//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
10355//   s/[BUCKET_ID]"
10356//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
10357//   Example:
10358//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id".
10359func (r *FoldersLocationsBucketsService) Get(name string) *FoldersLocationsBucketsGetCall {
10360	c := &FoldersLocationsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10361	c.name = name
10362	return c
10363}
10364
10365// Fields allows partial responses to be retrieved. See
10366// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10367// for more information.
10368func (c *FoldersLocationsBucketsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsGetCall {
10369	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10370	return c
10371}
10372
10373// IfNoneMatch sets the optional parameter which makes the operation
10374// fail if the object's ETag matches the given value. This is useful for
10375// getting updates only after the object has changed since the last
10376// request. Use googleapi.IsNotModified to check whether the response
10377// error from Do is the result of In-None-Match.
10378func (c *FoldersLocationsBucketsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsGetCall {
10379	c.ifNoneMatch_ = entityTag
10380	return c
10381}
10382
10383// Context sets the context to be used in this call's Do method. Any
10384// pending HTTP request will be aborted if the provided context is
10385// canceled.
10386func (c *FoldersLocationsBucketsGetCall) Context(ctx context.Context) *FoldersLocationsBucketsGetCall {
10387	c.ctx_ = ctx
10388	return c
10389}
10390
10391// Header returns an http.Header that can be modified by the caller to
10392// add HTTP headers to the request.
10393func (c *FoldersLocationsBucketsGetCall) Header() http.Header {
10394	if c.header_ == nil {
10395		c.header_ = make(http.Header)
10396	}
10397	return c.header_
10398}
10399
10400func (c *FoldersLocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) {
10401	reqHeaders := make(http.Header)
10402	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
10403	for k, v := range c.header_ {
10404		reqHeaders[k] = v
10405	}
10406	reqHeaders.Set("User-Agent", c.s.userAgent())
10407	if c.ifNoneMatch_ != "" {
10408		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10409	}
10410	var body io.Reader = nil
10411	c.urlParams_.Set("alt", alt)
10412	c.urlParams_.Set("prettyPrint", "false")
10413	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
10414	urls += "?" + c.urlParams_.Encode()
10415	req, err := http.NewRequest("GET", urls, body)
10416	if err != nil {
10417		return nil, err
10418	}
10419	req.Header = reqHeaders
10420	googleapi.Expand(req.URL, map[string]string{
10421		"name": c.name,
10422	})
10423	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10424}
10425
10426// Do executes the "logging.folders.locations.buckets.get" call.
10427// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
10428// status code is an error. Response headers are in either
10429// *LogBucket.ServerResponse.Header or (if a response was returned at
10430// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
10431// to check whether the returned error was because
10432// http.StatusNotModified was returned.
10433func (c *FoldersLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
10434	gensupport.SetOptions(c.urlParams_, opts...)
10435	res, err := c.doRequest("json")
10436	if res != nil && res.StatusCode == http.StatusNotModified {
10437		if res.Body != nil {
10438			res.Body.Close()
10439		}
10440		return nil, &googleapi.Error{
10441			Code:   res.StatusCode,
10442			Header: res.Header,
10443		}
10444	}
10445	if err != nil {
10446		return nil, err
10447	}
10448	defer googleapi.CloseBody(res)
10449	if err := googleapi.CheckResponse(res); err != nil {
10450		return nil, err
10451	}
10452	ret := &LogBucket{
10453		ServerResponse: googleapi.ServerResponse{
10454			Header:         res.Header,
10455			HTTPStatusCode: res.StatusCode,
10456		},
10457	}
10458	target := &ret
10459	if err := gensupport.DecodeResponse(target, res); err != nil {
10460		return nil, err
10461	}
10462	return ret, nil
10463	// {
10464	//   "description": "Gets a bucket.",
10465	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}",
10466	//   "httpMethod": "GET",
10467	//   "id": "logging.folders.locations.buckets.get",
10468	//   "parameterOrder": [
10469	//     "name"
10470	//   ],
10471	//   "parameters": {
10472	//     "name": {
10473	//       "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\".",
10474	//       "location": "path",
10475	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$",
10476	//       "required": true,
10477	//       "type": "string"
10478	//     }
10479	//   },
10480	//   "path": "v2/{+name}",
10481	//   "response": {
10482	//     "$ref": "LogBucket"
10483	//   },
10484	//   "scopes": [
10485	//     "https://www.googleapis.com/auth/cloud-platform",
10486	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
10487	//     "https://www.googleapis.com/auth/logging.admin",
10488	//     "https://www.googleapis.com/auth/logging.read"
10489	//   ]
10490	// }
10491
10492}
10493
10494// method id "logging.folders.locations.buckets.list":
10495
10496type FoldersLocationsBucketsListCall struct {
10497	s            *Service
10498	parent       string
10499	urlParams_   gensupport.URLParams
10500	ifNoneMatch_ string
10501	ctx_         context.Context
10502	header_      http.Header
10503}
10504
10505// List: Lists buckets.
10506//
10507// - parent: The parent resource whose buckets are to be listed:
10508//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
10509//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
10510//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
10511//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations
10512//   portion of the resource must be specified, but supplying the
10513//   character - in place of LOCATION_ID will return all buckets.
10514func (r *FoldersLocationsBucketsService) List(parent string) *FoldersLocationsBucketsListCall {
10515	c := &FoldersLocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10516	c.parent = parent
10517	return c
10518}
10519
10520// PageSize sets the optional parameter "pageSize": The maximum number
10521// of results to return from this request. Non-positive values are
10522// ignored. The presence of nextPageToken in the response indicates that
10523// more results might be available.
10524func (c *FoldersLocationsBucketsListCall) PageSize(pageSize int64) *FoldersLocationsBucketsListCall {
10525	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
10526	return c
10527}
10528
10529// PageToken sets the optional parameter "pageToken": If present, then
10530// retrieve the next batch of results from the preceding call to this
10531// method. pageToken must be the value of nextPageToken from the
10532// previous response. The values of other method parameters should be
10533// identical to those in the previous call.
10534func (c *FoldersLocationsBucketsListCall) PageToken(pageToken string) *FoldersLocationsBucketsListCall {
10535	c.urlParams_.Set("pageToken", pageToken)
10536	return c
10537}
10538
10539// Fields allows partial responses to be retrieved. See
10540// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10541// for more information.
10542func (c *FoldersLocationsBucketsListCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsListCall {
10543	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10544	return c
10545}
10546
10547// IfNoneMatch sets the optional parameter which makes the operation
10548// fail if the object's ETag matches the given value. This is useful for
10549// getting updates only after the object has changed since the last
10550// request. Use googleapi.IsNotModified to check whether the response
10551// error from Do is the result of In-None-Match.
10552func (c *FoldersLocationsBucketsListCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsListCall {
10553	c.ifNoneMatch_ = entityTag
10554	return c
10555}
10556
10557// Context sets the context to be used in this call's Do method. Any
10558// pending HTTP request will be aborted if the provided context is
10559// canceled.
10560func (c *FoldersLocationsBucketsListCall) Context(ctx context.Context) *FoldersLocationsBucketsListCall {
10561	c.ctx_ = ctx
10562	return c
10563}
10564
10565// Header returns an http.Header that can be modified by the caller to
10566// add HTTP headers to the request.
10567func (c *FoldersLocationsBucketsListCall) Header() http.Header {
10568	if c.header_ == nil {
10569		c.header_ = make(http.Header)
10570	}
10571	return c.header_
10572}
10573
10574func (c *FoldersLocationsBucketsListCall) doRequest(alt string) (*http.Response, error) {
10575	reqHeaders := make(http.Header)
10576	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
10577	for k, v := range c.header_ {
10578		reqHeaders[k] = v
10579	}
10580	reqHeaders.Set("User-Agent", c.s.userAgent())
10581	if c.ifNoneMatch_ != "" {
10582		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10583	}
10584	var body io.Reader = nil
10585	c.urlParams_.Set("alt", alt)
10586	c.urlParams_.Set("prettyPrint", "false")
10587	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
10588	urls += "?" + c.urlParams_.Encode()
10589	req, err := http.NewRequest("GET", urls, body)
10590	if err != nil {
10591		return nil, err
10592	}
10593	req.Header = reqHeaders
10594	googleapi.Expand(req.URL, map[string]string{
10595		"parent": c.parent,
10596	})
10597	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10598}
10599
10600// Do executes the "logging.folders.locations.buckets.list" call.
10601// Exactly one of *ListBucketsResponse or error will be non-nil. Any
10602// non-2xx status code is an error. Response headers are in either
10603// *ListBucketsResponse.ServerResponse.Header or (if a response was
10604// returned at all) in error.(*googleapi.Error).Header. Use
10605// googleapi.IsNotModified to check whether the returned error was
10606// because http.StatusNotModified was returned.
10607func (c *FoldersLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) {
10608	gensupport.SetOptions(c.urlParams_, opts...)
10609	res, err := c.doRequest("json")
10610	if res != nil && res.StatusCode == http.StatusNotModified {
10611		if res.Body != nil {
10612			res.Body.Close()
10613		}
10614		return nil, &googleapi.Error{
10615			Code:   res.StatusCode,
10616			Header: res.Header,
10617		}
10618	}
10619	if err != nil {
10620		return nil, err
10621	}
10622	defer googleapi.CloseBody(res)
10623	if err := googleapi.CheckResponse(res); err != nil {
10624		return nil, err
10625	}
10626	ret := &ListBucketsResponse{
10627		ServerResponse: googleapi.ServerResponse{
10628			Header:         res.Header,
10629			HTTPStatusCode: res.StatusCode,
10630		},
10631	}
10632	target := &ret
10633	if err := gensupport.DecodeResponse(target, res); err != nil {
10634		return nil, err
10635	}
10636	return ret, nil
10637	// {
10638	//   "description": "Lists buckets.",
10639	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets",
10640	//   "httpMethod": "GET",
10641	//   "id": "logging.folders.locations.buckets.list",
10642	//   "parameterOrder": [
10643	//     "parent"
10644	//   ],
10645	//   "parameters": {
10646	//     "pageSize": {
10647	//       "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.",
10648	//       "format": "int32",
10649	//       "location": "query",
10650	//       "type": "integer"
10651	//     },
10652	//     "pageToken": {
10653	//       "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.",
10654	//       "location": "query",
10655	//       "type": "string"
10656	//     },
10657	//     "parent": {
10658	//       "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.",
10659	//       "location": "path",
10660	//       "pattern": "^folders/[^/]+/locations/[^/]+$",
10661	//       "required": true,
10662	//       "type": "string"
10663	//     }
10664	//   },
10665	//   "path": "v2/{+parent}/buckets",
10666	//   "response": {
10667	//     "$ref": "ListBucketsResponse"
10668	//   },
10669	//   "scopes": [
10670	//     "https://www.googleapis.com/auth/cloud-platform",
10671	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
10672	//     "https://www.googleapis.com/auth/logging.admin",
10673	//     "https://www.googleapis.com/auth/logging.read"
10674	//   ]
10675	// }
10676
10677}
10678
10679// Pages invokes f for each page of results.
10680// A non-nil error returned from f will halt the iteration.
10681// The provided context supersedes any context provided to the Context method.
10682func (c *FoldersLocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error {
10683	c.ctx_ = ctx
10684	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
10685	for {
10686		x, err := c.Do()
10687		if err != nil {
10688			return err
10689		}
10690		if err := f(x); err != nil {
10691			return err
10692		}
10693		if x.NextPageToken == "" {
10694			return nil
10695		}
10696		c.PageToken(x.NextPageToken)
10697	}
10698}
10699
10700// method id "logging.folders.locations.buckets.patch":
10701
10702type FoldersLocationsBucketsPatchCall struct {
10703	s          *Service
10704	name       string
10705	logbucket  *LogBucket
10706	urlParams_ gensupport.URLParams
10707	ctx_       context.Context
10708	header_    http.Header
10709}
10710
10711// Patch: Updates a bucket. This method replaces the following fields in
10712// the existing bucket with values from the new bucket:
10713// retention_periodIf the retention period is decreased and the bucket
10714// is locked, FAILED_PRECONDITION will be returned.If the bucket has a
10715// LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be
10716// returned.A buckets region may not be modified after it is created.
10717//
10718// - name: The full resource name of the bucket to update.
10719//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
10720//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
10721//   CKET_ID]"
10722//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
10723//   s/[BUCKET_ID]"
10724//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
10725//   Example:
10726//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id".
10727//    Also requires permission "resourcemanager.projects.updateLiens" to
10728//   set the locked property.
10729func (r *FoldersLocationsBucketsService) Patch(name string, logbucket *LogBucket) *FoldersLocationsBucketsPatchCall {
10730	c := &FoldersLocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10731	c.name = name
10732	c.logbucket = logbucket
10733	return c
10734}
10735
10736// UpdateMask sets the optional parameter "updateMask": Required. Field
10737// mask that specifies the fields in bucket that need an update. A
10738// bucket field will be overwritten if, and only if, it is in the update
10739// mask. name and output only fields cannot be updated.For a detailed
10740// FieldMask definition, see
10741// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
10742// updateMask=retention_days.
10743func (c *FoldersLocationsBucketsPatchCall) UpdateMask(updateMask string) *FoldersLocationsBucketsPatchCall {
10744	c.urlParams_.Set("updateMask", updateMask)
10745	return c
10746}
10747
10748// Fields allows partial responses to be retrieved. See
10749// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10750// for more information.
10751func (c *FoldersLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsPatchCall {
10752	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10753	return c
10754}
10755
10756// Context sets the context to be used in this call's Do method. Any
10757// pending HTTP request will be aborted if the provided context is
10758// canceled.
10759func (c *FoldersLocationsBucketsPatchCall) Context(ctx context.Context) *FoldersLocationsBucketsPatchCall {
10760	c.ctx_ = ctx
10761	return c
10762}
10763
10764// Header returns an http.Header that can be modified by the caller to
10765// add HTTP headers to the request.
10766func (c *FoldersLocationsBucketsPatchCall) Header() http.Header {
10767	if c.header_ == nil {
10768		c.header_ = make(http.Header)
10769	}
10770	return c.header_
10771}
10772
10773func (c *FoldersLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
10774	reqHeaders := make(http.Header)
10775	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
10776	for k, v := range c.header_ {
10777		reqHeaders[k] = v
10778	}
10779	reqHeaders.Set("User-Agent", c.s.userAgent())
10780	var body io.Reader = nil
10781	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
10782	if err != nil {
10783		return nil, err
10784	}
10785	reqHeaders.Set("Content-Type", "application/json")
10786	c.urlParams_.Set("alt", alt)
10787	c.urlParams_.Set("prettyPrint", "false")
10788	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
10789	urls += "?" + c.urlParams_.Encode()
10790	req, err := http.NewRequest("PATCH", urls, body)
10791	if err != nil {
10792		return nil, err
10793	}
10794	req.Header = reqHeaders
10795	googleapi.Expand(req.URL, map[string]string{
10796		"name": c.name,
10797	})
10798	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10799}
10800
10801// Do executes the "logging.folders.locations.buckets.patch" call.
10802// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
10803// status code is an error. Response headers are in either
10804// *LogBucket.ServerResponse.Header or (if a response was returned at
10805// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
10806// to check whether the returned error was because
10807// http.StatusNotModified was returned.
10808func (c *FoldersLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
10809	gensupport.SetOptions(c.urlParams_, opts...)
10810	res, err := c.doRequest("json")
10811	if res != nil && res.StatusCode == http.StatusNotModified {
10812		if res.Body != nil {
10813			res.Body.Close()
10814		}
10815		return nil, &googleapi.Error{
10816			Code:   res.StatusCode,
10817			Header: res.Header,
10818		}
10819	}
10820	if err != nil {
10821		return nil, err
10822	}
10823	defer googleapi.CloseBody(res)
10824	if err := googleapi.CheckResponse(res); err != nil {
10825		return nil, err
10826	}
10827	ret := &LogBucket{
10828		ServerResponse: googleapi.ServerResponse{
10829			Header:         res.Header,
10830			HTTPStatusCode: res.StatusCode,
10831		},
10832	}
10833	target := &ret
10834	if err := gensupport.DecodeResponse(target, res); err != nil {
10835		return nil, err
10836	}
10837	return ret, nil
10838	// {
10839	//   "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.",
10840	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}",
10841	//   "httpMethod": "PATCH",
10842	//   "id": "logging.folders.locations.buckets.patch",
10843	//   "parameterOrder": [
10844	//     "name"
10845	//   ],
10846	//   "parameters": {
10847	//     "name": {
10848	//       "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",
10849	//       "location": "path",
10850	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$",
10851	//       "required": true,
10852	//       "type": "string"
10853	//     },
10854	//     "updateMask": {
10855	//       "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.",
10856	//       "format": "google-fieldmask",
10857	//       "location": "query",
10858	//       "type": "string"
10859	//     }
10860	//   },
10861	//   "path": "v2/{+name}",
10862	//   "request": {
10863	//     "$ref": "LogBucket"
10864	//   },
10865	//   "response": {
10866	//     "$ref": "LogBucket"
10867	//   },
10868	//   "scopes": [
10869	//     "https://www.googleapis.com/auth/cloud-platform",
10870	//     "https://www.googleapis.com/auth/logging.admin"
10871	//   ]
10872	// }
10873
10874}
10875
10876// method id "logging.folders.locations.buckets.undelete":
10877
10878type FoldersLocationsBucketsUndeleteCall struct {
10879	s                     *Service
10880	name                  string
10881	undeletebucketrequest *UndeleteBucketRequest
10882	urlParams_            gensupport.URLParams
10883	ctx_                  context.Context
10884	header_               http.Header
10885}
10886
10887// Undelete: Undeletes a bucket. A bucket that has been deleted may be
10888// undeleted within the grace period of 7 days.
10889//
10890// - name: The full resource name of the bucket to undelete.
10891//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
10892//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
10893//   CKET_ID]"
10894//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
10895//   s/[BUCKET_ID]"
10896//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
10897//   Example:
10898//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id".
10899func (r *FoldersLocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *FoldersLocationsBucketsUndeleteCall {
10900	c := &FoldersLocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10901	c.name = name
10902	c.undeletebucketrequest = undeletebucketrequest
10903	return c
10904}
10905
10906// Fields allows partial responses to be retrieved. See
10907// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10908// for more information.
10909func (c *FoldersLocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsUndeleteCall {
10910	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10911	return c
10912}
10913
10914// Context sets the context to be used in this call's Do method. Any
10915// pending HTTP request will be aborted if the provided context is
10916// canceled.
10917func (c *FoldersLocationsBucketsUndeleteCall) Context(ctx context.Context) *FoldersLocationsBucketsUndeleteCall {
10918	c.ctx_ = ctx
10919	return c
10920}
10921
10922// Header returns an http.Header that can be modified by the caller to
10923// add HTTP headers to the request.
10924func (c *FoldersLocationsBucketsUndeleteCall) Header() http.Header {
10925	if c.header_ == nil {
10926		c.header_ = make(http.Header)
10927	}
10928	return c.header_
10929}
10930
10931func (c *FoldersLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) {
10932	reqHeaders := make(http.Header)
10933	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
10934	for k, v := range c.header_ {
10935		reqHeaders[k] = v
10936	}
10937	reqHeaders.Set("User-Agent", c.s.userAgent())
10938	var body io.Reader = nil
10939	body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest)
10940	if err != nil {
10941		return nil, err
10942	}
10943	reqHeaders.Set("Content-Type", "application/json")
10944	c.urlParams_.Set("alt", alt)
10945	c.urlParams_.Set("prettyPrint", "false")
10946	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete")
10947	urls += "?" + c.urlParams_.Encode()
10948	req, err := http.NewRequest("POST", urls, body)
10949	if err != nil {
10950		return nil, err
10951	}
10952	req.Header = reqHeaders
10953	googleapi.Expand(req.URL, map[string]string{
10954		"name": c.name,
10955	})
10956	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10957}
10958
10959// Do executes the "logging.folders.locations.buckets.undelete" call.
10960// Exactly one of *Empty or error will be non-nil. Any non-2xx status
10961// code is an error. Response headers are in either
10962// *Empty.ServerResponse.Header or (if a response was returned at all)
10963// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10964// check whether the returned error was because http.StatusNotModified
10965// was returned.
10966func (c *FoldersLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
10967	gensupport.SetOptions(c.urlParams_, opts...)
10968	res, err := c.doRequest("json")
10969	if res != nil && res.StatusCode == http.StatusNotModified {
10970		if res.Body != nil {
10971			res.Body.Close()
10972		}
10973		return nil, &googleapi.Error{
10974			Code:   res.StatusCode,
10975			Header: res.Header,
10976		}
10977	}
10978	if err != nil {
10979		return nil, err
10980	}
10981	defer googleapi.CloseBody(res)
10982	if err := googleapi.CheckResponse(res); err != nil {
10983		return nil, err
10984	}
10985	ret := &Empty{
10986		ServerResponse: googleapi.ServerResponse{
10987			Header:         res.Header,
10988			HTTPStatusCode: res.StatusCode,
10989		},
10990	}
10991	target := &ret
10992	if err := gensupport.DecodeResponse(target, res); err != nil {
10993		return nil, err
10994	}
10995	return ret, nil
10996	// {
10997	//   "description": "Undeletes a bucket. A bucket that has been deleted may be undeleted within the grace period of 7 days.",
10998	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}:undelete",
10999	//   "httpMethod": "POST",
11000	//   "id": "logging.folders.locations.buckets.undelete",
11001	//   "parameterOrder": [
11002	//     "name"
11003	//   ],
11004	//   "parameters": {
11005	//     "name": {
11006	//       "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\".",
11007	//       "location": "path",
11008	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$",
11009	//       "required": true,
11010	//       "type": "string"
11011	//     }
11012	//   },
11013	//   "path": "v2/{+name}:undelete",
11014	//   "request": {
11015	//     "$ref": "UndeleteBucketRequest"
11016	//   },
11017	//   "response": {
11018	//     "$ref": "Empty"
11019	//   },
11020	//   "scopes": [
11021	//     "https://www.googleapis.com/auth/cloud-platform",
11022	//     "https://www.googleapis.com/auth/logging.admin"
11023	//   ]
11024	// }
11025
11026}
11027
11028// method id "logging.folders.locations.buckets.views.create":
11029
11030type FoldersLocationsBucketsViewsCreateCall struct {
11031	s          *Service
11032	parent     string
11033	logview    *LogView
11034	urlParams_ gensupport.URLParams
11035	ctx_       context.Context
11036	header_    http.Header
11037}
11038
11039// Create: Creates a view over logs in a bucket. A bucket may contain a
11040// maximum of 50 views.
11041//
11042// - parent: The bucket in which to create the view
11043//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
11044//   Example:
11045//   "projects/my-logging-project/locations/my-location/buckets/my-bucket
11046//   ".
11047func (r *FoldersLocationsBucketsViewsService) Create(parent string, logview *LogView) *FoldersLocationsBucketsViewsCreateCall {
11048	c := &FoldersLocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11049	c.parent = parent
11050	c.logview = logview
11051	return c
11052}
11053
11054// ViewId sets the optional parameter "viewId": Required. The id to use
11055// for this view.
11056func (c *FoldersLocationsBucketsViewsCreateCall) ViewId(viewId string) *FoldersLocationsBucketsViewsCreateCall {
11057	c.urlParams_.Set("viewId", viewId)
11058	return c
11059}
11060
11061// Fields allows partial responses to be retrieved. See
11062// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11063// for more information.
11064func (c *FoldersLocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsCreateCall {
11065	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11066	return c
11067}
11068
11069// Context sets the context to be used in this call's Do method. Any
11070// pending HTTP request will be aborted if the provided context is
11071// canceled.
11072func (c *FoldersLocationsBucketsViewsCreateCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsCreateCall {
11073	c.ctx_ = ctx
11074	return c
11075}
11076
11077// Header returns an http.Header that can be modified by the caller to
11078// add HTTP headers to the request.
11079func (c *FoldersLocationsBucketsViewsCreateCall) Header() http.Header {
11080	if c.header_ == nil {
11081		c.header_ = make(http.Header)
11082	}
11083	return c.header_
11084}
11085
11086func (c *FoldersLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) {
11087	reqHeaders := make(http.Header)
11088	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
11089	for k, v := range c.header_ {
11090		reqHeaders[k] = v
11091	}
11092	reqHeaders.Set("User-Agent", c.s.userAgent())
11093	var body io.Reader = nil
11094	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
11095	if err != nil {
11096		return nil, err
11097	}
11098	reqHeaders.Set("Content-Type", "application/json")
11099	c.urlParams_.Set("alt", alt)
11100	c.urlParams_.Set("prettyPrint", "false")
11101	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
11102	urls += "?" + c.urlParams_.Encode()
11103	req, err := http.NewRequest("POST", urls, body)
11104	if err != nil {
11105		return nil, err
11106	}
11107	req.Header = reqHeaders
11108	googleapi.Expand(req.URL, map[string]string{
11109		"parent": c.parent,
11110	})
11111	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11112}
11113
11114// Do executes the "logging.folders.locations.buckets.views.create" call.
11115// Exactly one of *LogView or error will be non-nil. Any non-2xx status
11116// code is an error. Response headers are in either
11117// *LogView.ServerResponse.Header or (if a response was returned at all)
11118// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11119// check whether the returned error was because http.StatusNotModified
11120// was returned.
11121func (c *FoldersLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
11122	gensupport.SetOptions(c.urlParams_, opts...)
11123	res, err := c.doRequest("json")
11124	if res != nil && res.StatusCode == http.StatusNotModified {
11125		if res.Body != nil {
11126			res.Body.Close()
11127		}
11128		return nil, &googleapi.Error{
11129			Code:   res.StatusCode,
11130			Header: res.Header,
11131		}
11132	}
11133	if err != nil {
11134		return nil, err
11135	}
11136	defer googleapi.CloseBody(res)
11137	if err := googleapi.CheckResponse(res); err != nil {
11138		return nil, err
11139	}
11140	ret := &LogView{
11141		ServerResponse: googleapi.ServerResponse{
11142			Header:         res.Header,
11143			HTTPStatusCode: res.StatusCode,
11144		},
11145	}
11146	target := &ret
11147	if err := gensupport.DecodeResponse(target, res); err != nil {
11148		return nil, err
11149	}
11150	return ret, nil
11151	// {
11152	//   "description": "Creates a view over logs in a bucket. A bucket may contain a maximum of 50 views.",
11153	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views",
11154	//   "httpMethod": "POST",
11155	//   "id": "logging.folders.locations.buckets.views.create",
11156	//   "parameterOrder": [
11157	//     "parent"
11158	//   ],
11159	//   "parameters": {
11160	//     "parent": {
11161	//       "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\"",
11162	//       "location": "path",
11163	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$",
11164	//       "required": true,
11165	//       "type": "string"
11166	//     },
11167	//     "viewId": {
11168	//       "description": "Required. The id to use for this view.",
11169	//       "location": "query",
11170	//       "type": "string"
11171	//     }
11172	//   },
11173	//   "path": "v2/{+parent}/views",
11174	//   "request": {
11175	//     "$ref": "LogView"
11176	//   },
11177	//   "response": {
11178	//     "$ref": "LogView"
11179	//   },
11180	//   "scopes": [
11181	//     "https://www.googleapis.com/auth/cloud-platform",
11182	//     "https://www.googleapis.com/auth/logging.admin"
11183	//   ]
11184	// }
11185
11186}
11187
11188// method id "logging.folders.locations.buckets.views.delete":
11189
11190type FoldersLocationsBucketsViewsDeleteCall struct {
11191	s          *Service
11192	name       string
11193	urlParams_ gensupport.URLParams
11194	ctx_       context.Context
11195	header_    http.Header
11196}
11197
11198// Delete: Deletes a view from a bucket.
11199//
11200// - name: The full resource name of the view to delete:
11201//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
11202//   iews/[VIEW_ID]" Example:
11203//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id/v
11204//   iews/my-view-id".
11205func (r *FoldersLocationsBucketsViewsService) Delete(name string) *FoldersLocationsBucketsViewsDeleteCall {
11206	c := &FoldersLocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11207	c.name = name
11208	return c
11209}
11210
11211// Fields allows partial responses to be retrieved. See
11212// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11213// for more information.
11214func (c *FoldersLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsDeleteCall {
11215	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11216	return c
11217}
11218
11219// Context sets the context to be used in this call's Do method. Any
11220// pending HTTP request will be aborted if the provided context is
11221// canceled.
11222func (c *FoldersLocationsBucketsViewsDeleteCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsDeleteCall {
11223	c.ctx_ = ctx
11224	return c
11225}
11226
11227// Header returns an http.Header that can be modified by the caller to
11228// add HTTP headers to the request.
11229func (c *FoldersLocationsBucketsViewsDeleteCall) Header() http.Header {
11230	if c.header_ == nil {
11231		c.header_ = make(http.Header)
11232	}
11233	return c.header_
11234}
11235
11236func (c *FoldersLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) {
11237	reqHeaders := make(http.Header)
11238	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
11239	for k, v := range c.header_ {
11240		reqHeaders[k] = v
11241	}
11242	reqHeaders.Set("User-Agent", c.s.userAgent())
11243	var body io.Reader = nil
11244	c.urlParams_.Set("alt", alt)
11245	c.urlParams_.Set("prettyPrint", "false")
11246	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
11247	urls += "?" + c.urlParams_.Encode()
11248	req, err := http.NewRequest("DELETE", urls, body)
11249	if err != nil {
11250		return nil, err
11251	}
11252	req.Header = reqHeaders
11253	googleapi.Expand(req.URL, map[string]string{
11254		"name": c.name,
11255	})
11256	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11257}
11258
11259// Do executes the "logging.folders.locations.buckets.views.delete" call.
11260// Exactly one of *Empty or error will be non-nil. Any non-2xx status
11261// code is an error. Response headers are in either
11262// *Empty.ServerResponse.Header or (if a response was returned at all)
11263// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11264// check whether the returned error was because http.StatusNotModified
11265// was returned.
11266func (c *FoldersLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
11267	gensupport.SetOptions(c.urlParams_, opts...)
11268	res, err := c.doRequest("json")
11269	if res != nil && res.StatusCode == http.StatusNotModified {
11270		if res.Body != nil {
11271			res.Body.Close()
11272		}
11273		return nil, &googleapi.Error{
11274			Code:   res.StatusCode,
11275			Header: res.Header,
11276		}
11277	}
11278	if err != nil {
11279		return nil, err
11280	}
11281	defer googleapi.CloseBody(res)
11282	if err := googleapi.CheckResponse(res); err != nil {
11283		return nil, err
11284	}
11285	ret := &Empty{
11286		ServerResponse: googleapi.ServerResponse{
11287			Header:         res.Header,
11288			HTTPStatusCode: res.StatusCode,
11289		},
11290	}
11291	target := &ret
11292	if err := gensupport.DecodeResponse(target, res); err != nil {
11293		return nil, err
11294	}
11295	return ret, nil
11296	// {
11297	//   "description": "Deletes a view from a bucket.",
11298	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
11299	//   "httpMethod": "DELETE",
11300	//   "id": "logging.folders.locations.buckets.views.delete",
11301	//   "parameterOrder": [
11302	//     "name"
11303	//   ],
11304	//   "parameters": {
11305	//     "name": {
11306	//       "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\".",
11307	//       "location": "path",
11308	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
11309	//       "required": true,
11310	//       "type": "string"
11311	//     }
11312	//   },
11313	//   "path": "v2/{+name}",
11314	//   "response": {
11315	//     "$ref": "Empty"
11316	//   },
11317	//   "scopes": [
11318	//     "https://www.googleapis.com/auth/cloud-platform",
11319	//     "https://www.googleapis.com/auth/logging.admin"
11320	//   ]
11321	// }
11322
11323}
11324
11325// method id "logging.folders.locations.buckets.views.get":
11326
11327type FoldersLocationsBucketsViewsGetCall struct {
11328	s            *Service
11329	name         string
11330	urlParams_   gensupport.URLParams
11331	ifNoneMatch_ string
11332	ctx_         context.Context
11333	header_      http.Header
11334}
11335
11336// Get: Gets a view.
11337//
11338// - name: The resource name of the policy:
11339//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
11340//   iews/[VIEW_ID]" Example:
11341//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id/v
11342//   iews/my-view-id".
11343func (r *FoldersLocationsBucketsViewsService) Get(name string) *FoldersLocationsBucketsViewsGetCall {
11344	c := &FoldersLocationsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11345	c.name = name
11346	return c
11347}
11348
11349// Fields allows partial responses to be retrieved. See
11350// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11351// for more information.
11352func (c *FoldersLocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsGetCall {
11353	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11354	return c
11355}
11356
11357// IfNoneMatch sets the optional parameter which makes the operation
11358// fail if the object's ETag matches the given value. This is useful for
11359// getting updates only after the object has changed since the last
11360// request. Use googleapi.IsNotModified to check whether the response
11361// error from Do is the result of In-None-Match.
11362func (c *FoldersLocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsViewsGetCall {
11363	c.ifNoneMatch_ = entityTag
11364	return c
11365}
11366
11367// Context sets the context to be used in this call's Do method. Any
11368// pending HTTP request will be aborted if the provided context is
11369// canceled.
11370func (c *FoldersLocationsBucketsViewsGetCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsGetCall {
11371	c.ctx_ = ctx
11372	return c
11373}
11374
11375// Header returns an http.Header that can be modified by the caller to
11376// add HTTP headers to the request.
11377func (c *FoldersLocationsBucketsViewsGetCall) Header() http.Header {
11378	if c.header_ == nil {
11379		c.header_ = make(http.Header)
11380	}
11381	return c.header_
11382}
11383
11384func (c *FoldersLocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) {
11385	reqHeaders := make(http.Header)
11386	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
11387	for k, v := range c.header_ {
11388		reqHeaders[k] = v
11389	}
11390	reqHeaders.Set("User-Agent", c.s.userAgent())
11391	if c.ifNoneMatch_ != "" {
11392		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11393	}
11394	var body io.Reader = nil
11395	c.urlParams_.Set("alt", alt)
11396	c.urlParams_.Set("prettyPrint", "false")
11397	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
11398	urls += "?" + c.urlParams_.Encode()
11399	req, err := http.NewRequest("GET", urls, body)
11400	if err != nil {
11401		return nil, err
11402	}
11403	req.Header = reqHeaders
11404	googleapi.Expand(req.URL, map[string]string{
11405		"name": c.name,
11406	})
11407	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11408}
11409
11410// Do executes the "logging.folders.locations.buckets.views.get" call.
11411// Exactly one of *LogView or error will be non-nil. Any non-2xx status
11412// code is an error. Response headers are in either
11413// *LogView.ServerResponse.Header or (if a response was returned at all)
11414// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11415// check whether the returned error was because http.StatusNotModified
11416// was returned.
11417func (c *FoldersLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
11418	gensupport.SetOptions(c.urlParams_, opts...)
11419	res, err := c.doRequest("json")
11420	if res != nil && res.StatusCode == http.StatusNotModified {
11421		if res.Body != nil {
11422			res.Body.Close()
11423		}
11424		return nil, &googleapi.Error{
11425			Code:   res.StatusCode,
11426			Header: res.Header,
11427		}
11428	}
11429	if err != nil {
11430		return nil, err
11431	}
11432	defer googleapi.CloseBody(res)
11433	if err := googleapi.CheckResponse(res); err != nil {
11434		return nil, err
11435	}
11436	ret := &LogView{
11437		ServerResponse: googleapi.ServerResponse{
11438			Header:         res.Header,
11439			HTTPStatusCode: res.StatusCode,
11440		},
11441	}
11442	target := &ret
11443	if err := gensupport.DecodeResponse(target, res); err != nil {
11444		return nil, err
11445	}
11446	return ret, nil
11447	// {
11448	//   "description": "Gets a view.",
11449	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
11450	//   "httpMethod": "GET",
11451	//   "id": "logging.folders.locations.buckets.views.get",
11452	//   "parameterOrder": [
11453	//     "name"
11454	//   ],
11455	//   "parameters": {
11456	//     "name": {
11457	//       "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\".",
11458	//       "location": "path",
11459	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
11460	//       "required": true,
11461	//       "type": "string"
11462	//     }
11463	//   },
11464	//   "path": "v2/{+name}",
11465	//   "response": {
11466	//     "$ref": "LogView"
11467	//   },
11468	//   "scopes": [
11469	//     "https://www.googleapis.com/auth/cloud-platform",
11470	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
11471	//     "https://www.googleapis.com/auth/logging.admin",
11472	//     "https://www.googleapis.com/auth/logging.read"
11473	//   ]
11474	// }
11475
11476}
11477
11478// method id "logging.folders.locations.buckets.views.list":
11479
11480type FoldersLocationsBucketsViewsListCall struct {
11481	s            *Service
11482	parent       string
11483	urlParams_   gensupport.URLParams
11484	ifNoneMatch_ string
11485	ctx_         context.Context
11486	header_      http.Header
11487}
11488
11489// List: Lists views on a bucket.
11490//
11491// - parent: The bucket whose views are to be listed:
11492//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]".
11493func (r *FoldersLocationsBucketsViewsService) List(parent string) *FoldersLocationsBucketsViewsListCall {
11494	c := &FoldersLocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11495	c.parent = parent
11496	return c
11497}
11498
11499// PageSize sets the optional parameter "pageSize": The maximum number
11500// of results to return from this request. Non-positive values are
11501// ignored. The presence of nextPageToken in the response indicates that
11502// more results might be available.
11503func (c *FoldersLocationsBucketsViewsListCall) PageSize(pageSize int64) *FoldersLocationsBucketsViewsListCall {
11504	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
11505	return c
11506}
11507
11508// PageToken sets the optional parameter "pageToken": If present, then
11509// retrieve the next batch of results from the preceding call to this
11510// method. pageToken must be the value of nextPageToken from the
11511// previous response. The values of other method parameters should be
11512// identical to those in the previous call.
11513func (c *FoldersLocationsBucketsViewsListCall) PageToken(pageToken string) *FoldersLocationsBucketsViewsListCall {
11514	c.urlParams_.Set("pageToken", pageToken)
11515	return c
11516}
11517
11518// Fields allows partial responses to be retrieved. See
11519// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11520// for more information.
11521func (c *FoldersLocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsListCall {
11522	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11523	return c
11524}
11525
11526// IfNoneMatch sets the optional parameter which makes the operation
11527// fail if the object's ETag matches the given value. This is useful for
11528// getting updates only after the object has changed since the last
11529// request. Use googleapi.IsNotModified to check whether the response
11530// error from Do is the result of In-None-Match.
11531func (c *FoldersLocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsViewsListCall {
11532	c.ifNoneMatch_ = entityTag
11533	return c
11534}
11535
11536// Context sets the context to be used in this call's Do method. Any
11537// pending HTTP request will be aborted if the provided context is
11538// canceled.
11539func (c *FoldersLocationsBucketsViewsListCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsListCall {
11540	c.ctx_ = ctx
11541	return c
11542}
11543
11544// Header returns an http.Header that can be modified by the caller to
11545// add HTTP headers to the request.
11546func (c *FoldersLocationsBucketsViewsListCall) Header() http.Header {
11547	if c.header_ == nil {
11548		c.header_ = make(http.Header)
11549	}
11550	return c.header_
11551}
11552
11553func (c *FoldersLocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) {
11554	reqHeaders := make(http.Header)
11555	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
11556	for k, v := range c.header_ {
11557		reqHeaders[k] = v
11558	}
11559	reqHeaders.Set("User-Agent", c.s.userAgent())
11560	if c.ifNoneMatch_ != "" {
11561		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11562	}
11563	var body io.Reader = nil
11564	c.urlParams_.Set("alt", alt)
11565	c.urlParams_.Set("prettyPrint", "false")
11566	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
11567	urls += "?" + c.urlParams_.Encode()
11568	req, err := http.NewRequest("GET", urls, body)
11569	if err != nil {
11570		return nil, err
11571	}
11572	req.Header = reqHeaders
11573	googleapi.Expand(req.URL, map[string]string{
11574		"parent": c.parent,
11575	})
11576	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11577}
11578
11579// Do executes the "logging.folders.locations.buckets.views.list" call.
11580// Exactly one of *ListViewsResponse or error will be non-nil. Any
11581// non-2xx status code is an error. Response headers are in either
11582// *ListViewsResponse.ServerResponse.Header or (if a response was
11583// returned at all) in error.(*googleapi.Error).Header. Use
11584// googleapi.IsNotModified to check whether the returned error was
11585// because http.StatusNotModified was returned.
11586func (c *FoldersLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) {
11587	gensupport.SetOptions(c.urlParams_, opts...)
11588	res, err := c.doRequest("json")
11589	if res != nil && res.StatusCode == http.StatusNotModified {
11590		if res.Body != nil {
11591			res.Body.Close()
11592		}
11593		return nil, &googleapi.Error{
11594			Code:   res.StatusCode,
11595			Header: res.Header,
11596		}
11597	}
11598	if err != nil {
11599		return nil, err
11600	}
11601	defer googleapi.CloseBody(res)
11602	if err := googleapi.CheckResponse(res); err != nil {
11603		return nil, err
11604	}
11605	ret := &ListViewsResponse{
11606		ServerResponse: googleapi.ServerResponse{
11607			Header:         res.Header,
11608			HTTPStatusCode: res.StatusCode,
11609		},
11610	}
11611	target := &ret
11612	if err := gensupport.DecodeResponse(target, res); err != nil {
11613		return nil, err
11614	}
11615	return ret, nil
11616	// {
11617	//   "description": "Lists views on a bucket.",
11618	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views",
11619	//   "httpMethod": "GET",
11620	//   "id": "logging.folders.locations.buckets.views.list",
11621	//   "parameterOrder": [
11622	//     "parent"
11623	//   ],
11624	//   "parameters": {
11625	//     "pageSize": {
11626	//       "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.",
11627	//       "format": "int32",
11628	//       "location": "query",
11629	//       "type": "integer"
11630	//     },
11631	//     "pageToken": {
11632	//       "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.",
11633	//       "location": "query",
11634	//       "type": "string"
11635	//     },
11636	//     "parent": {
11637	//       "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ",
11638	//       "location": "path",
11639	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$",
11640	//       "required": true,
11641	//       "type": "string"
11642	//     }
11643	//   },
11644	//   "path": "v2/{+parent}/views",
11645	//   "response": {
11646	//     "$ref": "ListViewsResponse"
11647	//   },
11648	//   "scopes": [
11649	//     "https://www.googleapis.com/auth/cloud-platform",
11650	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
11651	//     "https://www.googleapis.com/auth/logging.admin",
11652	//     "https://www.googleapis.com/auth/logging.read"
11653	//   ]
11654	// }
11655
11656}
11657
11658// Pages invokes f for each page of results.
11659// A non-nil error returned from f will halt the iteration.
11660// The provided context supersedes any context provided to the Context method.
11661func (c *FoldersLocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error {
11662	c.ctx_ = ctx
11663	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
11664	for {
11665		x, err := c.Do()
11666		if err != nil {
11667			return err
11668		}
11669		if err := f(x); err != nil {
11670			return err
11671		}
11672		if x.NextPageToken == "" {
11673			return nil
11674		}
11675		c.PageToken(x.NextPageToken)
11676	}
11677}
11678
11679// method id "logging.folders.locations.buckets.views.patch":
11680
11681type FoldersLocationsBucketsViewsPatchCall struct {
11682	s          *Service
11683	name       string
11684	logview    *LogView
11685	urlParams_ gensupport.URLParams
11686	ctx_       context.Context
11687	header_    http.Header
11688}
11689
11690// Patch: Updates a view. This method replaces the following fields in
11691// the existing view with values from the new view: filter.
11692//
11693// - name: The full resource name of the view to update
11694//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
11695//   iews/[VIEW_ID]" Example:
11696//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id/v
11697//   iews/my-view-id".
11698func (r *FoldersLocationsBucketsViewsService) Patch(name string, logview *LogView) *FoldersLocationsBucketsViewsPatchCall {
11699	c := &FoldersLocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11700	c.name = name
11701	c.logview = logview
11702	return c
11703}
11704
11705// UpdateMask sets the optional parameter "updateMask": Field mask that
11706// specifies the fields in view that need an update. A field will be
11707// overwritten if, and only if, it is in the update mask. name and
11708// output only fields cannot be updated.For a detailed FieldMask
11709// definition, see
11710// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
11711// updateMask=filter.
11712func (c *FoldersLocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *FoldersLocationsBucketsViewsPatchCall {
11713	c.urlParams_.Set("updateMask", updateMask)
11714	return c
11715}
11716
11717// Fields allows partial responses to be retrieved. See
11718// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11719// for more information.
11720func (c *FoldersLocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsPatchCall {
11721	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11722	return c
11723}
11724
11725// Context sets the context to be used in this call's Do method. Any
11726// pending HTTP request will be aborted if the provided context is
11727// canceled.
11728func (c *FoldersLocationsBucketsViewsPatchCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsPatchCall {
11729	c.ctx_ = ctx
11730	return c
11731}
11732
11733// Header returns an http.Header that can be modified by the caller to
11734// add HTTP headers to the request.
11735func (c *FoldersLocationsBucketsViewsPatchCall) Header() http.Header {
11736	if c.header_ == nil {
11737		c.header_ = make(http.Header)
11738	}
11739	return c.header_
11740}
11741
11742func (c *FoldersLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) {
11743	reqHeaders := make(http.Header)
11744	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
11745	for k, v := range c.header_ {
11746		reqHeaders[k] = v
11747	}
11748	reqHeaders.Set("User-Agent", c.s.userAgent())
11749	var body io.Reader = nil
11750	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
11751	if err != nil {
11752		return nil, err
11753	}
11754	reqHeaders.Set("Content-Type", "application/json")
11755	c.urlParams_.Set("alt", alt)
11756	c.urlParams_.Set("prettyPrint", "false")
11757	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
11758	urls += "?" + c.urlParams_.Encode()
11759	req, err := http.NewRequest("PATCH", urls, body)
11760	if err != nil {
11761		return nil, err
11762	}
11763	req.Header = reqHeaders
11764	googleapi.Expand(req.URL, map[string]string{
11765		"name": c.name,
11766	})
11767	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11768}
11769
11770// Do executes the "logging.folders.locations.buckets.views.patch" call.
11771// Exactly one of *LogView or error will be non-nil. Any non-2xx status
11772// code is an error. Response headers are in either
11773// *LogView.ServerResponse.Header or (if a response was returned at all)
11774// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11775// check whether the returned error was because http.StatusNotModified
11776// was returned.
11777func (c *FoldersLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
11778	gensupport.SetOptions(c.urlParams_, opts...)
11779	res, err := c.doRequest("json")
11780	if res != nil && res.StatusCode == http.StatusNotModified {
11781		if res.Body != nil {
11782			res.Body.Close()
11783		}
11784		return nil, &googleapi.Error{
11785			Code:   res.StatusCode,
11786			Header: res.Header,
11787		}
11788	}
11789	if err != nil {
11790		return nil, err
11791	}
11792	defer googleapi.CloseBody(res)
11793	if err := googleapi.CheckResponse(res); err != nil {
11794		return nil, err
11795	}
11796	ret := &LogView{
11797		ServerResponse: googleapi.ServerResponse{
11798			Header:         res.Header,
11799			HTTPStatusCode: res.StatusCode,
11800		},
11801	}
11802	target := &ret
11803	if err := gensupport.DecodeResponse(target, res); err != nil {
11804		return nil, err
11805	}
11806	return ret, nil
11807	// {
11808	//   "description": "Updates a view. This method replaces the following fields in the existing view with values from the new view: filter.",
11809	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
11810	//   "httpMethod": "PATCH",
11811	//   "id": "logging.folders.locations.buckets.views.patch",
11812	//   "parameterOrder": [
11813	//     "name"
11814	//   ],
11815	//   "parameters": {
11816	//     "name": {
11817	//       "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\".",
11818	//       "location": "path",
11819	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
11820	//       "required": true,
11821	//       "type": "string"
11822	//     },
11823	//     "updateMask": {
11824	//       "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.",
11825	//       "format": "google-fieldmask",
11826	//       "location": "query",
11827	//       "type": "string"
11828	//     }
11829	//   },
11830	//   "path": "v2/{+name}",
11831	//   "request": {
11832	//     "$ref": "LogView"
11833	//   },
11834	//   "response": {
11835	//     "$ref": "LogView"
11836	//   },
11837	//   "scopes": [
11838	//     "https://www.googleapis.com/auth/cloud-platform",
11839	//     "https://www.googleapis.com/auth/logging.admin"
11840	//   ]
11841	// }
11842
11843}
11844
11845// method id "logging.folders.logs.delete":
11846
11847type FoldersLogsDeleteCall struct {
11848	s          *Service
11849	logName    string
11850	urlParams_ gensupport.URLParams
11851	ctx_       context.Context
11852	header_    http.Header
11853}
11854
11855// Delete: Deletes all the log entries in a log for the _Default Log
11856// Bucket. The log reappears if it receives new entries. Log entries
11857// written shortly before the delete operation might not be deleted.
11858// Entries received after the delete operation with a timestamp before
11859// the operation will be deleted.
11860//
11861// - logName: The resource name of the log to delete:
11862//   projects/[PROJECT_ID]/logs/[LOG_ID]
11863//   organizations/[ORGANIZATION_ID]/logs/[LOG_ID]
11864//   billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]
11865//   folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For
11866//   example, "projects/my-project-id/logs/syslog",
11867//   "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For
11868//   more information about log names, see LogEntry.
11869func (r *FoldersLogsService) Delete(logName string) *FoldersLogsDeleteCall {
11870	c := &FoldersLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11871	c.logName = logName
11872	return c
11873}
11874
11875// Fields allows partial responses to be retrieved. See
11876// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11877// for more information.
11878func (c *FoldersLogsDeleteCall) Fields(s ...googleapi.Field) *FoldersLogsDeleteCall {
11879	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11880	return c
11881}
11882
11883// Context sets the context to be used in this call's Do method. Any
11884// pending HTTP request will be aborted if the provided context is
11885// canceled.
11886func (c *FoldersLogsDeleteCall) Context(ctx context.Context) *FoldersLogsDeleteCall {
11887	c.ctx_ = ctx
11888	return c
11889}
11890
11891// Header returns an http.Header that can be modified by the caller to
11892// add HTTP headers to the request.
11893func (c *FoldersLogsDeleteCall) Header() http.Header {
11894	if c.header_ == nil {
11895		c.header_ = make(http.Header)
11896	}
11897	return c.header_
11898}
11899
11900func (c *FoldersLogsDeleteCall) doRequest(alt string) (*http.Response, error) {
11901	reqHeaders := make(http.Header)
11902	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
11903	for k, v := range c.header_ {
11904		reqHeaders[k] = v
11905	}
11906	reqHeaders.Set("User-Agent", c.s.userAgent())
11907	var body io.Reader = nil
11908	c.urlParams_.Set("alt", alt)
11909	c.urlParams_.Set("prettyPrint", "false")
11910	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}")
11911	urls += "?" + c.urlParams_.Encode()
11912	req, err := http.NewRequest("DELETE", urls, body)
11913	if err != nil {
11914		return nil, err
11915	}
11916	req.Header = reqHeaders
11917	googleapi.Expand(req.URL, map[string]string{
11918		"logName": c.logName,
11919	})
11920	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11921}
11922
11923// Do executes the "logging.folders.logs.delete" call.
11924// Exactly one of *Empty or error will be non-nil. Any non-2xx status
11925// code is an error. Response headers are in either
11926// *Empty.ServerResponse.Header or (if a response was returned at all)
11927// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11928// check whether the returned error was because http.StatusNotModified
11929// was returned.
11930func (c *FoldersLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
11931	gensupport.SetOptions(c.urlParams_, opts...)
11932	res, err := c.doRequest("json")
11933	if res != nil && res.StatusCode == http.StatusNotModified {
11934		if res.Body != nil {
11935			res.Body.Close()
11936		}
11937		return nil, &googleapi.Error{
11938			Code:   res.StatusCode,
11939			Header: res.Header,
11940		}
11941	}
11942	if err != nil {
11943		return nil, err
11944	}
11945	defer googleapi.CloseBody(res)
11946	if err := googleapi.CheckResponse(res); err != nil {
11947		return nil, err
11948	}
11949	ret := &Empty{
11950		ServerResponse: googleapi.ServerResponse{
11951			Header:         res.Header,
11952			HTTPStatusCode: res.StatusCode,
11953		},
11954	}
11955	target := &ret
11956	if err := gensupport.DecodeResponse(target, res); err != nil {
11957		return nil, err
11958	}
11959	return ret, nil
11960	// {
11961	//   "description": "Deletes all the log entries in a log for the _Default Log Bucket. 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.",
11962	//   "flatPath": "v2/folders/{foldersId}/logs/{logsId}",
11963	//   "httpMethod": "DELETE",
11964	//   "id": "logging.folders.logs.delete",
11965	//   "parameterOrder": [
11966	//     "logName"
11967	//   ],
11968	//   "parameters": {
11969	//     "logName": {
11970	//       "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/123/logs/cloudaudit.googleapis.com%2Factivity\".For more information about log names, see LogEntry.",
11971	//       "location": "path",
11972	//       "pattern": "^folders/[^/]+/logs/[^/]+$",
11973	//       "required": true,
11974	//       "type": "string"
11975	//     }
11976	//   },
11977	//   "path": "v2/{+logName}",
11978	//   "response": {
11979	//     "$ref": "Empty"
11980	//   },
11981	//   "scopes": [
11982	//     "https://www.googleapis.com/auth/cloud-platform",
11983	//     "https://www.googleapis.com/auth/logging.admin"
11984	//   ]
11985	// }
11986
11987}
11988
11989// method id "logging.folders.logs.list":
11990
11991type FoldersLogsListCall struct {
11992	s            *Service
11993	parent       string
11994	urlParams_   gensupport.URLParams
11995	ifNoneMatch_ string
11996	ctx_         context.Context
11997	header_      http.Header
11998}
11999
12000// List: Lists the logs in projects, organizations, folders, or billing
12001// accounts. Only logs that have entries are listed.
12002//
12003// - parent: The resource name that owns the logs: projects/[PROJECT_ID]
12004//   organizations/[ORGANIZATION_ID]
12005//   billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID].
12006func (r *FoldersLogsService) List(parent string) *FoldersLogsListCall {
12007	c := &FoldersLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12008	c.parent = parent
12009	return c
12010}
12011
12012// PageSize sets the optional parameter "pageSize": The maximum number
12013// of results to return from this request. Non-positive values are
12014// ignored. The presence of nextPageToken in the response indicates that
12015// more results might be available.
12016func (c *FoldersLogsListCall) PageSize(pageSize int64) *FoldersLogsListCall {
12017	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
12018	return c
12019}
12020
12021// PageToken sets the optional parameter "pageToken": If present, then
12022// retrieve the next batch of results from the preceding call to this
12023// method. pageToken must be the value of nextPageToken from the
12024// previous response. The values of other method parameters should be
12025// identical to those in the previous call.
12026func (c *FoldersLogsListCall) PageToken(pageToken string) *FoldersLogsListCall {
12027	c.urlParams_.Set("pageToken", pageToken)
12028	return c
12029}
12030
12031// ResourceNames sets the optional parameter "resourceNames": The
12032// resource name that owns the logs:
12033// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view
12034// s/[VIEW_ID]
12035// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE
12036// T_ID]/views/[VIEW_ID]
12037// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[
12038// BUCKET_ID]/views/[VIEW_ID]
12039// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/
12040// [VIEW_ID]To support legacy queries, it could also be:
12041// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID]
12042// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]
12043func (c *FoldersLogsListCall) ResourceNames(resourceNames ...string) *FoldersLogsListCall {
12044	c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...))
12045	return c
12046}
12047
12048// Fields allows partial responses to be retrieved. See
12049// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12050// for more information.
12051func (c *FoldersLogsListCall) Fields(s ...googleapi.Field) *FoldersLogsListCall {
12052	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12053	return c
12054}
12055
12056// IfNoneMatch sets the optional parameter which makes the operation
12057// fail if the object's ETag matches the given value. This is useful for
12058// getting updates only after the object has changed since the last
12059// request. Use googleapi.IsNotModified to check whether the response
12060// error from Do is the result of In-None-Match.
12061func (c *FoldersLogsListCall) IfNoneMatch(entityTag string) *FoldersLogsListCall {
12062	c.ifNoneMatch_ = entityTag
12063	return c
12064}
12065
12066// Context sets the context to be used in this call's Do method. Any
12067// pending HTTP request will be aborted if the provided context is
12068// canceled.
12069func (c *FoldersLogsListCall) Context(ctx context.Context) *FoldersLogsListCall {
12070	c.ctx_ = ctx
12071	return c
12072}
12073
12074// Header returns an http.Header that can be modified by the caller to
12075// add HTTP headers to the request.
12076func (c *FoldersLogsListCall) Header() http.Header {
12077	if c.header_ == nil {
12078		c.header_ = make(http.Header)
12079	}
12080	return c.header_
12081}
12082
12083func (c *FoldersLogsListCall) doRequest(alt string) (*http.Response, error) {
12084	reqHeaders := make(http.Header)
12085	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
12086	for k, v := range c.header_ {
12087		reqHeaders[k] = v
12088	}
12089	reqHeaders.Set("User-Agent", c.s.userAgent())
12090	if c.ifNoneMatch_ != "" {
12091		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12092	}
12093	var body io.Reader = nil
12094	c.urlParams_.Set("alt", alt)
12095	c.urlParams_.Set("prettyPrint", "false")
12096	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs")
12097	urls += "?" + c.urlParams_.Encode()
12098	req, err := http.NewRequest("GET", urls, body)
12099	if err != nil {
12100		return nil, err
12101	}
12102	req.Header = reqHeaders
12103	googleapi.Expand(req.URL, map[string]string{
12104		"parent": c.parent,
12105	})
12106	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12107}
12108
12109// Do executes the "logging.folders.logs.list" call.
12110// Exactly one of *ListLogsResponse or error will be non-nil. Any
12111// non-2xx status code is an error. Response headers are in either
12112// *ListLogsResponse.ServerResponse.Header or (if a response was
12113// returned at all) in error.(*googleapi.Error).Header. Use
12114// googleapi.IsNotModified to check whether the returned error was
12115// because http.StatusNotModified was returned.
12116func (c *FoldersLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) {
12117	gensupport.SetOptions(c.urlParams_, opts...)
12118	res, err := c.doRequest("json")
12119	if res != nil && res.StatusCode == http.StatusNotModified {
12120		if res.Body != nil {
12121			res.Body.Close()
12122		}
12123		return nil, &googleapi.Error{
12124			Code:   res.StatusCode,
12125			Header: res.Header,
12126		}
12127	}
12128	if err != nil {
12129		return nil, err
12130	}
12131	defer googleapi.CloseBody(res)
12132	if err := googleapi.CheckResponse(res); err != nil {
12133		return nil, err
12134	}
12135	ret := &ListLogsResponse{
12136		ServerResponse: googleapi.ServerResponse{
12137			Header:         res.Header,
12138			HTTPStatusCode: res.StatusCode,
12139		},
12140	}
12141	target := &ret
12142	if err := gensupport.DecodeResponse(target, res); err != nil {
12143		return nil, err
12144	}
12145	return ret, nil
12146	// {
12147	//   "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.",
12148	//   "flatPath": "v2/folders/{foldersId}/logs",
12149	//   "httpMethod": "GET",
12150	//   "id": "logging.folders.logs.list",
12151	//   "parameterOrder": [
12152	//     "parent"
12153	//   ],
12154	//   "parameters": {
12155	//     "pageSize": {
12156	//       "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.",
12157	//       "format": "int32",
12158	//       "location": "query",
12159	//       "type": "integer"
12160	//     },
12161	//     "pageToken": {
12162	//       "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.",
12163	//       "location": "query",
12164	//       "type": "string"
12165	//     },
12166	//     "parent": {
12167	//       "description": "Required. The resource name that owns the logs: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]",
12168	//       "location": "path",
12169	//       "pattern": "^folders/[^/]+$",
12170	//       "required": true,
12171	//       "type": "string"
12172	//     },
12173	//     "resourceNames": {
12174	//       "description": "Optional. The resource name that owns the logs: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[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_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]",
12175	//       "location": "query",
12176	//       "repeated": true,
12177	//       "type": "string"
12178	//     }
12179	//   },
12180	//   "path": "v2/{+parent}/logs",
12181	//   "response": {
12182	//     "$ref": "ListLogsResponse"
12183	//   },
12184	//   "scopes": [
12185	//     "https://www.googleapis.com/auth/cloud-platform",
12186	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
12187	//     "https://www.googleapis.com/auth/logging.admin",
12188	//     "https://www.googleapis.com/auth/logging.read"
12189	//   ]
12190	// }
12191
12192}
12193
12194// Pages invokes f for each page of results.
12195// A non-nil error returned from f will halt the iteration.
12196// The provided context supersedes any context provided to the Context method.
12197func (c *FoldersLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error {
12198	c.ctx_ = ctx
12199	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
12200	for {
12201		x, err := c.Do()
12202		if err != nil {
12203			return err
12204		}
12205		if err := f(x); err != nil {
12206			return err
12207		}
12208		if x.NextPageToken == "" {
12209			return nil
12210		}
12211		c.PageToken(x.NextPageToken)
12212	}
12213}
12214
12215// method id "logging.folders.sinks.create":
12216
12217type FoldersSinksCreateCall struct {
12218	s          *Service
12219	parent     string
12220	logsink    *LogSink
12221	urlParams_ gensupport.URLParams
12222	ctx_       context.Context
12223	header_    http.Header
12224}
12225
12226// Create: Creates a sink that exports specified log entries to a
12227// destination. The export of newly-ingested log entries begins
12228// immediately, unless the sink's writer_identity is not permitted to
12229// write to the destination. A sink can export log entries only from the
12230// resource owning the sink.
12231//
12232// - parent: The resource in which to create the sink:
12233//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
12234//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
12235//   Examples: "projects/my-logging-project", "organizations/123456789".
12236func (r *FoldersSinksService) Create(parent string, logsink *LogSink) *FoldersSinksCreateCall {
12237	c := &FoldersSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12238	c.parent = parent
12239	c.logsink = logsink
12240	return c
12241}
12242
12243// UniqueWriterIdentity sets the optional parameter
12244// "uniqueWriterIdentity": Determines the kind of IAM identity returned
12245// as writer_identity in the new sink. If this value is omitted or set
12246// to false, and if the sink's parent is a project, then the value
12247// returned as writer_identity is the same group or service account used
12248// by Logging before the addition of writer identities to this API. The
12249// sink's destination must be in the same project as the sink itself.If
12250// this field is set to true, or if the sink is owned by a non-project
12251// resource such as an organization, then the value of writer_identity
12252// will be a unique service account used only for exports from the new
12253// sink. For more information, see writer_identity in LogSink.
12254func (c *FoldersSinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *FoldersSinksCreateCall {
12255	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
12256	return c
12257}
12258
12259// Fields allows partial responses to be retrieved. See
12260// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12261// for more information.
12262func (c *FoldersSinksCreateCall) Fields(s ...googleapi.Field) *FoldersSinksCreateCall {
12263	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12264	return c
12265}
12266
12267// Context sets the context to be used in this call's Do method. Any
12268// pending HTTP request will be aborted if the provided context is
12269// canceled.
12270func (c *FoldersSinksCreateCall) Context(ctx context.Context) *FoldersSinksCreateCall {
12271	c.ctx_ = ctx
12272	return c
12273}
12274
12275// Header returns an http.Header that can be modified by the caller to
12276// add HTTP headers to the request.
12277func (c *FoldersSinksCreateCall) Header() http.Header {
12278	if c.header_ == nil {
12279		c.header_ = make(http.Header)
12280	}
12281	return c.header_
12282}
12283
12284func (c *FoldersSinksCreateCall) doRequest(alt string) (*http.Response, error) {
12285	reqHeaders := make(http.Header)
12286	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
12287	for k, v := range c.header_ {
12288		reqHeaders[k] = v
12289	}
12290	reqHeaders.Set("User-Agent", c.s.userAgent())
12291	var body io.Reader = nil
12292	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
12293	if err != nil {
12294		return nil, err
12295	}
12296	reqHeaders.Set("Content-Type", "application/json")
12297	c.urlParams_.Set("alt", alt)
12298	c.urlParams_.Set("prettyPrint", "false")
12299	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
12300	urls += "?" + c.urlParams_.Encode()
12301	req, err := http.NewRequest("POST", urls, body)
12302	if err != nil {
12303		return nil, err
12304	}
12305	req.Header = reqHeaders
12306	googleapi.Expand(req.URL, map[string]string{
12307		"parent": c.parent,
12308	})
12309	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12310}
12311
12312// Do executes the "logging.folders.sinks.create" call.
12313// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
12314// code is an error. Response headers are in either
12315// *LogSink.ServerResponse.Header or (if a response was returned at all)
12316// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
12317// check whether the returned error was because http.StatusNotModified
12318// was returned.
12319func (c *FoldersSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
12320	gensupport.SetOptions(c.urlParams_, opts...)
12321	res, err := c.doRequest("json")
12322	if res != nil && res.StatusCode == http.StatusNotModified {
12323		if res.Body != nil {
12324			res.Body.Close()
12325		}
12326		return nil, &googleapi.Error{
12327			Code:   res.StatusCode,
12328			Header: res.Header,
12329		}
12330	}
12331	if err != nil {
12332		return nil, err
12333	}
12334	defer googleapi.CloseBody(res)
12335	if err := googleapi.CheckResponse(res); err != nil {
12336		return nil, err
12337	}
12338	ret := &LogSink{
12339		ServerResponse: googleapi.ServerResponse{
12340			Header:         res.Header,
12341			HTTPStatusCode: res.StatusCode,
12342		},
12343	}
12344	target := &ret
12345	if err := gensupport.DecodeResponse(target, res); err != nil {
12346		return nil, err
12347	}
12348	return ret, nil
12349	// {
12350	//   "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.",
12351	//   "flatPath": "v2/folders/{foldersId}/sinks",
12352	//   "httpMethod": "POST",
12353	//   "id": "logging.folders.sinks.create",
12354	//   "parameterOrder": [
12355	//     "parent"
12356	//   ],
12357	//   "parameters": {
12358	//     "parent": {
12359	//       "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\".",
12360	//       "location": "path",
12361	//       "pattern": "^folders/[^/]+$",
12362	//       "required": true,
12363	//       "type": "string"
12364	//     },
12365	//     "uniqueWriterIdentity": {
12366	//       "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.",
12367	//       "location": "query",
12368	//       "type": "boolean"
12369	//     }
12370	//   },
12371	//   "path": "v2/{+parent}/sinks",
12372	//   "request": {
12373	//     "$ref": "LogSink"
12374	//   },
12375	//   "response": {
12376	//     "$ref": "LogSink"
12377	//   },
12378	//   "scopes": [
12379	//     "https://www.googleapis.com/auth/cloud-platform",
12380	//     "https://www.googleapis.com/auth/logging.admin"
12381	//   ]
12382	// }
12383
12384}
12385
12386// method id "logging.folders.sinks.delete":
12387
12388type FoldersSinksDeleteCall struct {
12389	s          *Service
12390	sinkNameid string
12391	urlParams_ gensupport.URLParams
12392	ctx_       context.Context
12393	header_    http.Header
12394}
12395
12396// Delete: Deletes a sink. If the sink has a unique writer_identity,
12397// then that service account is also deleted.
12398//
12399// - sinkName: The full resource name of the sink to delete, including
12400//   the parent resource and the sink identifier:
12401//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
12402//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
12403//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
12404//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example:
12405//   "projects/my-project-id/sinks/my-sink-id".
12406func (r *FoldersSinksService) Delete(sinkNameid string) *FoldersSinksDeleteCall {
12407	c := &FoldersSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12408	c.sinkNameid = sinkNameid
12409	return c
12410}
12411
12412// Fields allows partial responses to be retrieved. See
12413// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12414// for more information.
12415func (c *FoldersSinksDeleteCall) Fields(s ...googleapi.Field) *FoldersSinksDeleteCall {
12416	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12417	return c
12418}
12419
12420// Context sets the context to be used in this call's Do method. Any
12421// pending HTTP request will be aborted if the provided context is
12422// canceled.
12423func (c *FoldersSinksDeleteCall) Context(ctx context.Context) *FoldersSinksDeleteCall {
12424	c.ctx_ = ctx
12425	return c
12426}
12427
12428// Header returns an http.Header that can be modified by the caller to
12429// add HTTP headers to the request.
12430func (c *FoldersSinksDeleteCall) Header() http.Header {
12431	if c.header_ == nil {
12432		c.header_ = make(http.Header)
12433	}
12434	return c.header_
12435}
12436
12437func (c *FoldersSinksDeleteCall) doRequest(alt string) (*http.Response, error) {
12438	reqHeaders := make(http.Header)
12439	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
12440	for k, v := range c.header_ {
12441		reqHeaders[k] = v
12442	}
12443	reqHeaders.Set("User-Agent", c.s.userAgent())
12444	var body io.Reader = nil
12445	c.urlParams_.Set("alt", alt)
12446	c.urlParams_.Set("prettyPrint", "false")
12447	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
12448	urls += "?" + c.urlParams_.Encode()
12449	req, err := http.NewRequest("DELETE", urls, body)
12450	if err != nil {
12451		return nil, err
12452	}
12453	req.Header = reqHeaders
12454	googleapi.Expand(req.URL, map[string]string{
12455		"sinkName": c.sinkNameid,
12456	})
12457	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12458}
12459
12460// Do executes the "logging.folders.sinks.delete" call.
12461// Exactly one of *Empty or error will be non-nil. Any non-2xx status
12462// code is an error. Response headers are in either
12463// *Empty.ServerResponse.Header or (if a response was returned at all)
12464// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
12465// check whether the returned error was because http.StatusNotModified
12466// was returned.
12467func (c *FoldersSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
12468	gensupport.SetOptions(c.urlParams_, opts...)
12469	res, err := c.doRequest("json")
12470	if res != nil && res.StatusCode == http.StatusNotModified {
12471		if res.Body != nil {
12472			res.Body.Close()
12473		}
12474		return nil, &googleapi.Error{
12475			Code:   res.StatusCode,
12476			Header: res.Header,
12477		}
12478	}
12479	if err != nil {
12480		return nil, err
12481	}
12482	defer googleapi.CloseBody(res)
12483	if err := googleapi.CheckResponse(res); err != nil {
12484		return nil, err
12485	}
12486	ret := &Empty{
12487		ServerResponse: googleapi.ServerResponse{
12488			Header:         res.Header,
12489			HTTPStatusCode: res.StatusCode,
12490		},
12491	}
12492	target := &ret
12493	if err := gensupport.DecodeResponse(target, res); err != nil {
12494		return nil, err
12495	}
12496	return ret, nil
12497	// {
12498	//   "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.",
12499	//   "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}",
12500	//   "httpMethod": "DELETE",
12501	//   "id": "logging.folders.sinks.delete",
12502	//   "parameterOrder": [
12503	//     "sinkName"
12504	//   ],
12505	//   "parameters": {
12506	//     "sinkName": {
12507	//       "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\".",
12508	//       "location": "path",
12509	//       "pattern": "^folders/[^/]+/sinks/[^/]+$",
12510	//       "required": true,
12511	//       "type": "string"
12512	//     }
12513	//   },
12514	//   "path": "v2/{+sinkName}",
12515	//   "response": {
12516	//     "$ref": "Empty"
12517	//   },
12518	//   "scopes": [
12519	//     "https://www.googleapis.com/auth/cloud-platform",
12520	//     "https://www.googleapis.com/auth/logging.admin"
12521	//   ]
12522	// }
12523
12524}
12525
12526// method id "logging.folders.sinks.get":
12527
12528type FoldersSinksGetCall struct {
12529	s            *Service
12530	sinkName     string
12531	urlParams_   gensupport.URLParams
12532	ifNoneMatch_ string
12533	ctx_         context.Context
12534	header_      http.Header
12535}
12536
12537// Get: Gets a sink.
12538//
12539// - sinkName: The resource name of the sink:
12540//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
12541//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
12542//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
12543//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example:
12544//   "projects/my-project-id/sinks/my-sink-id".
12545func (r *FoldersSinksService) Get(sinkName string) *FoldersSinksGetCall {
12546	c := &FoldersSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12547	c.sinkName = sinkName
12548	return c
12549}
12550
12551// Fields allows partial responses to be retrieved. See
12552// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12553// for more information.
12554func (c *FoldersSinksGetCall) Fields(s ...googleapi.Field) *FoldersSinksGetCall {
12555	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12556	return c
12557}
12558
12559// IfNoneMatch sets the optional parameter which makes the operation
12560// fail if the object's ETag matches the given value. This is useful for
12561// getting updates only after the object has changed since the last
12562// request. Use googleapi.IsNotModified to check whether the response
12563// error from Do is the result of In-None-Match.
12564func (c *FoldersSinksGetCall) IfNoneMatch(entityTag string) *FoldersSinksGetCall {
12565	c.ifNoneMatch_ = entityTag
12566	return c
12567}
12568
12569// Context sets the context to be used in this call's Do method. Any
12570// pending HTTP request will be aborted if the provided context is
12571// canceled.
12572func (c *FoldersSinksGetCall) Context(ctx context.Context) *FoldersSinksGetCall {
12573	c.ctx_ = ctx
12574	return c
12575}
12576
12577// Header returns an http.Header that can be modified by the caller to
12578// add HTTP headers to the request.
12579func (c *FoldersSinksGetCall) Header() http.Header {
12580	if c.header_ == nil {
12581		c.header_ = make(http.Header)
12582	}
12583	return c.header_
12584}
12585
12586func (c *FoldersSinksGetCall) doRequest(alt string) (*http.Response, error) {
12587	reqHeaders := make(http.Header)
12588	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
12589	for k, v := range c.header_ {
12590		reqHeaders[k] = v
12591	}
12592	reqHeaders.Set("User-Agent", c.s.userAgent())
12593	if c.ifNoneMatch_ != "" {
12594		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12595	}
12596	var body io.Reader = nil
12597	c.urlParams_.Set("alt", alt)
12598	c.urlParams_.Set("prettyPrint", "false")
12599	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
12600	urls += "?" + c.urlParams_.Encode()
12601	req, err := http.NewRequest("GET", urls, body)
12602	if err != nil {
12603		return nil, err
12604	}
12605	req.Header = reqHeaders
12606	googleapi.Expand(req.URL, map[string]string{
12607		"sinkName": c.sinkName,
12608	})
12609	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12610}
12611
12612// Do executes the "logging.folders.sinks.get" call.
12613// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
12614// code is an error. Response headers are in either
12615// *LogSink.ServerResponse.Header or (if a response was returned at all)
12616// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
12617// check whether the returned error was because http.StatusNotModified
12618// was returned.
12619func (c *FoldersSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
12620	gensupport.SetOptions(c.urlParams_, opts...)
12621	res, err := c.doRequest("json")
12622	if res != nil && res.StatusCode == http.StatusNotModified {
12623		if res.Body != nil {
12624			res.Body.Close()
12625		}
12626		return nil, &googleapi.Error{
12627			Code:   res.StatusCode,
12628			Header: res.Header,
12629		}
12630	}
12631	if err != nil {
12632		return nil, err
12633	}
12634	defer googleapi.CloseBody(res)
12635	if err := googleapi.CheckResponse(res); err != nil {
12636		return nil, err
12637	}
12638	ret := &LogSink{
12639		ServerResponse: googleapi.ServerResponse{
12640			Header:         res.Header,
12641			HTTPStatusCode: res.StatusCode,
12642		},
12643	}
12644	target := &ret
12645	if err := gensupport.DecodeResponse(target, res); err != nil {
12646		return nil, err
12647	}
12648	return ret, nil
12649	// {
12650	//   "description": "Gets a sink.",
12651	//   "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}",
12652	//   "httpMethod": "GET",
12653	//   "id": "logging.folders.sinks.get",
12654	//   "parameterOrder": [
12655	//     "sinkName"
12656	//   ],
12657	//   "parameters": {
12658	//     "sinkName": {
12659	//       "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\".",
12660	//       "location": "path",
12661	//       "pattern": "^folders/[^/]+/sinks/[^/]+$",
12662	//       "required": true,
12663	//       "type": "string"
12664	//     }
12665	//   },
12666	//   "path": "v2/{+sinkName}",
12667	//   "response": {
12668	//     "$ref": "LogSink"
12669	//   },
12670	//   "scopes": [
12671	//     "https://www.googleapis.com/auth/cloud-platform",
12672	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
12673	//     "https://www.googleapis.com/auth/logging.admin",
12674	//     "https://www.googleapis.com/auth/logging.read"
12675	//   ]
12676	// }
12677
12678}
12679
12680// method id "logging.folders.sinks.list":
12681
12682type FoldersSinksListCall struct {
12683	s            *Service
12684	parent       string
12685	urlParams_   gensupport.URLParams
12686	ifNoneMatch_ string
12687	ctx_         context.Context
12688	header_      http.Header
12689}
12690
12691// List: Lists sinks.
12692//
12693// - parent: The parent resource whose sinks are to be listed:
12694//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
12695//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]".
12696func (r *FoldersSinksService) List(parent string) *FoldersSinksListCall {
12697	c := &FoldersSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12698	c.parent = parent
12699	return c
12700}
12701
12702// PageSize sets the optional parameter "pageSize": The maximum number
12703// of results to return from this request. Non-positive values are
12704// ignored. The presence of nextPageToken in the response indicates that
12705// more results might be available.
12706func (c *FoldersSinksListCall) PageSize(pageSize int64) *FoldersSinksListCall {
12707	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
12708	return c
12709}
12710
12711// PageToken sets the optional parameter "pageToken": If present, then
12712// retrieve the next batch of results from the preceding call to this
12713// method. pageToken must be the value of nextPageToken from the
12714// previous response. The values of other method parameters should be
12715// identical to those in the previous call.
12716func (c *FoldersSinksListCall) PageToken(pageToken string) *FoldersSinksListCall {
12717	c.urlParams_.Set("pageToken", pageToken)
12718	return c
12719}
12720
12721// Fields allows partial responses to be retrieved. See
12722// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12723// for more information.
12724func (c *FoldersSinksListCall) Fields(s ...googleapi.Field) *FoldersSinksListCall {
12725	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12726	return c
12727}
12728
12729// IfNoneMatch sets the optional parameter which makes the operation
12730// fail if the object's ETag matches the given value. This is useful for
12731// getting updates only after the object has changed since the last
12732// request. Use googleapi.IsNotModified to check whether the response
12733// error from Do is the result of In-None-Match.
12734func (c *FoldersSinksListCall) IfNoneMatch(entityTag string) *FoldersSinksListCall {
12735	c.ifNoneMatch_ = entityTag
12736	return c
12737}
12738
12739// Context sets the context to be used in this call's Do method. Any
12740// pending HTTP request will be aborted if the provided context is
12741// canceled.
12742func (c *FoldersSinksListCall) Context(ctx context.Context) *FoldersSinksListCall {
12743	c.ctx_ = ctx
12744	return c
12745}
12746
12747// Header returns an http.Header that can be modified by the caller to
12748// add HTTP headers to the request.
12749func (c *FoldersSinksListCall) Header() http.Header {
12750	if c.header_ == nil {
12751		c.header_ = make(http.Header)
12752	}
12753	return c.header_
12754}
12755
12756func (c *FoldersSinksListCall) doRequest(alt string) (*http.Response, error) {
12757	reqHeaders := make(http.Header)
12758	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
12759	for k, v := range c.header_ {
12760		reqHeaders[k] = v
12761	}
12762	reqHeaders.Set("User-Agent", c.s.userAgent())
12763	if c.ifNoneMatch_ != "" {
12764		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12765	}
12766	var body io.Reader = nil
12767	c.urlParams_.Set("alt", alt)
12768	c.urlParams_.Set("prettyPrint", "false")
12769	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
12770	urls += "?" + c.urlParams_.Encode()
12771	req, err := http.NewRequest("GET", urls, body)
12772	if err != nil {
12773		return nil, err
12774	}
12775	req.Header = reqHeaders
12776	googleapi.Expand(req.URL, map[string]string{
12777		"parent": c.parent,
12778	})
12779	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12780}
12781
12782// Do executes the "logging.folders.sinks.list" call.
12783// Exactly one of *ListSinksResponse or error will be non-nil. Any
12784// non-2xx status code is an error. Response headers are in either
12785// *ListSinksResponse.ServerResponse.Header or (if a response was
12786// returned at all) in error.(*googleapi.Error).Header. Use
12787// googleapi.IsNotModified to check whether the returned error was
12788// because http.StatusNotModified was returned.
12789func (c *FoldersSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) {
12790	gensupport.SetOptions(c.urlParams_, opts...)
12791	res, err := c.doRequest("json")
12792	if res != nil && res.StatusCode == http.StatusNotModified {
12793		if res.Body != nil {
12794			res.Body.Close()
12795		}
12796		return nil, &googleapi.Error{
12797			Code:   res.StatusCode,
12798			Header: res.Header,
12799		}
12800	}
12801	if err != nil {
12802		return nil, err
12803	}
12804	defer googleapi.CloseBody(res)
12805	if err := googleapi.CheckResponse(res); err != nil {
12806		return nil, err
12807	}
12808	ret := &ListSinksResponse{
12809		ServerResponse: googleapi.ServerResponse{
12810			Header:         res.Header,
12811			HTTPStatusCode: res.StatusCode,
12812		},
12813	}
12814	target := &ret
12815	if err := gensupport.DecodeResponse(target, res); err != nil {
12816		return nil, err
12817	}
12818	return ret, nil
12819	// {
12820	//   "description": "Lists sinks.",
12821	//   "flatPath": "v2/folders/{foldersId}/sinks",
12822	//   "httpMethod": "GET",
12823	//   "id": "logging.folders.sinks.list",
12824	//   "parameterOrder": [
12825	//     "parent"
12826	//   ],
12827	//   "parameters": {
12828	//     "pageSize": {
12829	//       "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.",
12830	//       "format": "int32",
12831	//       "location": "query",
12832	//       "type": "integer"
12833	//     },
12834	//     "pageToken": {
12835	//       "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.",
12836	//       "location": "query",
12837	//       "type": "string"
12838	//     },
12839	//     "parent": {
12840	//       "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
12841	//       "location": "path",
12842	//       "pattern": "^folders/[^/]+$",
12843	//       "required": true,
12844	//       "type": "string"
12845	//     }
12846	//   },
12847	//   "path": "v2/{+parent}/sinks",
12848	//   "response": {
12849	//     "$ref": "ListSinksResponse"
12850	//   },
12851	//   "scopes": [
12852	//     "https://www.googleapis.com/auth/cloud-platform",
12853	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
12854	//     "https://www.googleapis.com/auth/logging.admin",
12855	//     "https://www.googleapis.com/auth/logging.read"
12856	//   ]
12857	// }
12858
12859}
12860
12861// Pages invokes f for each page of results.
12862// A non-nil error returned from f will halt the iteration.
12863// The provided context supersedes any context provided to the Context method.
12864func (c *FoldersSinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error {
12865	c.ctx_ = ctx
12866	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
12867	for {
12868		x, err := c.Do()
12869		if err != nil {
12870			return err
12871		}
12872		if err := f(x); err != nil {
12873			return err
12874		}
12875		if x.NextPageToken == "" {
12876			return nil
12877		}
12878		c.PageToken(x.NextPageToken)
12879	}
12880}
12881
12882// method id "logging.folders.sinks.patch":
12883
12884type FoldersSinksPatchCall struct {
12885	s          *Service
12886	sinkNameid string
12887	logsink    *LogSink
12888	urlParams_ gensupport.URLParams
12889	ctx_       context.Context
12890	header_    http.Header
12891}
12892
12893// Patch: Updates a sink. This method replaces the following fields in
12894// the existing sink with values from the new sink: destination, and
12895// filter.The updated sink might also have a new writer_identity; see
12896// the unique_writer_identity field.
12897//
12898// - sinkName: The full resource name of the sink to update, including
12899//   the parent resource and the sink identifier:
12900//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
12901//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
12902//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
12903//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example:
12904//   "projects/my-project-id/sinks/my-sink-id".
12905func (r *FoldersSinksService) Patch(sinkNameid string, logsink *LogSink) *FoldersSinksPatchCall {
12906	c := &FoldersSinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12907	c.sinkNameid = sinkNameid
12908	c.logsink = logsink
12909	return c
12910}
12911
12912// UniqueWriterIdentity sets the optional parameter
12913// "uniqueWriterIdentity": See sinks.create for a description of this
12914// field. When updating a sink, the effect of this field on the value of
12915// writer_identity in the updated sink depends on both the old and new
12916// values of this field: If the old and new values of this field are
12917// both false or both true, then there is no change to the sink's
12918// writer_identity. If the old value is false and the new value is true,
12919// then writer_identity is changed to a unique service account. It is an
12920// error if the old value is true and the new value is set to false or
12921// defaulted to false.
12922func (c *FoldersSinksPatchCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *FoldersSinksPatchCall {
12923	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
12924	return c
12925}
12926
12927// UpdateMask sets the optional parameter "updateMask": Field mask that
12928// specifies the fields in sink that need an update. A sink field will
12929// be overwritten if, and only if, it is in the update mask. name and
12930// output only fields cannot be updated.An empty updateMask is
12931// temporarily treated as using the following mask for backwards
12932// compatibility purposes: destination,filter,includeChildren At some
12933// point in the future, behavior will be removed and specifying an empty
12934// updateMask will be an error.For a detailed FieldMask definition, see
12935// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
12936// updateMask=filter.
12937func (c *FoldersSinksPatchCall) UpdateMask(updateMask string) *FoldersSinksPatchCall {
12938	c.urlParams_.Set("updateMask", updateMask)
12939	return c
12940}
12941
12942// Fields allows partial responses to be retrieved. See
12943// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12944// for more information.
12945func (c *FoldersSinksPatchCall) Fields(s ...googleapi.Field) *FoldersSinksPatchCall {
12946	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12947	return c
12948}
12949
12950// Context sets the context to be used in this call's Do method. Any
12951// pending HTTP request will be aborted if the provided context is
12952// canceled.
12953func (c *FoldersSinksPatchCall) Context(ctx context.Context) *FoldersSinksPatchCall {
12954	c.ctx_ = ctx
12955	return c
12956}
12957
12958// Header returns an http.Header that can be modified by the caller to
12959// add HTTP headers to the request.
12960func (c *FoldersSinksPatchCall) Header() http.Header {
12961	if c.header_ == nil {
12962		c.header_ = make(http.Header)
12963	}
12964	return c.header_
12965}
12966
12967func (c *FoldersSinksPatchCall) doRequest(alt string) (*http.Response, error) {
12968	reqHeaders := make(http.Header)
12969	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
12970	for k, v := range c.header_ {
12971		reqHeaders[k] = v
12972	}
12973	reqHeaders.Set("User-Agent", c.s.userAgent())
12974	var body io.Reader = nil
12975	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
12976	if err != nil {
12977		return nil, err
12978	}
12979	reqHeaders.Set("Content-Type", "application/json")
12980	c.urlParams_.Set("alt", alt)
12981	c.urlParams_.Set("prettyPrint", "false")
12982	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
12983	urls += "?" + c.urlParams_.Encode()
12984	req, err := http.NewRequest("PATCH", urls, body)
12985	if err != nil {
12986		return nil, err
12987	}
12988	req.Header = reqHeaders
12989	googleapi.Expand(req.URL, map[string]string{
12990		"sinkName": c.sinkNameid,
12991	})
12992	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12993}
12994
12995// Do executes the "logging.folders.sinks.patch" call.
12996// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
12997// code is an error. Response headers are in either
12998// *LogSink.ServerResponse.Header or (if a response was returned at all)
12999// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
13000// check whether the returned error was because http.StatusNotModified
13001// was returned.
13002func (c *FoldersSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
13003	gensupport.SetOptions(c.urlParams_, opts...)
13004	res, err := c.doRequest("json")
13005	if res != nil && res.StatusCode == http.StatusNotModified {
13006		if res.Body != nil {
13007			res.Body.Close()
13008		}
13009		return nil, &googleapi.Error{
13010			Code:   res.StatusCode,
13011			Header: res.Header,
13012		}
13013	}
13014	if err != nil {
13015		return nil, err
13016	}
13017	defer googleapi.CloseBody(res)
13018	if err := googleapi.CheckResponse(res); err != nil {
13019		return nil, err
13020	}
13021	ret := &LogSink{
13022		ServerResponse: googleapi.ServerResponse{
13023			Header:         res.Header,
13024			HTTPStatusCode: res.StatusCode,
13025		},
13026	}
13027	target := &ret
13028	if err := gensupport.DecodeResponse(target, res); err != nil {
13029		return nil, err
13030	}
13031	return ret, nil
13032	// {
13033	//   "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.",
13034	//   "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}",
13035	//   "httpMethod": "PATCH",
13036	//   "id": "logging.folders.sinks.patch",
13037	//   "parameterOrder": [
13038	//     "sinkName"
13039	//   ],
13040	//   "parameters": {
13041	//     "sinkName": {
13042	//       "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\".",
13043	//       "location": "path",
13044	//       "pattern": "^folders/[^/]+/sinks/[^/]+$",
13045	//       "required": true,
13046	//       "type": "string"
13047	//     },
13048	//     "uniqueWriterIdentity": {
13049	//       "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.",
13050	//       "location": "query",
13051	//       "type": "boolean"
13052	//     },
13053	//     "updateMask": {
13054	//       "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.",
13055	//       "format": "google-fieldmask",
13056	//       "location": "query",
13057	//       "type": "string"
13058	//     }
13059	//   },
13060	//   "path": "v2/{+sinkName}",
13061	//   "request": {
13062	//     "$ref": "LogSink"
13063	//   },
13064	//   "response": {
13065	//     "$ref": "LogSink"
13066	//   },
13067	//   "scopes": [
13068	//     "https://www.googleapis.com/auth/cloud-platform",
13069	//     "https://www.googleapis.com/auth/logging.admin"
13070	//   ]
13071	// }
13072
13073}
13074
13075// method id "logging.folders.sinks.update":
13076
13077type FoldersSinksUpdateCall struct {
13078	s          *Service
13079	sinkNameid string
13080	logsink    *LogSink
13081	urlParams_ gensupport.URLParams
13082	ctx_       context.Context
13083	header_    http.Header
13084}
13085
13086// Update: Updates a sink. This method replaces the following fields in
13087// the existing sink with values from the new sink: destination, and
13088// filter.The updated sink might also have a new writer_identity; see
13089// the unique_writer_identity field.
13090//
13091// - sinkName: The full resource name of the sink to update, including
13092//   the parent resource and the sink identifier:
13093//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
13094//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
13095//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
13096//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example:
13097//   "projects/my-project-id/sinks/my-sink-id".
13098func (r *FoldersSinksService) Update(sinkNameid string, logsink *LogSink) *FoldersSinksUpdateCall {
13099	c := &FoldersSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13100	c.sinkNameid = sinkNameid
13101	c.logsink = logsink
13102	return c
13103}
13104
13105// UniqueWriterIdentity sets the optional parameter
13106// "uniqueWriterIdentity": See sinks.create for a description of this
13107// field. When updating a sink, the effect of this field on the value of
13108// writer_identity in the updated sink depends on both the old and new
13109// values of this field: If the old and new values of this field are
13110// both false or both true, then there is no change to the sink's
13111// writer_identity. If the old value is false and the new value is true,
13112// then writer_identity is changed to a unique service account. It is an
13113// error if the old value is true and the new value is set to false or
13114// defaulted to false.
13115func (c *FoldersSinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *FoldersSinksUpdateCall {
13116	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
13117	return c
13118}
13119
13120// UpdateMask sets the optional parameter "updateMask": Field mask that
13121// specifies the fields in sink that need an update. A sink field will
13122// be overwritten if, and only if, it is in the update mask. name and
13123// output only fields cannot be updated.An empty updateMask is
13124// temporarily treated as using the following mask for backwards
13125// compatibility purposes: destination,filter,includeChildren At some
13126// point in the future, behavior will be removed and specifying an empty
13127// updateMask will be an error.For a detailed FieldMask definition, see
13128// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
13129// updateMask=filter.
13130func (c *FoldersSinksUpdateCall) UpdateMask(updateMask string) *FoldersSinksUpdateCall {
13131	c.urlParams_.Set("updateMask", updateMask)
13132	return c
13133}
13134
13135// Fields allows partial responses to be retrieved. See
13136// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
13137// for more information.
13138func (c *FoldersSinksUpdateCall) Fields(s ...googleapi.Field) *FoldersSinksUpdateCall {
13139	c.urlParams_.Set("fields", googleapi.CombineFields(s))
13140	return c
13141}
13142
13143// Context sets the context to be used in this call's Do method. Any
13144// pending HTTP request will be aborted if the provided context is
13145// canceled.
13146func (c *FoldersSinksUpdateCall) Context(ctx context.Context) *FoldersSinksUpdateCall {
13147	c.ctx_ = ctx
13148	return c
13149}
13150
13151// Header returns an http.Header that can be modified by the caller to
13152// add HTTP headers to the request.
13153func (c *FoldersSinksUpdateCall) Header() http.Header {
13154	if c.header_ == nil {
13155		c.header_ = make(http.Header)
13156	}
13157	return c.header_
13158}
13159
13160func (c *FoldersSinksUpdateCall) doRequest(alt string) (*http.Response, error) {
13161	reqHeaders := make(http.Header)
13162	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
13163	for k, v := range c.header_ {
13164		reqHeaders[k] = v
13165	}
13166	reqHeaders.Set("User-Agent", c.s.userAgent())
13167	var body io.Reader = nil
13168	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
13169	if err != nil {
13170		return nil, err
13171	}
13172	reqHeaders.Set("Content-Type", "application/json")
13173	c.urlParams_.Set("alt", alt)
13174	c.urlParams_.Set("prettyPrint", "false")
13175	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
13176	urls += "?" + c.urlParams_.Encode()
13177	req, err := http.NewRequest("PUT", urls, body)
13178	if err != nil {
13179		return nil, err
13180	}
13181	req.Header = reqHeaders
13182	googleapi.Expand(req.URL, map[string]string{
13183		"sinkName": c.sinkNameid,
13184	})
13185	return gensupport.SendRequest(c.ctx_, c.s.client, req)
13186}
13187
13188// Do executes the "logging.folders.sinks.update" call.
13189// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
13190// code is an error. Response headers are in either
13191// *LogSink.ServerResponse.Header or (if a response was returned at all)
13192// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
13193// check whether the returned error was because http.StatusNotModified
13194// was returned.
13195func (c *FoldersSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
13196	gensupport.SetOptions(c.urlParams_, opts...)
13197	res, err := c.doRequest("json")
13198	if res != nil && res.StatusCode == http.StatusNotModified {
13199		if res.Body != nil {
13200			res.Body.Close()
13201		}
13202		return nil, &googleapi.Error{
13203			Code:   res.StatusCode,
13204			Header: res.Header,
13205		}
13206	}
13207	if err != nil {
13208		return nil, err
13209	}
13210	defer googleapi.CloseBody(res)
13211	if err := googleapi.CheckResponse(res); err != nil {
13212		return nil, err
13213	}
13214	ret := &LogSink{
13215		ServerResponse: googleapi.ServerResponse{
13216			Header:         res.Header,
13217			HTTPStatusCode: res.StatusCode,
13218		},
13219	}
13220	target := &ret
13221	if err := gensupport.DecodeResponse(target, res); err != nil {
13222		return nil, err
13223	}
13224	return ret, nil
13225	// {
13226	//   "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.",
13227	//   "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}",
13228	//   "httpMethod": "PUT",
13229	//   "id": "logging.folders.sinks.update",
13230	//   "parameterOrder": [
13231	//     "sinkName"
13232	//   ],
13233	//   "parameters": {
13234	//     "sinkName": {
13235	//       "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\".",
13236	//       "location": "path",
13237	//       "pattern": "^folders/[^/]+/sinks/[^/]+$",
13238	//       "required": true,
13239	//       "type": "string"
13240	//     },
13241	//     "uniqueWriterIdentity": {
13242	//       "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.",
13243	//       "location": "query",
13244	//       "type": "boolean"
13245	//     },
13246	//     "updateMask": {
13247	//       "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.",
13248	//       "format": "google-fieldmask",
13249	//       "location": "query",
13250	//       "type": "string"
13251	//     }
13252	//   },
13253	//   "path": "v2/{+sinkName}",
13254	//   "request": {
13255	//     "$ref": "LogSink"
13256	//   },
13257	//   "response": {
13258	//     "$ref": "LogSink"
13259	//   },
13260	//   "scopes": [
13261	//     "https://www.googleapis.com/auth/cloud-platform",
13262	//     "https://www.googleapis.com/auth/logging.admin"
13263	//   ]
13264	// }
13265
13266}
13267
13268// method id "logging.locations.get":
13269
13270type LocationsGetCall struct {
13271	s            *Service
13272	name         string
13273	urlParams_   gensupport.URLParams
13274	ifNoneMatch_ string
13275	ctx_         context.Context
13276	header_      http.Header
13277}
13278
13279// Get: Gets information about a location.
13280//
13281// - name: Resource name for the location.
13282func (r *LocationsService) Get(name string) *LocationsGetCall {
13283	c := &LocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13284	c.name = name
13285	return c
13286}
13287
13288// Fields allows partial responses to be retrieved. See
13289// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
13290// for more information.
13291func (c *LocationsGetCall) Fields(s ...googleapi.Field) *LocationsGetCall {
13292	c.urlParams_.Set("fields", googleapi.CombineFields(s))
13293	return c
13294}
13295
13296// IfNoneMatch sets the optional parameter which makes the operation
13297// fail if the object's ETag matches the given value. This is useful for
13298// getting updates only after the object has changed since the last
13299// request. Use googleapi.IsNotModified to check whether the response
13300// error from Do is the result of In-None-Match.
13301func (c *LocationsGetCall) IfNoneMatch(entityTag string) *LocationsGetCall {
13302	c.ifNoneMatch_ = entityTag
13303	return c
13304}
13305
13306// Context sets the context to be used in this call's Do method. Any
13307// pending HTTP request will be aborted if the provided context is
13308// canceled.
13309func (c *LocationsGetCall) Context(ctx context.Context) *LocationsGetCall {
13310	c.ctx_ = ctx
13311	return c
13312}
13313
13314// Header returns an http.Header that can be modified by the caller to
13315// add HTTP headers to the request.
13316func (c *LocationsGetCall) Header() http.Header {
13317	if c.header_ == nil {
13318		c.header_ = make(http.Header)
13319	}
13320	return c.header_
13321}
13322
13323func (c *LocationsGetCall) doRequest(alt string) (*http.Response, error) {
13324	reqHeaders := make(http.Header)
13325	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
13326	for k, v := range c.header_ {
13327		reqHeaders[k] = v
13328	}
13329	reqHeaders.Set("User-Agent", c.s.userAgent())
13330	if c.ifNoneMatch_ != "" {
13331		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
13332	}
13333	var body io.Reader = nil
13334	c.urlParams_.Set("alt", alt)
13335	c.urlParams_.Set("prettyPrint", "false")
13336	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
13337	urls += "?" + c.urlParams_.Encode()
13338	req, err := http.NewRequest("GET", urls, body)
13339	if err != nil {
13340		return nil, err
13341	}
13342	req.Header = reqHeaders
13343	googleapi.Expand(req.URL, map[string]string{
13344		"name": c.name,
13345	})
13346	return gensupport.SendRequest(c.ctx_, c.s.client, req)
13347}
13348
13349// Do executes the "logging.locations.get" call.
13350// Exactly one of *Location or error will be non-nil. Any non-2xx status
13351// code is an error. Response headers are in either
13352// *Location.ServerResponse.Header or (if a response was returned at
13353// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
13354// to check whether the returned error was because
13355// http.StatusNotModified was returned.
13356func (c *LocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
13357	gensupport.SetOptions(c.urlParams_, opts...)
13358	res, err := c.doRequest("json")
13359	if res != nil && res.StatusCode == http.StatusNotModified {
13360		if res.Body != nil {
13361			res.Body.Close()
13362		}
13363		return nil, &googleapi.Error{
13364			Code:   res.StatusCode,
13365			Header: res.Header,
13366		}
13367	}
13368	if err != nil {
13369		return nil, err
13370	}
13371	defer googleapi.CloseBody(res)
13372	if err := googleapi.CheckResponse(res); err != nil {
13373		return nil, err
13374	}
13375	ret := &Location{
13376		ServerResponse: googleapi.ServerResponse{
13377			Header:         res.Header,
13378			HTTPStatusCode: res.StatusCode,
13379		},
13380	}
13381	target := &ret
13382	if err := gensupport.DecodeResponse(target, res); err != nil {
13383		return nil, err
13384	}
13385	return ret, nil
13386	// {
13387	//   "description": "Gets information about a location.",
13388	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}",
13389	//   "httpMethod": "GET",
13390	//   "id": "logging.locations.get",
13391	//   "parameterOrder": [
13392	//     "name"
13393	//   ],
13394	//   "parameters": {
13395	//     "name": {
13396	//       "description": "Resource name for the location.",
13397	//       "location": "path",
13398	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+$",
13399	//       "required": true,
13400	//       "type": "string"
13401	//     }
13402	//   },
13403	//   "path": "v2/{+name}",
13404	//   "response": {
13405	//     "$ref": "Location"
13406	//   },
13407	//   "scopes": [
13408	//     "https://www.googleapis.com/auth/cloud-platform",
13409	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
13410	//     "https://www.googleapis.com/auth/logging.admin",
13411	//     "https://www.googleapis.com/auth/logging.read"
13412	//   ]
13413	// }
13414
13415}
13416
13417// method id "logging.locations.list":
13418
13419type LocationsListCall struct {
13420	s            *Service
13421	name         string
13422	urlParams_   gensupport.URLParams
13423	ifNoneMatch_ string
13424	ctx_         context.Context
13425	header_      http.Header
13426}
13427
13428// List: Lists information about the supported locations for this
13429// service.
13430//
13431// - name: The resource that owns the locations collection, if
13432//   applicable.
13433func (r *LocationsService) List(name string) *LocationsListCall {
13434	c := &LocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13435	c.name = name
13436	return c
13437}
13438
13439// Filter sets the optional parameter "filter": A filter to narrow down
13440// results to a preferred subset. The filtering language accepts strings
13441// like "displayName=tokyo", and is documented in more detail in AIP-160
13442// (https://google.aip.dev/160).
13443func (c *LocationsListCall) Filter(filter string) *LocationsListCall {
13444	c.urlParams_.Set("filter", filter)
13445	return c
13446}
13447
13448// PageSize sets the optional parameter "pageSize": The maximum number
13449// of results to return. If not set, the service selects a default.
13450func (c *LocationsListCall) PageSize(pageSize int64) *LocationsListCall {
13451	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
13452	return c
13453}
13454
13455// PageToken sets the optional parameter "pageToken": A page token
13456// received from the next_page_token field in the response. Send that
13457// page token to receive the subsequent page.
13458func (c *LocationsListCall) PageToken(pageToken string) *LocationsListCall {
13459	c.urlParams_.Set("pageToken", pageToken)
13460	return c
13461}
13462
13463// Fields allows partial responses to be retrieved. See
13464// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
13465// for more information.
13466func (c *LocationsListCall) Fields(s ...googleapi.Field) *LocationsListCall {
13467	c.urlParams_.Set("fields", googleapi.CombineFields(s))
13468	return c
13469}
13470
13471// IfNoneMatch sets the optional parameter which makes the operation
13472// fail if the object's ETag matches the given value. This is useful for
13473// getting updates only after the object has changed since the last
13474// request. Use googleapi.IsNotModified to check whether the response
13475// error from Do is the result of In-None-Match.
13476func (c *LocationsListCall) IfNoneMatch(entityTag string) *LocationsListCall {
13477	c.ifNoneMatch_ = entityTag
13478	return c
13479}
13480
13481// Context sets the context to be used in this call's Do method. Any
13482// pending HTTP request will be aborted if the provided context is
13483// canceled.
13484func (c *LocationsListCall) Context(ctx context.Context) *LocationsListCall {
13485	c.ctx_ = ctx
13486	return c
13487}
13488
13489// Header returns an http.Header that can be modified by the caller to
13490// add HTTP headers to the request.
13491func (c *LocationsListCall) Header() http.Header {
13492	if c.header_ == nil {
13493		c.header_ = make(http.Header)
13494	}
13495	return c.header_
13496}
13497
13498func (c *LocationsListCall) doRequest(alt string) (*http.Response, error) {
13499	reqHeaders := make(http.Header)
13500	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
13501	for k, v := range c.header_ {
13502		reqHeaders[k] = v
13503	}
13504	reqHeaders.Set("User-Agent", c.s.userAgent())
13505	if c.ifNoneMatch_ != "" {
13506		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
13507	}
13508	var body io.Reader = nil
13509	c.urlParams_.Set("alt", alt)
13510	c.urlParams_.Set("prettyPrint", "false")
13511	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations")
13512	urls += "?" + c.urlParams_.Encode()
13513	req, err := http.NewRequest("GET", urls, body)
13514	if err != nil {
13515		return nil, err
13516	}
13517	req.Header = reqHeaders
13518	googleapi.Expand(req.URL, map[string]string{
13519		"name": c.name,
13520	})
13521	return gensupport.SendRequest(c.ctx_, c.s.client, req)
13522}
13523
13524// Do executes the "logging.locations.list" call.
13525// Exactly one of *ListLocationsResponse or error will be non-nil. Any
13526// non-2xx status code is an error. Response headers are in either
13527// *ListLocationsResponse.ServerResponse.Header or (if a response was
13528// returned at all) in error.(*googleapi.Error).Header. Use
13529// googleapi.IsNotModified to check whether the returned error was
13530// because http.StatusNotModified was returned.
13531func (c *LocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
13532	gensupport.SetOptions(c.urlParams_, opts...)
13533	res, err := c.doRequest("json")
13534	if res != nil && res.StatusCode == http.StatusNotModified {
13535		if res.Body != nil {
13536			res.Body.Close()
13537		}
13538		return nil, &googleapi.Error{
13539			Code:   res.StatusCode,
13540			Header: res.Header,
13541		}
13542	}
13543	if err != nil {
13544		return nil, err
13545	}
13546	defer googleapi.CloseBody(res)
13547	if err := googleapi.CheckResponse(res); err != nil {
13548		return nil, err
13549	}
13550	ret := &ListLocationsResponse{
13551		ServerResponse: googleapi.ServerResponse{
13552			Header:         res.Header,
13553			HTTPStatusCode: res.StatusCode,
13554		},
13555	}
13556	target := &ret
13557	if err := gensupport.DecodeResponse(target, res); err != nil {
13558		return nil, err
13559	}
13560	return ret, nil
13561	// {
13562	//   "description": "Lists information about the supported locations for this service.",
13563	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations",
13564	//   "httpMethod": "GET",
13565	//   "id": "logging.locations.list",
13566	//   "parameterOrder": [
13567	//     "name"
13568	//   ],
13569	//   "parameters": {
13570	//     "filter": {
13571	//       "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like \"displayName=tokyo\", and is documented in more detail in AIP-160 (https://google.aip.dev/160).",
13572	//       "location": "query",
13573	//       "type": "string"
13574	//     },
13575	//     "name": {
13576	//       "description": "The resource that owns the locations collection, if applicable.",
13577	//       "location": "path",
13578	//       "pattern": "^[^/]+/[^/]+$",
13579	//       "required": true,
13580	//       "type": "string"
13581	//     },
13582	//     "pageSize": {
13583	//       "description": "The maximum number of results to return. If not set, the service selects a default.",
13584	//       "format": "int32",
13585	//       "location": "query",
13586	//       "type": "integer"
13587	//     },
13588	//     "pageToken": {
13589	//       "description": "A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.",
13590	//       "location": "query",
13591	//       "type": "string"
13592	//     }
13593	//   },
13594	//   "path": "v2/{+name}/locations",
13595	//   "response": {
13596	//     "$ref": "ListLocationsResponse"
13597	//   },
13598	//   "scopes": [
13599	//     "https://www.googleapis.com/auth/cloud-platform",
13600	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
13601	//     "https://www.googleapis.com/auth/logging.admin",
13602	//     "https://www.googleapis.com/auth/logging.read"
13603	//   ]
13604	// }
13605
13606}
13607
13608// Pages invokes f for each page of results.
13609// A non-nil error returned from f will halt the iteration.
13610// The provided context supersedes any context provided to the Context method.
13611func (c *LocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
13612	c.ctx_ = ctx
13613	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
13614	for {
13615		x, err := c.Do()
13616		if err != nil {
13617			return err
13618		}
13619		if err := f(x); err != nil {
13620			return err
13621		}
13622		if x.NextPageToken == "" {
13623			return nil
13624		}
13625		c.PageToken(x.NextPageToken)
13626	}
13627}
13628
13629// method id "logging.locations.buckets.create":
13630
13631type LocationsBucketsCreateCall struct {
13632	s          *Service
13633	parent     string
13634	logbucket  *LogBucket
13635	urlParams_ gensupport.URLParams
13636	ctx_       context.Context
13637	header_    http.Header
13638}
13639
13640// Create: Creates a bucket that can be used to store log entries. Once
13641// a bucket has been created, the region cannot be changed.
13642//
13643// - parent: The resource in which to create the bucket:
13644//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]" Example:
13645//   "projects/my-logging-project/locations/global".
13646func (r *LocationsBucketsService) Create(parent string, logbucket *LogBucket) *LocationsBucketsCreateCall {
13647	c := &LocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13648	c.parent = parent
13649	c.logbucket = logbucket
13650	return c
13651}
13652
13653// BucketId sets the optional parameter "bucketId": Required. A
13654// client-assigned identifier such as "my-bucket". Identifiers are
13655// limited to 100 characters and can include only letters, digits,
13656// underscores, hyphens, and periods.
13657func (c *LocationsBucketsCreateCall) BucketId(bucketId string) *LocationsBucketsCreateCall {
13658	c.urlParams_.Set("bucketId", bucketId)
13659	return c
13660}
13661
13662// Fields allows partial responses to be retrieved. See
13663// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
13664// for more information.
13665func (c *LocationsBucketsCreateCall) Fields(s ...googleapi.Field) *LocationsBucketsCreateCall {
13666	c.urlParams_.Set("fields", googleapi.CombineFields(s))
13667	return c
13668}
13669
13670// Context sets the context to be used in this call's Do method. Any
13671// pending HTTP request will be aborted if the provided context is
13672// canceled.
13673func (c *LocationsBucketsCreateCall) Context(ctx context.Context) *LocationsBucketsCreateCall {
13674	c.ctx_ = ctx
13675	return c
13676}
13677
13678// Header returns an http.Header that can be modified by the caller to
13679// add HTTP headers to the request.
13680func (c *LocationsBucketsCreateCall) Header() http.Header {
13681	if c.header_ == nil {
13682		c.header_ = make(http.Header)
13683	}
13684	return c.header_
13685}
13686
13687func (c *LocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) {
13688	reqHeaders := make(http.Header)
13689	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
13690	for k, v := range c.header_ {
13691		reqHeaders[k] = v
13692	}
13693	reqHeaders.Set("User-Agent", c.s.userAgent())
13694	var body io.Reader = nil
13695	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
13696	if err != nil {
13697		return nil, err
13698	}
13699	reqHeaders.Set("Content-Type", "application/json")
13700	c.urlParams_.Set("alt", alt)
13701	c.urlParams_.Set("prettyPrint", "false")
13702	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
13703	urls += "?" + c.urlParams_.Encode()
13704	req, err := http.NewRequest("POST", urls, body)
13705	if err != nil {
13706		return nil, err
13707	}
13708	req.Header = reqHeaders
13709	googleapi.Expand(req.URL, map[string]string{
13710		"parent": c.parent,
13711	})
13712	return gensupport.SendRequest(c.ctx_, c.s.client, req)
13713}
13714
13715// Do executes the "logging.locations.buckets.create" call.
13716// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
13717// status code is an error. Response headers are in either
13718// *LogBucket.ServerResponse.Header or (if a response was returned at
13719// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
13720// to check whether the returned error was because
13721// http.StatusNotModified was returned.
13722func (c *LocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
13723	gensupport.SetOptions(c.urlParams_, opts...)
13724	res, err := c.doRequest("json")
13725	if res != nil && res.StatusCode == http.StatusNotModified {
13726		if res.Body != nil {
13727			res.Body.Close()
13728		}
13729		return nil, &googleapi.Error{
13730			Code:   res.StatusCode,
13731			Header: res.Header,
13732		}
13733	}
13734	if err != nil {
13735		return nil, err
13736	}
13737	defer googleapi.CloseBody(res)
13738	if err := googleapi.CheckResponse(res); err != nil {
13739		return nil, err
13740	}
13741	ret := &LogBucket{
13742		ServerResponse: googleapi.ServerResponse{
13743			Header:         res.Header,
13744			HTTPStatusCode: res.StatusCode,
13745		},
13746	}
13747	target := &ret
13748	if err := gensupport.DecodeResponse(target, res); err != nil {
13749		return nil, err
13750	}
13751	return ret, nil
13752	// {
13753	//   "description": "Creates a bucket that can be used to store log entries. Once a bucket has been created, the region cannot be changed.",
13754	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets",
13755	//   "httpMethod": "POST",
13756	//   "id": "logging.locations.buckets.create",
13757	//   "parameterOrder": [
13758	//     "parent"
13759	//   ],
13760	//   "parameters": {
13761	//     "bucketId": {
13762	//       "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.",
13763	//       "location": "query",
13764	//       "type": "string"
13765	//     },
13766	//     "parent": {
13767	//       "description": "Required. The resource in which to create the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" Example: \"projects/my-logging-project/locations/global\"",
13768	//       "location": "path",
13769	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+$",
13770	//       "required": true,
13771	//       "type": "string"
13772	//     }
13773	//   },
13774	//   "path": "v2/{+parent}/buckets",
13775	//   "request": {
13776	//     "$ref": "LogBucket"
13777	//   },
13778	//   "response": {
13779	//     "$ref": "LogBucket"
13780	//   },
13781	//   "scopes": [
13782	//     "https://www.googleapis.com/auth/cloud-platform",
13783	//     "https://www.googleapis.com/auth/logging.admin"
13784	//   ]
13785	// }
13786
13787}
13788
13789// method id "logging.locations.buckets.delete":
13790
13791type LocationsBucketsDeleteCall struct {
13792	s          *Service
13793	name       string
13794	urlParams_ gensupport.URLParams
13795	ctx_       context.Context
13796	header_    http.Header
13797}
13798
13799// Delete: Deletes a bucket. Moves the bucket to the DELETE_REQUESTED
13800// state. After 7 days, the bucket will be purged and all logs in the
13801// bucket will be permanently deleted.
13802//
13803// - name: The full resource name of the bucket to delete.
13804//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
13805//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
13806//   CKET_ID]"
13807//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
13808//   s/[BUCKET_ID]"
13809//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
13810//   Example:
13811//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id".
13812func (r *LocationsBucketsService) Delete(name string) *LocationsBucketsDeleteCall {
13813	c := &LocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13814	c.name = name
13815	return c
13816}
13817
13818// Fields allows partial responses to be retrieved. See
13819// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
13820// for more information.
13821func (c *LocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *LocationsBucketsDeleteCall {
13822	c.urlParams_.Set("fields", googleapi.CombineFields(s))
13823	return c
13824}
13825
13826// Context sets the context to be used in this call's Do method. Any
13827// pending HTTP request will be aborted if the provided context is
13828// canceled.
13829func (c *LocationsBucketsDeleteCall) Context(ctx context.Context) *LocationsBucketsDeleteCall {
13830	c.ctx_ = ctx
13831	return c
13832}
13833
13834// Header returns an http.Header that can be modified by the caller to
13835// add HTTP headers to the request.
13836func (c *LocationsBucketsDeleteCall) Header() http.Header {
13837	if c.header_ == nil {
13838		c.header_ = make(http.Header)
13839	}
13840	return c.header_
13841}
13842
13843func (c *LocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
13844	reqHeaders := make(http.Header)
13845	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
13846	for k, v := range c.header_ {
13847		reqHeaders[k] = v
13848	}
13849	reqHeaders.Set("User-Agent", c.s.userAgent())
13850	var body io.Reader = nil
13851	c.urlParams_.Set("alt", alt)
13852	c.urlParams_.Set("prettyPrint", "false")
13853	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
13854	urls += "?" + c.urlParams_.Encode()
13855	req, err := http.NewRequest("DELETE", urls, body)
13856	if err != nil {
13857		return nil, err
13858	}
13859	req.Header = reqHeaders
13860	googleapi.Expand(req.URL, map[string]string{
13861		"name": c.name,
13862	})
13863	return gensupport.SendRequest(c.ctx_, c.s.client, req)
13864}
13865
13866// Do executes the "logging.locations.buckets.delete" call.
13867// Exactly one of *Empty or error will be non-nil. Any non-2xx status
13868// code is an error. Response headers are in either
13869// *Empty.ServerResponse.Header or (if a response was returned at all)
13870// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
13871// check whether the returned error was because http.StatusNotModified
13872// was returned.
13873func (c *LocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
13874	gensupport.SetOptions(c.urlParams_, opts...)
13875	res, err := c.doRequest("json")
13876	if res != nil && res.StatusCode == http.StatusNotModified {
13877		if res.Body != nil {
13878			res.Body.Close()
13879		}
13880		return nil, &googleapi.Error{
13881			Code:   res.StatusCode,
13882			Header: res.Header,
13883		}
13884	}
13885	if err != nil {
13886		return nil, err
13887	}
13888	defer googleapi.CloseBody(res)
13889	if err := googleapi.CheckResponse(res); err != nil {
13890		return nil, err
13891	}
13892	ret := &Empty{
13893		ServerResponse: googleapi.ServerResponse{
13894			Header:         res.Header,
13895			HTTPStatusCode: res.StatusCode,
13896		},
13897	}
13898	target := &ret
13899	if err := gensupport.DecodeResponse(target, res); err != nil {
13900		return nil, err
13901	}
13902	return ret, nil
13903	// {
13904	//   "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.",
13905	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}",
13906	//   "httpMethod": "DELETE",
13907	//   "id": "logging.locations.buckets.delete",
13908	//   "parameterOrder": [
13909	//     "name"
13910	//   ],
13911	//   "parameters": {
13912	//     "name": {
13913	//       "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\".",
13914	//       "location": "path",
13915	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$",
13916	//       "required": true,
13917	//       "type": "string"
13918	//     }
13919	//   },
13920	//   "path": "v2/{+name}",
13921	//   "response": {
13922	//     "$ref": "Empty"
13923	//   },
13924	//   "scopes": [
13925	//     "https://www.googleapis.com/auth/cloud-platform",
13926	//     "https://www.googleapis.com/auth/logging.admin"
13927	//   ]
13928	// }
13929
13930}
13931
13932// method id "logging.locations.buckets.get":
13933
13934type LocationsBucketsGetCall struct {
13935	s            *Service
13936	name         string
13937	urlParams_   gensupport.URLParams
13938	ifNoneMatch_ string
13939	ctx_         context.Context
13940	header_      http.Header
13941}
13942
13943// Get: Gets a bucket.
13944//
13945// - name: The resource name of the bucket:
13946//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
13947//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
13948//   CKET_ID]"
13949//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
13950//   s/[BUCKET_ID]"
13951//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
13952//   Example:
13953//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id".
13954func (r *LocationsBucketsService) Get(name string) *LocationsBucketsGetCall {
13955	c := &LocationsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13956	c.name = name
13957	return c
13958}
13959
13960// Fields allows partial responses to be retrieved. See
13961// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
13962// for more information.
13963func (c *LocationsBucketsGetCall) Fields(s ...googleapi.Field) *LocationsBucketsGetCall {
13964	c.urlParams_.Set("fields", googleapi.CombineFields(s))
13965	return c
13966}
13967
13968// IfNoneMatch sets the optional parameter which makes the operation
13969// fail if the object's ETag matches the given value. This is useful for
13970// getting updates only after the object has changed since the last
13971// request. Use googleapi.IsNotModified to check whether the response
13972// error from Do is the result of In-None-Match.
13973func (c *LocationsBucketsGetCall) IfNoneMatch(entityTag string) *LocationsBucketsGetCall {
13974	c.ifNoneMatch_ = entityTag
13975	return c
13976}
13977
13978// Context sets the context to be used in this call's Do method. Any
13979// pending HTTP request will be aborted if the provided context is
13980// canceled.
13981func (c *LocationsBucketsGetCall) Context(ctx context.Context) *LocationsBucketsGetCall {
13982	c.ctx_ = ctx
13983	return c
13984}
13985
13986// Header returns an http.Header that can be modified by the caller to
13987// add HTTP headers to the request.
13988func (c *LocationsBucketsGetCall) Header() http.Header {
13989	if c.header_ == nil {
13990		c.header_ = make(http.Header)
13991	}
13992	return c.header_
13993}
13994
13995func (c *LocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) {
13996	reqHeaders := make(http.Header)
13997	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
13998	for k, v := range c.header_ {
13999		reqHeaders[k] = v
14000	}
14001	reqHeaders.Set("User-Agent", c.s.userAgent())
14002	if c.ifNoneMatch_ != "" {
14003		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
14004	}
14005	var body io.Reader = nil
14006	c.urlParams_.Set("alt", alt)
14007	c.urlParams_.Set("prettyPrint", "false")
14008	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
14009	urls += "?" + c.urlParams_.Encode()
14010	req, err := http.NewRequest("GET", urls, body)
14011	if err != nil {
14012		return nil, err
14013	}
14014	req.Header = reqHeaders
14015	googleapi.Expand(req.URL, map[string]string{
14016		"name": c.name,
14017	})
14018	return gensupport.SendRequest(c.ctx_, c.s.client, req)
14019}
14020
14021// Do executes the "logging.locations.buckets.get" call.
14022// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
14023// status code is an error. Response headers are in either
14024// *LogBucket.ServerResponse.Header or (if a response was returned at
14025// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
14026// to check whether the returned error was because
14027// http.StatusNotModified was returned.
14028func (c *LocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
14029	gensupport.SetOptions(c.urlParams_, opts...)
14030	res, err := c.doRequest("json")
14031	if res != nil && res.StatusCode == http.StatusNotModified {
14032		if res.Body != nil {
14033			res.Body.Close()
14034		}
14035		return nil, &googleapi.Error{
14036			Code:   res.StatusCode,
14037			Header: res.Header,
14038		}
14039	}
14040	if err != nil {
14041		return nil, err
14042	}
14043	defer googleapi.CloseBody(res)
14044	if err := googleapi.CheckResponse(res); err != nil {
14045		return nil, err
14046	}
14047	ret := &LogBucket{
14048		ServerResponse: googleapi.ServerResponse{
14049			Header:         res.Header,
14050			HTTPStatusCode: res.StatusCode,
14051		},
14052	}
14053	target := &ret
14054	if err := gensupport.DecodeResponse(target, res); err != nil {
14055		return nil, err
14056	}
14057	return ret, nil
14058	// {
14059	//   "description": "Gets a bucket.",
14060	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}",
14061	//   "httpMethod": "GET",
14062	//   "id": "logging.locations.buckets.get",
14063	//   "parameterOrder": [
14064	//     "name"
14065	//   ],
14066	//   "parameters": {
14067	//     "name": {
14068	//       "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\".",
14069	//       "location": "path",
14070	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$",
14071	//       "required": true,
14072	//       "type": "string"
14073	//     }
14074	//   },
14075	//   "path": "v2/{+name}",
14076	//   "response": {
14077	//     "$ref": "LogBucket"
14078	//   },
14079	//   "scopes": [
14080	//     "https://www.googleapis.com/auth/cloud-platform",
14081	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
14082	//     "https://www.googleapis.com/auth/logging.admin",
14083	//     "https://www.googleapis.com/auth/logging.read"
14084	//   ]
14085	// }
14086
14087}
14088
14089// method id "logging.locations.buckets.list":
14090
14091type LocationsBucketsListCall struct {
14092	s            *Service
14093	parent       string
14094	urlParams_   gensupport.URLParams
14095	ifNoneMatch_ string
14096	ctx_         context.Context
14097	header_      http.Header
14098}
14099
14100// List: Lists buckets.
14101//
14102// - parent: The parent resource whose buckets are to be listed:
14103//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
14104//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
14105//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
14106//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations
14107//   portion of the resource must be specified, but supplying the
14108//   character - in place of LOCATION_ID will return all buckets.
14109func (r *LocationsBucketsService) List(parent string) *LocationsBucketsListCall {
14110	c := &LocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14111	c.parent = parent
14112	return c
14113}
14114
14115// PageSize sets the optional parameter "pageSize": The maximum number
14116// of results to return from this request. Non-positive values are
14117// ignored. The presence of nextPageToken in the response indicates that
14118// more results might be available.
14119func (c *LocationsBucketsListCall) PageSize(pageSize int64) *LocationsBucketsListCall {
14120	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
14121	return c
14122}
14123
14124// PageToken sets the optional parameter "pageToken": If present, then
14125// retrieve the next batch of results from the preceding call to this
14126// method. pageToken must be the value of nextPageToken from the
14127// previous response. The values of other method parameters should be
14128// identical to those in the previous call.
14129func (c *LocationsBucketsListCall) PageToken(pageToken string) *LocationsBucketsListCall {
14130	c.urlParams_.Set("pageToken", pageToken)
14131	return c
14132}
14133
14134// Fields allows partial responses to be retrieved. See
14135// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
14136// for more information.
14137func (c *LocationsBucketsListCall) Fields(s ...googleapi.Field) *LocationsBucketsListCall {
14138	c.urlParams_.Set("fields", googleapi.CombineFields(s))
14139	return c
14140}
14141
14142// IfNoneMatch sets the optional parameter which makes the operation
14143// fail if the object's ETag matches the given value. This is useful for
14144// getting updates only after the object has changed since the last
14145// request. Use googleapi.IsNotModified to check whether the response
14146// error from Do is the result of In-None-Match.
14147func (c *LocationsBucketsListCall) IfNoneMatch(entityTag string) *LocationsBucketsListCall {
14148	c.ifNoneMatch_ = entityTag
14149	return c
14150}
14151
14152// Context sets the context to be used in this call's Do method. Any
14153// pending HTTP request will be aborted if the provided context is
14154// canceled.
14155func (c *LocationsBucketsListCall) Context(ctx context.Context) *LocationsBucketsListCall {
14156	c.ctx_ = ctx
14157	return c
14158}
14159
14160// Header returns an http.Header that can be modified by the caller to
14161// add HTTP headers to the request.
14162func (c *LocationsBucketsListCall) Header() http.Header {
14163	if c.header_ == nil {
14164		c.header_ = make(http.Header)
14165	}
14166	return c.header_
14167}
14168
14169func (c *LocationsBucketsListCall) doRequest(alt string) (*http.Response, error) {
14170	reqHeaders := make(http.Header)
14171	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
14172	for k, v := range c.header_ {
14173		reqHeaders[k] = v
14174	}
14175	reqHeaders.Set("User-Agent", c.s.userAgent())
14176	if c.ifNoneMatch_ != "" {
14177		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
14178	}
14179	var body io.Reader = nil
14180	c.urlParams_.Set("alt", alt)
14181	c.urlParams_.Set("prettyPrint", "false")
14182	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
14183	urls += "?" + c.urlParams_.Encode()
14184	req, err := http.NewRequest("GET", urls, body)
14185	if err != nil {
14186		return nil, err
14187	}
14188	req.Header = reqHeaders
14189	googleapi.Expand(req.URL, map[string]string{
14190		"parent": c.parent,
14191	})
14192	return gensupport.SendRequest(c.ctx_, c.s.client, req)
14193}
14194
14195// Do executes the "logging.locations.buckets.list" call.
14196// Exactly one of *ListBucketsResponse or error will be non-nil. Any
14197// non-2xx status code is an error. Response headers are in either
14198// *ListBucketsResponse.ServerResponse.Header or (if a response was
14199// returned at all) in error.(*googleapi.Error).Header. Use
14200// googleapi.IsNotModified to check whether the returned error was
14201// because http.StatusNotModified was returned.
14202func (c *LocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) {
14203	gensupport.SetOptions(c.urlParams_, opts...)
14204	res, err := c.doRequest("json")
14205	if res != nil && res.StatusCode == http.StatusNotModified {
14206		if res.Body != nil {
14207			res.Body.Close()
14208		}
14209		return nil, &googleapi.Error{
14210			Code:   res.StatusCode,
14211			Header: res.Header,
14212		}
14213	}
14214	if err != nil {
14215		return nil, err
14216	}
14217	defer googleapi.CloseBody(res)
14218	if err := googleapi.CheckResponse(res); err != nil {
14219		return nil, err
14220	}
14221	ret := &ListBucketsResponse{
14222		ServerResponse: googleapi.ServerResponse{
14223			Header:         res.Header,
14224			HTTPStatusCode: res.StatusCode,
14225		},
14226	}
14227	target := &ret
14228	if err := gensupport.DecodeResponse(target, res); err != nil {
14229		return nil, err
14230	}
14231	return ret, nil
14232	// {
14233	//   "description": "Lists buckets.",
14234	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets",
14235	//   "httpMethod": "GET",
14236	//   "id": "logging.locations.buckets.list",
14237	//   "parameterOrder": [
14238	//     "parent"
14239	//   ],
14240	//   "parameters": {
14241	//     "pageSize": {
14242	//       "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.",
14243	//       "format": "int32",
14244	//       "location": "query",
14245	//       "type": "integer"
14246	//     },
14247	//     "pageToken": {
14248	//       "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.",
14249	//       "location": "query",
14250	//       "type": "string"
14251	//     },
14252	//     "parent": {
14253	//       "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.",
14254	//       "location": "path",
14255	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+$",
14256	//       "required": true,
14257	//       "type": "string"
14258	//     }
14259	//   },
14260	//   "path": "v2/{+parent}/buckets",
14261	//   "response": {
14262	//     "$ref": "ListBucketsResponse"
14263	//   },
14264	//   "scopes": [
14265	//     "https://www.googleapis.com/auth/cloud-platform",
14266	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
14267	//     "https://www.googleapis.com/auth/logging.admin",
14268	//     "https://www.googleapis.com/auth/logging.read"
14269	//   ]
14270	// }
14271
14272}
14273
14274// Pages invokes f for each page of results.
14275// A non-nil error returned from f will halt the iteration.
14276// The provided context supersedes any context provided to the Context method.
14277func (c *LocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error {
14278	c.ctx_ = ctx
14279	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
14280	for {
14281		x, err := c.Do()
14282		if err != nil {
14283			return err
14284		}
14285		if err := f(x); err != nil {
14286			return err
14287		}
14288		if x.NextPageToken == "" {
14289			return nil
14290		}
14291		c.PageToken(x.NextPageToken)
14292	}
14293}
14294
14295// method id "logging.locations.buckets.patch":
14296
14297type LocationsBucketsPatchCall struct {
14298	s          *Service
14299	name       string
14300	logbucket  *LogBucket
14301	urlParams_ gensupport.URLParams
14302	ctx_       context.Context
14303	header_    http.Header
14304}
14305
14306// Patch: Updates a bucket. This method replaces the following fields in
14307// the existing bucket with values from the new bucket:
14308// retention_periodIf the retention period is decreased and the bucket
14309// is locked, FAILED_PRECONDITION will be returned.If the bucket has a
14310// LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be
14311// returned.A buckets region may not be modified after it is created.
14312//
14313// - name: The full resource name of the bucket to update.
14314//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
14315//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
14316//   CKET_ID]"
14317//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
14318//   s/[BUCKET_ID]"
14319//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
14320//   Example:
14321//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id".
14322//    Also requires permission "resourcemanager.projects.updateLiens" to
14323//   set the locked property.
14324func (r *LocationsBucketsService) Patch(name string, logbucket *LogBucket) *LocationsBucketsPatchCall {
14325	c := &LocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14326	c.name = name
14327	c.logbucket = logbucket
14328	return c
14329}
14330
14331// UpdateMask sets the optional parameter "updateMask": Required. Field
14332// mask that specifies the fields in bucket that need an update. A
14333// bucket field will be overwritten if, and only if, it is in the update
14334// mask. name and output only fields cannot be updated.For a detailed
14335// FieldMask definition, see
14336// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
14337// updateMask=retention_days.
14338func (c *LocationsBucketsPatchCall) UpdateMask(updateMask string) *LocationsBucketsPatchCall {
14339	c.urlParams_.Set("updateMask", updateMask)
14340	return c
14341}
14342
14343// Fields allows partial responses to be retrieved. See
14344// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
14345// for more information.
14346func (c *LocationsBucketsPatchCall) Fields(s ...googleapi.Field) *LocationsBucketsPatchCall {
14347	c.urlParams_.Set("fields", googleapi.CombineFields(s))
14348	return c
14349}
14350
14351// Context sets the context to be used in this call's Do method. Any
14352// pending HTTP request will be aborted if the provided context is
14353// canceled.
14354func (c *LocationsBucketsPatchCall) Context(ctx context.Context) *LocationsBucketsPatchCall {
14355	c.ctx_ = ctx
14356	return c
14357}
14358
14359// Header returns an http.Header that can be modified by the caller to
14360// add HTTP headers to the request.
14361func (c *LocationsBucketsPatchCall) Header() http.Header {
14362	if c.header_ == nil {
14363		c.header_ = make(http.Header)
14364	}
14365	return c.header_
14366}
14367
14368func (c *LocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
14369	reqHeaders := make(http.Header)
14370	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
14371	for k, v := range c.header_ {
14372		reqHeaders[k] = v
14373	}
14374	reqHeaders.Set("User-Agent", c.s.userAgent())
14375	var body io.Reader = nil
14376	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
14377	if err != nil {
14378		return nil, err
14379	}
14380	reqHeaders.Set("Content-Type", "application/json")
14381	c.urlParams_.Set("alt", alt)
14382	c.urlParams_.Set("prettyPrint", "false")
14383	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
14384	urls += "?" + c.urlParams_.Encode()
14385	req, err := http.NewRequest("PATCH", urls, body)
14386	if err != nil {
14387		return nil, err
14388	}
14389	req.Header = reqHeaders
14390	googleapi.Expand(req.URL, map[string]string{
14391		"name": c.name,
14392	})
14393	return gensupport.SendRequest(c.ctx_, c.s.client, req)
14394}
14395
14396// Do executes the "logging.locations.buckets.patch" call.
14397// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
14398// status code is an error. Response headers are in either
14399// *LogBucket.ServerResponse.Header or (if a response was returned at
14400// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
14401// to check whether the returned error was because
14402// http.StatusNotModified was returned.
14403func (c *LocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
14404	gensupport.SetOptions(c.urlParams_, opts...)
14405	res, err := c.doRequest("json")
14406	if res != nil && res.StatusCode == http.StatusNotModified {
14407		if res.Body != nil {
14408			res.Body.Close()
14409		}
14410		return nil, &googleapi.Error{
14411			Code:   res.StatusCode,
14412			Header: res.Header,
14413		}
14414	}
14415	if err != nil {
14416		return nil, err
14417	}
14418	defer googleapi.CloseBody(res)
14419	if err := googleapi.CheckResponse(res); err != nil {
14420		return nil, err
14421	}
14422	ret := &LogBucket{
14423		ServerResponse: googleapi.ServerResponse{
14424			Header:         res.Header,
14425			HTTPStatusCode: res.StatusCode,
14426		},
14427	}
14428	target := &ret
14429	if err := gensupport.DecodeResponse(target, res); err != nil {
14430		return nil, err
14431	}
14432	return ret, nil
14433	// {
14434	//   "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.",
14435	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}",
14436	//   "httpMethod": "PATCH",
14437	//   "id": "logging.locations.buckets.patch",
14438	//   "parameterOrder": [
14439	//     "name"
14440	//   ],
14441	//   "parameters": {
14442	//     "name": {
14443	//       "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",
14444	//       "location": "path",
14445	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$",
14446	//       "required": true,
14447	//       "type": "string"
14448	//     },
14449	//     "updateMask": {
14450	//       "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.",
14451	//       "format": "google-fieldmask",
14452	//       "location": "query",
14453	//       "type": "string"
14454	//     }
14455	//   },
14456	//   "path": "v2/{+name}",
14457	//   "request": {
14458	//     "$ref": "LogBucket"
14459	//   },
14460	//   "response": {
14461	//     "$ref": "LogBucket"
14462	//   },
14463	//   "scopes": [
14464	//     "https://www.googleapis.com/auth/cloud-platform",
14465	//     "https://www.googleapis.com/auth/logging.admin"
14466	//   ]
14467	// }
14468
14469}
14470
14471// method id "logging.locations.buckets.undelete":
14472
14473type LocationsBucketsUndeleteCall struct {
14474	s                     *Service
14475	name                  string
14476	undeletebucketrequest *UndeleteBucketRequest
14477	urlParams_            gensupport.URLParams
14478	ctx_                  context.Context
14479	header_               http.Header
14480}
14481
14482// Undelete: Undeletes a bucket. A bucket that has been deleted may be
14483// undeleted within the grace period of 7 days.
14484//
14485// - name: The full resource name of the bucket to undelete.
14486//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
14487//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
14488//   CKET_ID]"
14489//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
14490//   s/[BUCKET_ID]"
14491//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
14492//   Example:
14493//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id".
14494func (r *LocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *LocationsBucketsUndeleteCall {
14495	c := &LocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14496	c.name = name
14497	c.undeletebucketrequest = undeletebucketrequest
14498	return c
14499}
14500
14501// Fields allows partial responses to be retrieved. See
14502// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
14503// for more information.
14504func (c *LocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *LocationsBucketsUndeleteCall {
14505	c.urlParams_.Set("fields", googleapi.CombineFields(s))
14506	return c
14507}
14508
14509// Context sets the context to be used in this call's Do method. Any
14510// pending HTTP request will be aborted if the provided context is
14511// canceled.
14512func (c *LocationsBucketsUndeleteCall) Context(ctx context.Context) *LocationsBucketsUndeleteCall {
14513	c.ctx_ = ctx
14514	return c
14515}
14516
14517// Header returns an http.Header that can be modified by the caller to
14518// add HTTP headers to the request.
14519func (c *LocationsBucketsUndeleteCall) Header() http.Header {
14520	if c.header_ == nil {
14521		c.header_ = make(http.Header)
14522	}
14523	return c.header_
14524}
14525
14526func (c *LocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) {
14527	reqHeaders := make(http.Header)
14528	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
14529	for k, v := range c.header_ {
14530		reqHeaders[k] = v
14531	}
14532	reqHeaders.Set("User-Agent", c.s.userAgent())
14533	var body io.Reader = nil
14534	body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest)
14535	if err != nil {
14536		return nil, err
14537	}
14538	reqHeaders.Set("Content-Type", "application/json")
14539	c.urlParams_.Set("alt", alt)
14540	c.urlParams_.Set("prettyPrint", "false")
14541	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete")
14542	urls += "?" + c.urlParams_.Encode()
14543	req, err := http.NewRequest("POST", urls, body)
14544	if err != nil {
14545		return nil, err
14546	}
14547	req.Header = reqHeaders
14548	googleapi.Expand(req.URL, map[string]string{
14549		"name": c.name,
14550	})
14551	return gensupport.SendRequest(c.ctx_, c.s.client, req)
14552}
14553
14554// Do executes the "logging.locations.buckets.undelete" call.
14555// Exactly one of *Empty or error will be non-nil. Any non-2xx status
14556// code is an error. Response headers are in either
14557// *Empty.ServerResponse.Header or (if a response was returned at all)
14558// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
14559// check whether the returned error was because http.StatusNotModified
14560// was returned.
14561func (c *LocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
14562	gensupport.SetOptions(c.urlParams_, opts...)
14563	res, err := c.doRequest("json")
14564	if res != nil && res.StatusCode == http.StatusNotModified {
14565		if res.Body != nil {
14566			res.Body.Close()
14567		}
14568		return nil, &googleapi.Error{
14569			Code:   res.StatusCode,
14570			Header: res.Header,
14571		}
14572	}
14573	if err != nil {
14574		return nil, err
14575	}
14576	defer googleapi.CloseBody(res)
14577	if err := googleapi.CheckResponse(res); err != nil {
14578		return nil, err
14579	}
14580	ret := &Empty{
14581		ServerResponse: googleapi.ServerResponse{
14582			Header:         res.Header,
14583			HTTPStatusCode: res.StatusCode,
14584		},
14585	}
14586	target := &ret
14587	if err := gensupport.DecodeResponse(target, res); err != nil {
14588		return nil, err
14589	}
14590	return ret, nil
14591	// {
14592	//   "description": "Undeletes a bucket. A bucket that has been deleted may be undeleted within the grace period of 7 days.",
14593	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}:undelete",
14594	//   "httpMethod": "POST",
14595	//   "id": "logging.locations.buckets.undelete",
14596	//   "parameterOrder": [
14597	//     "name"
14598	//   ],
14599	//   "parameters": {
14600	//     "name": {
14601	//       "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\".",
14602	//       "location": "path",
14603	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$",
14604	//       "required": true,
14605	//       "type": "string"
14606	//     }
14607	//   },
14608	//   "path": "v2/{+name}:undelete",
14609	//   "request": {
14610	//     "$ref": "UndeleteBucketRequest"
14611	//   },
14612	//   "response": {
14613	//     "$ref": "Empty"
14614	//   },
14615	//   "scopes": [
14616	//     "https://www.googleapis.com/auth/cloud-platform",
14617	//     "https://www.googleapis.com/auth/logging.admin"
14618	//   ]
14619	// }
14620
14621}
14622
14623// method id "logging.locations.buckets.views.create":
14624
14625type LocationsBucketsViewsCreateCall struct {
14626	s          *Service
14627	parent     string
14628	logview    *LogView
14629	urlParams_ gensupport.URLParams
14630	ctx_       context.Context
14631	header_    http.Header
14632}
14633
14634// Create: Creates a view over logs in a bucket. A bucket may contain a
14635// maximum of 50 views.
14636//
14637// - parent: The bucket in which to create the view
14638//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
14639//   Example:
14640//   "projects/my-logging-project/locations/my-location/buckets/my-bucket
14641//   ".
14642func (r *LocationsBucketsViewsService) Create(parent string, logview *LogView) *LocationsBucketsViewsCreateCall {
14643	c := &LocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14644	c.parent = parent
14645	c.logview = logview
14646	return c
14647}
14648
14649// ViewId sets the optional parameter "viewId": Required. The id to use
14650// for this view.
14651func (c *LocationsBucketsViewsCreateCall) ViewId(viewId string) *LocationsBucketsViewsCreateCall {
14652	c.urlParams_.Set("viewId", viewId)
14653	return c
14654}
14655
14656// Fields allows partial responses to be retrieved. See
14657// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
14658// for more information.
14659func (c *LocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsCreateCall {
14660	c.urlParams_.Set("fields", googleapi.CombineFields(s))
14661	return c
14662}
14663
14664// Context sets the context to be used in this call's Do method. Any
14665// pending HTTP request will be aborted if the provided context is
14666// canceled.
14667func (c *LocationsBucketsViewsCreateCall) Context(ctx context.Context) *LocationsBucketsViewsCreateCall {
14668	c.ctx_ = ctx
14669	return c
14670}
14671
14672// Header returns an http.Header that can be modified by the caller to
14673// add HTTP headers to the request.
14674func (c *LocationsBucketsViewsCreateCall) Header() http.Header {
14675	if c.header_ == nil {
14676		c.header_ = make(http.Header)
14677	}
14678	return c.header_
14679}
14680
14681func (c *LocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) {
14682	reqHeaders := make(http.Header)
14683	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
14684	for k, v := range c.header_ {
14685		reqHeaders[k] = v
14686	}
14687	reqHeaders.Set("User-Agent", c.s.userAgent())
14688	var body io.Reader = nil
14689	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
14690	if err != nil {
14691		return nil, err
14692	}
14693	reqHeaders.Set("Content-Type", "application/json")
14694	c.urlParams_.Set("alt", alt)
14695	c.urlParams_.Set("prettyPrint", "false")
14696	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
14697	urls += "?" + c.urlParams_.Encode()
14698	req, err := http.NewRequest("POST", urls, body)
14699	if err != nil {
14700		return nil, err
14701	}
14702	req.Header = reqHeaders
14703	googleapi.Expand(req.URL, map[string]string{
14704		"parent": c.parent,
14705	})
14706	return gensupport.SendRequest(c.ctx_, c.s.client, req)
14707}
14708
14709// Do executes the "logging.locations.buckets.views.create" call.
14710// Exactly one of *LogView or error will be non-nil. Any non-2xx status
14711// code is an error. Response headers are in either
14712// *LogView.ServerResponse.Header or (if a response was returned at all)
14713// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
14714// check whether the returned error was because http.StatusNotModified
14715// was returned.
14716func (c *LocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
14717	gensupport.SetOptions(c.urlParams_, opts...)
14718	res, err := c.doRequest("json")
14719	if res != nil && res.StatusCode == http.StatusNotModified {
14720		if res.Body != nil {
14721			res.Body.Close()
14722		}
14723		return nil, &googleapi.Error{
14724			Code:   res.StatusCode,
14725			Header: res.Header,
14726		}
14727	}
14728	if err != nil {
14729		return nil, err
14730	}
14731	defer googleapi.CloseBody(res)
14732	if err := googleapi.CheckResponse(res); err != nil {
14733		return nil, err
14734	}
14735	ret := &LogView{
14736		ServerResponse: googleapi.ServerResponse{
14737			Header:         res.Header,
14738			HTTPStatusCode: res.StatusCode,
14739		},
14740	}
14741	target := &ret
14742	if err := gensupport.DecodeResponse(target, res); err != nil {
14743		return nil, err
14744	}
14745	return ret, nil
14746	// {
14747	//   "description": "Creates a view over logs in a bucket. A bucket may contain a maximum of 50 views.",
14748	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views",
14749	//   "httpMethod": "POST",
14750	//   "id": "logging.locations.buckets.views.create",
14751	//   "parameterOrder": [
14752	//     "parent"
14753	//   ],
14754	//   "parameters": {
14755	//     "parent": {
14756	//       "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\"",
14757	//       "location": "path",
14758	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$",
14759	//       "required": true,
14760	//       "type": "string"
14761	//     },
14762	//     "viewId": {
14763	//       "description": "Required. The id to use for this view.",
14764	//       "location": "query",
14765	//       "type": "string"
14766	//     }
14767	//   },
14768	//   "path": "v2/{+parent}/views",
14769	//   "request": {
14770	//     "$ref": "LogView"
14771	//   },
14772	//   "response": {
14773	//     "$ref": "LogView"
14774	//   },
14775	//   "scopes": [
14776	//     "https://www.googleapis.com/auth/cloud-platform",
14777	//     "https://www.googleapis.com/auth/logging.admin"
14778	//   ]
14779	// }
14780
14781}
14782
14783// method id "logging.locations.buckets.views.delete":
14784
14785type LocationsBucketsViewsDeleteCall struct {
14786	s          *Service
14787	name       string
14788	urlParams_ gensupport.URLParams
14789	ctx_       context.Context
14790	header_    http.Header
14791}
14792
14793// Delete: Deletes a view from a bucket.
14794//
14795// - name: The full resource name of the view to delete:
14796//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
14797//   iews/[VIEW_ID]" Example:
14798//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id/v
14799//   iews/my-view-id".
14800func (r *LocationsBucketsViewsService) Delete(name string) *LocationsBucketsViewsDeleteCall {
14801	c := &LocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14802	c.name = name
14803	return c
14804}
14805
14806// Fields allows partial responses to be retrieved. See
14807// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
14808// for more information.
14809func (c *LocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsDeleteCall {
14810	c.urlParams_.Set("fields", googleapi.CombineFields(s))
14811	return c
14812}
14813
14814// Context sets the context to be used in this call's Do method. Any
14815// pending HTTP request will be aborted if the provided context is
14816// canceled.
14817func (c *LocationsBucketsViewsDeleteCall) Context(ctx context.Context) *LocationsBucketsViewsDeleteCall {
14818	c.ctx_ = ctx
14819	return c
14820}
14821
14822// Header returns an http.Header that can be modified by the caller to
14823// add HTTP headers to the request.
14824func (c *LocationsBucketsViewsDeleteCall) Header() http.Header {
14825	if c.header_ == nil {
14826		c.header_ = make(http.Header)
14827	}
14828	return c.header_
14829}
14830
14831func (c *LocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) {
14832	reqHeaders := make(http.Header)
14833	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
14834	for k, v := range c.header_ {
14835		reqHeaders[k] = v
14836	}
14837	reqHeaders.Set("User-Agent", c.s.userAgent())
14838	var body io.Reader = nil
14839	c.urlParams_.Set("alt", alt)
14840	c.urlParams_.Set("prettyPrint", "false")
14841	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
14842	urls += "?" + c.urlParams_.Encode()
14843	req, err := http.NewRequest("DELETE", urls, body)
14844	if err != nil {
14845		return nil, err
14846	}
14847	req.Header = reqHeaders
14848	googleapi.Expand(req.URL, map[string]string{
14849		"name": c.name,
14850	})
14851	return gensupport.SendRequest(c.ctx_, c.s.client, req)
14852}
14853
14854// Do executes the "logging.locations.buckets.views.delete" call.
14855// Exactly one of *Empty or error will be non-nil. Any non-2xx status
14856// code is an error. Response headers are in either
14857// *Empty.ServerResponse.Header or (if a response was returned at all)
14858// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
14859// check whether the returned error was because http.StatusNotModified
14860// was returned.
14861func (c *LocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
14862	gensupport.SetOptions(c.urlParams_, opts...)
14863	res, err := c.doRequest("json")
14864	if res != nil && res.StatusCode == http.StatusNotModified {
14865		if res.Body != nil {
14866			res.Body.Close()
14867		}
14868		return nil, &googleapi.Error{
14869			Code:   res.StatusCode,
14870			Header: res.Header,
14871		}
14872	}
14873	if err != nil {
14874		return nil, err
14875	}
14876	defer googleapi.CloseBody(res)
14877	if err := googleapi.CheckResponse(res); err != nil {
14878		return nil, err
14879	}
14880	ret := &Empty{
14881		ServerResponse: googleapi.ServerResponse{
14882			Header:         res.Header,
14883			HTTPStatusCode: res.StatusCode,
14884		},
14885	}
14886	target := &ret
14887	if err := gensupport.DecodeResponse(target, res); err != nil {
14888		return nil, err
14889	}
14890	return ret, nil
14891	// {
14892	//   "description": "Deletes a view from a bucket.",
14893	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
14894	//   "httpMethod": "DELETE",
14895	//   "id": "logging.locations.buckets.views.delete",
14896	//   "parameterOrder": [
14897	//     "name"
14898	//   ],
14899	//   "parameters": {
14900	//     "name": {
14901	//       "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\".",
14902	//       "location": "path",
14903	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
14904	//       "required": true,
14905	//       "type": "string"
14906	//     }
14907	//   },
14908	//   "path": "v2/{+name}",
14909	//   "response": {
14910	//     "$ref": "Empty"
14911	//   },
14912	//   "scopes": [
14913	//     "https://www.googleapis.com/auth/cloud-platform",
14914	//     "https://www.googleapis.com/auth/logging.admin"
14915	//   ]
14916	// }
14917
14918}
14919
14920// method id "logging.locations.buckets.views.get":
14921
14922type LocationsBucketsViewsGetCall struct {
14923	s            *Service
14924	name         string
14925	urlParams_   gensupport.URLParams
14926	ifNoneMatch_ string
14927	ctx_         context.Context
14928	header_      http.Header
14929}
14930
14931// Get: Gets a view.
14932//
14933// - name: The resource name of the policy:
14934//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
14935//   iews/[VIEW_ID]" Example:
14936//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id/v
14937//   iews/my-view-id".
14938func (r *LocationsBucketsViewsService) Get(name string) *LocationsBucketsViewsGetCall {
14939	c := &LocationsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14940	c.name = name
14941	return c
14942}
14943
14944// Fields allows partial responses to be retrieved. See
14945// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
14946// for more information.
14947func (c *LocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsGetCall {
14948	c.urlParams_.Set("fields", googleapi.CombineFields(s))
14949	return c
14950}
14951
14952// IfNoneMatch sets the optional parameter which makes the operation
14953// fail if the object's ETag matches the given value. This is useful for
14954// getting updates only after the object has changed since the last
14955// request. Use googleapi.IsNotModified to check whether the response
14956// error from Do is the result of In-None-Match.
14957func (c *LocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *LocationsBucketsViewsGetCall {
14958	c.ifNoneMatch_ = entityTag
14959	return c
14960}
14961
14962// Context sets the context to be used in this call's Do method. Any
14963// pending HTTP request will be aborted if the provided context is
14964// canceled.
14965func (c *LocationsBucketsViewsGetCall) Context(ctx context.Context) *LocationsBucketsViewsGetCall {
14966	c.ctx_ = ctx
14967	return c
14968}
14969
14970// Header returns an http.Header that can be modified by the caller to
14971// add HTTP headers to the request.
14972func (c *LocationsBucketsViewsGetCall) Header() http.Header {
14973	if c.header_ == nil {
14974		c.header_ = make(http.Header)
14975	}
14976	return c.header_
14977}
14978
14979func (c *LocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) {
14980	reqHeaders := make(http.Header)
14981	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
14982	for k, v := range c.header_ {
14983		reqHeaders[k] = v
14984	}
14985	reqHeaders.Set("User-Agent", c.s.userAgent())
14986	if c.ifNoneMatch_ != "" {
14987		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
14988	}
14989	var body io.Reader = nil
14990	c.urlParams_.Set("alt", alt)
14991	c.urlParams_.Set("prettyPrint", "false")
14992	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
14993	urls += "?" + c.urlParams_.Encode()
14994	req, err := http.NewRequest("GET", urls, body)
14995	if err != nil {
14996		return nil, err
14997	}
14998	req.Header = reqHeaders
14999	googleapi.Expand(req.URL, map[string]string{
15000		"name": c.name,
15001	})
15002	return gensupport.SendRequest(c.ctx_, c.s.client, req)
15003}
15004
15005// Do executes the "logging.locations.buckets.views.get" call.
15006// Exactly one of *LogView or error will be non-nil. Any non-2xx status
15007// code is an error. Response headers are in either
15008// *LogView.ServerResponse.Header or (if a response was returned at all)
15009// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
15010// check whether the returned error was because http.StatusNotModified
15011// was returned.
15012func (c *LocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
15013	gensupport.SetOptions(c.urlParams_, opts...)
15014	res, err := c.doRequest("json")
15015	if res != nil && res.StatusCode == http.StatusNotModified {
15016		if res.Body != nil {
15017			res.Body.Close()
15018		}
15019		return nil, &googleapi.Error{
15020			Code:   res.StatusCode,
15021			Header: res.Header,
15022		}
15023	}
15024	if err != nil {
15025		return nil, err
15026	}
15027	defer googleapi.CloseBody(res)
15028	if err := googleapi.CheckResponse(res); err != nil {
15029		return nil, err
15030	}
15031	ret := &LogView{
15032		ServerResponse: googleapi.ServerResponse{
15033			Header:         res.Header,
15034			HTTPStatusCode: res.StatusCode,
15035		},
15036	}
15037	target := &ret
15038	if err := gensupport.DecodeResponse(target, res); err != nil {
15039		return nil, err
15040	}
15041	return ret, nil
15042	// {
15043	//   "description": "Gets a view.",
15044	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
15045	//   "httpMethod": "GET",
15046	//   "id": "logging.locations.buckets.views.get",
15047	//   "parameterOrder": [
15048	//     "name"
15049	//   ],
15050	//   "parameters": {
15051	//     "name": {
15052	//       "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\".",
15053	//       "location": "path",
15054	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
15055	//       "required": true,
15056	//       "type": "string"
15057	//     }
15058	//   },
15059	//   "path": "v2/{+name}",
15060	//   "response": {
15061	//     "$ref": "LogView"
15062	//   },
15063	//   "scopes": [
15064	//     "https://www.googleapis.com/auth/cloud-platform",
15065	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
15066	//     "https://www.googleapis.com/auth/logging.admin",
15067	//     "https://www.googleapis.com/auth/logging.read"
15068	//   ]
15069	// }
15070
15071}
15072
15073// method id "logging.locations.buckets.views.list":
15074
15075type LocationsBucketsViewsListCall struct {
15076	s            *Service
15077	parent       string
15078	urlParams_   gensupport.URLParams
15079	ifNoneMatch_ string
15080	ctx_         context.Context
15081	header_      http.Header
15082}
15083
15084// List: Lists views on a bucket.
15085//
15086// - parent: The bucket whose views are to be listed:
15087//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]".
15088func (r *LocationsBucketsViewsService) List(parent string) *LocationsBucketsViewsListCall {
15089	c := &LocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15090	c.parent = parent
15091	return c
15092}
15093
15094// PageSize sets the optional parameter "pageSize": The maximum number
15095// of results to return from this request. Non-positive values are
15096// ignored. The presence of nextPageToken in the response indicates that
15097// more results might be available.
15098func (c *LocationsBucketsViewsListCall) PageSize(pageSize int64) *LocationsBucketsViewsListCall {
15099	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
15100	return c
15101}
15102
15103// PageToken sets the optional parameter "pageToken": If present, then
15104// retrieve the next batch of results from the preceding call to this
15105// method. pageToken must be the value of nextPageToken from the
15106// previous response. The values of other method parameters should be
15107// identical to those in the previous call.
15108func (c *LocationsBucketsViewsListCall) PageToken(pageToken string) *LocationsBucketsViewsListCall {
15109	c.urlParams_.Set("pageToken", pageToken)
15110	return c
15111}
15112
15113// Fields allows partial responses to be retrieved. See
15114// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
15115// for more information.
15116func (c *LocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsListCall {
15117	c.urlParams_.Set("fields", googleapi.CombineFields(s))
15118	return c
15119}
15120
15121// IfNoneMatch sets the optional parameter which makes the operation
15122// fail if the object's ETag matches the given value. This is useful for
15123// getting updates only after the object has changed since the last
15124// request. Use googleapi.IsNotModified to check whether the response
15125// error from Do is the result of In-None-Match.
15126func (c *LocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *LocationsBucketsViewsListCall {
15127	c.ifNoneMatch_ = entityTag
15128	return c
15129}
15130
15131// Context sets the context to be used in this call's Do method. Any
15132// pending HTTP request will be aborted if the provided context is
15133// canceled.
15134func (c *LocationsBucketsViewsListCall) Context(ctx context.Context) *LocationsBucketsViewsListCall {
15135	c.ctx_ = ctx
15136	return c
15137}
15138
15139// Header returns an http.Header that can be modified by the caller to
15140// add HTTP headers to the request.
15141func (c *LocationsBucketsViewsListCall) Header() http.Header {
15142	if c.header_ == nil {
15143		c.header_ = make(http.Header)
15144	}
15145	return c.header_
15146}
15147
15148func (c *LocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) {
15149	reqHeaders := make(http.Header)
15150	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
15151	for k, v := range c.header_ {
15152		reqHeaders[k] = v
15153	}
15154	reqHeaders.Set("User-Agent", c.s.userAgent())
15155	if c.ifNoneMatch_ != "" {
15156		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
15157	}
15158	var body io.Reader = nil
15159	c.urlParams_.Set("alt", alt)
15160	c.urlParams_.Set("prettyPrint", "false")
15161	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
15162	urls += "?" + c.urlParams_.Encode()
15163	req, err := http.NewRequest("GET", urls, body)
15164	if err != nil {
15165		return nil, err
15166	}
15167	req.Header = reqHeaders
15168	googleapi.Expand(req.URL, map[string]string{
15169		"parent": c.parent,
15170	})
15171	return gensupport.SendRequest(c.ctx_, c.s.client, req)
15172}
15173
15174// Do executes the "logging.locations.buckets.views.list" call.
15175// Exactly one of *ListViewsResponse or error will be non-nil. Any
15176// non-2xx status code is an error. Response headers are in either
15177// *ListViewsResponse.ServerResponse.Header or (if a response was
15178// returned at all) in error.(*googleapi.Error).Header. Use
15179// googleapi.IsNotModified to check whether the returned error was
15180// because http.StatusNotModified was returned.
15181func (c *LocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) {
15182	gensupport.SetOptions(c.urlParams_, opts...)
15183	res, err := c.doRequest("json")
15184	if res != nil && res.StatusCode == http.StatusNotModified {
15185		if res.Body != nil {
15186			res.Body.Close()
15187		}
15188		return nil, &googleapi.Error{
15189			Code:   res.StatusCode,
15190			Header: res.Header,
15191		}
15192	}
15193	if err != nil {
15194		return nil, err
15195	}
15196	defer googleapi.CloseBody(res)
15197	if err := googleapi.CheckResponse(res); err != nil {
15198		return nil, err
15199	}
15200	ret := &ListViewsResponse{
15201		ServerResponse: googleapi.ServerResponse{
15202			Header:         res.Header,
15203			HTTPStatusCode: res.StatusCode,
15204		},
15205	}
15206	target := &ret
15207	if err := gensupport.DecodeResponse(target, res); err != nil {
15208		return nil, err
15209	}
15210	return ret, nil
15211	// {
15212	//   "description": "Lists views on a bucket.",
15213	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views",
15214	//   "httpMethod": "GET",
15215	//   "id": "logging.locations.buckets.views.list",
15216	//   "parameterOrder": [
15217	//     "parent"
15218	//   ],
15219	//   "parameters": {
15220	//     "pageSize": {
15221	//       "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.",
15222	//       "format": "int32",
15223	//       "location": "query",
15224	//       "type": "integer"
15225	//     },
15226	//     "pageToken": {
15227	//       "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.",
15228	//       "location": "query",
15229	//       "type": "string"
15230	//     },
15231	//     "parent": {
15232	//       "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ",
15233	//       "location": "path",
15234	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$",
15235	//       "required": true,
15236	//       "type": "string"
15237	//     }
15238	//   },
15239	//   "path": "v2/{+parent}/views",
15240	//   "response": {
15241	//     "$ref": "ListViewsResponse"
15242	//   },
15243	//   "scopes": [
15244	//     "https://www.googleapis.com/auth/cloud-platform",
15245	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
15246	//     "https://www.googleapis.com/auth/logging.admin",
15247	//     "https://www.googleapis.com/auth/logging.read"
15248	//   ]
15249	// }
15250
15251}
15252
15253// Pages invokes f for each page of results.
15254// A non-nil error returned from f will halt the iteration.
15255// The provided context supersedes any context provided to the Context method.
15256func (c *LocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error {
15257	c.ctx_ = ctx
15258	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
15259	for {
15260		x, err := c.Do()
15261		if err != nil {
15262			return err
15263		}
15264		if err := f(x); err != nil {
15265			return err
15266		}
15267		if x.NextPageToken == "" {
15268			return nil
15269		}
15270		c.PageToken(x.NextPageToken)
15271	}
15272}
15273
15274// method id "logging.locations.buckets.views.patch":
15275
15276type LocationsBucketsViewsPatchCall struct {
15277	s          *Service
15278	name       string
15279	logview    *LogView
15280	urlParams_ gensupport.URLParams
15281	ctx_       context.Context
15282	header_    http.Header
15283}
15284
15285// Patch: Updates a view. This method replaces the following fields in
15286// the existing view with values from the new view: filter.
15287//
15288// - name: The full resource name of the view to update
15289//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
15290//   iews/[VIEW_ID]" Example:
15291//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id/v
15292//   iews/my-view-id".
15293func (r *LocationsBucketsViewsService) Patch(name string, logview *LogView) *LocationsBucketsViewsPatchCall {
15294	c := &LocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15295	c.name = name
15296	c.logview = logview
15297	return c
15298}
15299
15300// UpdateMask sets the optional parameter "updateMask": Field mask that
15301// specifies the fields in view that need an update. A field will be
15302// overwritten if, and only if, it is in the update mask. name and
15303// output only fields cannot be updated.For a detailed FieldMask
15304// definition, see
15305// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
15306// updateMask=filter.
15307func (c *LocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *LocationsBucketsViewsPatchCall {
15308	c.urlParams_.Set("updateMask", updateMask)
15309	return c
15310}
15311
15312// Fields allows partial responses to be retrieved. See
15313// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
15314// for more information.
15315func (c *LocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsPatchCall {
15316	c.urlParams_.Set("fields", googleapi.CombineFields(s))
15317	return c
15318}
15319
15320// Context sets the context to be used in this call's Do method. Any
15321// pending HTTP request will be aborted if the provided context is
15322// canceled.
15323func (c *LocationsBucketsViewsPatchCall) Context(ctx context.Context) *LocationsBucketsViewsPatchCall {
15324	c.ctx_ = ctx
15325	return c
15326}
15327
15328// Header returns an http.Header that can be modified by the caller to
15329// add HTTP headers to the request.
15330func (c *LocationsBucketsViewsPatchCall) Header() http.Header {
15331	if c.header_ == nil {
15332		c.header_ = make(http.Header)
15333	}
15334	return c.header_
15335}
15336
15337func (c *LocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) {
15338	reqHeaders := make(http.Header)
15339	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
15340	for k, v := range c.header_ {
15341		reqHeaders[k] = v
15342	}
15343	reqHeaders.Set("User-Agent", c.s.userAgent())
15344	var body io.Reader = nil
15345	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
15346	if err != nil {
15347		return nil, err
15348	}
15349	reqHeaders.Set("Content-Type", "application/json")
15350	c.urlParams_.Set("alt", alt)
15351	c.urlParams_.Set("prettyPrint", "false")
15352	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
15353	urls += "?" + c.urlParams_.Encode()
15354	req, err := http.NewRequest("PATCH", urls, body)
15355	if err != nil {
15356		return nil, err
15357	}
15358	req.Header = reqHeaders
15359	googleapi.Expand(req.URL, map[string]string{
15360		"name": c.name,
15361	})
15362	return gensupport.SendRequest(c.ctx_, c.s.client, req)
15363}
15364
15365// Do executes the "logging.locations.buckets.views.patch" call.
15366// Exactly one of *LogView or error will be non-nil. Any non-2xx status
15367// code is an error. Response headers are in either
15368// *LogView.ServerResponse.Header or (if a response was returned at all)
15369// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
15370// check whether the returned error was because http.StatusNotModified
15371// was returned.
15372func (c *LocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
15373	gensupport.SetOptions(c.urlParams_, opts...)
15374	res, err := c.doRequest("json")
15375	if res != nil && res.StatusCode == http.StatusNotModified {
15376		if res.Body != nil {
15377			res.Body.Close()
15378		}
15379		return nil, &googleapi.Error{
15380			Code:   res.StatusCode,
15381			Header: res.Header,
15382		}
15383	}
15384	if err != nil {
15385		return nil, err
15386	}
15387	defer googleapi.CloseBody(res)
15388	if err := googleapi.CheckResponse(res); err != nil {
15389		return nil, err
15390	}
15391	ret := &LogView{
15392		ServerResponse: googleapi.ServerResponse{
15393			Header:         res.Header,
15394			HTTPStatusCode: res.StatusCode,
15395		},
15396	}
15397	target := &ret
15398	if err := gensupport.DecodeResponse(target, res); err != nil {
15399		return nil, err
15400	}
15401	return ret, nil
15402	// {
15403	//   "description": "Updates a view. This method replaces the following fields in the existing view with values from the new view: filter.",
15404	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
15405	//   "httpMethod": "PATCH",
15406	//   "id": "logging.locations.buckets.views.patch",
15407	//   "parameterOrder": [
15408	//     "name"
15409	//   ],
15410	//   "parameters": {
15411	//     "name": {
15412	//       "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\".",
15413	//       "location": "path",
15414	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
15415	//       "required": true,
15416	//       "type": "string"
15417	//     },
15418	//     "updateMask": {
15419	//       "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.",
15420	//       "format": "google-fieldmask",
15421	//       "location": "query",
15422	//       "type": "string"
15423	//     }
15424	//   },
15425	//   "path": "v2/{+name}",
15426	//   "request": {
15427	//     "$ref": "LogView"
15428	//   },
15429	//   "response": {
15430	//     "$ref": "LogView"
15431	//   },
15432	//   "scopes": [
15433	//     "https://www.googleapis.com/auth/cloud-platform",
15434	//     "https://www.googleapis.com/auth/logging.admin"
15435	//   ]
15436	// }
15437
15438}
15439
15440// method id "logging.logs.delete":
15441
15442type LogsDeleteCall struct {
15443	s          *Service
15444	logName    string
15445	urlParams_ gensupport.URLParams
15446	ctx_       context.Context
15447	header_    http.Header
15448}
15449
15450// Delete: Deletes all the log entries in a log for the _Default Log
15451// Bucket. The log reappears if it receives new entries. Log entries
15452// written shortly before the delete operation might not be deleted.
15453// Entries received after the delete operation with a timestamp before
15454// the operation will be deleted.
15455//
15456// - logName: The resource name of the log to delete:
15457//   projects/[PROJECT_ID]/logs/[LOG_ID]
15458//   organizations/[ORGANIZATION_ID]/logs/[LOG_ID]
15459//   billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]
15460//   folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For
15461//   example, "projects/my-project-id/logs/syslog",
15462//   "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For
15463//   more information about log names, see LogEntry.
15464func (r *LogsService) Delete(logName string) *LogsDeleteCall {
15465	c := &LogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15466	c.logName = logName
15467	return c
15468}
15469
15470// Fields allows partial responses to be retrieved. See
15471// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
15472// for more information.
15473func (c *LogsDeleteCall) Fields(s ...googleapi.Field) *LogsDeleteCall {
15474	c.urlParams_.Set("fields", googleapi.CombineFields(s))
15475	return c
15476}
15477
15478// Context sets the context to be used in this call's Do method. Any
15479// pending HTTP request will be aborted if the provided context is
15480// canceled.
15481func (c *LogsDeleteCall) Context(ctx context.Context) *LogsDeleteCall {
15482	c.ctx_ = ctx
15483	return c
15484}
15485
15486// Header returns an http.Header that can be modified by the caller to
15487// add HTTP headers to the request.
15488func (c *LogsDeleteCall) Header() http.Header {
15489	if c.header_ == nil {
15490		c.header_ = make(http.Header)
15491	}
15492	return c.header_
15493}
15494
15495func (c *LogsDeleteCall) doRequest(alt string) (*http.Response, error) {
15496	reqHeaders := make(http.Header)
15497	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
15498	for k, v := range c.header_ {
15499		reqHeaders[k] = v
15500	}
15501	reqHeaders.Set("User-Agent", c.s.userAgent())
15502	var body io.Reader = nil
15503	c.urlParams_.Set("alt", alt)
15504	c.urlParams_.Set("prettyPrint", "false")
15505	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}")
15506	urls += "?" + c.urlParams_.Encode()
15507	req, err := http.NewRequest("DELETE", urls, body)
15508	if err != nil {
15509		return nil, err
15510	}
15511	req.Header = reqHeaders
15512	googleapi.Expand(req.URL, map[string]string{
15513		"logName": c.logName,
15514	})
15515	return gensupport.SendRequest(c.ctx_, c.s.client, req)
15516}
15517
15518// Do executes the "logging.logs.delete" call.
15519// Exactly one of *Empty or error will be non-nil. Any non-2xx status
15520// code is an error. Response headers are in either
15521// *Empty.ServerResponse.Header or (if a response was returned at all)
15522// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
15523// check whether the returned error was because http.StatusNotModified
15524// was returned.
15525func (c *LogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
15526	gensupport.SetOptions(c.urlParams_, opts...)
15527	res, err := c.doRequest("json")
15528	if res != nil && res.StatusCode == http.StatusNotModified {
15529		if res.Body != nil {
15530			res.Body.Close()
15531		}
15532		return nil, &googleapi.Error{
15533			Code:   res.StatusCode,
15534			Header: res.Header,
15535		}
15536	}
15537	if err != nil {
15538		return nil, err
15539	}
15540	defer googleapi.CloseBody(res)
15541	if err := googleapi.CheckResponse(res); err != nil {
15542		return nil, err
15543	}
15544	ret := &Empty{
15545		ServerResponse: googleapi.ServerResponse{
15546			Header:         res.Header,
15547			HTTPStatusCode: res.StatusCode,
15548		},
15549	}
15550	target := &ret
15551	if err := gensupport.DecodeResponse(target, res); err != nil {
15552		return nil, err
15553	}
15554	return ret, nil
15555	// {
15556	//   "description": "Deletes all the log entries in a log for the _Default Log Bucket. 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.",
15557	//   "flatPath": "v2/{v2Id}/{v2Id1}/logs/{logsId}",
15558	//   "httpMethod": "DELETE",
15559	//   "id": "logging.logs.delete",
15560	//   "parameterOrder": [
15561	//     "logName"
15562	//   ],
15563	//   "parameters": {
15564	//     "logName": {
15565	//       "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/123/logs/cloudaudit.googleapis.com%2Factivity\".For more information about log names, see LogEntry.",
15566	//       "location": "path",
15567	//       "pattern": "^[^/]+/[^/]+/logs/[^/]+$",
15568	//       "required": true,
15569	//       "type": "string"
15570	//     }
15571	//   },
15572	//   "path": "v2/{+logName}",
15573	//   "response": {
15574	//     "$ref": "Empty"
15575	//   },
15576	//   "scopes": [
15577	//     "https://www.googleapis.com/auth/cloud-platform",
15578	//     "https://www.googleapis.com/auth/logging.admin"
15579	//   ]
15580	// }
15581
15582}
15583
15584// method id "logging.logs.list":
15585
15586type LogsListCall struct {
15587	s            *Service
15588	parent       string
15589	urlParams_   gensupport.URLParams
15590	ifNoneMatch_ string
15591	ctx_         context.Context
15592	header_      http.Header
15593}
15594
15595// List: Lists the logs in projects, organizations, folders, or billing
15596// accounts. Only logs that have entries are listed.
15597//
15598// - parent: The resource name that owns the logs: projects/[PROJECT_ID]
15599//   organizations/[ORGANIZATION_ID]
15600//   billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID].
15601func (r *LogsService) List(parent string) *LogsListCall {
15602	c := &LogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15603	c.parent = parent
15604	return c
15605}
15606
15607// PageSize sets the optional parameter "pageSize": The maximum number
15608// of results to return from this request. Non-positive values are
15609// ignored. The presence of nextPageToken in the response indicates that
15610// more results might be available.
15611func (c *LogsListCall) PageSize(pageSize int64) *LogsListCall {
15612	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
15613	return c
15614}
15615
15616// PageToken sets the optional parameter "pageToken": If present, then
15617// retrieve the next batch of results from the preceding call to this
15618// method. pageToken must be the value of nextPageToken from the
15619// previous response. The values of other method parameters should be
15620// identical to those in the previous call.
15621func (c *LogsListCall) PageToken(pageToken string) *LogsListCall {
15622	c.urlParams_.Set("pageToken", pageToken)
15623	return c
15624}
15625
15626// ResourceNames sets the optional parameter "resourceNames": The
15627// resource name that owns the logs:
15628// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view
15629// s/[VIEW_ID]
15630// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE
15631// T_ID]/views/[VIEW_ID]
15632// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[
15633// BUCKET_ID]/views/[VIEW_ID]
15634// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/
15635// [VIEW_ID]To support legacy queries, it could also be:
15636// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID]
15637// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]
15638func (c *LogsListCall) ResourceNames(resourceNames ...string) *LogsListCall {
15639	c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...))
15640	return c
15641}
15642
15643// Fields allows partial responses to be retrieved. See
15644// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
15645// for more information.
15646func (c *LogsListCall) Fields(s ...googleapi.Field) *LogsListCall {
15647	c.urlParams_.Set("fields", googleapi.CombineFields(s))
15648	return c
15649}
15650
15651// IfNoneMatch sets the optional parameter which makes the operation
15652// fail if the object's ETag matches the given value. This is useful for
15653// getting updates only after the object has changed since the last
15654// request. Use googleapi.IsNotModified to check whether the response
15655// error from Do is the result of In-None-Match.
15656func (c *LogsListCall) IfNoneMatch(entityTag string) *LogsListCall {
15657	c.ifNoneMatch_ = entityTag
15658	return c
15659}
15660
15661// Context sets the context to be used in this call's Do method. Any
15662// pending HTTP request will be aborted if the provided context is
15663// canceled.
15664func (c *LogsListCall) Context(ctx context.Context) *LogsListCall {
15665	c.ctx_ = ctx
15666	return c
15667}
15668
15669// Header returns an http.Header that can be modified by the caller to
15670// add HTTP headers to the request.
15671func (c *LogsListCall) Header() http.Header {
15672	if c.header_ == nil {
15673		c.header_ = make(http.Header)
15674	}
15675	return c.header_
15676}
15677
15678func (c *LogsListCall) doRequest(alt string) (*http.Response, error) {
15679	reqHeaders := make(http.Header)
15680	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
15681	for k, v := range c.header_ {
15682		reqHeaders[k] = v
15683	}
15684	reqHeaders.Set("User-Agent", c.s.userAgent())
15685	if c.ifNoneMatch_ != "" {
15686		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
15687	}
15688	var body io.Reader = nil
15689	c.urlParams_.Set("alt", alt)
15690	c.urlParams_.Set("prettyPrint", "false")
15691	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs")
15692	urls += "?" + c.urlParams_.Encode()
15693	req, err := http.NewRequest("GET", urls, body)
15694	if err != nil {
15695		return nil, err
15696	}
15697	req.Header = reqHeaders
15698	googleapi.Expand(req.URL, map[string]string{
15699		"parent": c.parent,
15700	})
15701	return gensupport.SendRequest(c.ctx_, c.s.client, req)
15702}
15703
15704// Do executes the "logging.logs.list" call.
15705// Exactly one of *ListLogsResponse or error will be non-nil. Any
15706// non-2xx status code is an error. Response headers are in either
15707// *ListLogsResponse.ServerResponse.Header or (if a response was
15708// returned at all) in error.(*googleapi.Error).Header. Use
15709// googleapi.IsNotModified to check whether the returned error was
15710// because http.StatusNotModified was returned.
15711func (c *LogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) {
15712	gensupport.SetOptions(c.urlParams_, opts...)
15713	res, err := c.doRequest("json")
15714	if res != nil && res.StatusCode == http.StatusNotModified {
15715		if res.Body != nil {
15716			res.Body.Close()
15717		}
15718		return nil, &googleapi.Error{
15719			Code:   res.StatusCode,
15720			Header: res.Header,
15721		}
15722	}
15723	if err != nil {
15724		return nil, err
15725	}
15726	defer googleapi.CloseBody(res)
15727	if err := googleapi.CheckResponse(res); err != nil {
15728		return nil, err
15729	}
15730	ret := &ListLogsResponse{
15731		ServerResponse: googleapi.ServerResponse{
15732			Header:         res.Header,
15733			HTTPStatusCode: res.StatusCode,
15734		},
15735	}
15736	target := &ret
15737	if err := gensupport.DecodeResponse(target, res); err != nil {
15738		return nil, err
15739	}
15740	return ret, nil
15741	// {
15742	//   "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.",
15743	//   "flatPath": "v2/{v2Id}/{v2Id1}/logs",
15744	//   "httpMethod": "GET",
15745	//   "id": "logging.logs.list",
15746	//   "parameterOrder": [
15747	//     "parent"
15748	//   ],
15749	//   "parameters": {
15750	//     "pageSize": {
15751	//       "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.",
15752	//       "format": "int32",
15753	//       "location": "query",
15754	//       "type": "integer"
15755	//     },
15756	//     "pageToken": {
15757	//       "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.",
15758	//       "location": "query",
15759	//       "type": "string"
15760	//     },
15761	//     "parent": {
15762	//       "description": "Required. The resource name that owns the logs: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]",
15763	//       "location": "path",
15764	//       "pattern": "^[^/]+/[^/]+$",
15765	//       "required": true,
15766	//       "type": "string"
15767	//     },
15768	//     "resourceNames": {
15769	//       "description": "Optional. The resource name that owns the logs: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[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_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]",
15770	//       "location": "query",
15771	//       "repeated": true,
15772	//       "type": "string"
15773	//     }
15774	//   },
15775	//   "path": "v2/{+parent}/logs",
15776	//   "response": {
15777	//     "$ref": "ListLogsResponse"
15778	//   },
15779	//   "scopes": [
15780	//     "https://www.googleapis.com/auth/cloud-platform",
15781	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
15782	//     "https://www.googleapis.com/auth/logging.admin",
15783	//     "https://www.googleapis.com/auth/logging.read"
15784	//   ]
15785	// }
15786
15787}
15788
15789// Pages invokes f for each page of results.
15790// A non-nil error returned from f will halt the iteration.
15791// The provided context supersedes any context provided to the Context method.
15792func (c *LogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error {
15793	c.ctx_ = ctx
15794	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
15795	for {
15796		x, err := c.Do()
15797		if err != nil {
15798			return err
15799		}
15800		if err := f(x); err != nil {
15801			return err
15802		}
15803		if x.NextPageToken == "" {
15804			return nil
15805		}
15806		c.PageToken(x.NextPageToken)
15807	}
15808}
15809
15810// method id "logging.monitoredResourceDescriptors.list":
15811
15812type MonitoredResourceDescriptorsListCall struct {
15813	s            *Service
15814	urlParams_   gensupport.URLParams
15815	ifNoneMatch_ string
15816	ctx_         context.Context
15817	header_      http.Header
15818}
15819
15820// List: Lists the descriptors for monitored resource types used by
15821// Logging.
15822func (r *MonitoredResourceDescriptorsService) List() *MonitoredResourceDescriptorsListCall {
15823	c := &MonitoredResourceDescriptorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15824	return c
15825}
15826
15827// PageSize sets the optional parameter "pageSize": The maximum number
15828// of results to return from this request. Non-positive values are
15829// ignored. The presence of nextPageToken in the response indicates that
15830// more results might be available.
15831func (c *MonitoredResourceDescriptorsListCall) PageSize(pageSize int64) *MonitoredResourceDescriptorsListCall {
15832	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
15833	return c
15834}
15835
15836// PageToken sets the optional parameter "pageToken": If present, then
15837// retrieve the next batch of results from the preceding call to this
15838// method. pageToken must be the value of nextPageToken from the
15839// previous response. The values of other method parameters should be
15840// identical to those in the previous call.
15841func (c *MonitoredResourceDescriptorsListCall) PageToken(pageToken string) *MonitoredResourceDescriptorsListCall {
15842	c.urlParams_.Set("pageToken", pageToken)
15843	return c
15844}
15845
15846// Fields allows partial responses to be retrieved. See
15847// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
15848// for more information.
15849func (c *MonitoredResourceDescriptorsListCall) Fields(s ...googleapi.Field) *MonitoredResourceDescriptorsListCall {
15850	c.urlParams_.Set("fields", googleapi.CombineFields(s))
15851	return c
15852}
15853
15854// IfNoneMatch sets the optional parameter which makes the operation
15855// fail if the object's ETag matches the given value. This is useful for
15856// getting updates only after the object has changed since the last
15857// request. Use googleapi.IsNotModified to check whether the response
15858// error from Do is the result of In-None-Match.
15859func (c *MonitoredResourceDescriptorsListCall) IfNoneMatch(entityTag string) *MonitoredResourceDescriptorsListCall {
15860	c.ifNoneMatch_ = entityTag
15861	return c
15862}
15863
15864// Context sets the context to be used in this call's Do method. Any
15865// pending HTTP request will be aborted if the provided context is
15866// canceled.
15867func (c *MonitoredResourceDescriptorsListCall) Context(ctx context.Context) *MonitoredResourceDescriptorsListCall {
15868	c.ctx_ = ctx
15869	return c
15870}
15871
15872// Header returns an http.Header that can be modified by the caller to
15873// add HTTP headers to the request.
15874func (c *MonitoredResourceDescriptorsListCall) Header() http.Header {
15875	if c.header_ == nil {
15876		c.header_ = make(http.Header)
15877	}
15878	return c.header_
15879}
15880
15881func (c *MonitoredResourceDescriptorsListCall) doRequest(alt string) (*http.Response, error) {
15882	reqHeaders := make(http.Header)
15883	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
15884	for k, v := range c.header_ {
15885		reqHeaders[k] = v
15886	}
15887	reqHeaders.Set("User-Agent", c.s.userAgent())
15888	if c.ifNoneMatch_ != "" {
15889		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
15890	}
15891	var body io.Reader = nil
15892	c.urlParams_.Set("alt", alt)
15893	c.urlParams_.Set("prettyPrint", "false")
15894	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/monitoredResourceDescriptors")
15895	urls += "?" + c.urlParams_.Encode()
15896	req, err := http.NewRequest("GET", urls, body)
15897	if err != nil {
15898		return nil, err
15899	}
15900	req.Header = reqHeaders
15901	return gensupport.SendRequest(c.ctx_, c.s.client, req)
15902}
15903
15904// Do executes the "logging.monitoredResourceDescriptors.list" call.
15905// Exactly one of *ListMonitoredResourceDescriptorsResponse or error
15906// will be non-nil. Any non-2xx status code is an error. Response
15907// headers are in either
15908// *ListMonitoredResourceDescriptorsResponse.ServerResponse.Header or
15909// (if a response was returned at all) in
15910// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
15911// whether the returned error was because http.StatusNotModified was
15912// returned.
15913func (c *MonitoredResourceDescriptorsListCall) Do(opts ...googleapi.CallOption) (*ListMonitoredResourceDescriptorsResponse, error) {
15914	gensupport.SetOptions(c.urlParams_, opts...)
15915	res, err := c.doRequest("json")
15916	if res != nil && res.StatusCode == http.StatusNotModified {
15917		if res.Body != nil {
15918			res.Body.Close()
15919		}
15920		return nil, &googleapi.Error{
15921			Code:   res.StatusCode,
15922			Header: res.Header,
15923		}
15924	}
15925	if err != nil {
15926		return nil, err
15927	}
15928	defer googleapi.CloseBody(res)
15929	if err := googleapi.CheckResponse(res); err != nil {
15930		return nil, err
15931	}
15932	ret := &ListMonitoredResourceDescriptorsResponse{
15933		ServerResponse: googleapi.ServerResponse{
15934			Header:         res.Header,
15935			HTTPStatusCode: res.StatusCode,
15936		},
15937	}
15938	target := &ret
15939	if err := gensupport.DecodeResponse(target, res); err != nil {
15940		return nil, err
15941	}
15942	return ret, nil
15943	// {
15944	//   "description": "Lists the descriptors for monitored resource types used by Logging.",
15945	//   "flatPath": "v2/monitoredResourceDescriptors",
15946	//   "httpMethod": "GET",
15947	//   "id": "logging.monitoredResourceDescriptors.list",
15948	//   "parameterOrder": [],
15949	//   "parameters": {
15950	//     "pageSize": {
15951	//       "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.",
15952	//       "format": "int32",
15953	//       "location": "query",
15954	//       "type": "integer"
15955	//     },
15956	//     "pageToken": {
15957	//       "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.",
15958	//       "location": "query",
15959	//       "type": "string"
15960	//     }
15961	//   },
15962	//   "path": "v2/monitoredResourceDescriptors",
15963	//   "response": {
15964	//     "$ref": "ListMonitoredResourceDescriptorsResponse"
15965	//   },
15966	//   "scopes": [
15967	//     "https://www.googleapis.com/auth/cloud-platform",
15968	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
15969	//     "https://www.googleapis.com/auth/logging.admin",
15970	//     "https://www.googleapis.com/auth/logging.read"
15971	//   ]
15972	// }
15973
15974}
15975
15976// Pages invokes f for each page of results.
15977// A non-nil error returned from f will halt the iteration.
15978// The provided context supersedes any context provided to the Context method.
15979func (c *MonitoredResourceDescriptorsListCall) Pages(ctx context.Context, f func(*ListMonitoredResourceDescriptorsResponse) error) error {
15980	c.ctx_ = ctx
15981	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
15982	for {
15983		x, err := c.Do()
15984		if err != nil {
15985			return err
15986		}
15987		if err := f(x); err != nil {
15988			return err
15989		}
15990		if x.NextPageToken == "" {
15991			return nil
15992		}
15993		c.PageToken(x.NextPageToken)
15994	}
15995}
15996
15997// method id "logging.organizations.getCmekSettings":
15998
15999type OrganizationsGetCmekSettingsCall struct {
16000	s            *Service
16001	name         string
16002	urlParams_   gensupport.URLParams
16003	ifNoneMatch_ string
16004	ctx_         context.Context
16005	header_      http.Header
16006}
16007
16008// GetCmekSettings: Gets the Logs Router CMEK settings for the given
16009// resource.Note: CMEK for the Logs Router can currently only be
16010// configured for GCP organizations. Once configured, it applies to all
16011// projects and folders in the GCP organization.See Enabling CMEK for
16012// Logs Router
16013// (https://cloud.google.com/logging/docs/routing/managed-encryption)
16014// for more information.
16015//
16016// - name: The resource for which to retrieve CMEK settings.
16017//   "projects/[PROJECT_ID]/cmekSettings"
16018//   "organizations/[ORGANIZATION_ID]/cmekSettings"
16019//   "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
16020//   "folders/[FOLDER_ID]/cmekSettings" Example:
16021//   "organizations/12345/cmekSettings".Note: CMEK for the Logs Router
16022//   can currently only be configured for GCP organizations. Once
16023//   configured, it applies to all projects and folders in the GCP
16024//   organization.
16025func (r *OrganizationsService) GetCmekSettings(name string) *OrganizationsGetCmekSettingsCall {
16026	c := &OrganizationsGetCmekSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
16027	c.name = name
16028	return c
16029}
16030
16031// Fields allows partial responses to be retrieved. See
16032// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
16033// for more information.
16034func (c *OrganizationsGetCmekSettingsCall) Fields(s ...googleapi.Field) *OrganizationsGetCmekSettingsCall {
16035	c.urlParams_.Set("fields", googleapi.CombineFields(s))
16036	return c
16037}
16038
16039// IfNoneMatch sets the optional parameter which makes the operation
16040// fail if the object's ETag matches the given value. This is useful for
16041// getting updates only after the object has changed since the last
16042// request. Use googleapi.IsNotModified to check whether the response
16043// error from Do is the result of In-None-Match.
16044func (c *OrganizationsGetCmekSettingsCall) IfNoneMatch(entityTag string) *OrganizationsGetCmekSettingsCall {
16045	c.ifNoneMatch_ = entityTag
16046	return c
16047}
16048
16049// Context sets the context to be used in this call's Do method. Any
16050// pending HTTP request will be aborted if the provided context is
16051// canceled.
16052func (c *OrganizationsGetCmekSettingsCall) Context(ctx context.Context) *OrganizationsGetCmekSettingsCall {
16053	c.ctx_ = ctx
16054	return c
16055}
16056
16057// Header returns an http.Header that can be modified by the caller to
16058// add HTTP headers to the request.
16059func (c *OrganizationsGetCmekSettingsCall) Header() http.Header {
16060	if c.header_ == nil {
16061		c.header_ = make(http.Header)
16062	}
16063	return c.header_
16064}
16065
16066func (c *OrganizationsGetCmekSettingsCall) doRequest(alt string) (*http.Response, error) {
16067	reqHeaders := make(http.Header)
16068	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
16069	for k, v := range c.header_ {
16070		reqHeaders[k] = v
16071	}
16072	reqHeaders.Set("User-Agent", c.s.userAgent())
16073	if c.ifNoneMatch_ != "" {
16074		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
16075	}
16076	var body io.Reader = nil
16077	c.urlParams_.Set("alt", alt)
16078	c.urlParams_.Set("prettyPrint", "false")
16079	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings")
16080	urls += "?" + c.urlParams_.Encode()
16081	req, err := http.NewRequest("GET", urls, body)
16082	if err != nil {
16083		return nil, err
16084	}
16085	req.Header = reqHeaders
16086	googleapi.Expand(req.URL, map[string]string{
16087		"name": c.name,
16088	})
16089	return gensupport.SendRequest(c.ctx_, c.s.client, req)
16090}
16091
16092// Do executes the "logging.organizations.getCmekSettings" call.
16093// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx
16094// status code is an error. Response headers are in either
16095// *CmekSettings.ServerResponse.Header or (if a response was returned at
16096// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
16097// to check whether the returned error was because
16098// http.StatusNotModified was returned.
16099func (c *OrganizationsGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) {
16100	gensupport.SetOptions(c.urlParams_, opts...)
16101	res, err := c.doRequest("json")
16102	if res != nil && res.StatusCode == http.StatusNotModified {
16103		if res.Body != nil {
16104			res.Body.Close()
16105		}
16106		return nil, &googleapi.Error{
16107			Code:   res.StatusCode,
16108			Header: res.Header,
16109		}
16110	}
16111	if err != nil {
16112		return nil, err
16113	}
16114	defer googleapi.CloseBody(res)
16115	if err := googleapi.CheckResponse(res); err != nil {
16116		return nil, err
16117	}
16118	ret := &CmekSettings{
16119		ServerResponse: googleapi.ServerResponse{
16120			Header:         res.Header,
16121			HTTPStatusCode: res.StatusCode,
16122		},
16123	}
16124	target := &ret
16125	if err := gensupport.DecodeResponse(target, res); err != nil {
16126		return nil, err
16127	}
16128	return ret, nil
16129	// {
16130	//   "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.",
16131	//   "flatPath": "v2/organizations/{organizationsId}/cmekSettings",
16132	//   "httpMethod": "GET",
16133	//   "id": "logging.organizations.getCmekSettings",
16134	//   "parameterOrder": [
16135	//     "name"
16136	//   ],
16137	//   "parameters": {
16138	//     "name": {
16139	//       "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.",
16140	//       "location": "path",
16141	//       "pattern": "^organizations/[^/]+$",
16142	//       "required": true,
16143	//       "type": "string"
16144	//     }
16145	//   },
16146	//   "path": "v2/{+name}/cmekSettings",
16147	//   "response": {
16148	//     "$ref": "CmekSettings"
16149	//   },
16150	//   "scopes": [
16151	//     "https://www.googleapis.com/auth/cloud-platform",
16152	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
16153	//     "https://www.googleapis.com/auth/logging.admin",
16154	//     "https://www.googleapis.com/auth/logging.read"
16155	//   ]
16156	// }
16157
16158}
16159
16160// method id "logging.organizations.updateCmekSettings":
16161
16162type OrganizationsUpdateCmekSettingsCall struct {
16163	s            *Service
16164	name         string
16165	cmeksettings *CmekSettings
16166	urlParams_   gensupport.URLParams
16167	ctx_         context.Context
16168	header_      http.Header
16169}
16170
16171// UpdateCmekSettings: Updates the Logs Router CMEK settings for the
16172// given resource.Note: CMEK for the Logs Router can currently only be
16173// configured for GCP organizations. Once configured, it applies to all
16174// projects and folders in the GCP organization.UpdateCmekSettings will
16175// fail if 1) kms_key_name is invalid, or 2) the associated service
16176// account does not have the required
16177// roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key,
16178// or 3) access to the key is disabled.See Enabling CMEK for Logs Router
16179// (https://cloud.google.com/logging/docs/routing/managed-encryption)
16180// for more information.
16181//
16182// - name: The resource name for the CMEK settings to update.
16183//   "projects/[PROJECT_ID]/cmekSettings"
16184//   "organizations/[ORGANIZATION_ID]/cmekSettings"
16185//   "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
16186//   "folders/[FOLDER_ID]/cmekSettings" Example:
16187//   "organizations/12345/cmekSettings".Note: CMEK for the Logs Router
16188//   can currently only be configured for GCP organizations. Once
16189//   configured, it applies to all projects and folders in the GCP
16190//   organization.
16191func (r *OrganizationsService) UpdateCmekSettings(name string, cmeksettings *CmekSettings) *OrganizationsUpdateCmekSettingsCall {
16192	c := &OrganizationsUpdateCmekSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
16193	c.name = name
16194	c.cmeksettings = cmeksettings
16195	return c
16196}
16197
16198// UpdateMask sets the optional parameter "updateMask": Field mask
16199// identifying which fields from cmek_settings should be updated. A
16200// field will be overwritten if and only if it is in the update mask.
16201// Output only fields cannot be updated.See FieldMask for more
16202// information.Example: "updateMask=kmsKeyName"
16203func (c *OrganizationsUpdateCmekSettingsCall) UpdateMask(updateMask string) *OrganizationsUpdateCmekSettingsCall {
16204	c.urlParams_.Set("updateMask", updateMask)
16205	return c
16206}
16207
16208// Fields allows partial responses to be retrieved. See
16209// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
16210// for more information.
16211func (c *OrganizationsUpdateCmekSettingsCall) Fields(s ...googleapi.Field) *OrganizationsUpdateCmekSettingsCall {
16212	c.urlParams_.Set("fields", googleapi.CombineFields(s))
16213	return c
16214}
16215
16216// Context sets the context to be used in this call's Do method. Any
16217// pending HTTP request will be aborted if the provided context is
16218// canceled.
16219func (c *OrganizationsUpdateCmekSettingsCall) Context(ctx context.Context) *OrganizationsUpdateCmekSettingsCall {
16220	c.ctx_ = ctx
16221	return c
16222}
16223
16224// Header returns an http.Header that can be modified by the caller to
16225// add HTTP headers to the request.
16226func (c *OrganizationsUpdateCmekSettingsCall) Header() http.Header {
16227	if c.header_ == nil {
16228		c.header_ = make(http.Header)
16229	}
16230	return c.header_
16231}
16232
16233func (c *OrganizationsUpdateCmekSettingsCall) doRequest(alt string) (*http.Response, error) {
16234	reqHeaders := make(http.Header)
16235	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
16236	for k, v := range c.header_ {
16237		reqHeaders[k] = v
16238	}
16239	reqHeaders.Set("User-Agent", c.s.userAgent())
16240	var body io.Reader = nil
16241	body, err := googleapi.WithoutDataWrapper.JSONReader(c.cmeksettings)
16242	if err != nil {
16243		return nil, err
16244	}
16245	reqHeaders.Set("Content-Type", "application/json")
16246	c.urlParams_.Set("alt", alt)
16247	c.urlParams_.Set("prettyPrint", "false")
16248	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings")
16249	urls += "?" + c.urlParams_.Encode()
16250	req, err := http.NewRequest("PATCH", urls, body)
16251	if err != nil {
16252		return nil, err
16253	}
16254	req.Header = reqHeaders
16255	googleapi.Expand(req.URL, map[string]string{
16256		"name": c.name,
16257	})
16258	return gensupport.SendRequest(c.ctx_, c.s.client, req)
16259}
16260
16261// Do executes the "logging.organizations.updateCmekSettings" call.
16262// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx
16263// status code is an error. Response headers are in either
16264// *CmekSettings.ServerResponse.Header or (if a response was returned at
16265// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
16266// to check whether the returned error was because
16267// http.StatusNotModified was returned.
16268func (c *OrganizationsUpdateCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) {
16269	gensupport.SetOptions(c.urlParams_, opts...)
16270	res, err := c.doRequest("json")
16271	if res != nil && res.StatusCode == http.StatusNotModified {
16272		if res.Body != nil {
16273			res.Body.Close()
16274		}
16275		return nil, &googleapi.Error{
16276			Code:   res.StatusCode,
16277			Header: res.Header,
16278		}
16279	}
16280	if err != nil {
16281		return nil, err
16282	}
16283	defer googleapi.CloseBody(res)
16284	if err := googleapi.CheckResponse(res); err != nil {
16285		return nil, err
16286	}
16287	ret := &CmekSettings{
16288		ServerResponse: googleapi.ServerResponse{
16289			Header:         res.Header,
16290			HTTPStatusCode: res.StatusCode,
16291		},
16292	}
16293	target := &ret
16294	if err := gensupport.DecodeResponse(target, res); err != nil {
16295		return nil, err
16296	}
16297	return ret, nil
16298	// {
16299	//   "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.",
16300	//   "flatPath": "v2/organizations/{organizationsId}/cmekSettings",
16301	//   "httpMethod": "PATCH",
16302	//   "id": "logging.organizations.updateCmekSettings",
16303	//   "parameterOrder": [
16304	//     "name"
16305	//   ],
16306	//   "parameters": {
16307	//     "name": {
16308	//       "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.",
16309	//       "location": "path",
16310	//       "pattern": "^organizations/[^/]+$",
16311	//       "required": true,
16312	//       "type": "string"
16313	//     },
16314	//     "updateMask": {
16315	//       "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\"",
16316	//       "format": "google-fieldmask",
16317	//       "location": "query",
16318	//       "type": "string"
16319	//     }
16320	//   },
16321	//   "path": "v2/{+name}/cmekSettings",
16322	//   "request": {
16323	//     "$ref": "CmekSettings"
16324	//   },
16325	//   "response": {
16326	//     "$ref": "CmekSettings"
16327	//   },
16328	//   "scopes": [
16329	//     "https://www.googleapis.com/auth/cloud-platform",
16330	//     "https://www.googleapis.com/auth/logging.admin"
16331	//   ]
16332	// }
16333
16334}
16335
16336// method id "logging.organizations.exclusions.create":
16337
16338type OrganizationsExclusionsCreateCall struct {
16339	s            *Service
16340	parent       string
16341	logexclusion *LogExclusion
16342	urlParams_   gensupport.URLParams
16343	ctx_         context.Context
16344	header_      http.Header
16345}
16346
16347// Create: Creates a new exclusion in a specified parent resource. Only
16348// log entries belonging to that resource can be excluded. You can have
16349// up to 10 exclusions in a resource.
16350//
16351// - parent: The parent resource in which to create the exclusion:
16352//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
16353//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
16354//   Examples: "projects/my-logging-project", "organizations/123456789".
16355func (r *OrganizationsExclusionsService) Create(parent string, logexclusion *LogExclusion) *OrganizationsExclusionsCreateCall {
16356	c := &OrganizationsExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
16357	c.parent = parent
16358	c.logexclusion = logexclusion
16359	return c
16360}
16361
16362// Fields allows partial responses to be retrieved. See
16363// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
16364// for more information.
16365func (c *OrganizationsExclusionsCreateCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsCreateCall {
16366	c.urlParams_.Set("fields", googleapi.CombineFields(s))
16367	return c
16368}
16369
16370// Context sets the context to be used in this call's Do method. Any
16371// pending HTTP request will be aborted if the provided context is
16372// canceled.
16373func (c *OrganizationsExclusionsCreateCall) Context(ctx context.Context) *OrganizationsExclusionsCreateCall {
16374	c.ctx_ = ctx
16375	return c
16376}
16377
16378// Header returns an http.Header that can be modified by the caller to
16379// add HTTP headers to the request.
16380func (c *OrganizationsExclusionsCreateCall) Header() http.Header {
16381	if c.header_ == nil {
16382		c.header_ = make(http.Header)
16383	}
16384	return c.header_
16385}
16386
16387func (c *OrganizationsExclusionsCreateCall) doRequest(alt string) (*http.Response, error) {
16388	reqHeaders := make(http.Header)
16389	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
16390	for k, v := range c.header_ {
16391		reqHeaders[k] = v
16392	}
16393	reqHeaders.Set("User-Agent", c.s.userAgent())
16394	var body io.Reader = nil
16395	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
16396	if err != nil {
16397		return nil, err
16398	}
16399	reqHeaders.Set("Content-Type", "application/json")
16400	c.urlParams_.Set("alt", alt)
16401	c.urlParams_.Set("prettyPrint", "false")
16402	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
16403	urls += "?" + c.urlParams_.Encode()
16404	req, err := http.NewRequest("POST", urls, body)
16405	if err != nil {
16406		return nil, err
16407	}
16408	req.Header = reqHeaders
16409	googleapi.Expand(req.URL, map[string]string{
16410		"parent": c.parent,
16411	})
16412	return gensupport.SendRequest(c.ctx_, c.s.client, req)
16413}
16414
16415// Do executes the "logging.organizations.exclusions.create" call.
16416// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
16417// status code is an error. Response headers are in either
16418// *LogExclusion.ServerResponse.Header or (if a response was returned at
16419// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
16420// to check whether the returned error was because
16421// http.StatusNotModified was returned.
16422func (c *OrganizationsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
16423	gensupport.SetOptions(c.urlParams_, opts...)
16424	res, err := c.doRequest("json")
16425	if res != nil && res.StatusCode == http.StatusNotModified {
16426		if res.Body != nil {
16427			res.Body.Close()
16428		}
16429		return nil, &googleapi.Error{
16430			Code:   res.StatusCode,
16431			Header: res.Header,
16432		}
16433	}
16434	if err != nil {
16435		return nil, err
16436	}
16437	defer googleapi.CloseBody(res)
16438	if err := googleapi.CheckResponse(res); err != nil {
16439		return nil, err
16440	}
16441	ret := &LogExclusion{
16442		ServerResponse: googleapi.ServerResponse{
16443			Header:         res.Header,
16444			HTTPStatusCode: res.StatusCode,
16445		},
16446	}
16447	target := &ret
16448	if err := gensupport.DecodeResponse(target, res); err != nil {
16449		return nil, err
16450	}
16451	return ret, nil
16452	// {
16453	//   "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.",
16454	//   "flatPath": "v2/organizations/{organizationsId}/exclusions",
16455	//   "httpMethod": "POST",
16456	//   "id": "logging.organizations.exclusions.create",
16457	//   "parameterOrder": [
16458	//     "parent"
16459	//   ],
16460	//   "parameters": {
16461	//     "parent": {
16462	//       "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\".",
16463	//       "location": "path",
16464	//       "pattern": "^organizations/[^/]+$",
16465	//       "required": true,
16466	//       "type": "string"
16467	//     }
16468	//   },
16469	//   "path": "v2/{+parent}/exclusions",
16470	//   "request": {
16471	//     "$ref": "LogExclusion"
16472	//   },
16473	//   "response": {
16474	//     "$ref": "LogExclusion"
16475	//   },
16476	//   "scopes": [
16477	//     "https://www.googleapis.com/auth/cloud-platform",
16478	//     "https://www.googleapis.com/auth/logging.admin"
16479	//   ]
16480	// }
16481
16482}
16483
16484// method id "logging.organizations.exclusions.delete":
16485
16486type OrganizationsExclusionsDeleteCall struct {
16487	s          *Service
16488	name       string
16489	urlParams_ gensupport.URLParams
16490	ctx_       context.Context
16491	header_    http.Header
16492}
16493
16494// Delete: Deletes an exclusion.
16495//
16496// - name: The resource name of an existing exclusion to delete:
16497//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
16498//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
16499//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
16500//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example:
16501//   "projects/my-project-id/exclusions/my-exclusion-id".
16502func (r *OrganizationsExclusionsService) Delete(name string) *OrganizationsExclusionsDeleteCall {
16503	c := &OrganizationsExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
16504	c.name = name
16505	return c
16506}
16507
16508// Fields allows partial responses to be retrieved. See
16509// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
16510// for more information.
16511func (c *OrganizationsExclusionsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsDeleteCall {
16512	c.urlParams_.Set("fields", googleapi.CombineFields(s))
16513	return c
16514}
16515
16516// Context sets the context to be used in this call's Do method. Any
16517// pending HTTP request will be aborted if the provided context is
16518// canceled.
16519func (c *OrganizationsExclusionsDeleteCall) Context(ctx context.Context) *OrganizationsExclusionsDeleteCall {
16520	c.ctx_ = ctx
16521	return c
16522}
16523
16524// Header returns an http.Header that can be modified by the caller to
16525// add HTTP headers to the request.
16526func (c *OrganizationsExclusionsDeleteCall) Header() http.Header {
16527	if c.header_ == nil {
16528		c.header_ = make(http.Header)
16529	}
16530	return c.header_
16531}
16532
16533func (c *OrganizationsExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) {
16534	reqHeaders := make(http.Header)
16535	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
16536	for k, v := range c.header_ {
16537		reqHeaders[k] = v
16538	}
16539	reqHeaders.Set("User-Agent", c.s.userAgent())
16540	var body io.Reader = nil
16541	c.urlParams_.Set("alt", alt)
16542	c.urlParams_.Set("prettyPrint", "false")
16543	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
16544	urls += "?" + c.urlParams_.Encode()
16545	req, err := http.NewRequest("DELETE", urls, body)
16546	if err != nil {
16547		return nil, err
16548	}
16549	req.Header = reqHeaders
16550	googleapi.Expand(req.URL, map[string]string{
16551		"name": c.name,
16552	})
16553	return gensupport.SendRequest(c.ctx_, c.s.client, req)
16554}
16555
16556// Do executes the "logging.organizations.exclusions.delete" call.
16557// Exactly one of *Empty or error will be non-nil. Any non-2xx status
16558// code is an error. Response headers are in either
16559// *Empty.ServerResponse.Header or (if a response was returned at all)
16560// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
16561// check whether the returned error was because http.StatusNotModified
16562// was returned.
16563func (c *OrganizationsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
16564	gensupport.SetOptions(c.urlParams_, opts...)
16565	res, err := c.doRequest("json")
16566	if res != nil && res.StatusCode == http.StatusNotModified {
16567		if res.Body != nil {
16568			res.Body.Close()
16569		}
16570		return nil, &googleapi.Error{
16571			Code:   res.StatusCode,
16572			Header: res.Header,
16573		}
16574	}
16575	if err != nil {
16576		return nil, err
16577	}
16578	defer googleapi.CloseBody(res)
16579	if err := googleapi.CheckResponse(res); err != nil {
16580		return nil, err
16581	}
16582	ret := &Empty{
16583		ServerResponse: googleapi.ServerResponse{
16584			Header:         res.Header,
16585			HTTPStatusCode: res.StatusCode,
16586		},
16587	}
16588	target := &ret
16589	if err := gensupport.DecodeResponse(target, res); err != nil {
16590		return nil, err
16591	}
16592	return ret, nil
16593	// {
16594	//   "description": "Deletes an exclusion.",
16595	//   "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}",
16596	//   "httpMethod": "DELETE",
16597	//   "id": "logging.organizations.exclusions.delete",
16598	//   "parameterOrder": [
16599	//     "name"
16600	//   ],
16601	//   "parameters": {
16602	//     "name": {
16603	//       "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\".",
16604	//       "location": "path",
16605	//       "pattern": "^organizations/[^/]+/exclusions/[^/]+$",
16606	//       "required": true,
16607	//       "type": "string"
16608	//     }
16609	//   },
16610	//   "path": "v2/{+name}",
16611	//   "response": {
16612	//     "$ref": "Empty"
16613	//   },
16614	//   "scopes": [
16615	//     "https://www.googleapis.com/auth/cloud-platform",
16616	//     "https://www.googleapis.com/auth/logging.admin"
16617	//   ]
16618	// }
16619
16620}
16621
16622// method id "logging.organizations.exclusions.get":
16623
16624type OrganizationsExclusionsGetCall struct {
16625	s            *Service
16626	name         string
16627	urlParams_   gensupport.URLParams
16628	ifNoneMatch_ string
16629	ctx_         context.Context
16630	header_      http.Header
16631}
16632
16633// Get: Gets the description of an exclusion.
16634//
16635// - name: The resource name of an existing exclusion:
16636//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
16637//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
16638//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
16639//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example:
16640//   "projects/my-project-id/exclusions/my-exclusion-id".
16641func (r *OrganizationsExclusionsService) Get(name string) *OrganizationsExclusionsGetCall {
16642	c := &OrganizationsExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
16643	c.name = name
16644	return c
16645}
16646
16647// Fields allows partial responses to be retrieved. See
16648// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
16649// for more information.
16650func (c *OrganizationsExclusionsGetCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsGetCall {
16651	c.urlParams_.Set("fields", googleapi.CombineFields(s))
16652	return c
16653}
16654
16655// IfNoneMatch sets the optional parameter which makes the operation
16656// fail if the object's ETag matches the given value. This is useful for
16657// getting updates only after the object has changed since the last
16658// request. Use googleapi.IsNotModified to check whether the response
16659// error from Do is the result of In-None-Match.
16660func (c *OrganizationsExclusionsGetCall) IfNoneMatch(entityTag string) *OrganizationsExclusionsGetCall {
16661	c.ifNoneMatch_ = entityTag
16662	return c
16663}
16664
16665// Context sets the context to be used in this call's Do method. Any
16666// pending HTTP request will be aborted if the provided context is
16667// canceled.
16668func (c *OrganizationsExclusionsGetCall) Context(ctx context.Context) *OrganizationsExclusionsGetCall {
16669	c.ctx_ = ctx
16670	return c
16671}
16672
16673// Header returns an http.Header that can be modified by the caller to
16674// add HTTP headers to the request.
16675func (c *OrganizationsExclusionsGetCall) Header() http.Header {
16676	if c.header_ == nil {
16677		c.header_ = make(http.Header)
16678	}
16679	return c.header_
16680}
16681
16682func (c *OrganizationsExclusionsGetCall) doRequest(alt string) (*http.Response, error) {
16683	reqHeaders := make(http.Header)
16684	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
16685	for k, v := range c.header_ {
16686		reqHeaders[k] = v
16687	}
16688	reqHeaders.Set("User-Agent", c.s.userAgent())
16689	if c.ifNoneMatch_ != "" {
16690		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
16691	}
16692	var body io.Reader = nil
16693	c.urlParams_.Set("alt", alt)
16694	c.urlParams_.Set("prettyPrint", "false")
16695	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
16696	urls += "?" + c.urlParams_.Encode()
16697	req, err := http.NewRequest("GET", urls, body)
16698	if err != nil {
16699		return nil, err
16700	}
16701	req.Header = reqHeaders
16702	googleapi.Expand(req.URL, map[string]string{
16703		"name": c.name,
16704	})
16705	return gensupport.SendRequest(c.ctx_, c.s.client, req)
16706}
16707
16708// Do executes the "logging.organizations.exclusions.get" call.
16709// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
16710// status code is an error. Response headers are in either
16711// *LogExclusion.ServerResponse.Header or (if a response was returned at
16712// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
16713// to check whether the returned error was because
16714// http.StatusNotModified was returned.
16715func (c *OrganizationsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
16716	gensupport.SetOptions(c.urlParams_, opts...)
16717	res, err := c.doRequest("json")
16718	if res != nil && res.StatusCode == http.StatusNotModified {
16719		if res.Body != nil {
16720			res.Body.Close()
16721		}
16722		return nil, &googleapi.Error{
16723			Code:   res.StatusCode,
16724			Header: res.Header,
16725		}
16726	}
16727	if err != nil {
16728		return nil, err
16729	}
16730	defer googleapi.CloseBody(res)
16731	if err := googleapi.CheckResponse(res); err != nil {
16732		return nil, err
16733	}
16734	ret := &LogExclusion{
16735		ServerResponse: googleapi.ServerResponse{
16736			Header:         res.Header,
16737			HTTPStatusCode: res.StatusCode,
16738		},
16739	}
16740	target := &ret
16741	if err := gensupport.DecodeResponse(target, res); err != nil {
16742		return nil, err
16743	}
16744	return ret, nil
16745	// {
16746	//   "description": "Gets the description of an exclusion.",
16747	//   "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}",
16748	//   "httpMethod": "GET",
16749	//   "id": "logging.organizations.exclusions.get",
16750	//   "parameterOrder": [
16751	//     "name"
16752	//   ],
16753	//   "parameters": {
16754	//     "name": {
16755	//       "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\".",
16756	//       "location": "path",
16757	//       "pattern": "^organizations/[^/]+/exclusions/[^/]+$",
16758	//       "required": true,
16759	//       "type": "string"
16760	//     }
16761	//   },
16762	//   "path": "v2/{+name}",
16763	//   "response": {
16764	//     "$ref": "LogExclusion"
16765	//   },
16766	//   "scopes": [
16767	//     "https://www.googleapis.com/auth/cloud-platform",
16768	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
16769	//     "https://www.googleapis.com/auth/logging.admin",
16770	//     "https://www.googleapis.com/auth/logging.read"
16771	//   ]
16772	// }
16773
16774}
16775
16776// method id "logging.organizations.exclusions.list":
16777
16778type OrganizationsExclusionsListCall struct {
16779	s            *Service
16780	parent       string
16781	urlParams_   gensupport.URLParams
16782	ifNoneMatch_ string
16783	ctx_         context.Context
16784	header_      http.Header
16785}
16786
16787// List: Lists all the exclusions in a parent resource.
16788//
16789// - parent: The parent resource whose exclusions are to be listed.
16790//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
16791//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]".
16792func (r *OrganizationsExclusionsService) List(parent string) *OrganizationsExclusionsListCall {
16793	c := &OrganizationsExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
16794	c.parent = parent
16795	return c
16796}
16797
16798// PageSize sets the optional parameter "pageSize": The maximum number
16799// of results to return from this request. Non-positive values are
16800// ignored. The presence of nextPageToken in the response indicates that
16801// more results might be available.
16802func (c *OrganizationsExclusionsListCall) PageSize(pageSize int64) *OrganizationsExclusionsListCall {
16803	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
16804	return c
16805}
16806
16807// PageToken sets the optional parameter "pageToken": If present, then
16808// retrieve the next batch of results from the preceding call to this
16809// method. pageToken must be the value of nextPageToken from the
16810// previous response. The values of other method parameters should be
16811// identical to those in the previous call.
16812func (c *OrganizationsExclusionsListCall) PageToken(pageToken string) *OrganizationsExclusionsListCall {
16813	c.urlParams_.Set("pageToken", pageToken)
16814	return c
16815}
16816
16817// Fields allows partial responses to be retrieved. See
16818// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
16819// for more information.
16820func (c *OrganizationsExclusionsListCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsListCall {
16821	c.urlParams_.Set("fields", googleapi.CombineFields(s))
16822	return c
16823}
16824
16825// IfNoneMatch sets the optional parameter which makes the operation
16826// fail if the object's ETag matches the given value. This is useful for
16827// getting updates only after the object has changed since the last
16828// request. Use googleapi.IsNotModified to check whether the response
16829// error from Do is the result of In-None-Match.
16830func (c *OrganizationsExclusionsListCall) IfNoneMatch(entityTag string) *OrganizationsExclusionsListCall {
16831	c.ifNoneMatch_ = entityTag
16832	return c
16833}
16834
16835// Context sets the context to be used in this call's Do method. Any
16836// pending HTTP request will be aborted if the provided context is
16837// canceled.
16838func (c *OrganizationsExclusionsListCall) Context(ctx context.Context) *OrganizationsExclusionsListCall {
16839	c.ctx_ = ctx
16840	return c
16841}
16842
16843// Header returns an http.Header that can be modified by the caller to
16844// add HTTP headers to the request.
16845func (c *OrganizationsExclusionsListCall) Header() http.Header {
16846	if c.header_ == nil {
16847		c.header_ = make(http.Header)
16848	}
16849	return c.header_
16850}
16851
16852func (c *OrganizationsExclusionsListCall) doRequest(alt string) (*http.Response, error) {
16853	reqHeaders := make(http.Header)
16854	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
16855	for k, v := range c.header_ {
16856		reqHeaders[k] = v
16857	}
16858	reqHeaders.Set("User-Agent", c.s.userAgent())
16859	if c.ifNoneMatch_ != "" {
16860		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
16861	}
16862	var body io.Reader = nil
16863	c.urlParams_.Set("alt", alt)
16864	c.urlParams_.Set("prettyPrint", "false")
16865	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
16866	urls += "?" + c.urlParams_.Encode()
16867	req, err := http.NewRequest("GET", urls, body)
16868	if err != nil {
16869		return nil, err
16870	}
16871	req.Header = reqHeaders
16872	googleapi.Expand(req.URL, map[string]string{
16873		"parent": c.parent,
16874	})
16875	return gensupport.SendRequest(c.ctx_, c.s.client, req)
16876}
16877
16878// Do executes the "logging.organizations.exclusions.list" call.
16879// Exactly one of *ListExclusionsResponse or error will be non-nil. Any
16880// non-2xx status code is an error. Response headers are in either
16881// *ListExclusionsResponse.ServerResponse.Header or (if a response was
16882// returned at all) in error.(*googleapi.Error).Header. Use
16883// googleapi.IsNotModified to check whether the returned error was
16884// because http.StatusNotModified was returned.
16885func (c *OrganizationsExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) {
16886	gensupport.SetOptions(c.urlParams_, opts...)
16887	res, err := c.doRequest("json")
16888	if res != nil && res.StatusCode == http.StatusNotModified {
16889		if res.Body != nil {
16890			res.Body.Close()
16891		}
16892		return nil, &googleapi.Error{
16893			Code:   res.StatusCode,
16894			Header: res.Header,
16895		}
16896	}
16897	if err != nil {
16898		return nil, err
16899	}
16900	defer googleapi.CloseBody(res)
16901	if err := googleapi.CheckResponse(res); err != nil {
16902		return nil, err
16903	}
16904	ret := &ListExclusionsResponse{
16905		ServerResponse: googleapi.ServerResponse{
16906			Header:         res.Header,
16907			HTTPStatusCode: res.StatusCode,
16908		},
16909	}
16910	target := &ret
16911	if err := gensupport.DecodeResponse(target, res); err != nil {
16912		return nil, err
16913	}
16914	return ret, nil
16915	// {
16916	//   "description": "Lists all the exclusions in a parent resource.",
16917	//   "flatPath": "v2/organizations/{organizationsId}/exclusions",
16918	//   "httpMethod": "GET",
16919	//   "id": "logging.organizations.exclusions.list",
16920	//   "parameterOrder": [
16921	//     "parent"
16922	//   ],
16923	//   "parameters": {
16924	//     "pageSize": {
16925	//       "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.",
16926	//       "format": "int32",
16927	//       "location": "query",
16928	//       "type": "integer"
16929	//     },
16930	//     "pageToken": {
16931	//       "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.",
16932	//       "location": "query",
16933	//       "type": "string"
16934	//     },
16935	//     "parent": {
16936	//       "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
16937	//       "location": "path",
16938	//       "pattern": "^organizations/[^/]+$",
16939	//       "required": true,
16940	//       "type": "string"
16941	//     }
16942	//   },
16943	//   "path": "v2/{+parent}/exclusions",
16944	//   "response": {
16945	//     "$ref": "ListExclusionsResponse"
16946	//   },
16947	//   "scopes": [
16948	//     "https://www.googleapis.com/auth/cloud-platform",
16949	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
16950	//     "https://www.googleapis.com/auth/logging.admin",
16951	//     "https://www.googleapis.com/auth/logging.read"
16952	//   ]
16953	// }
16954
16955}
16956
16957// Pages invokes f for each page of results.
16958// A non-nil error returned from f will halt the iteration.
16959// The provided context supersedes any context provided to the Context method.
16960func (c *OrganizationsExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error {
16961	c.ctx_ = ctx
16962	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
16963	for {
16964		x, err := c.Do()
16965		if err != nil {
16966			return err
16967		}
16968		if err := f(x); err != nil {
16969			return err
16970		}
16971		if x.NextPageToken == "" {
16972			return nil
16973		}
16974		c.PageToken(x.NextPageToken)
16975	}
16976}
16977
16978// method id "logging.organizations.exclusions.patch":
16979
16980type OrganizationsExclusionsPatchCall struct {
16981	s            *Service
16982	name         string
16983	logexclusion *LogExclusion
16984	urlParams_   gensupport.URLParams
16985	ctx_         context.Context
16986	header_      http.Header
16987}
16988
16989// Patch: Changes one or more properties of an existing exclusion.
16990//
16991// - name: The resource name of the exclusion to update:
16992//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
16993//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
16994//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
16995//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example:
16996//   "projects/my-project-id/exclusions/my-exclusion-id".
16997func (r *OrganizationsExclusionsService) Patch(name string, logexclusion *LogExclusion) *OrganizationsExclusionsPatchCall {
16998	c := &OrganizationsExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
16999	c.name = name
17000	c.logexclusion = logexclusion
17001	return c
17002}
17003
17004// UpdateMask sets the optional parameter "updateMask": Required. A
17005// non-empty list of fields to change in the existing exclusion. New
17006// values for the fields are taken from the corresponding fields in the
17007// LogExclusion included in this request. Fields not mentioned in
17008// update_mask are not changed and are ignored in the request.For
17009// example, to change the filter and description of an exclusion,
17010// specify an update_mask of "filter,description".
17011func (c *OrganizationsExclusionsPatchCall) UpdateMask(updateMask string) *OrganizationsExclusionsPatchCall {
17012	c.urlParams_.Set("updateMask", updateMask)
17013	return c
17014}
17015
17016// Fields allows partial responses to be retrieved. See
17017// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
17018// for more information.
17019func (c *OrganizationsExclusionsPatchCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsPatchCall {
17020	c.urlParams_.Set("fields", googleapi.CombineFields(s))
17021	return c
17022}
17023
17024// Context sets the context to be used in this call's Do method. Any
17025// pending HTTP request will be aborted if the provided context is
17026// canceled.
17027func (c *OrganizationsExclusionsPatchCall) Context(ctx context.Context) *OrganizationsExclusionsPatchCall {
17028	c.ctx_ = ctx
17029	return c
17030}
17031
17032// Header returns an http.Header that can be modified by the caller to
17033// add HTTP headers to the request.
17034func (c *OrganizationsExclusionsPatchCall) Header() http.Header {
17035	if c.header_ == nil {
17036		c.header_ = make(http.Header)
17037	}
17038	return c.header_
17039}
17040
17041func (c *OrganizationsExclusionsPatchCall) doRequest(alt string) (*http.Response, error) {
17042	reqHeaders := make(http.Header)
17043	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
17044	for k, v := range c.header_ {
17045		reqHeaders[k] = v
17046	}
17047	reqHeaders.Set("User-Agent", c.s.userAgent())
17048	var body io.Reader = nil
17049	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
17050	if err != nil {
17051		return nil, err
17052	}
17053	reqHeaders.Set("Content-Type", "application/json")
17054	c.urlParams_.Set("alt", alt)
17055	c.urlParams_.Set("prettyPrint", "false")
17056	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
17057	urls += "?" + c.urlParams_.Encode()
17058	req, err := http.NewRequest("PATCH", urls, body)
17059	if err != nil {
17060		return nil, err
17061	}
17062	req.Header = reqHeaders
17063	googleapi.Expand(req.URL, map[string]string{
17064		"name": c.name,
17065	})
17066	return gensupport.SendRequest(c.ctx_, c.s.client, req)
17067}
17068
17069// Do executes the "logging.organizations.exclusions.patch" call.
17070// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
17071// status code is an error. Response headers are in either
17072// *LogExclusion.ServerResponse.Header or (if a response was returned at
17073// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
17074// to check whether the returned error was because
17075// http.StatusNotModified was returned.
17076func (c *OrganizationsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
17077	gensupport.SetOptions(c.urlParams_, opts...)
17078	res, err := c.doRequest("json")
17079	if res != nil && res.StatusCode == http.StatusNotModified {
17080		if res.Body != nil {
17081			res.Body.Close()
17082		}
17083		return nil, &googleapi.Error{
17084			Code:   res.StatusCode,
17085			Header: res.Header,
17086		}
17087	}
17088	if err != nil {
17089		return nil, err
17090	}
17091	defer googleapi.CloseBody(res)
17092	if err := googleapi.CheckResponse(res); err != nil {
17093		return nil, err
17094	}
17095	ret := &LogExclusion{
17096		ServerResponse: googleapi.ServerResponse{
17097			Header:         res.Header,
17098			HTTPStatusCode: res.StatusCode,
17099		},
17100	}
17101	target := &ret
17102	if err := gensupport.DecodeResponse(target, res); err != nil {
17103		return nil, err
17104	}
17105	return ret, nil
17106	// {
17107	//   "description": "Changes one or more properties of an existing exclusion.",
17108	//   "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}",
17109	//   "httpMethod": "PATCH",
17110	//   "id": "logging.organizations.exclusions.patch",
17111	//   "parameterOrder": [
17112	//     "name"
17113	//   ],
17114	//   "parameters": {
17115	//     "name": {
17116	//       "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\".",
17117	//       "location": "path",
17118	//       "pattern": "^organizations/[^/]+/exclusions/[^/]+$",
17119	//       "required": true,
17120	//       "type": "string"
17121	//     },
17122	//     "updateMask": {
17123	//       "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\".",
17124	//       "format": "google-fieldmask",
17125	//       "location": "query",
17126	//       "type": "string"
17127	//     }
17128	//   },
17129	//   "path": "v2/{+name}",
17130	//   "request": {
17131	//     "$ref": "LogExclusion"
17132	//   },
17133	//   "response": {
17134	//     "$ref": "LogExclusion"
17135	//   },
17136	//   "scopes": [
17137	//     "https://www.googleapis.com/auth/cloud-platform",
17138	//     "https://www.googleapis.com/auth/logging.admin"
17139	//   ]
17140	// }
17141
17142}
17143
17144// method id "logging.organizations.locations.get":
17145
17146type OrganizationsLocationsGetCall struct {
17147	s            *Service
17148	name         string
17149	urlParams_   gensupport.URLParams
17150	ifNoneMatch_ string
17151	ctx_         context.Context
17152	header_      http.Header
17153}
17154
17155// Get: Gets information about a location.
17156//
17157// - name: Resource name for the location.
17158func (r *OrganizationsLocationsService) Get(name string) *OrganizationsLocationsGetCall {
17159	c := &OrganizationsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
17160	c.name = name
17161	return c
17162}
17163
17164// Fields allows partial responses to be retrieved. See
17165// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
17166// for more information.
17167func (c *OrganizationsLocationsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsGetCall {
17168	c.urlParams_.Set("fields", googleapi.CombineFields(s))
17169	return c
17170}
17171
17172// IfNoneMatch sets the optional parameter which makes the operation
17173// fail if the object's ETag matches the given value. This is useful for
17174// getting updates only after the object has changed since the last
17175// request. Use googleapi.IsNotModified to check whether the response
17176// error from Do is the result of In-None-Match.
17177func (c *OrganizationsLocationsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsGetCall {
17178	c.ifNoneMatch_ = entityTag
17179	return c
17180}
17181
17182// Context sets the context to be used in this call's Do method. Any
17183// pending HTTP request will be aborted if the provided context is
17184// canceled.
17185func (c *OrganizationsLocationsGetCall) Context(ctx context.Context) *OrganizationsLocationsGetCall {
17186	c.ctx_ = ctx
17187	return c
17188}
17189
17190// Header returns an http.Header that can be modified by the caller to
17191// add HTTP headers to the request.
17192func (c *OrganizationsLocationsGetCall) Header() http.Header {
17193	if c.header_ == nil {
17194		c.header_ = make(http.Header)
17195	}
17196	return c.header_
17197}
17198
17199func (c *OrganizationsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
17200	reqHeaders := make(http.Header)
17201	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
17202	for k, v := range c.header_ {
17203		reqHeaders[k] = v
17204	}
17205	reqHeaders.Set("User-Agent", c.s.userAgent())
17206	if c.ifNoneMatch_ != "" {
17207		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
17208	}
17209	var body io.Reader = nil
17210	c.urlParams_.Set("alt", alt)
17211	c.urlParams_.Set("prettyPrint", "false")
17212	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
17213	urls += "?" + c.urlParams_.Encode()
17214	req, err := http.NewRequest("GET", urls, body)
17215	if err != nil {
17216		return nil, err
17217	}
17218	req.Header = reqHeaders
17219	googleapi.Expand(req.URL, map[string]string{
17220		"name": c.name,
17221	})
17222	return gensupport.SendRequest(c.ctx_, c.s.client, req)
17223}
17224
17225// Do executes the "logging.organizations.locations.get" call.
17226// Exactly one of *Location or error will be non-nil. Any non-2xx status
17227// code is an error. Response headers are in either
17228// *Location.ServerResponse.Header or (if a response was returned at
17229// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
17230// to check whether the returned error was because
17231// http.StatusNotModified was returned.
17232func (c *OrganizationsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
17233	gensupport.SetOptions(c.urlParams_, opts...)
17234	res, err := c.doRequest("json")
17235	if res != nil && res.StatusCode == http.StatusNotModified {
17236		if res.Body != nil {
17237			res.Body.Close()
17238		}
17239		return nil, &googleapi.Error{
17240			Code:   res.StatusCode,
17241			Header: res.Header,
17242		}
17243	}
17244	if err != nil {
17245		return nil, err
17246	}
17247	defer googleapi.CloseBody(res)
17248	if err := googleapi.CheckResponse(res); err != nil {
17249		return nil, err
17250	}
17251	ret := &Location{
17252		ServerResponse: googleapi.ServerResponse{
17253			Header:         res.Header,
17254			HTTPStatusCode: res.StatusCode,
17255		},
17256	}
17257	target := &ret
17258	if err := gensupport.DecodeResponse(target, res); err != nil {
17259		return nil, err
17260	}
17261	return ret, nil
17262	// {
17263	//   "description": "Gets information about a location.",
17264	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}",
17265	//   "httpMethod": "GET",
17266	//   "id": "logging.organizations.locations.get",
17267	//   "parameterOrder": [
17268	//     "name"
17269	//   ],
17270	//   "parameters": {
17271	//     "name": {
17272	//       "description": "Resource name for the location.",
17273	//       "location": "path",
17274	//       "pattern": "^organizations/[^/]+/locations/[^/]+$",
17275	//       "required": true,
17276	//       "type": "string"
17277	//     }
17278	//   },
17279	//   "path": "v2/{+name}",
17280	//   "response": {
17281	//     "$ref": "Location"
17282	//   },
17283	//   "scopes": [
17284	//     "https://www.googleapis.com/auth/cloud-platform",
17285	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
17286	//     "https://www.googleapis.com/auth/logging.admin",
17287	//     "https://www.googleapis.com/auth/logging.read"
17288	//   ]
17289	// }
17290
17291}
17292
17293// method id "logging.organizations.locations.list":
17294
17295type OrganizationsLocationsListCall struct {
17296	s            *Service
17297	name         string
17298	urlParams_   gensupport.URLParams
17299	ifNoneMatch_ string
17300	ctx_         context.Context
17301	header_      http.Header
17302}
17303
17304// List: Lists information about the supported locations for this
17305// service.
17306//
17307// - name: The resource that owns the locations collection, if
17308//   applicable.
17309func (r *OrganizationsLocationsService) List(name string) *OrganizationsLocationsListCall {
17310	c := &OrganizationsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
17311	c.name = name
17312	return c
17313}
17314
17315// Filter sets the optional parameter "filter": A filter to narrow down
17316// results to a preferred subset. The filtering language accepts strings
17317// like "displayName=tokyo", and is documented in more detail in AIP-160
17318// (https://google.aip.dev/160).
17319func (c *OrganizationsLocationsListCall) Filter(filter string) *OrganizationsLocationsListCall {
17320	c.urlParams_.Set("filter", filter)
17321	return c
17322}
17323
17324// PageSize sets the optional parameter "pageSize": The maximum number
17325// of results to return. If not set, the service selects a default.
17326func (c *OrganizationsLocationsListCall) PageSize(pageSize int64) *OrganizationsLocationsListCall {
17327	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
17328	return c
17329}
17330
17331// PageToken sets the optional parameter "pageToken": A page token
17332// received from the next_page_token field in the response. Send that
17333// page token to receive the subsequent page.
17334func (c *OrganizationsLocationsListCall) PageToken(pageToken string) *OrganizationsLocationsListCall {
17335	c.urlParams_.Set("pageToken", pageToken)
17336	return c
17337}
17338
17339// Fields allows partial responses to be retrieved. See
17340// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
17341// for more information.
17342func (c *OrganizationsLocationsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsListCall {
17343	c.urlParams_.Set("fields", googleapi.CombineFields(s))
17344	return c
17345}
17346
17347// IfNoneMatch sets the optional parameter which makes the operation
17348// fail if the object's ETag matches the given value. This is useful for
17349// getting updates only after the object has changed since the last
17350// request. Use googleapi.IsNotModified to check whether the response
17351// error from Do is the result of In-None-Match.
17352func (c *OrganizationsLocationsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsListCall {
17353	c.ifNoneMatch_ = entityTag
17354	return c
17355}
17356
17357// Context sets the context to be used in this call's Do method. Any
17358// pending HTTP request will be aborted if the provided context is
17359// canceled.
17360func (c *OrganizationsLocationsListCall) Context(ctx context.Context) *OrganizationsLocationsListCall {
17361	c.ctx_ = ctx
17362	return c
17363}
17364
17365// Header returns an http.Header that can be modified by the caller to
17366// add HTTP headers to the request.
17367func (c *OrganizationsLocationsListCall) Header() http.Header {
17368	if c.header_ == nil {
17369		c.header_ = make(http.Header)
17370	}
17371	return c.header_
17372}
17373
17374func (c *OrganizationsLocationsListCall) doRequest(alt string) (*http.Response, error) {
17375	reqHeaders := make(http.Header)
17376	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
17377	for k, v := range c.header_ {
17378		reqHeaders[k] = v
17379	}
17380	reqHeaders.Set("User-Agent", c.s.userAgent())
17381	if c.ifNoneMatch_ != "" {
17382		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
17383	}
17384	var body io.Reader = nil
17385	c.urlParams_.Set("alt", alt)
17386	c.urlParams_.Set("prettyPrint", "false")
17387	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations")
17388	urls += "?" + c.urlParams_.Encode()
17389	req, err := http.NewRequest("GET", urls, body)
17390	if err != nil {
17391		return nil, err
17392	}
17393	req.Header = reqHeaders
17394	googleapi.Expand(req.URL, map[string]string{
17395		"name": c.name,
17396	})
17397	return gensupport.SendRequest(c.ctx_, c.s.client, req)
17398}
17399
17400// Do executes the "logging.organizations.locations.list" call.
17401// Exactly one of *ListLocationsResponse or error will be non-nil. Any
17402// non-2xx status code is an error. Response headers are in either
17403// *ListLocationsResponse.ServerResponse.Header or (if a response was
17404// returned at all) in error.(*googleapi.Error).Header. Use
17405// googleapi.IsNotModified to check whether the returned error was
17406// because http.StatusNotModified was returned.
17407func (c *OrganizationsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
17408	gensupport.SetOptions(c.urlParams_, opts...)
17409	res, err := c.doRequest("json")
17410	if res != nil && res.StatusCode == http.StatusNotModified {
17411		if res.Body != nil {
17412			res.Body.Close()
17413		}
17414		return nil, &googleapi.Error{
17415			Code:   res.StatusCode,
17416			Header: res.Header,
17417		}
17418	}
17419	if err != nil {
17420		return nil, err
17421	}
17422	defer googleapi.CloseBody(res)
17423	if err := googleapi.CheckResponse(res); err != nil {
17424		return nil, err
17425	}
17426	ret := &ListLocationsResponse{
17427		ServerResponse: googleapi.ServerResponse{
17428			Header:         res.Header,
17429			HTTPStatusCode: res.StatusCode,
17430		},
17431	}
17432	target := &ret
17433	if err := gensupport.DecodeResponse(target, res); err != nil {
17434		return nil, err
17435	}
17436	return ret, nil
17437	// {
17438	//   "description": "Lists information about the supported locations for this service.",
17439	//   "flatPath": "v2/organizations/{organizationsId}/locations",
17440	//   "httpMethod": "GET",
17441	//   "id": "logging.organizations.locations.list",
17442	//   "parameterOrder": [
17443	//     "name"
17444	//   ],
17445	//   "parameters": {
17446	//     "filter": {
17447	//       "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like \"displayName=tokyo\", and is documented in more detail in AIP-160 (https://google.aip.dev/160).",
17448	//       "location": "query",
17449	//       "type": "string"
17450	//     },
17451	//     "name": {
17452	//       "description": "The resource that owns the locations collection, if applicable.",
17453	//       "location": "path",
17454	//       "pattern": "^organizations/[^/]+$",
17455	//       "required": true,
17456	//       "type": "string"
17457	//     },
17458	//     "pageSize": {
17459	//       "description": "The maximum number of results to return. If not set, the service selects a default.",
17460	//       "format": "int32",
17461	//       "location": "query",
17462	//       "type": "integer"
17463	//     },
17464	//     "pageToken": {
17465	//       "description": "A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.",
17466	//       "location": "query",
17467	//       "type": "string"
17468	//     }
17469	//   },
17470	//   "path": "v2/{+name}/locations",
17471	//   "response": {
17472	//     "$ref": "ListLocationsResponse"
17473	//   },
17474	//   "scopes": [
17475	//     "https://www.googleapis.com/auth/cloud-platform",
17476	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
17477	//     "https://www.googleapis.com/auth/logging.admin",
17478	//     "https://www.googleapis.com/auth/logging.read"
17479	//   ]
17480	// }
17481
17482}
17483
17484// Pages invokes f for each page of results.
17485// A non-nil error returned from f will halt the iteration.
17486// The provided context supersedes any context provided to the Context method.
17487func (c *OrganizationsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
17488	c.ctx_ = ctx
17489	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
17490	for {
17491		x, err := c.Do()
17492		if err != nil {
17493			return err
17494		}
17495		if err := f(x); err != nil {
17496			return err
17497		}
17498		if x.NextPageToken == "" {
17499			return nil
17500		}
17501		c.PageToken(x.NextPageToken)
17502	}
17503}
17504
17505// method id "logging.organizations.locations.buckets.create":
17506
17507type OrganizationsLocationsBucketsCreateCall struct {
17508	s          *Service
17509	parent     string
17510	logbucket  *LogBucket
17511	urlParams_ gensupport.URLParams
17512	ctx_       context.Context
17513	header_    http.Header
17514}
17515
17516// Create: Creates a bucket that can be used to store log entries. Once
17517// a bucket has been created, the region cannot be changed.
17518//
17519// - parent: The resource in which to create the bucket:
17520//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]" Example:
17521//   "projects/my-logging-project/locations/global".
17522func (r *OrganizationsLocationsBucketsService) Create(parent string, logbucket *LogBucket) *OrganizationsLocationsBucketsCreateCall {
17523	c := &OrganizationsLocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
17524	c.parent = parent
17525	c.logbucket = logbucket
17526	return c
17527}
17528
17529// BucketId sets the optional parameter "bucketId": Required. A
17530// client-assigned identifier such as "my-bucket". Identifiers are
17531// limited to 100 characters and can include only letters, digits,
17532// underscores, hyphens, and periods.
17533func (c *OrganizationsLocationsBucketsCreateCall) BucketId(bucketId string) *OrganizationsLocationsBucketsCreateCall {
17534	c.urlParams_.Set("bucketId", bucketId)
17535	return c
17536}
17537
17538// Fields allows partial responses to be retrieved. See
17539// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
17540// for more information.
17541func (c *OrganizationsLocationsBucketsCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsCreateCall {
17542	c.urlParams_.Set("fields", googleapi.CombineFields(s))
17543	return c
17544}
17545
17546// Context sets the context to be used in this call's Do method. Any
17547// pending HTTP request will be aborted if the provided context is
17548// canceled.
17549func (c *OrganizationsLocationsBucketsCreateCall) Context(ctx context.Context) *OrganizationsLocationsBucketsCreateCall {
17550	c.ctx_ = ctx
17551	return c
17552}
17553
17554// Header returns an http.Header that can be modified by the caller to
17555// add HTTP headers to the request.
17556func (c *OrganizationsLocationsBucketsCreateCall) Header() http.Header {
17557	if c.header_ == nil {
17558		c.header_ = make(http.Header)
17559	}
17560	return c.header_
17561}
17562
17563func (c *OrganizationsLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) {
17564	reqHeaders := make(http.Header)
17565	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
17566	for k, v := range c.header_ {
17567		reqHeaders[k] = v
17568	}
17569	reqHeaders.Set("User-Agent", c.s.userAgent())
17570	var body io.Reader = nil
17571	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
17572	if err != nil {
17573		return nil, err
17574	}
17575	reqHeaders.Set("Content-Type", "application/json")
17576	c.urlParams_.Set("alt", alt)
17577	c.urlParams_.Set("prettyPrint", "false")
17578	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
17579	urls += "?" + c.urlParams_.Encode()
17580	req, err := http.NewRequest("POST", urls, body)
17581	if err != nil {
17582		return nil, err
17583	}
17584	req.Header = reqHeaders
17585	googleapi.Expand(req.URL, map[string]string{
17586		"parent": c.parent,
17587	})
17588	return gensupport.SendRequest(c.ctx_, c.s.client, req)
17589}
17590
17591// Do executes the "logging.organizations.locations.buckets.create" call.
17592// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
17593// status code is an error. Response headers are in either
17594// *LogBucket.ServerResponse.Header or (if a response was returned at
17595// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
17596// to check whether the returned error was because
17597// http.StatusNotModified was returned.
17598func (c *OrganizationsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
17599	gensupport.SetOptions(c.urlParams_, opts...)
17600	res, err := c.doRequest("json")
17601	if res != nil && res.StatusCode == http.StatusNotModified {
17602		if res.Body != nil {
17603			res.Body.Close()
17604		}
17605		return nil, &googleapi.Error{
17606			Code:   res.StatusCode,
17607			Header: res.Header,
17608		}
17609	}
17610	if err != nil {
17611		return nil, err
17612	}
17613	defer googleapi.CloseBody(res)
17614	if err := googleapi.CheckResponse(res); err != nil {
17615		return nil, err
17616	}
17617	ret := &LogBucket{
17618		ServerResponse: googleapi.ServerResponse{
17619			Header:         res.Header,
17620			HTTPStatusCode: res.StatusCode,
17621		},
17622	}
17623	target := &ret
17624	if err := gensupport.DecodeResponse(target, res); err != nil {
17625		return nil, err
17626	}
17627	return ret, nil
17628	// {
17629	//   "description": "Creates a bucket that can be used to store log entries. Once a bucket has been created, the region cannot be changed.",
17630	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets",
17631	//   "httpMethod": "POST",
17632	//   "id": "logging.organizations.locations.buckets.create",
17633	//   "parameterOrder": [
17634	//     "parent"
17635	//   ],
17636	//   "parameters": {
17637	//     "bucketId": {
17638	//       "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.",
17639	//       "location": "query",
17640	//       "type": "string"
17641	//     },
17642	//     "parent": {
17643	//       "description": "Required. The resource in which to create the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" Example: \"projects/my-logging-project/locations/global\"",
17644	//       "location": "path",
17645	//       "pattern": "^organizations/[^/]+/locations/[^/]+$",
17646	//       "required": true,
17647	//       "type": "string"
17648	//     }
17649	//   },
17650	//   "path": "v2/{+parent}/buckets",
17651	//   "request": {
17652	//     "$ref": "LogBucket"
17653	//   },
17654	//   "response": {
17655	//     "$ref": "LogBucket"
17656	//   },
17657	//   "scopes": [
17658	//     "https://www.googleapis.com/auth/cloud-platform",
17659	//     "https://www.googleapis.com/auth/logging.admin"
17660	//   ]
17661	// }
17662
17663}
17664
17665// method id "logging.organizations.locations.buckets.delete":
17666
17667type OrganizationsLocationsBucketsDeleteCall struct {
17668	s          *Service
17669	name       string
17670	urlParams_ gensupport.URLParams
17671	ctx_       context.Context
17672	header_    http.Header
17673}
17674
17675// Delete: Deletes a bucket. Moves the bucket to the DELETE_REQUESTED
17676// state. After 7 days, the bucket will be purged and all logs in the
17677// bucket will be permanently deleted.
17678//
17679// - name: The full resource name of the bucket to delete.
17680//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
17681//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
17682//   CKET_ID]"
17683//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
17684//   s/[BUCKET_ID]"
17685//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
17686//   Example:
17687//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id".
17688func (r *OrganizationsLocationsBucketsService) Delete(name string) *OrganizationsLocationsBucketsDeleteCall {
17689	c := &OrganizationsLocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
17690	c.name = name
17691	return c
17692}
17693
17694// Fields allows partial responses to be retrieved. See
17695// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
17696// for more information.
17697func (c *OrganizationsLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsDeleteCall {
17698	c.urlParams_.Set("fields", googleapi.CombineFields(s))
17699	return c
17700}
17701
17702// Context sets the context to be used in this call's Do method. Any
17703// pending HTTP request will be aborted if the provided context is
17704// canceled.
17705func (c *OrganizationsLocationsBucketsDeleteCall) Context(ctx context.Context) *OrganizationsLocationsBucketsDeleteCall {
17706	c.ctx_ = ctx
17707	return c
17708}
17709
17710// Header returns an http.Header that can be modified by the caller to
17711// add HTTP headers to the request.
17712func (c *OrganizationsLocationsBucketsDeleteCall) Header() http.Header {
17713	if c.header_ == nil {
17714		c.header_ = make(http.Header)
17715	}
17716	return c.header_
17717}
17718
17719func (c *OrganizationsLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
17720	reqHeaders := make(http.Header)
17721	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
17722	for k, v := range c.header_ {
17723		reqHeaders[k] = v
17724	}
17725	reqHeaders.Set("User-Agent", c.s.userAgent())
17726	var body io.Reader = nil
17727	c.urlParams_.Set("alt", alt)
17728	c.urlParams_.Set("prettyPrint", "false")
17729	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
17730	urls += "?" + c.urlParams_.Encode()
17731	req, err := http.NewRequest("DELETE", urls, body)
17732	if err != nil {
17733		return nil, err
17734	}
17735	req.Header = reqHeaders
17736	googleapi.Expand(req.URL, map[string]string{
17737		"name": c.name,
17738	})
17739	return gensupport.SendRequest(c.ctx_, c.s.client, req)
17740}
17741
17742// Do executes the "logging.organizations.locations.buckets.delete" call.
17743// Exactly one of *Empty or error will be non-nil. Any non-2xx status
17744// code is an error. Response headers are in either
17745// *Empty.ServerResponse.Header or (if a response was returned at all)
17746// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
17747// check whether the returned error was because http.StatusNotModified
17748// was returned.
17749func (c *OrganizationsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
17750	gensupport.SetOptions(c.urlParams_, opts...)
17751	res, err := c.doRequest("json")
17752	if res != nil && res.StatusCode == http.StatusNotModified {
17753		if res.Body != nil {
17754			res.Body.Close()
17755		}
17756		return nil, &googleapi.Error{
17757			Code:   res.StatusCode,
17758			Header: res.Header,
17759		}
17760	}
17761	if err != nil {
17762		return nil, err
17763	}
17764	defer googleapi.CloseBody(res)
17765	if err := googleapi.CheckResponse(res); err != nil {
17766		return nil, err
17767	}
17768	ret := &Empty{
17769		ServerResponse: googleapi.ServerResponse{
17770			Header:         res.Header,
17771			HTTPStatusCode: res.StatusCode,
17772		},
17773	}
17774	target := &ret
17775	if err := gensupport.DecodeResponse(target, res); err != nil {
17776		return nil, err
17777	}
17778	return ret, nil
17779	// {
17780	//   "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.",
17781	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}",
17782	//   "httpMethod": "DELETE",
17783	//   "id": "logging.organizations.locations.buckets.delete",
17784	//   "parameterOrder": [
17785	//     "name"
17786	//   ],
17787	//   "parameters": {
17788	//     "name": {
17789	//       "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\".",
17790	//       "location": "path",
17791	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$",
17792	//       "required": true,
17793	//       "type": "string"
17794	//     }
17795	//   },
17796	//   "path": "v2/{+name}",
17797	//   "response": {
17798	//     "$ref": "Empty"
17799	//   },
17800	//   "scopes": [
17801	//     "https://www.googleapis.com/auth/cloud-platform",
17802	//     "https://www.googleapis.com/auth/logging.admin"
17803	//   ]
17804	// }
17805
17806}
17807
17808// method id "logging.organizations.locations.buckets.get":
17809
17810type OrganizationsLocationsBucketsGetCall struct {
17811	s            *Service
17812	name         string
17813	urlParams_   gensupport.URLParams
17814	ifNoneMatch_ string
17815	ctx_         context.Context
17816	header_      http.Header
17817}
17818
17819// Get: Gets a bucket.
17820//
17821// - name: The resource name of the bucket:
17822//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
17823//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
17824//   CKET_ID]"
17825//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
17826//   s/[BUCKET_ID]"
17827//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
17828//   Example:
17829//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id".
17830func (r *OrganizationsLocationsBucketsService) Get(name string) *OrganizationsLocationsBucketsGetCall {
17831	c := &OrganizationsLocationsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
17832	c.name = name
17833	return c
17834}
17835
17836// Fields allows partial responses to be retrieved. See
17837// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
17838// for more information.
17839func (c *OrganizationsLocationsBucketsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsGetCall {
17840	c.urlParams_.Set("fields", googleapi.CombineFields(s))
17841	return c
17842}
17843
17844// IfNoneMatch sets the optional parameter which makes the operation
17845// fail if the object's ETag matches the given value. This is useful for
17846// getting updates only after the object has changed since the last
17847// request. Use googleapi.IsNotModified to check whether the response
17848// error from Do is the result of In-None-Match.
17849func (c *OrganizationsLocationsBucketsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsGetCall {
17850	c.ifNoneMatch_ = entityTag
17851	return c
17852}
17853
17854// Context sets the context to be used in this call's Do method. Any
17855// pending HTTP request will be aborted if the provided context is
17856// canceled.
17857func (c *OrganizationsLocationsBucketsGetCall) Context(ctx context.Context) *OrganizationsLocationsBucketsGetCall {
17858	c.ctx_ = ctx
17859	return c
17860}
17861
17862// Header returns an http.Header that can be modified by the caller to
17863// add HTTP headers to the request.
17864func (c *OrganizationsLocationsBucketsGetCall) Header() http.Header {
17865	if c.header_ == nil {
17866		c.header_ = make(http.Header)
17867	}
17868	return c.header_
17869}
17870
17871func (c *OrganizationsLocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) {
17872	reqHeaders := make(http.Header)
17873	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
17874	for k, v := range c.header_ {
17875		reqHeaders[k] = v
17876	}
17877	reqHeaders.Set("User-Agent", c.s.userAgent())
17878	if c.ifNoneMatch_ != "" {
17879		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
17880	}
17881	var body io.Reader = nil
17882	c.urlParams_.Set("alt", alt)
17883	c.urlParams_.Set("prettyPrint", "false")
17884	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
17885	urls += "?" + c.urlParams_.Encode()
17886	req, err := http.NewRequest("GET", urls, body)
17887	if err != nil {
17888		return nil, err
17889	}
17890	req.Header = reqHeaders
17891	googleapi.Expand(req.URL, map[string]string{
17892		"name": c.name,
17893	})
17894	return gensupport.SendRequest(c.ctx_, c.s.client, req)
17895}
17896
17897// Do executes the "logging.organizations.locations.buckets.get" call.
17898// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
17899// status code is an error. Response headers are in either
17900// *LogBucket.ServerResponse.Header or (if a response was returned at
17901// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
17902// to check whether the returned error was because
17903// http.StatusNotModified was returned.
17904func (c *OrganizationsLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
17905	gensupport.SetOptions(c.urlParams_, opts...)
17906	res, err := c.doRequest("json")
17907	if res != nil && res.StatusCode == http.StatusNotModified {
17908		if res.Body != nil {
17909			res.Body.Close()
17910		}
17911		return nil, &googleapi.Error{
17912			Code:   res.StatusCode,
17913			Header: res.Header,
17914		}
17915	}
17916	if err != nil {
17917		return nil, err
17918	}
17919	defer googleapi.CloseBody(res)
17920	if err := googleapi.CheckResponse(res); err != nil {
17921		return nil, err
17922	}
17923	ret := &LogBucket{
17924		ServerResponse: googleapi.ServerResponse{
17925			Header:         res.Header,
17926			HTTPStatusCode: res.StatusCode,
17927		},
17928	}
17929	target := &ret
17930	if err := gensupport.DecodeResponse(target, res); err != nil {
17931		return nil, err
17932	}
17933	return ret, nil
17934	// {
17935	//   "description": "Gets a bucket.",
17936	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}",
17937	//   "httpMethod": "GET",
17938	//   "id": "logging.organizations.locations.buckets.get",
17939	//   "parameterOrder": [
17940	//     "name"
17941	//   ],
17942	//   "parameters": {
17943	//     "name": {
17944	//       "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\".",
17945	//       "location": "path",
17946	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$",
17947	//       "required": true,
17948	//       "type": "string"
17949	//     }
17950	//   },
17951	//   "path": "v2/{+name}",
17952	//   "response": {
17953	//     "$ref": "LogBucket"
17954	//   },
17955	//   "scopes": [
17956	//     "https://www.googleapis.com/auth/cloud-platform",
17957	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
17958	//     "https://www.googleapis.com/auth/logging.admin",
17959	//     "https://www.googleapis.com/auth/logging.read"
17960	//   ]
17961	// }
17962
17963}
17964
17965// method id "logging.organizations.locations.buckets.list":
17966
17967type OrganizationsLocationsBucketsListCall struct {
17968	s            *Service
17969	parent       string
17970	urlParams_   gensupport.URLParams
17971	ifNoneMatch_ string
17972	ctx_         context.Context
17973	header_      http.Header
17974}
17975
17976// List: Lists buckets.
17977//
17978// - parent: The parent resource whose buckets are to be listed:
17979//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
17980//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
17981//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
17982//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations
17983//   portion of the resource must be specified, but supplying the
17984//   character - in place of LOCATION_ID will return all buckets.
17985func (r *OrganizationsLocationsBucketsService) List(parent string) *OrganizationsLocationsBucketsListCall {
17986	c := &OrganizationsLocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
17987	c.parent = parent
17988	return c
17989}
17990
17991// PageSize sets the optional parameter "pageSize": The maximum number
17992// of results to return from this request. Non-positive values are
17993// ignored. The presence of nextPageToken in the response indicates that
17994// more results might be available.
17995func (c *OrganizationsLocationsBucketsListCall) PageSize(pageSize int64) *OrganizationsLocationsBucketsListCall {
17996	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
17997	return c
17998}
17999
18000// PageToken sets the optional parameter "pageToken": If present, then
18001// retrieve the next batch of results from the preceding call to this
18002// method. pageToken must be the value of nextPageToken from the
18003// previous response. The values of other method parameters should be
18004// identical to those in the previous call.
18005func (c *OrganizationsLocationsBucketsListCall) PageToken(pageToken string) *OrganizationsLocationsBucketsListCall {
18006	c.urlParams_.Set("pageToken", pageToken)
18007	return c
18008}
18009
18010// Fields allows partial responses to be retrieved. See
18011// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
18012// for more information.
18013func (c *OrganizationsLocationsBucketsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsListCall {
18014	c.urlParams_.Set("fields", googleapi.CombineFields(s))
18015	return c
18016}
18017
18018// IfNoneMatch sets the optional parameter which makes the operation
18019// fail if the object's ETag matches the given value. This is useful for
18020// getting updates only after the object has changed since the last
18021// request. Use googleapi.IsNotModified to check whether the response
18022// error from Do is the result of In-None-Match.
18023func (c *OrganizationsLocationsBucketsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsListCall {
18024	c.ifNoneMatch_ = entityTag
18025	return c
18026}
18027
18028// Context sets the context to be used in this call's Do method. Any
18029// pending HTTP request will be aborted if the provided context is
18030// canceled.
18031func (c *OrganizationsLocationsBucketsListCall) Context(ctx context.Context) *OrganizationsLocationsBucketsListCall {
18032	c.ctx_ = ctx
18033	return c
18034}
18035
18036// Header returns an http.Header that can be modified by the caller to
18037// add HTTP headers to the request.
18038func (c *OrganizationsLocationsBucketsListCall) Header() http.Header {
18039	if c.header_ == nil {
18040		c.header_ = make(http.Header)
18041	}
18042	return c.header_
18043}
18044
18045func (c *OrganizationsLocationsBucketsListCall) doRequest(alt string) (*http.Response, error) {
18046	reqHeaders := make(http.Header)
18047	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
18048	for k, v := range c.header_ {
18049		reqHeaders[k] = v
18050	}
18051	reqHeaders.Set("User-Agent", c.s.userAgent())
18052	if c.ifNoneMatch_ != "" {
18053		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
18054	}
18055	var body io.Reader = nil
18056	c.urlParams_.Set("alt", alt)
18057	c.urlParams_.Set("prettyPrint", "false")
18058	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
18059	urls += "?" + c.urlParams_.Encode()
18060	req, err := http.NewRequest("GET", urls, body)
18061	if err != nil {
18062		return nil, err
18063	}
18064	req.Header = reqHeaders
18065	googleapi.Expand(req.URL, map[string]string{
18066		"parent": c.parent,
18067	})
18068	return gensupport.SendRequest(c.ctx_, c.s.client, req)
18069}
18070
18071// Do executes the "logging.organizations.locations.buckets.list" call.
18072// Exactly one of *ListBucketsResponse or error will be non-nil. Any
18073// non-2xx status code is an error. Response headers are in either
18074// *ListBucketsResponse.ServerResponse.Header or (if a response was
18075// returned at all) in error.(*googleapi.Error).Header. Use
18076// googleapi.IsNotModified to check whether the returned error was
18077// because http.StatusNotModified was returned.
18078func (c *OrganizationsLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) {
18079	gensupport.SetOptions(c.urlParams_, opts...)
18080	res, err := c.doRequest("json")
18081	if res != nil && res.StatusCode == http.StatusNotModified {
18082		if res.Body != nil {
18083			res.Body.Close()
18084		}
18085		return nil, &googleapi.Error{
18086			Code:   res.StatusCode,
18087			Header: res.Header,
18088		}
18089	}
18090	if err != nil {
18091		return nil, err
18092	}
18093	defer googleapi.CloseBody(res)
18094	if err := googleapi.CheckResponse(res); err != nil {
18095		return nil, err
18096	}
18097	ret := &ListBucketsResponse{
18098		ServerResponse: googleapi.ServerResponse{
18099			Header:         res.Header,
18100			HTTPStatusCode: res.StatusCode,
18101		},
18102	}
18103	target := &ret
18104	if err := gensupport.DecodeResponse(target, res); err != nil {
18105		return nil, err
18106	}
18107	return ret, nil
18108	// {
18109	//   "description": "Lists buckets.",
18110	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets",
18111	//   "httpMethod": "GET",
18112	//   "id": "logging.organizations.locations.buckets.list",
18113	//   "parameterOrder": [
18114	//     "parent"
18115	//   ],
18116	//   "parameters": {
18117	//     "pageSize": {
18118	//       "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.",
18119	//       "format": "int32",
18120	//       "location": "query",
18121	//       "type": "integer"
18122	//     },
18123	//     "pageToken": {
18124	//       "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.",
18125	//       "location": "query",
18126	//       "type": "string"
18127	//     },
18128	//     "parent": {
18129	//       "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.",
18130	//       "location": "path",
18131	//       "pattern": "^organizations/[^/]+/locations/[^/]+$",
18132	//       "required": true,
18133	//       "type": "string"
18134	//     }
18135	//   },
18136	//   "path": "v2/{+parent}/buckets",
18137	//   "response": {
18138	//     "$ref": "ListBucketsResponse"
18139	//   },
18140	//   "scopes": [
18141	//     "https://www.googleapis.com/auth/cloud-platform",
18142	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
18143	//     "https://www.googleapis.com/auth/logging.admin",
18144	//     "https://www.googleapis.com/auth/logging.read"
18145	//   ]
18146	// }
18147
18148}
18149
18150// Pages invokes f for each page of results.
18151// A non-nil error returned from f will halt the iteration.
18152// The provided context supersedes any context provided to the Context method.
18153func (c *OrganizationsLocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error {
18154	c.ctx_ = ctx
18155	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
18156	for {
18157		x, err := c.Do()
18158		if err != nil {
18159			return err
18160		}
18161		if err := f(x); err != nil {
18162			return err
18163		}
18164		if x.NextPageToken == "" {
18165			return nil
18166		}
18167		c.PageToken(x.NextPageToken)
18168	}
18169}
18170
18171// method id "logging.organizations.locations.buckets.patch":
18172
18173type OrganizationsLocationsBucketsPatchCall struct {
18174	s          *Service
18175	name       string
18176	logbucket  *LogBucket
18177	urlParams_ gensupport.URLParams
18178	ctx_       context.Context
18179	header_    http.Header
18180}
18181
18182// Patch: Updates a bucket. This method replaces the following fields in
18183// the existing bucket with values from the new bucket:
18184// retention_periodIf the retention period is decreased and the bucket
18185// is locked, FAILED_PRECONDITION will be returned.If the bucket has a
18186// LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be
18187// returned.A buckets region may not be modified after it is created.
18188//
18189// - name: The full resource name of the bucket to update.
18190//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
18191//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
18192//   CKET_ID]"
18193//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
18194//   s/[BUCKET_ID]"
18195//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
18196//   Example:
18197//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id".
18198//    Also requires permission "resourcemanager.projects.updateLiens" to
18199//   set the locked property.
18200func (r *OrganizationsLocationsBucketsService) Patch(name string, logbucket *LogBucket) *OrganizationsLocationsBucketsPatchCall {
18201	c := &OrganizationsLocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
18202	c.name = name
18203	c.logbucket = logbucket
18204	return c
18205}
18206
18207// UpdateMask sets the optional parameter "updateMask": Required. Field
18208// mask that specifies the fields in bucket that need an update. A
18209// bucket field will be overwritten if, and only if, it is in the update
18210// mask. name and output only fields cannot be updated.For a detailed
18211// FieldMask definition, see
18212// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
18213// updateMask=retention_days.
18214func (c *OrganizationsLocationsBucketsPatchCall) UpdateMask(updateMask string) *OrganizationsLocationsBucketsPatchCall {
18215	c.urlParams_.Set("updateMask", updateMask)
18216	return c
18217}
18218
18219// Fields allows partial responses to be retrieved. See
18220// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
18221// for more information.
18222func (c *OrganizationsLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsPatchCall {
18223	c.urlParams_.Set("fields", googleapi.CombineFields(s))
18224	return c
18225}
18226
18227// Context sets the context to be used in this call's Do method. Any
18228// pending HTTP request will be aborted if the provided context is
18229// canceled.
18230func (c *OrganizationsLocationsBucketsPatchCall) Context(ctx context.Context) *OrganizationsLocationsBucketsPatchCall {
18231	c.ctx_ = ctx
18232	return c
18233}
18234
18235// Header returns an http.Header that can be modified by the caller to
18236// add HTTP headers to the request.
18237func (c *OrganizationsLocationsBucketsPatchCall) Header() http.Header {
18238	if c.header_ == nil {
18239		c.header_ = make(http.Header)
18240	}
18241	return c.header_
18242}
18243
18244func (c *OrganizationsLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
18245	reqHeaders := make(http.Header)
18246	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
18247	for k, v := range c.header_ {
18248		reqHeaders[k] = v
18249	}
18250	reqHeaders.Set("User-Agent", c.s.userAgent())
18251	var body io.Reader = nil
18252	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
18253	if err != nil {
18254		return nil, err
18255	}
18256	reqHeaders.Set("Content-Type", "application/json")
18257	c.urlParams_.Set("alt", alt)
18258	c.urlParams_.Set("prettyPrint", "false")
18259	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
18260	urls += "?" + c.urlParams_.Encode()
18261	req, err := http.NewRequest("PATCH", urls, body)
18262	if err != nil {
18263		return nil, err
18264	}
18265	req.Header = reqHeaders
18266	googleapi.Expand(req.URL, map[string]string{
18267		"name": c.name,
18268	})
18269	return gensupport.SendRequest(c.ctx_, c.s.client, req)
18270}
18271
18272// Do executes the "logging.organizations.locations.buckets.patch" call.
18273// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
18274// status code is an error. Response headers are in either
18275// *LogBucket.ServerResponse.Header or (if a response was returned at
18276// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
18277// to check whether the returned error was because
18278// http.StatusNotModified was returned.
18279func (c *OrganizationsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
18280	gensupport.SetOptions(c.urlParams_, opts...)
18281	res, err := c.doRequest("json")
18282	if res != nil && res.StatusCode == http.StatusNotModified {
18283		if res.Body != nil {
18284			res.Body.Close()
18285		}
18286		return nil, &googleapi.Error{
18287			Code:   res.StatusCode,
18288			Header: res.Header,
18289		}
18290	}
18291	if err != nil {
18292		return nil, err
18293	}
18294	defer googleapi.CloseBody(res)
18295	if err := googleapi.CheckResponse(res); err != nil {
18296		return nil, err
18297	}
18298	ret := &LogBucket{
18299		ServerResponse: googleapi.ServerResponse{
18300			Header:         res.Header,
18301			HTTPStatusCode: res.StatusCode,
18302		},
18303	}
18304	target := &ret
18305	if err := gensupport.DecodeResponse(target, res); err != nil {
18306		return nil, err
18307	}
18308	return ret, nil
18309	// {
18310	//   "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.",
18311	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}",
18312	//   "httpMethod": "PATCH",
18313	//   "id": "logging.organizations.locations.buckets.patch",
18314	//   "parameterOrder": [
18315	//     "name"
18316	//   ],
18317	//   "parameters": {
18318	//     "name": {
18319	//       "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",
18320	//       "location": "path",
18321	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$",
18322	//       "required": true,
18323	//       "type": "string"
18324	//     },
18325	//     "updateMask": {
18326	//       "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.",
18327	//       "format": "google-fieldmask",
18328	//       "location": "query",
18329	//       "type": "string"
18330	//     }
18331	//   },
18332	//   "path": "v2/{+name}",
18333	//   "request": {
18334	//     "$ref": "LogBucket"
18335	//   },
18336	//   "response": {
18337	//     "$ref": "LogBucket"
18338	//   },
18339	//   "scopes": [
18340	//     "https://www.googleapis.com/auth/cloud-platform",
18341	//     "https://www.googleapis.com/auth/logging.admin"
18342	//   ]
18343	// }
18344
18345}
18346
18347// method id "logging.organizations.locations.buckets.undelete":
18348
18349type OrganizationsLocationsBucketsUndeleteCall struct {
18350	s                     *Service
18351	name                  string
18352	undeletebucketrequest *UndeleteBucketRequest
18353	urlParams_            gensupport.URLParams
18354	ctx_                  context.Context
18355	header_               http.Header
18356}
18357
18358// Undelete: Undeletes a bucket. A bucket that has been deleted may be
18359// undeleted within the grace period of 7 days.
18360//
18361// - name: The full resource name of the bucket to undelete.
18362//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
18363//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
18364//   CKET_ID]"
18365//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
18366//   s/[BUCKET_ID]"
18367//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
18368//   Example:
18369//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id".
18370func (r *OrganizationsLocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *OrganizationsLocationsBucketsUndeleteCall {
18371	c := &OrganizationsLocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
18372	c.name = name
18373	c.undeletebucketrequest = undeletebucketrequest
18374	return c
18375}
18376
18377// Fields allows partial responses to be retrieved. See
18378// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
18379// for more information.
18380func (c *OrganizationsLocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsUndeleteCall {
18381	c.urlParams_.Set("fields", googleapi.CombineFields(s))
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 *OrganizationsLocationsBucketsUndeleteCall) Context(ctx context.Context) *OrganizationsLocationsBucketsUndeleteCall {
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 *OrganizationsLocationsBucketsUndeleteCall) Header() http.Header {
18396	if c.header_ == nil {
18397		c.header_ = make(http.Header)
18398	}
18399	return c.header_
18400}
18401
18402func (c *OrganizationsLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) {
18403	reqHeaders := make(http.Header)
18404	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
18405	for k, v := range c.header_ {
18406		reqHeaders[k] = v
18407	}
18408	reqHeaders.Set("User-Agent", c.s.userAgent())
18409	var body io.Reader = nil
18410	body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest)
18411	if err != nil {
18412		return nil, err
18413	}
18414	reqHeaders.Set("Content-Type", "application/json")
18415	c.urlParams_.Set("alt", alt)
18416	c.urlParams_.Set("prettyPrint", "false")
18417	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete")
18418	urls += "?" + c.urlParams_.Encode()
18419	req, err := http.NewRequest("POST", urls, body)
18420	if err != nil {
18421		return nil, err
18422	}
18423	req.Header = reqHeaders
18424	googleapi.Expand(req.URL, map[string]string{
18425		"name": c.name,
18426	})
18427	return gensupport.SendRequest(c.ctx_, c.s.client, req)
18428}
18429
18430// Do executes the "logging.organizations.locations.buckets.undelete" call.
18431// Exactly one of *Empty or error will be non-nil. Any non-2xx status
18432// code is an error. Response headers are in either
18433// *Empty.ServerResponse.Header or (if a response was returned at all)
18434// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
18435// check whether the returned error was because http.StatusNotModified
18436// was returned.
18437func (c *OrganizationsLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
18438	gensupport.SetOptions(c.urlParams_, opts...)
18439	res, err := c.doRequest("json")
18440	if res != nil && res.StatusCode == http.StatusNotModified {
18441		if res.Body != nil {
18442			res.Body.Close()
18443		}
18444		return nil, &googleapi.Error{
18445			Code:   res.StatusCode,
18446			Header: res.Header,
18447		}
18448	}
18449	if err != nil {
18450		return nil, err
18451	}
18452	defer googleapi.CloseBody(res)
18453	if err := googleapi.CheckResponse(res); err != nil {
18454		return nil, err
18455	}
18456	ret := &Empty{
18457		ServerResponse: googleapi.ServerResponse{
18458			Header:         res.Header,
18459			HTTPStatusCode: res.StatusCode,
18460		},
18461	}
18462	target := &ret
18463	if err := gensupport.DecodeResponse(target, res); err != nil {
18464		return nil, err
18465	}
18466	return ret, nil
18467	// {
18468	//   "description": "Undeletes a bucket. A bucket that has been deleted may be undeleted within the grace period of 7 days.",
18469	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}:undelete",
18470	//   "httpMethod": "POST",
18471	//   "id": "logging.organizations.locations.buckets.undelete",
18472	//   "parameterOrder": [
18473	//     "name"
18474	//   ],
18475	//   "parameters": {
18476	//     "name": {
18477	//       "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\".",
18478	//       "location": "path",
18479	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$",
18480	//       "required": true,
18481	//       "type": "string"
18482	//     }
18483	//   },
18484	//   "path": "v2/{+name}:undelete",
18485	//   "request": {
18486	//     "$ref": "UndeleteBucketRequest"
18487	//   },
18488	//   "response": {
18489	//     "$ref": "Empty"
18490	//   },
18491	//   "scopes": [
18492	//     "https://www.googleapis.com/auth/cloud-platform",
18493	//     "https://www.googleapis.com/auth/logging.admin"
18494	//   ]
18495	// }
18496
18497}
18498
18499// method id "logging.organizations.locations.buckets.views.create":
18500
18501type OrganizationsLocationsBucketsViewsCreateCall struct {
18502	s          *Service
18503	parent     string
18504	logview    *LogView
18505	urlParams_ gensupport.URLParams
18506	ctx_       context.Context
18507	header_    http.Header
18508}
18509
18510// Create: Creates a view over logs in a bucket. A bucket may contain a
18511// maximum of 50 views.
18512//
18513// - parent: The bucket in which to create the view
18514//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
18515//   Example:
18516//   "projects/my-logging-project/locations/my-location/buckets/my-bucket
18517//   ".
18518func (r *OrganizationsLocationsBucketsViewsService) Create(parent string, logview *LogView) *OrganizationsLocationsBucketsViewsCreateCall {
18519	c := &OrganizationsLocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
18520	c.parent = parent
18521	c.logview = logview
18522	return c
18523}
18524
18525// ViewId sets the optional parameter "viewId": Required. The id to use
18526// for this view.
18527func (c *OrganizationsLocationsBucketsViewsCreateCall) ViewId(viewId string) *OrganizationsLocationsBucketsViewsCreateCall {
18528	c.urlParams_.Set("viewId", viewId)
18529	return c
18530}
18531
18532// Fields allows partial responses to be retrieved. See
18533// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
18534// for more information.
18535func (c *OrganizationsLocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsCreateCall {
18536	c.urlParams_.Set("fields", googleapi.CombineFields(s))
18537	return c
18538}
18539
18540// Context sets the context to be used in this call's Do method. Any
18541// pending HTTP request will be aborted if the provided context is
18542// canceled.
18543func (c *OrganizationsLocationsBucketsViewsCreateCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsCreateCall {
18544	c.ctx_ = ctx
18545	return c
18546}
18547
18548// Header returns an http.Header that can be modified by the caller to
18549// add HTTP headers to the request.
18550func (c *OrganizationsLocationsBucketsViewsCreateCall) Header() http.Header {
18551	if c.header_ == nil {
18552		c.header_ = make(http.Header)
18553	}
18554	return c.header_
18555}
18556
18557func (c *OrganizationsLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) {
18558	reqHeaders := make(http.Header)
18559	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
18560	for k, v := range c.header_ {
18561		reqHeaders[k] = v
18562	}
18563	reqHeaders.Set("User-Agent", c.s.userAgent())
18564	var body io.Reader = nil
18565	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
18566	if err != nil {
18567		return nil, err
18568	}
18569	reqHeaders.Set("Content-Type", "application/json")
18570	c.urlParams_.Set("alt", alt)
18571	c.urlParams_.Set("prettyPrint", "false")
18572	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
18573	urls += "?" + c.urlParams_.Encode()
18574	req, err := http.NewRequest("POST", urls, body)
18575	if err != nil {
18576		return nil, err
18577	}
18578	req.Header = reqHeaders
18579	googleapi.Expand(req.URL, map[string]string{
18580		"parent": c.parent,
18581	})
18582	return gensupport.SendRequest(c.ctx_, c.s.client, req)
18583}
18584
18585// Do executes the "logging.organizations.locations.buckets.views.create" call.
18586// Exactly one of *LogView or error will be non-nil. Any non-2xx status
18587// code is an error. Response headers are in either
18588// *LogView.ServerResponse.Header or (if a response was returned at all)
18589// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
18590// check whether the returned error was because http.StatusNotModified
18591// was returned.
18592func (c *OrganizationsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
18593	gensupport.SetOptions(c.urlParams_, opts...)
18594	res, err := c.doRequest("json")
18595	if res != nil && res.StatusCode == http.StatusNotModified {
18596		if res.Body != nil {
18597			res.Body.Close()
18598		}
18599		return nil, &googleapi.Error{
18600			Code:   res.StatusCode,
18601			Header: res.Header,
18602		}
18603	}
18604	if err != nil {
18605		return nil, err
18606	}
18607	defer googleapi.CloseBody(res)
18608	if err := googleapi.CheckResponse(res); err != nil {
18609		return nil, err
18610	}
18611	ret := &LogView{
18612		ServerResponse: googleapi.ServerResponse{
18613			Header:         res.Header,
18614			HTTPStatusCode: res.StatusCode,
18615		},
18616	}
18617	target := &ret
18618	if err := gensupport.DecodeResponse(target, res); err != nil {
18619		return nil, err
18620	}
18621	return ret, nil
18622	// {
18623	//   "description": "Creates a view over logs in a bucket. A bucket may contain a maximum of 50 views.",
18624	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views",
18625	//   "httpMethod": "POST",
18626	//   "id": "logging.organizations.locations.buckets.views.create",
18627	//   "parameterOrder": [
18628	//     "parent"
18629	//   ],
18630	//   "parameters": {
18631	//     "parent": {
18632	//       "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\"",
18633	//       "location": "path",
18634	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$",
18635	//       "required": true,
18636	//       "type": "string"
18637	//     },
18638	//     "viewId": {
18639	//       "description": "Required. The id to use for this view.",
18640	//       "location": "query",
18641	//       "type": "string"
18642	//     }
18643	//   },
18644	//   "path": "v2/{+parent}/views",
18645	//   "request": {
18646	//     "$ref": "LogView"
18647	//   },
18648	//   "response": {
18649	//     "$ref": "LogView"
18650	//   },
18651	//   "scopes": [
18652	//     "https://www.googleapis.com/auth/cloud-platform",
18653	//     "https://www.googleapis.com/auth/logging.admin"
18654	//   ]
18655	// }
18656
18657}
18658
18659// method id "logging.organizations.locations.buckets.views.delete":
18660
18661type OrganizationsLocationsBucketsViewsDeleteCall struct {
18662	s          *Service
18663	name       string
18664	urlParams_ gensupport.URLParams
18665	ctx_       context.Context
18666	header_    http.Header
18667}
18668
18669// Delete: Deletes a view from a bucket.
18670//
18671// - name: The full resource name of the view to delete:
18672//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
18673//   iews/[VIEW_ID]" Example:
18674//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id/v
18675//   iews/my-view-id".
18676func (r *OrganizationsLocationsBucketsViewsService) Delete(name string) *OrganizationsLocationsBucketsViewsDeleteCall {
18677	c := &OrganizationsLocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
18678	c.name = name
18679	return c
18680}
18681
18682// Fields allows partial responses to be retrieved. See
18683// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
18684// for more information.
18685func (c *OrganizationsLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsDeleteCall {
18686	c.urlParams_.Set("fields", googleapi.CombineFields(s))
18687	return c
18688}
18689
18690// Context sets the context to be used in this call's Do method. Any
18691// pending HTTP request will be aborted if the provided context is
18692// canceled.
18693func (c *OrganizationsLocationsBucketsViewsDeleteCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsDeleteCall {
18694	c.ctx_ = ctx
18695	return c
18696}
18697
18698// Header returns an http.Header that can be modified by the caller to
18699// add HTTP headers to the request.
18700func (c *OrganizationsLocationsBucketsViewsDeleteCall) Header() http.Header {
18701	if c.header_ == nil {
18702		c.header_ = make(http.Header)
18703	}
18704	return c.header_
18705}
18706
18707func (c *OrganizationsLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) {
18708	reqHeaders := make(http.Header)
18709	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
18710	for k, v := range c.header_ {
18711		reqHeaders[k] = v
18712	}
18713	reqHeaders.Set("User-Agent", c.s.userAgent())
18714	var body io.Reader = nil
18715	c.urlParams_.Set("alt", alt)
18716	c.urlParams_.Set("prettyPrint", "false")
18717	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
18718	urls += "?" + c.urlParams_.Encode()
18719	req, err := http.NewRequest("DELETE", urls, body)
18720	if err != nil {
18721		return nil, err
18722	}
18723	req.Header = reqHeaders
18724	googleapi.Expand(req.URL, map[string]string{
18725		"name": c.name,
18726	})
18727	return gensupport.SendRequest(c.ctx_, c.s.client, req)
18728}
18729
18730// Do executes the "logging.organizations.locations.buckets.views.delete" call.
18731// Exactly one of *Empty or error will be non-nil. Any non-2xx status
18732// code is an error. Response headers are in either
18733// *Empty.ServerResponse.Header or (if a response was returned at all)
18734// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
18735// check whether the returned error was because http.StatusNotModified
18736// was returned.
18737func (c *OrganizationsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
18738	gensupport.SetOptions(c.urlParams_, opts...)
18739	res, err := c.doRequest("json")
18740	if res != nil && res.StatusCode == http.StatusNotModified {
18741		if res.Body != nil {
18742			res.Body.Close()
18743		}
18744		return nil, &googleapi.Error{
18745			Code:   res.StatusCode,
18746			Header: res.Header,
18747		}
18748	}
18749	if err != nil {
18750		return nil, err
18751	}
18752	defer googleapi.CloseBody(res)
18753	if err := googleapi.CheckResponse(res); err != nil {
18754		return nil, err
18755	}
18756	ret := &Empty{
18757		ServerResponse: googleapi.ServerResponse{
18758			Header:         res.Header,
18759			HTTPStatusCode: res.StatusCode,
18760		},
18761	}
18762	target := &ret
18763	if err := gensupport.DecodeResponse(target, res); err != nil {
18764		return nil, err
18765	}
18766	return ret, nil
18767	// {
18768	//   "description": "Deletes a view from a bucket.",
18769	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
18770	//   "httpMethod": "DELETE",
18771	//   "id": "logging.organizations.locations.buckets.views.delete",
18772	//   "parameterOrder": [
18773	//     "name"
18774	//   ],
18775	//   "parameters": {
18776	//     "name": {
18777	//       "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\".",
18778	//       "location": "path",
18779	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
18780	//       "required": true,
18781	//       "type": "string"
18782	//     }
18783	//   },
18784	//   "path": "v2/{+name}",
18785	//   "response": {
18786	//     "$ref": "Empty"
18787	//   },
18788	//   "scopes": [
18789	//     "https://www.googleapis.com/auth/cloud-platform",
18790	//     "https://www.googleapis.com/auth/logging.admin"
18791	//   ]
18792	// }
18793
18794}
18795
18796// method id "logging.organizations.locations.buckets.views.get":
18797
18798type OrganizationsLocationsBucketsViewsGetCall struct {
18799	s            *Service
18800	name         string
18801	urlParams_   gensupport.URLParams
18802	ifNoneMatch_ string
18803	ctx_         context.Context
18804	header_      http.Header
18805}
18806
18807// Get: Gets a view.
18808//
18809// - name: The resource name of the policy:
18810//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
18811//   iews/[VIEW_ID]" Example:
18812//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id/v
18813//   iews/my-view-id".
18814func (r *OrganizationsLocationsBucketsViewsService) Get(name string) *OrganizationsLocationsBucketsViewsGetCall {
18815	c := &OrganizationsLocationsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
18816	c.name = name
18817	return c
18818}
18819
18820// Fields allows partial responses to be retrieved. See
18821// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
18822// for more information.
18823func (c *OrganizationsLocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsGetCall {
18824	c.urlParams_.Set("fields", googleapi.CombineFields(s))
18825	return c
18826}
18827
18828// IfNoneMatch sets the optional parameter which makes the operation
18829// fail if the object's ETag matches the given value. This is useful for
18830// getting updates only after the object has changed since the last
18831// request. Use googleapi.IsNotModified to check whether the response
18832// error from Do is the result of In-None-Match.
18833func (c *OrganizationsLocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsViewsGetCall {
18834	c.ifNoneMatch_ = entityTag
18835	return c
18836}
18837
18838// Context sets the context to be used in this call's Do method. Any
18839// pending HTTP request will be aborted if the provided context is
18840// canceled.
18841func (c *OrganizationsLocationsBucketsViewsGetCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsGetCall {
18842	c.ctx_ = ctx
18843	return c
18844}
18845
18846// Header returns an http.Header that can be modified by the caller to
18847// add HTTP headers to the request.
18848func (c *OrganizationsLocationsBucketsViewsGetCall) Header() http.Header {
18849	if c.header_ == nil {
18850		c.header_ = make(http.Header)
18851	}
18852	return c.header_
18853}
18854
18855func (c *OrganizationsLocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) {
18856	reqHeaders := make(http.Header)
18857	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
18858	for k, v := range c.header_ {
18859		reqHeaders[k] = v
18860	}
18861	reqHeaders.Set("User-Agent", c.s.userAgent())
18862	if c.ifNoneMatch_ != "" {
18863		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
18864	}
18865	var body io.Reader = nil
18866	c.urlParams_.Set("alt", alt)
18867	c.urlParams_.Set("prettyPrint", "false")
18868	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
18869	urls += "?" + c.urlParams_.Encode()
18870	req, err := http.NewRequest("GET", urls, body)
18871	if err != nil {
18872		return nil, err
18873	}
18874	req.Header = reqHeaders
18875	googleapi.Expand(req.URL, map[string]string{
18876		"name": c.name,
18877	})
18878	return gensupport.SendRequest(c.ctx_, c.s.client, req)
18879}
18880
18881// Do executes the "logging.organizations.locations.buckets.views.get" call.
18882// Exactly one of *LogView or error will be non-nil. Any non-2xx status
18883// code is an error. Response headers are in either
18884// *LogView.ServerResponse.Header or (if a response was returned at all)
18885// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
18886// check whether the returned error was because http.StatusNotModified
18887// was returned.
18888func (c *OrganizationsLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
18889	gensupport.SetOptions(c.urlParams_, opts...)
18890	res, err := c.doRequest("json")
18891	if res != nil && res.StatusCode == http.StatusNotModified {
18892		if res.Body != nil {
18893			res.Body.Close()
18894		}
18895		return nil, &googleapi.Error{
18896			Code:   res.StatusCode,
18897			Header: res.Header,
18898		}
18899	}
18900	if err != nil {
18901		return nil, err
18902	}
18903	defer googleapi.CloseBody(res)
18904	if err := googleapi.CheckResponse(res); err != nil {
18905		return nil, err
18906	}
18907	ret := &LogView{
18908		ServerResponse: googleapi.ServerResponse{
18909			Header:         res.Header,
18910			HTTPStatusCode: res.StatusCode,
18911		},
18912	}
18913	target := &ret
18914	if err := gensupport.DecodeResponse(target, res); err != nil {
18915		return nil, err
18916	}
18917	return ret, nil
18918	// {
18919	//   "description": "Gets a view.",
18920	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
18921	//   "httpMethod": "GET",
18922	//   "id": "logging.organizations.locations.buckets.views.get",
18923	//   "parameterOrder": [
18924	//     "name"
18925	//   ],
18926	//   "parameters": {
18927	//     "name": {
18928	//       "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\".",
18929	//       "location": "path",
18930	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
18931	//       "required": true,
18932	//       "type": "string"
18933	//     }
18934	//   },
18935	//   "path": "v2/{+name}",
18936	//   "response": {
18937	//     "$ref": "LogView"
18938	//   },
18939	//   "scopes": [
18940	//     "https://www.googleapis.com/auth/cloud-platform",
18941	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
18942	//     "https://www.googleapis.com/auth/logging.admin",
18943	//     "https://www.googleapis.com/auth/logging.read"
18944	//   ]
18945	// }
18946
18947}
18948
18949// method id "logging.organizations.locations.buckets.views.list":
18950
18951type OrganizationsLocationsBucketsViewsListCall struct {
18952	s            *Service
18953	parent       string
18954	urlParams_   gensupport.URLParams
18955	ifNoneMatch_ string
18956	ctx_         context.Context
18957	header_      http.Header
18958}
18959
18960// List: Lists views on a bucket.
18961//
18962// - parent: The bucket whose views are to be listed:
18963//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]".
18964func (r *OrganizationsLocationsBucketsViewsService) List(parent string) *OrganizationsLocationsBucketsViewsListCall {
18965	c := &OrganizationsLocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
18966	c.parent = parent
18967	return c
18968}
18969
18970// PageSize sets the optional parameter "pageSize": The maximum number
18971// of results to return from this request. Non-positive values are
18972// ignored. The presence of nextPageToken in the response indicates that
18973// more results might be available.
18974func (c *OrganizationsLocationsBucketsViewsListCall) PageSize(pageSize int64) *OrganizationsLocationsBucketsViewsListCall {
18975	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
18976	return c
18977}
18978
18979// PageToken sets the optional parameter "pageToken": If present, then
18980// retrieve the next batch of results from the preceding call to this
18981// method. pageToken must be the value of nextPageToken from the
18982// previous response. The values of other method parameters should be
18983// identical to those in the previous call.
18984func (c *OrganizationsLocationsBucketsViewsListCall) PageToken(pageToken string) *OrganizationsLocationsBucketsViewsListCall {
18985	c.urlParams_.Set("pageToken", pageToken)
18986	return c
18987}
18988
18989// Fields allows partial responses to be retrieved. See
18990// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
18991// for more information.
18992func (c *OrganizationsLocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsListCall {
18993	c.urlParams_.Set("fields", googleapi.CombineFields(s))
18994	return c
18995}
18996
18997// IfNoneMatch sets the optional parameter which makes the operation
18998// fail if the object's ETag matches the given value. This is useful for
18999// getting updates only after the object has changed since the last
19000// request. Use googleapi.IsNotModified to check whether the response
19001// error from Do is the result of In-None-Match.
19002func (c *OrganizationsLocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsViewsListCall {
19003	c.ifNoneMatch_ = entityTag
19004	return c
19005}
19006
19007// Context sets the context to be used in this call's Do method. Any
19008// pending HTTP request will be aborted if the provided context is
19009// canceled.
19010func (c *OrganizationsLocationsBucketsViewsListCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsListCall {
19011	c.ctx_ = ctx
19012	return c
19013}
19014
19015// Header returns an http.Header that can be modified by the caller to
19016// add HTTP headers to the request.
19017func (c *OrganizationsLocationsBucketsViewsListCall) Header() http.Header {
19018	if c.header_ == nil {
19019		c.header_ = make(http.Header)
19020	}
19021	return c.header_
19022}
19023
19024func (c *OrganizationsLocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) {
19025	reqHeaders := make(http.Header)
19026	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
19027	for k, v := range c.header_ {
19028		reqHeaders[k] = v
19029	}
19030	reqHeaders.Set("User-Agent", c.s.userAgent())
19031	if c.ifNoneMatch_ != "" {
19032		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
19033	}
19034	var body io.Reader = nil
19035	c.urlParams_.Set("alt", alt)
19036	c.urlParams_.Set("prettyPrint", "false")
19037	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
19038	urls += "?" + c.urlParams_.Encode()
19039	req, err := http.NewRequest("GET", urls, body)
19040	if err != nil {
19041		return nil, err
19042	}
19043	req.Header = reqHeaders
19044	googleapi.Expand(req.URL, map[string]string{
19045		"parent": c.parent,
19046	})
19047	return gensupport.SendRequest(c.ctx_, c.s.client, req)
19048}
19049
19050// Do executes the "logging.organizations.locations.buckets.views.list" call.
19051// Exactly one of *ListViewsResponse or error will be non-nil. Any
19052// non-2xx status code is an error. Response headers are in either
19053// *ListViewsResponse.ServerResponse.Header or (if a response was
19054// returned at all) in error.(*googleapi.Error).Header. Use
19055// googleapi.IsNotModified to check whether the returned error was
19056// because http.StatusNotModified was returned.
19057func (c *OrganizationsLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) {
19058	gensupport.SetOptions(c.urlParams_, opts...)
19059	res, err := c.doRequest("json")
19060	if res != nil && res.StatusCode == http.StatusNotModified {
19061		if res.Body != nil {
19062			res.Body.Close()
19063		}
19064		return nil, &googleapi.Error{
19065			Code:   res.StatusCode,
19066			Header: res.Header,
19067		}
19068	}
19069	if err != nil {
19070		return nil, err
19071	}
19072	defer googleapi.CloseBody(res)
19073	if err := googleapi.CheckResponse(res); err != nil {
19074		return nil, err
19075	}
19076	ret := &ListViewsResponse{
19077		ServerResponse: googleapi.ServerResponse{
19078			Header:         res.Header,
19079			HTTPStatusCode: res.StatusCode,
19080		},
19081	}
19082	target := &ret
19083	if err := gensupport.DecodeResponse(target, res); err != nil {
19084		return nil, err
19085	}
19086	return ret, nil
19087	// {
19088	//   "description": "Lists views on a bucket.",
19089	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views",
19090	//   "httpMethod": "GET",
19091	//   "id": "logging.organizations.locations.buckets.views.list",
19092	//   "parameterOrder": [
19093	//     "parent"
19094	//   ],
19095	//   "parameters": {
19096	//     "pageSize": {
19097	//       "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.",
19098	//       "format": "int32",
19099	//       "location": "query",
19100	//       "type": "integer"
19101	//     },
19102	//     "pageToken": {
19103	//       "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.",
19104	//       "location": "query",
19105	//       "type": "string"
19106	//     },
19107	//     "parent": {
19108	//       "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ",
19109	//       "location": "path",
19110	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$",
19111	//       "required": true,
19112	//       "type": "string"
19113	//     }
19114	//   },
19115	//   "path": "v2/{+parent}/views",
19116	//   "response": {
19117	//     "$ref": "ListViewsResponse"
19118	//   },
19119	//   "scopes": [
19120	//     "https://www.googleapis.com/auth/cloud-platform",
19121	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
19122	//     "https://www.googleapis.com/auth/logging.admin",
19123	//     "https://www.googleapis.com/auth/logging.read"
19124	//   ]
19125	// }
19126
19127}
19128
19129// Pages invokes f for each page of results.
19130// A non-nil error returned from f will halt the iteration.
19131// The provided context supersedes any context provided to the Context method.
19132func (c *OrganizationsLocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error {
19133	c.ctx_ = ctx
19134	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
19135	for {
19136		x, err := c.Do()
19137		if err != nil {
19138			return err
19139		}
19140		if err := f(x); err != nil {
19141			return err
19142		}
19143		if x.NextPageToken == "" {
19144			return nil
19145		}
19146		c.PageToken(x.NextPageToken)
19147	}
19148}
19149
19150// method id "logging.organizations.locations.buckets.views.patch":
19151
19152type OrganizationsLocationsBucketsViewsPatchCall struct {
19153	s          *Service
19154	name       string
19155	logview    *LogView
19156	urlParams_ gensupport.URLParams
19157	ctx_       context.Context
19158	header_    http.Header
19159}
19160
19161// Patch: Updates a view. This method replaces the following fields in
19162// the existing view with values from the new view: filter.
19163//
19164// - name: The full resource name of the view to update
19165//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
19166//   iews/[VIEW_ID]" Example:
19167//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id/v
19168//   iews/my-view-id".
19169func (r *OrganizationsLocationsBucketsViewsService) Patch(name string, logview *LogView) *OrganizationsLocationsBucketsViewsPatchCall {
19170	c := &OrganizationsLocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
19171	c.name = name
19172	c.logview = logview
19173	return c
19174}
19175
19176// UpdateMask sets the optional parameter "updateMask": Field mask that
19177// specifies the fields in view that need an update. A field will be
19178// overwritten if, and only if, it is in the update mask. name and
19179// output only fields cannot be updated.For a detailed FieldMask
19180// definition, see
19181// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
19182// updateMask=filter.
19183func (c *OrganizationsLocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *OrganizationsLocationsBucketsViewsPatchCall {
19184	c.urlParams_.Set("updateMask", updateMask)
19185	return c
19186}
19187
19188// Fields allows partial responses to be retrieved. See
19189// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
19190// for more information.
19191func (c *OrganizationsLocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsPatchCall {
19192	c.urlParams_.Set("fields", googleapi.CombineFields(s))
19193	return c
19194}
19195
19196// Context sets the context to be used in this call's Do method. Any
19197// pending HTTP request will be aborted if the provided context is
19198// canceled.
19199func (c *OrganizationsLocationsBucketsViewsPatchCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsPatchCall {
19200	c.ctx_ = ctx
19201	return c
19202}
19203
19204// Header returns an http.Header that can be modified by the caller to
19205// add HTTP headers to the request.
19206func (c *OrganizationsLocationsBucketsViewsPatchCall) Header() http.Header {
19207	if c.header_ == nil {
19208		c.header_ = make(http.Header)
19209	}
19210	return c.header_
19211}
19212
19213func (c *OrganizationsLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) {
19214	reqHeaders := make(http.Header)
19215	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
19216	for k, v := range c.header_ {
19217		reqHeaders[k] = v
19218	}
19219	reqHeaders.Set("User-Agent", c.s.userAgent())
19220	var body io.Reader = nil
19221	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
19222	if err != nil {
19223		return nil, err
19224	}
19225	reqHeaders.Set("Content-Type", "application/json")
19226	c.urlParams_.Set("alt", alt)
19227	c.urlParams_.Set("prettyPrint", "false")
19228	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
19229	urls += "?" + c.urlParams_.Encode()
19230	req, err := http.NewRequest("PATCH", urls, body)
19231	if err != nil {
19232		return nil, err
19233	}
19234	req.Header = reqHeaders
19235	googleapi.Expand(req.URL, map[string]string{
19236		"name": c.name,
19237	})
19238	return gensupport.SendRequest(c.ctx_, c.s.client, req)
19239}
19240
19241// Do executes the "logging.organizations.locations.buckets.views.patch" call.
19242// Exactly one of *LogView or error will be non-nil. Any non-2xx status
19243// code is an error. Response headers are in either
19244// *LogView.ServerResponse.Header or (if a response was returned at all)
19245// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
19246// check whether the returned error was because http.StatusNotModified
19247// was returned.
19248func (c *OrganizationsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
19249	gensupport.SetOptions(c.urlParams_, opts...)
19250	res, err := c.doRequest("json")
19251	if res != nil && res.StatusCode == http.StatusNotModified {
19252		if res.Body != nil {
19253			res.Body.Close()
19254		}
19255		return nil, &googleapi.Error{
19256			Code:   res.StatusCode,
19257			Header: res.Header,
19258		}
19259	}
19260	if err != nil {
19261		return nil, err
19262	}
19263	defer googleapi.CloseBody(res)
19264	if err := googleapi.CheckResponse(res); err != nil {
19265		return nil, err
19266	}
19267	ret := &LogView{
19268		ServerResponse: googleapi.ServerResponse{
19269			Header:         res.Header,
19270			HTTPStatusCode: res.StatusCode,
19271		},
19272	}
19273	target := &ret
19274	if err := gensupport.DecodeResponse(target, res); err != nil {
19275		return nil, err
19276	}
19277	return ret, nil
19278	// {
19279	//   "description": "Updates a view. This method replaces the following fields in the existing view with values from the new view: filter.",
19280	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
19281	//   "httpMethod": "PATCH",
19282	//   "id": "logging.organizations.locations.buckets.views.patch",
19283	//   "parameterOrder": [
19284	//     "name"
19285	//   ],
19286	//   "parameters": {
19287	//     "name": {
19288	//       "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\".",
19289	//       "location": "path",
19290	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
19291	//       "required": true,
19292	//       "type": "string"
19293	//     },
19294	//     "updateMask": {
19295	//       "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.",
19296	//       "format": "google-fieldmask",
19297	//       "location": "query",
19298	//       "type": "string"
19299	//     }
19300	//   },
19301	//   "path": "v2/{+name}",
19302	//   "request": {
19303	//     "$ref": "LogView"
19304	//   },
19305	//   "response": {
19306	//     "$ref": "LogView"
19307	//   },
19308	//   "scopes": [
19309	//     "https://www.googleapis.com/auth/cloud-platform",
19310	//     "https://www.googleapis.com/auth/logging.admin"
19311	//   ]
19312	// }
19313
19314}
19315
19316// method id "logging.organizations.logs.delete":
19317
19318type OrganizationsLogsDeleteCall struct {
19319	s          *Service
19320	logName    string
19321	urlParams_ gensupport.URLParams
19322	ctx_       context.Context
19323	header_    http.Header
19324}
19325
19326// Delete: Deletes all the log entries in a log for the _Default Log
19327// Bucket. The log reappears if it receives new entries. Log entries
19328// written shortly before the delete operation might not be deleted.
19329// Entries received after the delete operation with a timestamp before
19330// the operation will be deleted.
19331//
19332// - logName: The resource name of the log to delete:
19333//   projects/[PROJECT_ID]/logs/[LOG_ID]
19334//   organizations/[ORGANIZATION_ID]/logs/[LOG_ID]
19335//   billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]
19336//   folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For
19337//   example, "projects/my-project-id/logs/syslog",
19338//   "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For
19339//   more information about log names, see LogEntry.
19340func (r *OrganizationsLogsService) Delete(logName string) *OrganizationsLogsDeleteCall {
19341	c := &OrganizationsLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
19342	c.logName = logName
19343	return c
19344}
19345
19346// Fields allows partial responses to be retrieved. See
19347// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
19348// for more information.
19349func (c *OrganizationsLogsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLogsDeleteCall {
19350	c.urlParams_.Set("fields", googleapi.CombineFields(s))
19351	return c
19352}
19353
19354// Context sets the context to be used in this call's Do method. Any
19355// pending HTTP request will be aborted if the provided context is
19356// canceled.
19357func (c *OrganizationsLogsDeleteCall) Context(ctx context.Context) *OrganizationsLogsDeleteCall {
19358	c.ctx_ = ctx
19359	return c
19360}
19361
19362// Header returns an http.Header that can be modified by the caller to
19363// add HTTP headers to the request.
19364func (c *OrganizationsLogsDeleteCall) Header() http.Header {
19365	if c.header_ == nil {
19366		c.header_ = make(http.Header)
19367	}
19368	return c.header_
19369}
19370
19371func (c *OrganizationsLogsDeleteCall) doRequest(alt string) (*http.Response, error) {
19372	reqHeaders := make(http.Header)
19373	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
19374	for k, v := range c.header_ {
19375		reqHeaders[k] = v
19376	}
19377	reqHeaders.Set("User-Agent", c.s.userAgent())
19378	var body io.Reader = nil
19379	c.urlParams_.Set("alt", alt)
19380	c.urlParams_.Set("prettyPrint", "false")
19381	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}")
19382	urls += "?" + c.urlParams_.Encode()
19383	req, err := http.NewRequest("DELETE", urls, body)
19384	if err != nil {
19385		return nil, err
19386	}
19387	req.Header = reqHeaders
19388	googleapi.Expand(req.URL, map[string]string{
19389		"logName": c.logName,
19390	})
19391	return gensupport.SendRequest(c.ctx_, c.s.client, req)
19392}
19393
19394// Do executes the "logging.organizations.logs.delete" call.
19395// Exactly one of *Empty or error will be non-nil. Any non-2xx status
19396// code is an error. Response headers are in either
19397// *Empty.ServerResponse.Header or (if a response was returned at all)
19398// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
19399// check whether the returned error was because http.StatusNotModified
19400// was returned.
19401func (c *OrganizationsLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
19402	gensupport.SetOptions(c.urlParams_, opts...)
19403	res, err := c.doRequest("json")
19404	if res != nil && res.StatusCode == http.StatusNotModified {
19405		if res.Body != nil {
19406			res.Body.Close()
19407		}
19408		return nil, &googleapi.Error{
19409			Code:   res.StatusCode,
19410			Header: res.Header,
19411		}
19412	}
19413	if err != nil {
19414		return nil, err
19415	}
19416	defer googleapi.CloseBody(res)
19417	if err := googleapi.CheckResponse(res); err != nil {
19418		return nil, err
19419	}
19420	ret := &Empty{
19421		ServerResponse: googleapi.ServerResponse{
19422			Header:         res.Header,
19423			HTTPStatusCode: res.StatusCode,
19424		},
19425	}
19426	target := &ret
19427	if err := gensupport.DecodeResponse(target, res); err != nil {
19428		return nil, err
19429	}
19430	return ret, nil
19431	// {
19432	//   "description": "Deletes all the log entries in a log for the _Default Log Bucket. 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.",
19433	//   "flatPath": "v2/organizations/{organizationsId}/logs/{logsId}",
19434	//   "httpMethod": "DELETE",
19435	//   "id": "logging.organizations.logs.delete",
19436	//   "parameterOrder": [
19437	//     "logName"
19438	//   ],
19439	//   "parameters": {
19440	//     "logName": {
19441	//       "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/123/logs/cloudaudit.googleapis.com%2Factivity\".For more information about log names, see LogEntry.",
19442	//       "location": "path",
19443	//       "pattern": "^organizations/[^/]+/logs/[^/]+$",
19444	//       "required": true,
19445	//       "type": "string"
19446	//     }
19447	//   },
19448	//   "path": "v2/{+logName}",
19449	//   "response": {
19450	//     "$ref": "Empty"
19451	//   },
19452	//   "scopes": [
19453	//     "https://www.googleapis.com/auth/cloud-platform",
19454	//     "https://www.googleapis.com/auth/logging.admin"
19455	//   ]
19456	// }
19457
19458}
19459
19460// method id "logging.organizations.logs.list":
19461
19462type OrganizationsLogsListCall struct {
19463	s            *Service
19464	parent       string
19465	urlParams_   gensupport.URLParams
19466	ifNoneMatch_ string
19467	ctx_         context.Context
19468	header_      http.Header
19469}
19470
19471// List: Lists the logs in projects, organizations, folders, or billing
19472// accounts. Only logs that have entries are listed.
19473//
19474// - parent: The resource name that owns the logs: projects/[PROJECT_ID]
19475//   organizations/[ORGANIZATION_ID]
19476//   billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID].
19477func (r *OrganizationsLogsService) List(parent string) *OrganizationsLogsListCall {
19478	c := &OrganizationsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
19479	c.parent = parent
19480	return c
19481}
19482
19483// PageSize sets the optional parameter "pageSize": The maximum number
19484// of results to return from this request. Non-positive values are
19485// ignored. The presence of nextPageToken in the response indicates that
19486// more results might be available.
19487func (c *OrganizationsLogsListCall) PageSize(pageSize int64) *OrganizationsLogsListCall {
19488	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
19489	return c
19490}
19491
19492// PageToken sets the optional parameter "pageToken": If present, then
19493// retrieve the next batch of results from the preceding call to this
19494// method. pageToken must be the value of nextPageToken from the
19495// previous response. The values of other method parameters should be
19496// identical to those in the previous call.
19497func (c *OrganizationsLogsListCall) PageToken(pageToken string) *OrganizationsLogsListCall {
19498	c.urlParams_.Set("pageToken", pageToken)
19499	return c
19500}
19501
19502// ResourceNames sets the optional parameter "resourceNames": The
19503// resource name that owns the logs:
19504// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view
19505// s/[VIEW_ID]
19506// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE
19507// T_ID]/views/[VIEW_ID]
19508// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[
19509// BUCKET_ID]/views/[VIEW_ID]
19510// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/
19511// [VIEW_ID]To support legacy queries, it could also be:
19512// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID]
19513// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]
19514func (c *OrganizationsLogsListCall) ResourceNames(resourceNames ...string) *OrganizationsLogsListCall {
19515	c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...))
19516	return c
19517}
19518
19519// Fields allows partial responses to be retrieved. See
19520// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
19521// for more information.
19522func (c *OrganizationsLogsListCall) Fields(s ...googleapi.Field) *OrganizationsLogsListCall {
19523	c.urlParams_.Set("fields", googleapi.CombineFields(s))
19524	return c
19525}
19526
19527// IfNoneMatch sets the optional parameter which makes the operation
19528// fail if the object's ETag matches the given value. This is useful for
19529// getting updates only after the object has changed since the last
19530// request. Use googleapi.IsNotModified to check whether the response
19531// error from Do is the result of In-None-Match.
19532func (c *OrganizationsLogsListCall) IfNoneMatch(entityTag string) *OrganizationsLogsListCall {
19533	c.ifNoneMatch_ = entityTag
19534	return c
19535}
19536
19537// Context sets the context to be used in this call's Do method. Any
19538// pending HTTP request will be aborted if the provided context is
19539// canceled.
19540func (c *OrganizationsLogsListCall) Context(ctx context.Context) *OrganizationsLogsListCall {
19541	c.ctx_ = ctx
19542	return c
19543}
19544
19545// Header returns an http.Header that can be modified by the caller to
19546// add HTTP headers to the request.
19547func (c *OrganizationsLogsListCall) Header() http.Header {
19548	if c.header_ == nil {
19549		c.header_ = make(http.Header)
19550	}
19551	return c.header_
19552}
19553
19554func (c *OrganizationsLogsListCall) doRequest(alt string) (*http.Response, error) {
19555	reqHeaders := make(http.Header)
19556	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
19557	for k, v := range c.header_ {
19558		reqHeaders[k] = v
19559	}
19560	reqHeaders.Set("User-Agent", c.s.userAgent())
19561	if c.ifNoneMatch_ != "" {
19562		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
19563	}
19564	var body io.Reader = nil
19565	c.urlParams_.Set("alt", alt)
19566	c.urlParams_.Set("prettyPrint", "false")
19567	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs")
19568	urls += "?" + c.urlParams_.Encode()
19569	req, err := http.NewRequest("GET", urls, body)
19570	if err != nil {
19571		return nil, err
19572	}
19573	req.Header = reqHeaders
19574	googleapi.Expand(req.URL, map[string]string{
19575		"parent": c.parent,
19576	})
19577	return gensupport.SendRequest(c.ctx_, c.s.client, req)
19578}
19579
19580// Do executes the "logging.organizations.logs.list" call.
19581// Exactly one of *ListLogsResponse or error will be non-nil. Any
19582// non-2xx status code is an error. Response headers are in either
19583// *ListLogsResponse.ServerResponse.Header or (if a response was
19584// returned at all) in error.(*googleapi.Error).Header. Use
19585// googleapi.IsNotModified to check whether the returned error was
19586// because http.StatusNotModified was returned.
19587func (c *OrganizationsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) {
19588	gensupport.SetOptions(c.urlParams_, opts...)
19589	res, err := c.doRequest("json")
19590	if res != nil && res.StatusCode == http.StatusNotModified {
19591		if res.Body != nil {
19592			res.Body.Close()
19593		}
19594		return nil, &googleapi.Error{
19595			Code:   res.StatusCode,
19596			Header: res.Header,
19597		}
19598	}
19599	if err != nil {
19600		return nil, err
19601	}
19602	defer googleapi.CloseBody(res)
19603	if err := googleapi.CheckResponse(res); err != nil {
19604		return nil, err
19605	}
19606	ret := &ListLogsResponse{
19607		ServerResponse: googleapi.ServerResponse{
19608			Header:         res.Header,
19609			HTTPStatusCode: res.StatusCode,
19610		},
19611	}
19612	target := &ret
19613	if err := gensupport.DecodeResponse(target, res); err != nil {
19614		return nil, err
19615	}
19616	return ret, nil
19617	// {
19618	//   "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.",
19619	//   "flatPath": "v2/organizations/{organizationsId}/logs",
19620	//   "httpMethod": "GET",
19621	//   "id": "logging.organizations.logs.list",
19622	//   "parameterOrder": [
19623	//     "parent"
19624	//   ],
19625	//   "parameters": {
19626	//     "pageSize": {
19627	//       "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.",
19628	//       "format": "int32",
19629	//       "location": "query",
19630	//       "type": "integer"
19631	//     },
19632	//     "pageToken": {
19633	//       "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.",
19634	//       "location": "query",
19635	//       "type": "string"
19636	//     },
19637	//     "parent": {
19638	//       "description": "Required. The resource name that owns the logs: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]",
19639	//       "location": "path",
19640	//       "pattern": "^organizations/[^/]+$",
19641	//       "required": true,
19642	//       "type": "string"
19643	//     },
19644	//     "resourceNames": {
19645	//       "description": "Optional. The resource name that owns the logs: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[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_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]",
19646	//       "location": "query",
19647	//       "repeated": true,
19648	//       "type": "string"
19649	//     }
19650	//   },
19651	//   "path": "v2/{+parent}/logs",
19652	//   "response": {
19653	//     "$ref": "ListLogsResponse"
19654	//   },
19655	//   "scopes": [
19656	//     "https://www.googleapis.com/auth/cloud-platform",
19657	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
19658	//     "https://www.googleapis.com/auth/logging.admin",
19659	//     "https://www.googleapis.com/auth/logging.read"
19660	//   ]
19661	// }
19662
19663}
19664
19665// Pages invokes f for each page of results.
19666// A non-nil error returned from f will halt the iteration.
19667// The provided context supersedes any context provided to the Context method.
19668func (c *OrganizationsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error {
19669	c.ctx_ = ctx
19670	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
19671	for {
19672		x, err := c.Do()
19673		if err != nil {
19674			return err
19675		}
19676		if err := f(x); err != nil {
19677			return err
19678		}
19679		if x.NextPageToken == "" {
19680			return nil
19681		}
19682		c.PageToken(x.NextPageToken)
19683	}
19684}
19685
19686// method id "logging.organizations.sinks.create":
19687
19688type OrganizationsSinksCreateCall struct {
19689	s          *Service
19690	parent     string
19691	logsink    *LogSink
19692	urlParams_ gensupport.URLParams
19693	ctx_       context.Context
19694	header_    http.Header
19695}
19696
19697// Create: Creates a sink that exports specified log entries to a
19698// destination. The export of newly-ingested log entries begins
19699// immediately, unless the sink's writer_identity is not permitted to
19700// write to the destination. A sink can export log entries only from the
19701// resource owning the sink.
19702//
19703// - parent: The resource in which to create the sink:
19704//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
19705//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
19706//   Examples: "projects/my-logging-project", "organizations/123456789".
19707func (r *OrganizationsSinksService) Create(parent string, logsink *LogSink) *OrganizationsSinksCreateCall {
19708	c := &OrganizationsSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
19709	c.parent = parent
19710	c.logsink = logsink
19711	return c
19712}
19713
19714// UniqueWriterIdentity sets the optional parameter
19715// "uniqueWriterIdentity": Determines the kind of IAM identity returned
19716// as writer_identity in the new sink. If this value is omitted or set
19717// to false, and if the sink's parent is a project, then the value
19718// returned as writer_identity is the same group or service account used
19719// by Logging before the addition of writer identities to this API. The
19720// sink's destination must be in the same project as the sink itself.If
19721// this field is set to true, or if the sink is owned by a non-project
19722// resource such as an organization, then the value of writer_identity
19723// will be a unique service account used only for exports from the new
19724// sink. For more information, see writer_identity in LogSink.
19725func (c *OrganizationsSinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *OrganizationsSinksCreateCall {
19726	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
19727	return c
19728}
19729
19730// Fields allows partial responses to be retrieved. See
19731// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
19732// for more information.
19733func (c *OrganizationsSinksCreateCall) Fields(s ...googleapi.Field) *OrganizationsSinksCreateCall {
19734	c.urlParams_.Set("fields", googleapi.CombineFields(s))
19735	return c
19736}
19737
19738// Context sets the context to be used in this call's Do method. Any
19739// pending HTTP request will be aborted if the provided context is
19740// canceled.
19741func (c *OrganizationsSinksCreateCall) Context(ctx context.Context) *OrganizationsSinksCreateCall {
19742	c.ctx_ = ctx
19743	return c
19744}
19745
19746// Header returns an http.Header that can be modified by the caller to
19747// add HTTP headers to the request.
19748func (c *OrganizationsSinksCreateCall) Header() http.Header {
19749	if c.header_ == nil {
19750		c.header_ = make(http.Header)
19751	}
19752	return c.header_
19753}
19754
19755func (c *OrganizationsSinksCreateCall) doRequest(alt string) (*http.Response, error) {
19756	reqHeaders := make(http.Header)
19757	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
19758	for k, v := range c.header_ {
19759		reqHeaders[k] = v
19760	}
19761	reqHeaders.Set("User-Agent", c.s.userAgent())
19762	var body io.Reader = nil
19763	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
19764	if err != nil {
19765		return nil, err
19766	}
19767	reqHeaders.Set("Content-Type", "application/json")
19768	c.urlParams_.Set("alt", alt)
19769	c.urlParams_.Set("prettyPrint", "false")
19770	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
19771	urls += "?" + c.urlParams_.Encode()
19772	req, err := http.NewRequest("POST", urls, body)
19773	if err != nil {
19774		return nil, err
19775	}
19776	req.Header = reqHeaders
19777	googleapi.Expand(req.URL, map[string]string{
19778		"parent": c.parent,
19779	})
19780	return gensupport.SendRequest(c.ctx_, c.s.client, req)
19781}
19782
19783// Do executes the "logging.organizations.sinks.create" call.
19784// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
19785// code is an error. Response headers are in either
19786// *LogSink.ServerResponse.Header or (if a response was returned at all)
19787// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
19788// check whether the returned error was because http.StatusNotModified
19789// was returned.
19790func (c *OrganizationsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
19791	gensupport.SetOptions(c.urlParams_, opts...)
19792	res, err := c.doRequest("json")
19793	if res != nil && res.StatusCode == http.StatusNotModified {
19794		if res.Body != nil {
19795			res.Body.Close()
19796		}
19797		return nil, &googleapi.Error{
19798			Code:   res.StatusCode,
19799			Header: res.Header,
19800		}
19801	}
19802	if err != nil {
19803		return nil, err
19804	}
19805	defer googleapi.CloseBody(res)
19806	if err := googleapi.CheckResponse(res); err != nil {
19807		return nil, err
19808	}
19809	ret := &LogSink{
19810		ServerResponse: googleapi.ServerResponse{
19811			Header:         res.Header,
19812			HTTPStatusCode: res.StatusCode,
19813		},
19814	}
19815	target := &ret
19816	if err := gensupport.DecodeResponse(target, res); err != nil {
19817		return nil, err
19818	}
19819	return ret, nil
19820	// {
19821	//   "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.",
19822	//   "flatPath": "v2/organizations/{organizationsId}/sinks",
19823	//   "httpMethod": "POST",
19824	//   "id": "logging.organizations.sinks.create",
19825	//   "parameterOrder": [
19826	//     "parent"
19827	//   ],
19828	//   "parameters": {
19829	//     "parent": {
19830	//       "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\".",
19831	//       "location": "path",
19832	//       "pattern": "^organizations/[^/]+$",
19833	//       "required": true,
19834	//       "type": "string"
19835	//     },
19836	//     "uniqueWriterIdentity": {
19837	//       "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.",
19838	//       "location": "query",
19839	//       "type": "boolean"
19840	//     }
19841	//   },
19842	//   "path": "v2/{+parent}/sinks",
19843	//   "request": {
19844	//     "$ref": "LogSink"
19845	//   },
19846	//   "response": {
19847	//     "$ref": "LogSink"
19848	//   },
19849	//   "scopes": [
19850	//     "https://www.googleapis.com/auth/cloud-platform",
19851	//     "https://www.googleapis.com/auth/logging.admin"
19852	//   ]
19853	// }
19854
19855}
19856
19857// method id "logging.organizations.sinks.delete":
19858
19859type OrganizationsSinksDeleteCall struct {
19860	s          *Service
19861	sinkNameid string
19862	urlParams_ gensupport.URLParams
19863	ctx_       context.Context
19864	header_    http.Header
19865}
19866
19867// Delete: Deletes a sink. If the sink has a unique writer_identity,
19868// then that service account is also deleted.
19869//
19870// - sinkName: The full resource name of the sink to delete, including
19871//   the parent resource and the sink identifier:
19872//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
19873//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
19874//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
19875//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example:
19876//   "projects/my-project-id/sinks/my-sink-id".
19877func (r *OrganizationsSinksService) Delete(sinkNameid string) *OrganizationsSinksDeleteCall {
19878	c := &OrganizationsSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
19879	c.sinkNameid = sinkNameid
19880	return c
19881}
19882
19883// Fields allows partial responses to be retrieved. See
19884// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
19885// for more information.
19886func (c *OrganizationsSinksDeleteCall) Fields(s ...googleapi.Field) *OrganizationsSinksDeleteCall {
19887	c.urlParams_.Set("fields", googleapi.CombineFields(s))
19888	return c
19889}
19890
19891// Context sets the context to be used in this call's Do method. Any
19892// pending HTTP request will be aborted if the provided context is
19893// canceled.
19894func (c *OrganizationsSinksDeleteCall) Context(ctx context.Context) *OrganizationsSinksDeleteCall {
19895	c.ctx_ = ctx
19896	return c
19897}
19898
19899// Header returns an http.Header that can be modified by the caller to
19900// add HTTP headers to the request.
19901func (c *OrganizationsSinksDeleteCall) Header() http.Header {
19902	if c.header_ == nil {
19903		c.header_ = make(http.Header)
19904	}
19905	return c.header_
19906}
19907
19908func (c *OrganizationsSinksDeleteCall) doRequest(alt string) (*http.Response, error) {
19909	reqHeaders := make(http.Header)
19910	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
19911	for k, v := range c.header_ {
19912		reqHeaders[k] = v
19913	}
19914	reqHeaders.Set("User-Agent", c.s.userAgent())
19915	var body io.Reader = nil
19916	c.urlParams_.Set("alt", alt)
19917	c.urlParams_.Set("prettyPrint", "false")
19918	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
19919	urls += "?" + c.urlParams_.Encode()
19920	req, err := http.NewRequest("DELETE", urls, body)
19921	if err != nil {
19922		return nil, err
19923	}
19924	req.Header = reqHeaders
19925	googleapi.Expand(req.URL, map[string]string{
19926		"sinkName": c.sinkNameid,
19927	})
19928	return gensupport.SendRequest(c.ctx_, c.s.client, req)
19929}
19930
19931// Do executes the "logging.organizations.sinks.delete" call.
19932// Exactly one of *Empty or error will be non-nil. Any non-2xx status
19933// code is an error. Response headers are in either
19934// *Empty.ServerResponse.Header or (if a response was returned at all)
19935// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
19936// check whether the returned error was because http.StatusNotModified
19937// was returned.
19938func (c *OrganizationsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
19939	gensupport.SetOptions(c.urlParams_, opts...)
19940	res, err := c.doRequest("json")
19941	if res != nil && res.StatusCode == http.StatusNotModified {
19942		if res.Body != nil {
19943			res.Body.Close()
19944		}
19945		return nil, &googleapi.Error{
19946			Code:   res.StatusCode,
19947			Header: res.Header,
19948		}
19949	}
19950	if err != nil {
19951		return nil, err
19952	}
19953	defer googleapi.CloseBody(res)
19954	if err := googleapi.CheckResponse(res); err != nil {
19955		return nil, err
19956	}
19957	ret := &Empty{
19958		ServerResponse: googleapi.ServerResponse{
19959			Header:         res.Header,
19960			HTTPStatusCode: res.StatusCode,
19961		},
19962	}
19963	target := &ret
19964	if err := gensupport.DecodeResponse(target, res); err != nil {
19965		return nil, err
19966	}
19967	return ret, nil
19968	// {
19969	//   "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.",
19970	//   "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}",
19971	//   "httpMethod": "DELETE",
19972	//   "id": "logging.organizations.sinks.delete",
19973	//   "parameterOrder": [
19974	//     "sinkName"
19975	//   ],
19976	//   "parameters": {
19977	//     "sinkName": {
19978	//       "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\".",
19979	//       "location": "path",
19980	//       "pattern": "^organizations/[^/]+/sinks/[^/]+$",
19981	//       "required": true,
19982	//       "type": "string"
19983	//     }
19984	//   },
19985	//   "path": "v2/{+sinkName}",
19986	//   "response": {
19987	//     "$ref": "Empty"
19988	//   },
19989	//   "scopes": [
19990	//     "https://www.googleapis.com/auth/cloud-platform",
19991	//     "https://www.googleapis.com/auth/logging.admin"
19992	//   ]
19993	// }
19994
19995}
19996
19997// method id "logging.organizations.sinks.get":
19998
19999type OrganizationsSinksGetCall struct {
20000	s            *Service
20001	sinkName     string
20002	urlParams_   gensupport.URLParams
20003	ifNoneMatch_ string
20004	ctx_         context.Context
20005	header_      http.Header
20006}
20007
20008// Get: Gets a sink.
20009//
20010// - sinkName: The resource name of the sink:
20011//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
20012//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
20013//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
20014//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example:
20015//   "projects/my-project-id/sinks/my-sink-id".
20016func (r *OrganizationsSinksService) Get(sinkName string) *OrganizationsSinksGetCall {
20017	c := &OrganizationsSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
20018	c.sinkName = sinkName
20019	return c
20020}
20021
20022// Fields allows partial responses to be retrieved. See
20023// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
20024// for more information.
20025func (c *OrganizationsSinksGetCall) Fields(s ...googleapi.Field) *OrganizationsSinksGetCall {
20026	c.urlParams_.Set("fields", googleapi.CombineFields(s))
20027	return c
20028}
20029
20030// IfNoneMatch sets the optional parameter which makes the operation
20031// fail if the object's ETag matches the given value. This is useful for
20032// getting updates only after the object has changed since the last
20033// request. Use googleapi.IsNotModified to check whether the response
20034// error from Do is the result of In-None-Match.
20035func (c *OrganizationsSinksGetCall) IfNoneMatch(entityTag string) *OrganizationsSinksGetCall {
20036	c.ifNoneMatch_ = entityTag
20037	return c
20038}
20039
20040// Context sets the context to be used in this call's Do method. Any
20041// pending HTTP request will be aborted if the provided context is
20042// canceled.
20043func (c *OrganizationsSinksGetCall) Context(ctx context.Context) *OrganizationsSinksGetCall {
20044	c.ctx_ = ctx
20045	return c
20046}
20047
20048// Header returns an http.Header that can be modified by the caller to
20049// add HTTP headers to the request.
20050func (c *OrganizationsSinksGetCall) Header() http.Header {
20051	if c.header_ == nil {
20052		c.header_ = make(http.Header)
20053	}
20054	return c.header_
20055}
20056
20057func (c *OrganizationsSinksGetCall) doRequest(alt string) (*http.Response, error) {
20058	reqHeaders := make(http.Header)
20059	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
20060	for k, v := range c.header_ {
20061		reqHeaders[k] = v
20062	}
20063	reqHeaders.Set("User-Agent", c.s.userAgent())
20064	if c.ifNoneMatch_ != "" {
20065		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
20066	}
20067	var body io.Reader = nil
20068	c.urlParams_.Set("alt", alt)
20069	c.urlParams_.Set("prettyPrint", "false")
20070	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
20071	urls += "?" + c.urlParams_.Encode()
20072	req, err := http.NewRequest("GET", urls, body)
20073	if err != nil {
20074		return nil, err
20075	}
20076	req.Header = reqHeaders
20077	googleapi.Expand(req.URL, map[string]string{
20078		"sinkName": c.sinkName,
20079	})
20080	return gensupport.SendRequest(c.ctx_, c.s.client, req)
20081}
20082
20083// Do executes the "logging.organizations.sinks.get" call.
20084// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
20085// code is an error. Response headers are in either
20086// *LogSink.ServerResponse.Header or (if a response was returned at all)
20087// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
20088// check whether the returned error was because http.StatusNotModified
20089// was returned.
20090func (c *OrganizationsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
20091	gensupport.SetOptions(c.urlParams_, opts...)
20092	res, err := c.doRequest("json")
20093	if res != nil && res.StatusCode == http.StatusNotModified {
20094		if res.Body != nil {
20095			res.Body.Close()
20096		}
20097		return nil, &googleapi.Error{
20098			Code:   res.StatusCode,
20099			Header: res.Header,
20100		}
20101	}
20102	if err != nil {
20103		return nil, err
20104	}
20105	defer googleapi.CloseBody(res)
20106	if err := googleapi.CheckResponse(res); err != nil {
20107		return nil, err
20108	}
20109	ret := &LogSink{
20110		ServerResponse: googleapi.ServerResponse{
20111			Header:         res.Header,
20112			HTTPStatusCode: res.StatusCode,
20113		},
20114	}
20115	target := &ret
20116	if err := gensupport.DecodeResponse(target, res); err != nil {
20117		return nil, err
20118	}
20119	return ret, nil
20120	// {
20121	//   "description": "Gets a sink.",
20122	//   "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}",
20123	//   "httpMethod": "GET",
20124	//   "id": "logging.organizations.sinks.get",
20125	//   "parameterOrder": [
20126	//     "sinkName"
20127	//   ],
20128	//   "parameters": {
20129	//     "sinkName": {
20130	//       "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\".",
20131	//       "location": "path",
20132	//       "pattern": "^organizations/[^/]+/sinks/[^/]+$",
20133	//       "required": true,
20134	//       "type": "string"
20135	//     }
20136	//   },
20137	//   "path": "v2/{+sinkName}",
20138	//   "response": {
20139	//     "$ref": "LogSink"
20140	//   },
20141	//   "scopes": [
20142	//     "https://www.googleapis.com/auth/cloud-platform",
20143	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
20144	//     "https://www.googleapis.com/auth/logging.admin",
20145	//     "https://www.googleapis.com/auth/logging.read"
20146	//   ]
20147	// }
20148
20149}
20150
20151// method id "logging.organizations.sinks.list":
20152
20153type OrganizationsSinksListCall struct {
20154	s            *Service
20155	parent       string
20156	urlParams_   gensupport.URLParams
20157	ifNoneMatch_ string
20158	ctx_         context.Context
20159	header_      http.Header
20160}
20161
20162// List: Lists sinks.
20163//
20164// - parent: The parent resource whose sinks are to be listed:
20165//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
20166//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]".
20167func (r *OrganizationsSinksService) List(parent string) *OrganizationsSinksListCall {
20168	c := &OrganizationsSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
20169	c.parent = parent
20170	return c
20171}
20172
20173// PageSize sets the optional parameter "pageSize": The maximum number
20174// of results to return from this request. Non-positive values are
20175// ignored. The presence of nextPageToken in the response indicates that
20176// more results might be available.
20177func (c *OrganizationsSinksListCall) PageSize(pageSize int64) *OrganizationsSinksListCall {
20178	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
20179	return c
20180}
20181
20182// PageToken sets the optional parameter "pageToken": If present, then
20183// retrieve the next batch of results from the preceding call to this
20184// method. pageToken must be the value of nextPageToken from the
20185// previous response. The values of other method parameters should be
20186// identical to those in the previous call.
20187func (c *OrganizationsSinksListCall) PageToken(pageToken string) *OrganizationsSinksListCall {
20188	c.urlParams_.Set("pageToken", pageToken)
20189	return c
20190}
20191
20192// Fields allows partial responses to be retrieved. See
20193// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
20194// for more information.
20195func (c *OrganizationsSinksListCall) Fields(s ...googleapi.Field) *OrganizationsSinksListCall {
20196	c.urlParams_.Set("fields", googleapi.CombineFields(s))
20197	return c
20198}
20199
20200// IfNoneMatch sets the optional parameter which makes the operation
20201// fail if the object's ETag matches the given value. This is useful for
20202// getting updates only after the object has changed since the last
20203// request. Use googleapi.IsNotModified to check whether the response
20204// error from Do is the result of In-None-Match.
20205func (c *OrganizationsSinksListCall) IfNoneMatch(entityTag string) *OrganizationsSinksListCall {
20206	c.ifNoneMatch_ = entityTag
20207	return c
20208}
20209
20210// Context sets the context to be used in this call's Do method. Any
20211// pending HTTP request will be aborted if the provided context is
20212// canceled.
20213func (c *OrganizationsSinksListCall) Context(ctx context.Context) *OrganizationsSinksListCall {
20214	c.ctx_ = ctx
20215	return c
20216}
20217
20218// Header returns an http.Header that can be modified by the caller to
20219// add HTTP headers to the request.
20220func (c *OrganizationsSinksListCall) Header() http.Header {
20221	if c.header_ == nil {
20222		c.header_ = make(http.Header)
20223	}
20224	return c.header_
20225}
20226
20227func (c *OrganizationsSinksListCall) doRequest(alt string) (*http.Response, error) {
20228	reqHeaders := make(http.Header)
20229	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
20230	for k, v := range c.header_ {
20231		reqHeaders[k] = v
20232	}
20233	reqHeaders.Set("User-Agent", c.s.userAgent())
20234	if c.ifNoneMatch_ != "" {
20235		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
20236	}
20237	var body io.Reader = nil
20238	c.urlParams_.Set("alt", alt)
20239	c.urlParams_.Set("prettyPrint", "false")
20240	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
20241	urls += "?" + c.urlParams_.Encode()
20242	req, err := http.NewRequest("GET", urls, body)
20243	if err != nil {
20244		return nil, err
20245	}
20246	req.Header = reqHeaders
20247	googleapi.Expand(req.URL, map[string]string{
20248		"parent": c.parent,
20249	})
20250	return gensupport.SendRequest(c.ctx_, c.s.client, req)
20251}
20252
20253// Do executes the "logging.organizations.sinks.list" call.
20254// Exactly one of *ListSinksResponse or error will be non-nil. Any
20255// non-2xx status code is an error. Response headers are in either
20256// *ListSinksResponse.ServerResponse.Header or (if a response was
20257// returned at all) in error.(*googleapi.Error).Header. Use
20258// googleapi.IsNotModified to check whether the returned error was
20259// because http.StatusNotModified was returned.
20260func (c *OrganizationsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) {
20261	gensupport.SetOptions(c.urlParams_, opts...)
20262	res, err := c.doRequest("json")
20263	if res != nil && res.StatusCode == http.StatusNotModified {
20264		if res.Body != nil {
20265			res.Body.Close()
20266		}
20267		return nil, &googleapi.Error{
20268			Code:   res.StatusCode,
20269			Header: res.Header,
20270		}
20271	}
20272	if err != nil {
20273		return nil, err
20274	}
20275	defer googleapi.CloseBody(res)
20276	if err := googleapi.CheckResponse(res); err != nil {
20277		return nil, err
20278	}
20279	ret := &ListSinksResponse{
20280		ServerResponse: googleapi.ServerResponse{
20281			Header:         res.Header,
20282			HTTPStatusCode: res.StatusCode,
20283		},
20284	}
20285	target := &ret
20286	if err := gensupport.DecodeResponse(target, res); err != nil {
20287		return nil, err
20288	}
20289	return ret, nil
20290	// {
20291	//   "description": "Lists sinks.",
20292	//   "flatPath": "v2/organizations/{organizationsId}/sinks",
20293	//   "httpMethod": "GET",
20294	//   "id": "logging.organizations.sinks.list",
20295	//   "parameterOrder": [
20296	//     "parent"
20297	//   ],
20298	//   "parameters": {
20299	//     "pageSize": {
20300	//       "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.",
20301	//       "format": "int32",
20302	//       "location": "query",
20303	//       "type": "integer"
20304	//     },
20305	//     "pageToken": {
20306	//       "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.",
20307	//       "location": "query",
20308	//       "type": "string"
20309	//     },
20310	//     "parent": {
20311	//       "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
20312	//       "location": "path",
20313	//       "pattern": "^organizations/[^/]+$",
20314	//       "required": true,
20315	//       "type": "string"
20316	//     }
20317	//   },
20318	//   "path": "v2/{+parent}/sinks",
20319	//   "response": {
20320	//     "$ref": "ListSinksResponse"
20321	//   },
20322	//   "scopes": [
20323	//     "https://www.googleapis.com/auth/cloud-platform",
20324	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
20325	//     "https://www.googleapis.com/auth/logging.admin",
20326	//     "https://www.googleapis.com/auth/logging.read"
20327	//   ]
20328	// }
20329
20330}
20331
20332// Pages invokes f for each page of results.
20333// A non-nil error returned from f will halt the iteration.
20334// The provided context supersedes any context provided to the Context method.
20335func (c *OrganizationsSinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error {
20336	c.ctx_ = ctx
20337	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
20338	for {
20339		x, err := c.Do()
20340		if err != nil {
20341			return err
20342		}
20343		if err := f(x); err != nil {
20344			return err
20345		}
20346		if x.NextPageToken == "" {
20347			return nil
20348		}
20349		c.PageToken(x.NextPageToken)
20350	}
20351}
20352
20353// method id "logging.organizations.sinks.patch":
20354
20355type OrganizationsSinksPatchCall struct {
20356	s          *Service
20357	sinkNameid string
20358	logsink    *LogSink
20359	urlParams_ gensupport.URLParams
20360	ctx_       context.Context
20361	header_    http.Header
20362}
20363
20364// Patch: Updates a sink. This method replaces the following fields in
20365// the existing sink with values from the new sink: destination, and
20366// filter.The updated sink might also have a new writer_identity; see
20367// the unique_writer_identity field.
20368//
20369// - sinkName: The full resource name of the sink to update, including
20370//   the parent resource and the sink identifier:
20371//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
20372//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
20373//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
20374//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example:
20375//   "projects/my-project-id/sinks/my-sink-id".
20376func (r *OrganizationsSinksService) Patch(sinkNameid string, logsink *LogSink) *OrganizationsSinksPatchCall {
20377	c := &OrganizationsSinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
20378	c.sinkNameid = sinkNameid
20379	c.logsink = logsink
20380	return c
20381}
20382
20383// UniqueWriterIdentity sets the optional parameter
20384// "uniqueWriterIdentity": See sinks.create for a description of this
20385// field. When updating a sink, the effect of this field on the value of
20386// writer_identity in the updated sink depends on both the old and new
20387// values of this field: If the old and new values of this field are
20388// both false or both true, then there is no change to the sink's
20389// writer_identity. If the old value is false and the new value is true,
20390// then writer_identity is changed to a unique service account. It is an
20391// error if the old value is true and the new value is set to false or
20392// defaulted to false.
20393func (c *OrganizationsSinksPatchCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *OrganizationsSinksPatchCall {
20394	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
20395	return c
20396}
20397
20398// UpdateMask sets the optional parameter "updateMask": Field mask that
20399// specifies the fields in sink that need an update. A sink field will
20400// be overwritten if, and only if, it is in the update mask. name and
20401// output only fields cannot be updated.An empty updateMask is
20402// temporarily treated as using the following mask for backwards
20403// compatibility purposes: destination,filter,includeChildren At some
20404// point in the future, behavior will be removed and specifying an empty
20405// updateMask will be an error.For a detailed FieldMask definition, see
20406// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
20407// updateMask=filter.
20408func (c *OrganizationsSinksPatchCall) UpdateMask(updateMask string) *OrganizationsSinksPatchCall {
20409	c.urlParams_.Set("updateMask", updateMask)
20410	return c
20411}
20412
20413// Fields allows partial responses to be retrieved. See
20414// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
20415// for more information.
20416func (c *OrganizationsSinksPatchCall) Fields(s ...googleapi.Field) *OrganizationsSinksPatchCall {
20417	c.urlParams_.Set("fields", googleapi.CombineFields(s))
20418	return c
20419}
20420
20421// Context sets the context to be used in this call's Do method. Any
20422// pending HTTP request will be aborted if the provided context is
20423// canceled.
20424func (c *OrganizationsSinksPatchCall) Context(ctx context.Context) *OrganizationsSinksPatchCall {
20425	c.ctx_ = ctx
20426	return c
20427}
20428
20429// Header returns an http.Header that can be modified by the caller to
20430// add HTTP headers to the request.
20431func (c *OrganizationsSinksPatchCall) Header() http.Header {
20432	if c.header_ == nil {
20433		c.header_ = make(http.Header)
20434	}
20435	return c.header_
20436}
20437
20438func (c *OrganizationsSinksPatchCall) doRequest(alt string) (*http.Response, error) {
20439	reqHeaders := make(http.Header)
20440	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
20441	for k, v := range c.header_ {
20442		reqHeaders[k] = v
20443	}
20444	reqHeaders.Set("User-Agent", c.s.userAgent())
20445	var body io.Reader = nil
20446	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
20447	if err != nil {
20448		return nil, err
20449	}
20450	reqHeaders.Set("Content-Type", "application/json")
20451	c.urlParams_.Set("alt", alt)
20452	c.urlParams_.Set("prettyPrint", "false")
20453	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
20454	urls += "?" + c.urlParams_.Encode()
20455	req, err := http.NewRequest("PATCH", urls, body)
20456	if err != nil {
20457		return nil, err
20458	}
20459	req.Header = reqHeaders
20460	googleapi.Expand(req.URL, map[string]string{
20461		"sinkName": c.sinkNameid,
20462	})
20463	return gensupport.SendRequest(c.ctx_, c.s.client, req)
20464}
20465
20466// Do executes the "logging.organizations.sinks.patch" call.
20467// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
20468// code is an error. Response headers are in either
20469// *LogSink.ServerResponse.Header or (if a response was returned at all)
20470// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
20471// check whether the returned error was because http.StatusNotModified
20472// was returned.
20473func (c *OrganizationsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
20474	gensupport.SetOptions(c.urlParams_, opts...)
20475	res, err := c.doRequest("json")
20476	if res != nil && res.StatusCode == http.StatusNotModified {
20477		if res.Body != nil {
20478			res.Body.Close()
20479		}
20480		return nil, &googleapi.Error{
20481			Code:   res.StatusCode,
20482			Header: res.Header,
20483		}
20484	}
20485	if err != nil {
20486		return nil, err
20487	}
20488	defer googleapi.CloseBody(res)
20489	if err := googleapi.CheckResponse(res); err != nil {
20490		return nil, err
20491	}
20492	ret := &LogSink{
20493		ServerResponse: googleapi.ServerResponse{
20494			Header:         res.Header,
20495			HTTPStatusCode: res.StatusCode,
20496		},
20497	}
20498	target := &ret
20499	if err := gensupport.DecodeResponse(target, res); err != nil {
20500		return nil, err
20501	}
20502	return ret, nil
20503	// {
20504	//   "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.",
20505	//   "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}",
20506	//   "httpMethod": "PATCH",
20507	//   "id": "logging.organizations.sinks.patch",
20508	//   "parameterOrder": [
20509	//     "sinkName"
20510	//   ],
20511	//   "parameters": {
20512	//     "sinkName": {
20513	//       "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\".",
20514	//       "location": "path",
20515	//       "pattern": "^organizations/[^/]+/sinks/[^/]+$",
20516	//       "required": true,
20517	//       "type": "string"
20518	//     },
20519	//     "uniqueWriterIdentity": {
20520	//       "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.",
20521	//       "location": "query",
20522	//       "type": "boolean"
20523	//     },
20524	//     "updateMask": {
20525	//       "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.",
20526	//       "format": "google-fieldmask",
20527	//       "location": "query",
20528	//       "type": "string"
20529	//     }
20530	//   },
20531	//   "path": "v2/{+sinkName}",
20532	//   "request": {
20533	//     "$ref": "LogSink"
20534	//   },
20535	//   "response": {
20536	//     "$ref": "LogSink"
20537	//   },
20538	//   "scopes": [
20539	//     "https://www.googleapis.com/auth/cloud-platform",
20540	//     "https://www.googleapis.com/auth/logging.admin"
20541	//   ]
20542	// }
20543
20544}
20545
20546// method id "logging.organizations.sinks.update":
20547
20548type OrganizationsSinksUpdateCall struct {
20549	s          *Service
20550	sinkNameid string
20551	logsink    *LogSink
20552	urlParams_ gensupport.URLParams
20553	ctx_       context.Context
20554	header_    http.Header
20555}
20556
20557// Update: Updates a sink. This method replaces the following fields in
20558// the existing sink with values from the new sink: destination, and
20559// filter.The updated sink might also have a new writer_identity; see
20560// the unique_writer_identity field.
20561//
20562// - sinkName: The full resource name of the sink to update, including
20563//   the parent resource and the sink identifier:
20564//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
20565//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
20566//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
20567//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example:
20568//   "projects/my-project-id/sinks/my-sink-id".
20569func (r *OrganizationsSinksService) Update(sinkNameid string, logsink *LogSink) *OrganizationsSinksUpdateCall {
20570	c := &OrganizationsSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
20571	c.sinkNameid = sinkNameid
20572	c.logsink = logsink
20573	return c
20574}
20575
20576// UniqueWriterIdentity sets the optional parameter
20577// "uniqueWriterIdentity": See sinks.create for a description of this
20578// field. When updating a sink, the effect of this field on the value of
20579// writer_identity in the updated sink depends on both the old and new
20580// values of this field: If the old and new values of this field are
20581// both false or both true, then there is no change to the sink's
20582// writer_identity. If the old value is false and the new value is true,
20583// then writer_identity is changed to a unique service account. It is an
20584// error if the old value is true and the new value is set to false or
20585// defaulted to false.
20586func (c *OrganizationsSinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *OrganizationsSinksUpdateCall {
20587	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
20588	return c
20589}
20590
20591// UpdateMask sets the optional parameter "updateMask": Field mask that
20592// specifies the fields in sink that need an update. A sink field will
20593// be overwritten if, and only if, it is in the update mask. name and
20594// output only fields cannot be updated.An empty updateMask is
20595// temporarily treated as using the following mask for backwards
20596// compatibility purposes: destination,filter,includeChildren At some
20597// point in the future, behavior will be removed and specifying an empty
20598// updateMask will be an error.For a detailed FieldMask definition, see
20599// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
20600// updateMask=filter.
20601func (c *OrganizationsSinksUpdateCall) UpdateMask(updateMask string) *OrganizationsSinksUpdateCall {
20602	c.urlParams_.Set("updateMask", updateMask)
20603	return c
20604}
20605
20606// Fields allows partial responses to be retrieved. See
20607// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
20608// for more information.
20609func (c *OrganizationsSinksUpdateCall) Fields(s ...googleapi.Field) *OrganizationsSinksUpdateCall {
20610	c.urlParams_.Set("fields", googleapi.CombineFields(s))
20611	return c
20612}
20613
20614// Context sets the context to be used in this call's Do method. Any
20615// pending HTTP request will be aborted if the provided context is
20616// canceled.
20617func (c *OrganizationsSinksUpdateCall) Context(ctx context.Context) *OrganizationsSinksUpdateCall {
20618	c.ctx_ = ctx
20619	return c
20620}
20621
20622// Header returns an http.Header that can be modified by the caller to
20623// add HTTP headers to the request.
20624func (c *OrganizationsSinksUpdateCall) Header() http.Header {
20625	if c.header_ == nil {
20626		c.header_ = make(http.Header)
20627	}
20628	return c.header_
20629}
20630
20631func (c *OrganizationsSinksUpdateCall) doRequest(alt string) (*http.Response, error) {
20632	reqHeaders := make(http.Header)
20633	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
20634	for k, v := range c.header_ {
20635		reqHeaders[k] = v
20636	}
20637	reqHeaders.Set("User-Agent", c.s.userAgent())
20638	var body io.Reader = nil
20639	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
20640	if err != nil {
20641		return nil, err
20642	}
20643	reqHeaders.Set("Content-Type", "application/json")
20644	c.urlParams_.Set("alt", alt)
20645	c.urlParams_.Set("prettyPrint", "false")
20646	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
20647	urls += "?" + c.urlParams_.Encode()
20648	req, err := http.NewRequest("PUT", urls, body)
20649	if err != nil {
20650		return nil, err
20651	}
20652	req.Header = reqHeaders
20653	googleapi.Expand(req.URL, map[string]string{
20654		"sinkName": c.sinkNameid,
20655	})
20656	return gensupport.SendRequest(c.ctx_, c.s.client, req)
20657}
20658
20659// Do executes the "logging.organizations.sinks.update" call.
20660// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
20661// code is an error. Response headers are in either
20662// *LogSink.ServerResponse.Header or (if a response was returned at all)
20663// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
20664// check whether the returned error was because http.StatusNotModified
20665// was returned.
20666func (c *OrganizationsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
20667	gensupport.SetOptions(c.urlParams_, opts...)
20668	res, err := c.doRequest("json")
20669	if res != nil && res.StatusCode == http.StatusNotModified {
20670		if res.Body != nil {
20671			res.Body.Close()
20672		}
20673		return nil, &googleapi.Error{
20674			Code:   res.StatusCode,
20675			Header: res.Header,
20676		}
20677	}
20678	if err != nil {
20679		return nil, err
20680	}
20681	defer googleapi.CloseBody(res)
20682	if err := googleapi.CheckResponse(res); err != nil {
20683		return nil, err
20684	}
20685	ret := &LogSink{
20686		ServerResponse: googleapi.ServerResponse{
20687			Header:         res.Header,
20688			HTTPStatusCode: res.StatusCode,
20689		},
20690	}
20691	target := &ret
20692	if err := gensupport.DecodeResponse(target, res); err != nil {
20693		return nil, err
20694	}
20695	return ret, nil
20696	// {
20697	//   "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.",
20698	//   "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}",
20699	//   "httpMethod": "PUT",
20700	//   "id": "logging.organizations.sinks.update",
20701	//   "parameterOrder": [
20702	//     "sinkName"
20703	//   ],
20704	//   "parameters": {
20705	//     "sinkName": {
20706	//       "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\".",
20707	//       "location": "path",
20708	//       "pattern": "^organizations/[^/]+/sinks/[^/]+$",
20709	//       "required": true,
20710	//       "type": "string"
20711	//     },
20712	//     "uniqueWriterIdentity": {
20713	//       "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.",
20714	//       "location": "query",
20715	//       "type": "boolean"
20716	//     },
20717	//     "updateMask": {
20718	//       "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.",
20719	//       "format": "google-fieldmask",
20720	//       "location": "query",
20721	//       "type": "string"
20722	//     }
20723	//   },
20724	//   "path": "v2/{+sinkName}",
20725	//   "request": {
20726	//     "$ref": "LogSink"
20727	//   },
20728	//   "response": {
20729	//     "$ref": "LogSink"
20730	//   },
20731	//   "scopes": [
20732	//     "https://www.googleapis.com/auth/cloud-platform",
20733	//     "https://www.googleapis.com/auth/logging.admin"
20734	//   ]
20735	// }
20736
20737}
20738
20739// method id "logging.projects.exclusions.create":
20740
20741type ProjectsExclusionsCreateCall struct {
20742	s            *Service
20743	parent       string
20744	logexclusion *LogExclusion
20745	urlParams_   gensupport.URLParams
20746	ctx_         context.Context
20747	header_      http.Header
20748}
20749
20750// Create: Creates a new exclusion in a specified parent resource. Only
20751// log entries belonging to that resource can be excluded. You can have
20752// up to 10 exclusions in a resource.
20753//
20754// - parent: The parent resource in which to create the exclusion:
20755//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
20756//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
20757//   Examples: "projects/my-logging-project", "organizations/123456789".
20758func (r *ProjectsExclusionsService) Create(parent string, logexclusion *LogExclusion) *ProjectsExclusionsCreateCall {
20759	c := &ProjectsExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
20760	c.parent = parent
20761	c.logexclusion = logexclusion
20762	return c
20763}
20764
20765// Fields allows partial responses to be retrieved. See
20766// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
20767// for more information.
20768func (c *ProjectsExclusionsCreateCall) Fields(s ...googleapi.Field) *ProjectsExclusionsCreateCall {
20769	c.urlParams_.Set("fields", googleapi.CombineFields(s))
20770	return c
20771}
20772
20773// Context sets the context to be used in this call's Do method. Any
20774// pending HTTP request will be aborted if the provided context is
20775// canceled.
20776func (c *ProjectsExclusionsCreateCall) Context(ctx context.Context) *ProjectsExclusionsCreateCall {
20777	c.ctx_ = ctx
20778	return c
20779}
20780
20781// Header returns an http.Header that can be modified by the caller to
20782// add HTTP headers to the request.
20783func (c *ProjectsExclusionsCreateCall) Header() http.Header {
20784	if c.header_ == nil {
20785		c.header_ = make(http.Header)
20786	}
20787	return c.header_
20788}
20789
20790func (c *ProjectsExclusionsCreateCall) doRequest(alt string) (*http.Response, error) {
20791	reqHeaders := make(http.Header)
20792	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
20793	for k, v := range c.header_ {
20794		reqHeaders[k] = v
20795	}
20796	reqHeaders.Set("User-Agent", c.s.userAgent())
20797	var body io.Reader = nil
20798	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
20799	if err != nil {
20800		return nil, err
20801	}
20802	reqHeaders.Set("Content-Type", "application/json")
20803	c.urlParams_.Set("alt", alt)
20804	c.urlParams_.Set("prettyPrint", "false")
20805	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
20806	urls += "?" + c.urlParams_.Encode()
20807	req, err := http.NewRequest("POST", urls, body)
20808	if err != nil {
20809		return nil, err
20810	}
20811	req.Header = reqHeaders
20812	googleapi.Expand(req.URL, map[string]string{
20813		"parent": c.parent,
20814	})
20815	return gensupport.SendRequest(c.ctx_, c.s.client, req)
20816}
20817
20818// Do executes the "logging.projects.exclusions.create" call.
20819// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
20820// status code is an error. Response headers are in either
20821// *LogExclusion.ServerResponse.Header or (if a response was returned at
20822// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
20823// to check whether the returned error was because
20824// http.StatusNotModified was returned.
20825func (c *ProjectsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
20826	gensupport.SetOptions(c.urlParams_, opts...)
20827	res, err := c.doRequest("json")
20828	if res != nil && res.StatusCode == http.StatusNotModified {
20829		if res.Body != nil {
20830			res.Body.Close()
20831		}
20832		return nil, &googleapi.Error{
20833			Code:   res.StatusCode,
20834			Header: res.Header,
20835		}
20836	}
20837	if err != nil {
20838		return nil, err
20839	}
20840	defer googleapi.CloseBody(res)
20841	if err := googleapi.CheckResponse(res); err != nil {
20842		return nil, err
20843	}
20844	ret := &LogExclusion{
20845		ServerResponse: googleapi.ServerResponse{
20846			Header:         res.Header,
20847			HTTPStatusCode: res.StatusCode,
20848		},
20849	}
20850	target := &ret
20851	if err := gensupport.DecodeResponse(target, res); err != nil {
20852		return nil, err
20853	}
20854	return ret, nil
20855	// {
20856	//   "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.",
20857	//   "flatPath": "v2/projects/{projectsId}/exclusions",
20858	//   "httpMethod": "POST",
20859	//   "id": "logging.projects.exclusions.create",
20860	//   "parameterOrder": [
20861	//     "parent"
20862	//   ],
20863	//   "parameters": {
20864	//     "parent": {
20865	//       "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\".",
20866	//       "location": "path",
20867	//       "pattern": "^projects/[^/]+$",
20868	//       "required": true,
20869	//       "type": "string"
20870	//     }
20871	//   },
20872	//   "path": "v2/{+parent}/exclusions",
20873	//   "request": {
20874	//     "$ref": "LogExclusion"
20875	//   },
20876	//   "response": {
20877	//     "$ref": "LogExclusion"
20878	//   },
20879	//   "scopes": [
20880	//     "https://www.googleapis.com/auth/cloud-platform",
20881	//     "https://www.googleapis.com/auth/logging.admin"
20882	//   ]
20883	// }
20884
20885}
20886
20887// method id "logging.projects.exclusions.delete":
20888
20889type ProjectsExclusionsDeleteCall struct {
20890	s          *Service
20891	name       string
20892	urlParams_ gensupport.URLParams
20893	ctx_       context.Context
20894	header_    http.Header
20895}
20896
20897// Delete: Deletes an exclusion.
20898//
20899// - name: The resource name of an existing exclusion to delete:
20900//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
20901//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
20902//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
20903//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example:
20904//   "projects/my-project-id/exclusions/my-exclusion-id".
20905func (r *ProjectsExclusionsService) Delete(name string) *ProjectsExclusionsDeleteCall {
20906	c := &ProjectsExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
20907	c.name = name
20908	return c
20909}
20910
20911// Fields allows partial responses to be retrieved. See
20912// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
20913// for more information.
20914func (c *ProjectsExclusionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsExclusionsDeleteCall {
20915	c.urlParams_.Set("fields", googleapi.CombineFields(s))
20916	return c
20917}
20918
20919// Context sets the context to be used in this call's Do method. Any
20920// pending HTTP request will be aborted if the provided context is
20921// canceled.
20922func (c *ProjectsExclusionsDeleteCall) Context(ctx context.Context) *ProjectsExclusionsDeleteCall {
20923	c.ctx_ = ctx
20924	return c
20925}
20926
20927// Header returns an http.Header that can be modified by the caller to
20928// add HTTP headers to the request.
20929func (c *ProjectsExclusionsDeleteCall) Header() http.Header {
20930	if c.header_ == nil {
20931		c.header_ = make(http.Header)
20932	}
20933	return c.header_
20934}
20935
20936func (c *ProjectsExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) {
20937	reqHeaders := make(http.Header)
20938	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
20939	for k, v := range c.header_ {
20940		reqHeaders[k] = v
20941	}
20942	reqHeaders.Set("User-Agent", c.s.userAgent())
20943	var body io.Reader = nil
20944	c.urlParams_.Set("alt", alt)
20945	c.urlParams_.Set("prettyPrint", "false")
20946	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
20947	urls += "?" + c.urlParams_.Encode()
20948	req, err := http.NewRequest("DELETE", urls, body)
20949	if err != nil {
20950		return nil, err
20951	}
20952	req.Header = reqHeaders
20953	googleapi.Expand(req.URL, map[string]string{
20954		"name": c.name,
20955	})
20956	return gensupport.SendRequest(c.ctx_, c.s.client, req)
20957}
20958
20959// Do executes the "logging.projects.exclusions.delete" call.
20960// Exactly one of *Empty or error will be non-nil. Any non-2xx status
20961// code is an error. Response headers are in either
20962// *Empty.ServerResponse.Header or (if a response was returned at all)
20963// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
20964// check whether the returned error was because http.StatusNotModified
20965// was returned.
20966func (c *ProjectsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
20967	gensupport.SetOptions(c.urlParams_, opts...)
20968	res, err := c.doRequest("json")
20969	if res != nil && res.StatusCode == http.StatusNotModified {
20970		if res.Body != nil {
20971			res.Body.Close()
20972		}
20973		return nil, &googleapi.Error{
20974			Code:   res.StatusCode,
20975			Header: res.Header,
20976		}
20977	}
20978	if err != nil {
20979		return nil, err
20980	}
20981	defer googleapi.CloseBody(res)
20982	if err := googleapi.CheckResponse(res); err != nil {
20983		return nil, err
20984	}
20985	ret := &Empty{
20986		ServerResponse: googleapi.ServerResponse{
20987			Header:         res.Header,
20988			HTTPStatusCode: res.StatusCode,
20989		},
20990	}
20991	target := &ret
20992	if err := gensupport.DecodeResponse(target, res); err != nil {
20993		return nil, err
20994	}
20995	return ret, nil
20996	// {
20997	//   "description": "Deletes an exclusion.",
20998	//   "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}",
20999	//   "httpMethod": "DELETE",
21000	//   "id": "logging.projects.exclusions.delete",
21001	//   "parameterOrder": [
21002	//     "name"
21003	//   ],
21004	//   "parameters": {
21005	//     "name": {
21006	//       "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\".",
21007	//       "location": "path",
21008	//       "pattern": "^projects/[^/]+/exclusions/[^/]+$",
21009	//       "required": true,
21010	//       "type": "string"
21011	//     }
21012	//   },
21013	//   "path": "v2/{+name}",
21014	//   "response": {
21015	//     "$ref": "Empty"
21016	//   },
21017	//   "scopes": [
21018	//     "https://www.googleapis.com/auth/cloud-platform",
21019	//     "https://www.googleapis.com/auth/logging.admin"
21020	//   ]
21021	// }
21022
21023}
21024
21025// method id "logging.projects.exclusions.get":
21026
21027type ProjectsExclusionsGetCall struct {
21028	s            *Service
21029	name         string
21030	urlParams_   gensupport.URLParams
21031	ifNoneMatch_ string
21032	ctx_         context.Context
21033	header_      http.Header
21034}
21035
21036// Get: Gets the description of an exclusion.
21037//
21038// - name: The resource name of an existing exclusion:
21039//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
21040//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
21041//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
21042//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example:
21043//   "projects/my-project-id/exclusions/my-exclusion-id".
21044func (r *ProjectsExclusionsService) Get(name string) *ProjectsExclusionsGetCall {
21045	c := &ProjectsExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
21046	c.name = name
21047	return c
21048}
21049
21050// Fields allows partial responses to be retrieved. See
21051// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
21052// for more information.
21053func (c *ProjectsExclusionsGetCall) Fields(s ...googleapi.Field) *ProjectsExclusionsGetCall {
21054	c.urlParams_.Set("fields", googleapi.CombineFields(s))
21055	return c
21056}
21057
21058// IfNoneMatch sets the optional parameter which makes the operation
21059// fail if the object's ETag matches the given value. This is useful for
21060// getting updates only after the object has changed since the last
21061// request. Use googleapi.IsNotModified to check whether the response
21062// error from Do is the result of In-None-Match.
21063func (c *ProjectsExclusionsGetCall) IfNoneMatch(entityTag string) *ProjectsExclusionsGetCall {
21064	c.ifNoneMatch_ = entityTag
21065	return c
21066}
21067
21068// Context sets the context to be used in this call's Do method. Any
21069// pending HTTP request will be aborted if the provided context is
21070// canceled.
21071func (c *ProjectsExclusionsGetCall) Context(ctx context.Context) *ProjectsExclusionsGetCall {
21072	c.ctx_ = ctx
21073	return c
21074}
21075
21076// Header returns an http.Header that can be modified by the caller to
21077// add HTTP headers to the request.
21078func (c *ProjectsExclusionsGetCall) Header() http.Header {
21079	if c.header_ == nil {
21080		c.header_ = make(http.Header)
21081	}
21082	return c.header_
21083}
21084
21085func (c *ProjectsExclusionsGetCall) doRequest(alt string) (*http.Response, error) {
21086	reqHeaders := make(http.Header)
21087	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
21088	for k, v := range c.header_ {
21089		reqHeaders[k] = v
21090	}
21091	reqHeaders.Set("User-Agent", c.s.userAgent())
21092	if c.ifNoneMatch_ != "" {
21093		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
21094	}
21095	var body io.Reader = nil
21096	c.urlParams_.Set("alt", alt)
21097	c.urlParams_.Set("prettyPrint", "false")
21098	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
21099	urls += "?" + c.urlParams_.Encode()
21100	req, err := http.NewRequest("GET", urls, body)
21101	if err != nil {
21102		return nil, err
21103	}
21104	req.Header = reqHeaders
21105	googleapi.Expand(req.URL, map[string]string{
21106		"name": c.name,
21107	})
21108	return gensupport.SendRequest(c.ctx_, c.s.client, req)
21109}
21110
21111// Do executes the "logging.projects.exclusions.get" call.
21112// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
21113// status code is an error. Response headers are in either
21114// *LogExclusion.ServerResponse.Header or (if a response was returned at
21115// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
21116// to check whether the returned error was because
21117// http.StatusNotModified was returned.
21118func (c *ProjectsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
21119	gensupport.SetOptions(c.urlParams_, opts...)
21120	res, err := c.doRequest("json")
21121	if res != nil && res.StatusCode == http.StatusNotModified {
21122		if res.Body != nil {
21123			res.Body.Close()
21124		}
21125		return nil, &googleapi.Error{
21126			Code:   res.StatusCode,
21127			Header: res.Header,
21128		}
21129	}
21130	if err != nil {
21131		return nil, err
21132	}
21133	defer googleapi.CloseBody(res)
21134	if err := googleapi.CheckResponse(res); err != nil {
21135		return nil, err
21136	}
21137	ret := &LogExclusion{
21138		ServerResponse: googleapi.ServerResponse{
21139			Header:         res.Header,
21140			HTTPStatusCode: res.StatusCode,
21141		},
21142	}
21143	target := &ret
21144	if err := gensupport.DecodeResponse(target, res); err != nil {
21145		return nil, err
21146	}
21147	return ret, nil
21148	// {
21149	//   "description": "Gets the description of an exclusion.",
21150	//   "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}",
21151	//   "httpMethod": "GET",
21152	//   "id": "logging.projects.exclusions.get",
21153	//   "parameterOrder": [
21154	//     "name"
21155	//   ],
21156	//   "parameters": {
21157	//     "name": {
21158	//       "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\".",
21159	//       "location": "path",
21160	//       "pattern": "^projects/[^/]+/exclusions/[^/]+$",
21161	//       "required": true,
21162	//       "type": "string"
21163	//     }
21164	//   },
21165	//   "path": "v2/{+name}",
21166	//   "response": {
21167	//     "$ref": "LogExclusion"
21168	//   },
21169	//   "scopes": [
21170	//     "https://www.googleapis.com/auth/cloud-platform",
21171	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
21172	//     "https://www.googleapis.com/auth/logging.admin",
21173	//     "https://www.googleapis.com/auth/logging.read"
21174	//   ]
21175	// }
21176
21177}
21178
21179// method id "logging.projects.exclusions.list":
21180
21181type ProjectsExclusionsListCall struct {
21182	s            *Service
21183	parent       string
21184	urlParams_   gensupport.URLParams
21185	ifNoneMatch_ string
21186	ctx_         context.Context
21187	header_      http.Header
21188}
21189
21190// List: Lists all the exclusions in a parent resource.
21191//
21192// - parent: The parent resource whose exclusions are to be listed.
21193//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
21194//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]".
21195func (r *ProjectsExclusionsService) List(parent string) *ProjectsExclusionsListCall {
21196	c := &ProjectsExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
21197	c.parent = parent
21198	return c
21199}
21200
21201// PageSize sets the optional parameter "pageSize": The maximum number
21202// of results to return from this request. Non-positive values are
21203// ignored. The presence of nextPageToken in the response indicates that
21204// more results might be available.
21205func (c *ProjectsExclusionsListCall) PageSize(pageSize int64) *ProjectsExclusionsListCall {
21206	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
21207	return c
21208}
21209
21210// PageToken sets the optional parameter "pageToken": If present, then
21211// retrieve the next batch of results from the preceding call to this
21212// method. pageToken must be the value of nextPageToken from the
21213// previous response. The values of other method parameters should be
21214// identical to those in the previous call.
21215func (c *ProjectsExclusionsListCall) PageToken(pageToken string) *ProjectsExclusionsListCall {
21216	c.urlParams_.Set("pageToken", pageToken)
21217	return c
21218}
21219
21220// Fields allows partial responses to be retrieved. See
21221// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
21222// for more information.
21223func (c *ProjectsExclusionsListCall) Fields(s ...googleapi.Field) *ProjectsExclusionsListCall {
21224	c.urlParams_.Set("fields", googleapi.CombineFields(s))
21225	return c
21226}
21227
21228// IfNoneMatch sets the optional parameter which makes the operation
21229// fail if the object's ETag matches the given value. This is useful for
21230// getting updates only after the object has changed since the last
21231// request. Use googleapi.IsNotModified to check whether the response
21232// error from Do is the result of In-None-Match.
21233func (c *ProjectsExclusionsListCall) IfNoneMatch(entityTag string) *ProjectsExclusionsListCall {
21234	c.ifNoneMatch_ = entityTag
21235	return c
21236}
21237
21238// Context sets the context to be used in this call's Do method. Any
21239// pending HTTP request will be aborted if the provided context is
21240// canceled.
21241func (c *ProjectsExclusionsListCall) Context(ctx context.Context) *ProjectsExclusionsListCall {
21242	c.ctx_ = ctx
21243	return c
21244}
21245
21246// Header returns an http.Header that can be modified by the caller to
21247// add HTTP headers to the request.
21248func (c *ProjectsExclusionsListCall) Header() http.Header {
21249	if c.header_ == nil {
21250		c.header_ = make(http.Header)
21251	}
21252	return c.header_
21253}
21254
21255func (c *ProjectsExclusionsListCall) doRequest(alt string) (*http.Response, error) {
21256	reqHeaders := make(http.Header)
21257	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
21258	for k, v := range c.header_ {
21259		reqHeaders[k] = v
21260	}
21261	reqHeaders.Set("User-Agent", c.s.userAgent())
21262	if c.ifNoneMatch_ != "" {
21263		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
21264	}
21265	var body io.Reader = nil
21266	c.urlParams_.Set("alt", alt)
21267	c.urlParams_.Set("prettyPrint", "false")
21268	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
21269	urls += "?" + c.urlParams_.Encode()
21270	req, err := http.NewRequest("GET", urls, body)
21271	if err != nil {
21272		return nil, err
21273	}
21274	req.Header = reqHeaders
21275	googleapi.Expand(req.URL, map[string]string{
21276		"parent": c.parent,
21277	})
21278	return gensupport.SendRequest(c.ctx_, c.s.client, req)
21279}
21280
21281// Do executes the "logging.projects.exclusions.list" call.
21282// Exactly one of *ListExclusionsResponse or error will be non-nil. Any
21283// non-2xx status code is an error. Response headers are in either
21284// *ListExclusionsResponse.ServerResponse.Header or (if a response was
21285// returned at all) in error.(*googleapi.Error).Header. Use
21286// googleapi.IsNotModified to check whether the returned error was
21287// because http.StatusNotModified was returned.
21288func (c *ProjectsExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) {
21289	gensupport.SetOptions(c.urlParams_, opts...)
21290	res, err := c.doRequest("json")
21291	if res != nil && res.StatusCode == http.StatusNotModified {
21292		if res.Body != nil {
21293			res.Body.Close()
21294		}
21295		return nil, &googleapi.Error{
21296			Code:   res.StatusCode,
21297			Header: res.Header,
21298		}
21299	}
21300	if err != nil {
21301		return nil, err
21302	}
21303	defer googleapi.CloseBody(res)
21304	if err := googleapi.CheckResponse(res); err != nil {
21305		return nil, err
21306	}
21307	ret := &ListExclusionsResponse{
21308		ServerResponse: googleapi.ServerResponse{
21309			Header:         res.Header,
21310			HTTPStatusCode: res.StatusCode,
21311		},
21312	}
21313	target := &ret
21314	if err := gensupport.DecodeResponse(target, res); err != nil {
21315		return nil, err
21316	}
21317	return ret, nil
21318	// {
21319	//   "description": "Lists all the exclusions in a parent resource.",
21320	//   "flatPath": "v2/projects/{projectsId}/exclusions",
21321	//   "httpMethod": "GET",
21322	//   "id": "logging.projects.exclusions.list",
21323	//   "parameterOrder": [
21324	//     "parent"
21325	//   ],
21326	//   "parameters": {
21327	//     "pageSize": {
21328	//       "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.",
21329	//       "format": "int32",
21330	//       "location": "query",
21331	//       "type": "integer"
21332	//     },
21333	//     "pageToken": {
21334	//       "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.",
21335	//       "location": "query",
21336	//       "type": "string"
21337	//     },
21338	//     "parent": {
21339	//       "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
21340	//       "location": "path",
21341	//       "pattern": "^projects/[^/]+$",
21342	//       "required": true,
21343	//       "type": "string"
21344	//     }
21345	//   },
21346	//   "path": "v2/{+parent}/exclusions",
21347	//   "response": {
21348	//     "$ref": "ListExclusionsResponse"
21349	//   },
21350	//   "scopes": [
21351	//     "https://www.googleapis.com/auth/cloud-platform",
21352	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
21353	//     "https://www.googleapis.com/auth/logging.admin",
21354	//     "https://www.googleapis.com/auth/logging.read"
21355	//   ]
21356	// }
21357
21358}
21359
21360// Pages invokes f for each page of results.
21361// A non-nil error returned from f will halt the iteration.
21362// The provided context supersedes any context provided to the Context method.
21363func (c *ProjectsExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error {
21364	c.ctx_ = ctx
21365	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
21366	for {
21367		x, err := c.Do()
21368		if err != nil {
21369			return err
21370		}
21371		if err := f(x); err != nil {
21372			return err
21373		}
21374		if x.NextPageToken == "" {
21375			return nil
21376		}
21377		c.PageToken(x.NextPageToken)
21378	}
21379}
21380
21381// method id "logging.projects.exclusions.patch":
21382
21383type ProjectsExclusionsPatchCall struct {
21384	s            *Service
21385	name         string
21386	logexclusion *LogExclusion
21387	urlParams_   gensupport.URLParams
21388	ctx_         context.Context
21389	header_      http.Header
21390}
21391
21392// Patch: Changes one or more properties of an existing exclusion.
21393//
21394// - name: The resource name of the exclusion to update:
21395//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
21396//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
21397//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
21398//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" Example:
21399//   "projects/my-project-id/exclusions/my-exclusion-id".
21400func (r *ProjectsExclusionsService) Patch(name string, logexclusion *LogExclusion) *ProjectsExclusionsPatchCall {
21401	c := &ProjectsExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
21402	c.name = name
21403	c.logexclusion = logexclusion
21404	return c
21405}
21406
21407// UpdateMask sets the optional parameter "updateMask": Required. A
21408// non-empty list of fields to change in the existing exclusion. New
21409// values for the fields are taken from the corresponding fields in the
21410// LogExclusion included in this request. Fields not mentioned in
21411// update_mask are not changed and are ignored in the request.For
21412// example, to change the filter and description of an exclusion,
21413// specify an update_mask of "filter,description".
21414func (c *ProjectsExclusionsPatchCall) UpdateMask(updateMask string) *ProjectsExclusionsPatchCall {
21415	c.urlParams_.Set("updateMask", updateMask)
21416	return c
21417}
21418
21419// Fields allows partial responses to be retrieved. See
21420// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
21421// for more information.
21422func (c *ProjectsExclusionsPatchCall) Fields(s ...googleapi.Field) *ProjectsExclusionsPatchCall {
21423	c.urlParams_.Set("fields", googleapi.CombineFields(s))
21424	return c
21425}
21426
21427// Context sets the context to be used in this call's Do method. Any
21428// pending HTTP request will be aborted if the provided context is
21429// canceled.
21430func (c *ProjectsExclusionsPatchCall) Context(ctx context.Context) *ProjectsExclusionsPatchCall {
21431	c.ctx_ = ctx
21432	return c
21433}
21434
21435// Header returns an http.Header that can be modified by the caller to
21436// add HTTP headers to the request.
21437func (c *ProjectsExclusionsPatchCall) Header() http.Header {
21438	if c.header_ == nil {
21439		c.header_ = make(http.Header)
21440	}
21441	return c.header_
21442}
21443
21444func (c *ProjectsExclusionsPatchCall) doRequest(alt string) (*http.Response, error) {
21445	reqHeaders := make(http.Header)
21446	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
21447	for k, v := range c.header_ {
21448		reqHeaders[k] = v
21449	}
21450	reqHeaders.Set("User-Agent", c.s.userAgent())
21451	var body io.Reader = nil
21452	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
21453	if err != nil {
21454		return nil, err
21455	}
21456	reqHeaders.Set("Content-Type", "application/json")
21457	c.urlParams_.Set("alt", alt)
21458	c.urlParams_.Set("prettyPrint", "false")
21459	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
21460	urls += "?" + c.urlParams_.Encode()
21461	req, err := http.NewRequest("PATCH", urls, body)
21462	if err != nil {
21463		return nil, err
21464	}
21465	req.Header = reqHeaders
21466	googleapi.Expand(req.URL, map[string]string{
21467		"name": c.name,
21468	})
21469	return gensupport.SendRequest(c.ctx_, c.s.client, req)
21470}
21471
21472// Do executes the "logging.projects.exclusions.patch" call.
21473// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
21474// status code is an error. Response headers are in either
21475// *LogExclusion.ServerResponse.Header or (if a response was returned at
21476// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
21477// to check whether the returned error was because
21478// http.StatusNotModified was returned.
21479func (c *ProjectsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
21480	gensupport.SetOptions(c.urlParams_, opts...)
21481	res, err := c.doRequest("json")
21482	if res != nil && res.StatusCode == http.StatusNotModified {
21483		if res.Body != nil {
21484			res.Body.Close()
21485		}
21486		return nil, &googleapi.Error{
21487			Code:   res.StatusCode,
21488			Header: res.Header,
21489		}
21490	}
21491	if err != nil {
21492		return nil, err
21493	}
21494	defer googleapi.CloseBody(res)
21495	if err := googleapi.CheckResponse(res); err != nil {
21496		return nil, err
21497	}
21498	ret := &LogExclusion{
21499		ServerResponse: googleapi.ServerResponse{
21500			Header:         res.Header,
21501			HTTPStatusCode: res.StatusCode,
21502		},
21503	}
21504	target := &ret
21505	if err := gensupport.DecodeResponse(target, res); err != nil {
21506		return nil, err
21507	}
21508	return ret, nil
21509	// {
21510	//   "description": "Changes one or more properties of an existing exclusion.",
21511	//   "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}",
21512	//   "httpMethod": "PATCH",
21513	//   "id": "logging.projects.exclusions.patch",
21514	//   "parameterOrder": [
21515	//     "name"
21516	//   ],
21517	//   "parameters": {
21518	//     "name": {
21519	//       "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\".",
21520	//       "location": "path",
21521	//       "pattern": "^projects/[^/]+/exclusions/[^/]+$",
21522	//       "required": true,
21523	//       "type": "string"
21524	//     },
21525	//     "updateMask": {
21526	//       "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\".",
21527	//       "format": "google-fieldmask",
21528	//       "location": "query",
21529	//       "type": "string"
21530	//     }
21531	//   },
21532	//   "path": "v2/{+name}",
21533	//   "request": {
21534	//     "$ref": "LogExclusion"
21535	//   },
21536	//   "response": {
21537	//     "$ref": "LogExclusion"
21538	//   },
21539	//   "scopes": [
21540	//     "https://www.googleapis.com/auth/cloud-platform",
21541	//     "https://www.googleapis.com/auth/logging.admin"
21542	//   ]
21543	// }
21544
21545}
21546
21547// method id "logging.projects.locations.get":
21548
21549type ProjectsLocationsGetCall struct {
21550	s            *Service
21551	name         string
21552	urlParams_   gensupport.URLParams
21553	ifNoneMatch_ string
21554	ctx_         context.Context
21555	header_      http.Header
21556}
21557
21558// Get: Gets information about a location.
21559//
21560// - name: Resource name for the location.
21561func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
21562	c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
21563	c.name = name
21564	return c
21565}
21566
21567// Fields allows partial responses to be retrieved. See
21568// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
21569// for more information.
21570func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
21571	c.urlParams_.Set("fields", googleapi.CombineFields(s))
21572	return c
21573}
21574
21575// IfNoneMatch sets the optional parameter which makes the operation
21576// fail if the object's ETag matches the given value. This is useful for
21577// getting updates only after the object has changed since the last
21578// request. Use googleapi.IsNotModified to check whether the response
21579// error from Do is the result of In-None-Match.
21580func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
21581	c.ifNoneMatch_ = entityTag
21582	return c
21583}
21584
21585// Context sets the context to be used in this call's Do method. Any
21586// pending HTTP request will be aborted if the provided context is
21587// canceled.
21588func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
21589	c.ctx_ = ctx
21590	return c
21591}
21592
21593// Header returns an http.Header that can be modified by the caller to
21594// add HTTP headers to the request.
21595func (c *ProjectsLocationsGetCall) Header() http.Header {
21596	if c.header_ == nil {
21597		c.header_ = make(http.Header)
21598	}
21599	return c.header_
21600}
21601
21602func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
21603	reqHeaders := make(http.Header)
21604	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
21605	for k, v := range c.header_ {
21606		reqHeaders[k] = v
21607	}
21608	reqHeaders.Set("User-Agent", c.s.userAgent())
21609	if c.ifNoneMatch_ != "" {
21610		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
21611	}
21612	var body io.Reader = nil
21613	c.urlParams_.Set("alt", alt)
21614	c.urlParams_.Set("prettyPrint", "false")
21615	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
21616	urls += "?" + c.urlParams_.Encode()
21617	req, err := http.NewRequest("GET", urls, body)
21618	if err != nil {
21619		return nil, err
21620	}
21621	req.Header = reqHeaders
21622	googleapi.Expand(req.URL, map[string]string{
21623		"name": c.name,
21624	})
21625	return gensupport.SendRequest(c.ctx_, c.s.client, req)
21626}
21627
21628// Do executes the "logging.projects.locations.get" call.
21629// Exactly one of *Location or error will be non-nil. Any non-2xx status
21630// code is an error. Response headers are in either
21631// *Location.ServerResponse.Header or (if a response was returned at
21632// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
21633// to check whether the returned error was because
21634// http.StatusNotModified was returned.
21635func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
21636	gensupport.SetOptions(c.urlParams_, opts...)
21637	res, err := c.doRequest("json")
21638	if res != nil && res.StatusCode == http.StatusNotModified {
21639		if res.Body != nil {
21640			res.Body.Close()
21641		}
21642		return nil, &googleapi.Error{
21643			Code:   res.StatusCode,
21644			Header: res.Header,
21645		}
21646	}
21647	if err != nil {
21648		return nil, err
21649	}
21650	defer googleapi.CloseBody(res)
21651	if err := googleapi.CheckResponse(res); err != nil {
21652		return nil, err
21653	}
21654	ret := &Location{
21655		ServerResponse: googleapi.ServerResponse{
21656			Header:         res.Header,
21657			HTTPStatusCode: res.StatusCode,
21658		},
21659	}
21660	target := &ret
21661	if err := gensupport.DecodeResponse(target, res); err != nil {
21662		return nil, err
21663	}
21664	return ret, nil
21665	// {
21666	//   "description": "Gets information about a location.",
21667	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}",
21668	//   "httpMethod": "GET",
21669	//   "id": "logging.projects.locations.get",
21670	//   "parameterOrder": [
21671	//     "name"
21672	//   ],
21673	//   "parameters": {
21674	//     "name": {
21675	//       "description": "Resource name for the location.",
21676	//       "location": "path",
21677	//       "pattern": "^projects/[^/]+/locations/[^/]+$",
21678	//       "required": true,
21679	//       "type": "string"
21680	//     }
21681	//   },
21682	//   "path": "v2/{+name}",
21683	//   "response": {
21684	//     "$ref": "Location"
21685	//   },
21686	//   "scopes": [
21687	//     "https://www.googleapis.com/auth/cloud-platform",
21688	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
21689	//     "https://www.googleapis.com/auth/logging.admin",
21690	//     "https://www.googleapis.com/auth/logging.read"
21691	//   ]
21692	// }
21693
21694}
21695
21696// method id "logging.projects.locations.list":
21697
21698type ProjectsLocationsListCall struct {
21699	s            *Service
21700	name         string
21701	urlParams_   gensupport.URLParams
21702	ifNoneMatch_ string
21703	ctx_         context.Context
21704	header_      http.Header
21705}
21706
21707// List: Lists information about the supported locations for this
21708// service.
21709//
21710// - name: The resource that owns the locations collection, if
21711//   applicable.
21712func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
21713	c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
21714	c.name = name
21715	return c
21716}
21717
21718// Filter sets the optional parameter "filter": A filter to narrow down
21719// results to a preferred subset. The filtering language accepts strings
21720// like "displayName=tokyo", and is documented in more detail in AIP-160
21721// (https://google.aip.dev/160).
21722func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
21723	c.urlParams_.Set("filter", filter)
21724	return c
21725}
21726
21727// PageSize sets the optional parameter "pageSize": The maximum number
21728// of results to return. If not set, the service selects a default.
21729func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
21730	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
21731	return c
21732}
21733
21734// PageToken sets the optional parameter "pageToken": A page token
21735// received from the next_page_token field in the response. Send that
21736// page token to receive the subsequent page.
21737func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
21738	c.urlParams_.Set("pageToken", pageToken)
21739	return c
21740}
21741
21742// Fields allows partial responses to be retrieved. See
21743// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
21744// for more information.
21745func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
21746	c.urlParams_.Set("fields", googleapi.CombineFields(s))
21747	return c
21748}
21749
21750// IfNoneMatch sets the optional parameter which makes the operation
21751// fail if the object's ETag matches the given value. This is useful for
21752// getting updates only after the object has changed since the last
21753// request. Use googleapi.IsNotModified to check whether the response
21754// error from Do is the result of In-None-Match.
21755func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
21756	c.ifNoneMatch_ = entityTag
21757	return c
21758}
21759
21760// Context sets the context to be used in this call's Do method. Any
21761// pending HTTP request will be aborted if the provided context is
21762// canceled.
21763func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
21764	c.ctx_ = ctx
21765	return c
21766}
21767
21768// Header returns an http.Header that can be modified by the caller to
21769// add HTTP headers to the request.
21770func (c *ProjectsLocationsListCall) Header() http.Header {
21771	if c.header_ == nil {
21772		c.header_ = make(http.Header)
21773	}
21774	return c.header_
21775}
21776
21777func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
21778	reqHeaders := make(http.Header)
21779	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
21780	for k, v := range c.header_ {
21781		reqHeaders[k] = v
21782	}
21783	reqHeaders.Set("User-Agent", c.s.userAgent())
21784	if c.ifNoneMatch_ != "" {
21785		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
21786	}
21787	var body io.Reader = nil
21788	c.urlParams_.Set("alt", alt)
21789	c.urlParams_.Set("prettyPrint", "false")
21790	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations")
21791	urls += "?" + c.urlParams_.Encode()
21792	req, err := http.NewRequest("GET", urls, body)
21793	if err != nil {
21794		return nil, err
21795	}
21796	req.Header = reqHeaders
21797	googleapi.Expand(req.URL, map[string]string{
21798		"name": c.name,
21799	})
21800	return gensupport.SendRequest(c.ctx_, c.s.client, req)
21801}
21802
21803// Do executes the "logging.projects.locations.list" call.
21804// Exactly one of *ListLocationsResponse or error will be non-nil. Any
21805// non-2xx status code is an error. Response headers are in either
21806// *ListLocationsResponse.ServerResponse.Header or (if a response was
21807// returned at all) in error.(*googleapi.Error).Header. Use
21808// googleapi.IsNotModified to check whether the returned error was
21809// because http.StatusNotModified was returned.
21810func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
21811	gensupport.SetOptions(c.urlParams_, opts...)
21812	res, err := c.doRequest("json")
21813	if res != nil && res.StatusCode == http.StatusNotModified {
21814		if res.Body != nil {
21815			res.Body.Close()
21816		}
21817		return nil, &googleapi.Error{
21818			Code:   res.StatusCode,
21819			Header: res.Header,
21820		}
21821	}
21822	if err != nil {
21823		return nil, err
21824	}
21825	defer googleapi.CloseBody(res)
21826	if err := googleapi.CheckResponse(res); err != nil {
21827		return nil, err
21828	}
21829	ret := &ListLocationsResponse{
21830		ServerResponse: googleapi.ServerResponse{
21831			Header:         res.Header,
21832			HTTPStatusCode: res.StatusCode,
21833		},
21834	}
21835	target := &ret
21836	if err := gensupport.DecodeResponse(target, res); err != nil {
21837		return nil, err
21838	}
21839	return ret, nil
21840	// {
21841	//   "description": "Lists information about the supported locations for this service.",
21842	//   "flatPath": "v2/projects/{projectsId}/locations",
21843	//   "httpMethod": "GET",
21844	//   "id": "logging.projects.locations.list",
21845	//   "parameterOrder": [
21846	//     "name"
21847	//   ],
21848	//   "parameters": {
21849	//     "filter": {
21850	//       "description": "A filter to narrow down results to a preferred subset. The filtering language accepts strings like \"displayName=tokyo\", and is documented in more detail in AIP-160 (https://google.aip.dev/160).",
21851	//       "location": "query",
21852	//       "type": "string"
21853	//     },
21854	//     "name": {
21855	//       "description": "The resource that owns the locations collection, if applicable.",
21856	//       "location": "path",
21857	//       "pattern": "^projects/[^/]+$",
21858	//       "required": true,
21859	//       "type": "string"
21860	//     },
21861	//     "pageSize": {
21862	//       "description": "The maximum number of results to return. If not set, the service selects a default.",
21863	//       "format": "int32",
21864	//       "location": "query",
21865	//       "type": "integer"
21866	//     },
21867	//     "pageToken": {
21868	//       "description": "A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.",
21869	//       "location": "query",
21870	//       "type": "string"
21871	//     }
21872	//   },
21873	//   "path": "v2/{+name}/locations",
21874	//   "response": {
21875	//     "$ref": "ListLocationsResponse"
21876	//   },
21877	//   "scopes": [
21878	//     "https://www.googleapis.com/auth/cloud-platform",
21879	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
21880	//     "https://www.googleapis.com/auth/logging.admin",
21881	//     "https://www.googleapis.com/auth/logging.read"
21882	//   ]
21883	// }
21884
21885}
21886
21887// Pages invokes f for each page of results.
21888// A non-nil error returned from f will halt the iteration.
21889// The provided context supersedes any context provided to the Context method.
21890func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
21891	c.ctx_ = ctx
21892	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
21893	for {
21894		x, err := c.Do()
21895		if err != nil {
21896			return err
21897		}
21898		if err := f(x); err != nil {
21899			return err
21900		}
21901		if x.NextPageToken == "" {
21902			return nil
21903		}
21904		c.PageToken(x.NextPageToken)
21905	}
21906}
21907
21908// method id "logging.projects.locations.buckets.create":
21909
21910type ProjectsLocationsBucketsCreateCall struct {
21911	s          *Service
21912	parent     string
21913	logbucket  *LogBucket
21914	urlParams_ gensupport.URLParams
21915	ctx_       context.Context
21916	header_    http.Header
21917}
21918
21919// Create: Creates a bucket that can be used to store log entries. Once
21920// a bucket has been created, the region cannot be changed.
21921//
21922// - parent: The resource in which to create the bucket:
21923//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]" Example:
21924//   "projects/my-logging-project/locations/global".
21925func (r *ProjectsLocationsBucketsService) Create(parent string, logbucket *LogBucket) *ProjectsLocationsBucketsCreateCall {
21926	c := &ProjectsLocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
21927	c.parent = parent
21928	c.logbucket = logbucket
21929	return c
21930}
21931
21932// BucketId sets the optional parameter "bucketId": Required. A
21933// client-assigned identifier such as "my-bucket". Identifiers are
21934// limited to 100 characters and can include only letters, digits,
21935// underscores, hyphens, and periods.
21936func (c *ProjectsLocationsBucketsCreateCall) BucketId(bucketId string) *ProjectsLocationsBucketsCreateCall {
21937	c.urlParams_.Set("bucketId", bucketId)
21938	return c
21939}
21940
21941// Fields allows partial responses to be retrieved. See
21942// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
21943// for more information.
21944func (c *ProjectsLocationsBucketsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsCreateCall {
21945	c.urlParams_.Set("fields", googleapi.CombineFields(s))
21946	return c
21947}
21948
21949// Context sets the context to be used in this call's Do method. Any
21950// pending HTTP request will be aborted if the provided context is
21951// canceled.
21952func (c *ProjectsLocationsBucketsCreateCall) Context(ctx context.Context) *ProjectsLocationsBucketsCreateCall {
21953	c.ctx_ = ctx
21954	return c
21955}
21956
21957// Header returns an http.Header that can be modified by the caller to
21958// add HTTP headers to the request.
21959func (c *ProjectsLocationsBucketsCreateCall) Header() http.Header {
21960	if c.header_ == nil {
21961		c.header_ = make(http.Header)
21962	}
21963	return c.header_
21964}
21965
21966func (c *ProjectsLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) {
21967	reqHeaders := make(http.Header)
21968	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
21969	for k, v := range c.header_ {
21970		reqHeaders[k] = v
21971	}
21972	reqHeaders.Set("User-Agent", c.s.userAgent())
21973	var body io.Reader = nil
21974	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
21975	if err != nil {
21976		return nil, err
21977	}
21978	reqHeaders.Set("Content-Type", "application/json")
21979	c.urlParams_.Set("alt", alt)
21980	c.urlParams_.Set("prettyPrint", "false")
21981	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
21982	urls += "?" + c.urlParams_.Encode()
21983	req, err := http.NewRequest("POST", urls, body)
21984	if err != nil {
21985		return nil, err
21986	}
21987	req.Header = reqHeaders
21988	googleapi.Expand(req.URL, map[string]string{
21989		"parent": c.parent,
21990	})
21991	return gensupport.SendRequest(c.ctx_, c.s.client, req)
21992}
21993
21994// Do executes the "logging.projects.locations.buckets.create" call.
21995// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
21996// status code is an error. Response headers are in either
21997// *LogBucket.ServerResponse.Header or (if a response was returned at
21998// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
21999// to check whether the returned error was because
22000// http.StatusNotModified was returned.
22001func (c *ProjectsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
22002	gensupport.SetOptions(c.urlParams_, opts...)
22003	res, err := c.doRequest("json")
22004	if res != nil && res.StatusCode == http.StatusNotModified {
22005		if res.Body != nil {
22006			res.Body.Close()
22007		}
22008		return nil, &googleapi.Error{
22009			Code:   res.StatusCode,
22010			Header: res.Header,
22011		}
22012	}
22013	if err != nil {
22014		return nil, err
22015	}
22016	defer googleapi.CloseBody(res)
22017	if err := googleapi.CheckResponse(res); err != nil {
22018		return nil, err
22019	}
22020	ret := &LogBucket{
22021		ServerResponse: googleapi.ServerResponse{
22022			Header:         res.Header,
22023			HTTPStatusCode: res.StatusCode,
22024		},
22025	}
22026	target := &ret
22027	if err := gensupport.DecodeResponse(target, res); err != nil {
22028		return nil, err
22029	}
22030	return ret, nil
22031	// {
22032	//   "description": "Creates a bucket that can be used to store log entries. Once a bucket has been created, the region cannot be changed.",
22033	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets",
22034	//   "httpMethod": "POST",
22035	//   "id": "logging.projects.locations.buckets.create",
22036	//   "parameterOrder": [
22037	//     "parent"
22038	//   ],
22039	//   "parameters": {
22040	//     "bucketId": {
22041	//       "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.",
22042	//       "location": "query",
22043	//       "type": "string"
22044	//     },
22045	//     "parent": {
22046	//       "description": "Required. The resource in which to create the bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" Example: \"projects/my-logging-project/locations/global\"",
22047	//       "location": "path",
22048	//       "pattern": "^projects/[^/]+/locations/[^/]+$",
22049	//       "required": true,
22050	//       "type": "string"
22051	//     }
22052	//   },
22053	//   "path": "v2/{+parent}/buckets",
22054	//   "request": {
22055	//     "$ref": "LogBucket"
22056	//   },
22057	//   "response": {
22058	//     "$ref": "LogBucket"
22059	//   },
22060	//   "scopes": [
22061	//     "https://www.googleapis.com/auth/cloud-platform",
22062	//     "https://www.googleapis.com/auth/logging.admin"
22063	//   ]
22064	// }
22065
22066}
22067
22068// method id "logging.projects.locations.buckets.delete":
22069
22070type ProjectsLocationsBucketsDeleteCall struct {
22071	s          *Service
22072	name       string
22073	urlParams_ gensupport.URLParams
22074	ctx_       context.Context
22075	header_    http.Header
22076}
22077
22078// Delete: Deletes a bucket. Moves the bucket to the DELETE_REQUESTED
22079// state. After 7 days, the bucket will be purged and all logs in the
22080// bucket will be permanently deleted.
22081//
22082// - name: The full resource name of the bucket to delete.
22083//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
22084//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
22085//   CKET_ID]"
22086//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
22087//   s/[BUCKET_ID]"
22088//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
22089//   Example:
22090//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id".
22091func (r *ProjectsLocationsBucketsService) Delete(name string) *ProjectsLocationsBucketsDeleteCall {
22092	c := &ProjectsLocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
22093	c.name = name
22094	return c
22095}
22096
22097// Fields allows partial responses to be retrieved. See
22098// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
22099// for more information.
22100func (c *ProjectsLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsDeleteCall {
22101	c.urlParams_.Set("fields", googleapi.CombineFields(s))
22102	return c
22103}
22104
22105// Context sets the context to be used in this call's Do method. Any
22106// pending HTTP request will be aborted if the provided context is
22107// canceled.
22108func (c *ProjectsLocationsBucketsDeleteCall) Context(ctx context.Context) *ProjectsLocationsBucketsDeleteCall {
22109	c.ctx_ = ctx
22110	return c
22111}
22112
22113// Header returns an http.Header that can be modified by the caller to
22114// add HTTP headers to the request.
22115func (c *ProjectsLocationsBucketsDeleteCall) Header() http.Header {
22116	if c.header_ == nil {
22117		c.header_ = make(http.Header)
22118	}
22119	return c.header_
22120}
22121
22122func (c *ProjectsLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
22123	reqHeaders := make(http.Header)
22124	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
22125	for k, v := range c.header_ {
22126		reqHeaders[k] = v
22127	}
22128	reqHeaders.Set("User-Agent", c.s.userAgent())
22129	var body io.Reader = nil
22130	c.urlParams_.Set("alt", alt)
22131	c.urlParams_.Set("prettyPrint", "false")
22132	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
22133	urls += "?" + c.urlParams_.Encode()
22134	req, err := http.NewRequest("DELETE", urls, body)
22135	if err != nil {
22136		return nil, err
22137	}
22138	req.Header = reqHeaders
22139	googleapi.Expand(req.URL, map[string]string{
22140		"name": c.name,
22141	})
22142	return gensupport.SendRequest(c.ctx_, c.s.client, req)
22143}
22144
22145// Do executes the "logging.projects.locations.buckets.delete" call.
22146// Exactly one of *Empty or error will be non-nil. Any non-2xx status
22147// code is an error. Response headers are in either
22148// *Empty.ServerResponse.Header or (if a response was returned at all)
22149// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
22150// check whether the returned error was because http.StatusNotModified
22151// was returned.
22152func (c *ProjectsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
22153	gensupport.SetOptions(c.urlParams_, opts...)
22154	res, err := c.doRequest("json")
22155	if res != nil && res.StatusCode == http.StatusNotModified {
22156		if res.Body != nil {
22157			res.Body.Close()
22158		}
22159		return nil, &googleapi.Error{
22160			Code:   res.StatusCode,
22161			Header: res.Header,
22162		}
22163	}
22164	if err != nil {
22165		return nil, err
22166	}
22167	defer googleapi.CloseBody(res)
22168	if err := googleapi.CheckResponse(res); err != nil {
22169		return nil, err
22170	}
22171	ret := &Empty{
22172		ServerResponse: googleapi.ServerResponse{
22173			Header:         res.Header,
22174			HTTPStatusCode: res.StatusCode,
22175		},
22176	}
22177	target := &ret
22178	if err := gensupport.DecodeResponse(target, res); err != nil {
22179		return nil, err
22180	}
22181	return ret, nil
22182	// {
22183	//   "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.",
22184	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}",
22185	//   "httpMethod": "DELETE",
22186	//   "id": "logging.projects.locations.buckets.delete",
22187	//   "parameterOrder": [
22188	//     "name"
22189	//   ],
22190	//   "parameters": {
22191	//     "name": {
22192	//       "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\".",
22193	//       "location": "path",
22194	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$",
22195	//       "required": true,
22196	//       "type": "string"
22197	//     }
22198	//   },
22199	//   "path": "v2/{+name}",
22200	//   "response": {
22201	//     "$ref": "Empty"
22202	//   },
22203	//   "scopes": [
22204	//     "https://www.googleapis.com/auth/cloud-platform",
22205	//     "https://www.googleapis.com/auth/logging.admin"
22206	//   ]
22207	// }
22208
22209}
22210
22211// method id "logging.projects.locations.buckets.get":
22212
22213type ProjectsLocationsBucketsGetCall struct {
22214	s            *Service
22215	name         string
22216	urlParams_   gensupport.URLParams
22217	ifNoneMatch_ string
22218	ctx_         context.Context
22219	header_      http.Header
22220}
22221
22222// Get: Gets a bucket.
22223//
22224// - name: The resource name of the bucket:
22225//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
22226//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
22227//   CKET_ID]"
22228//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
22229//   s/[BUCKET_ID]"
22230//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
22231//   Example:
22232//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id".
22233func (r *ProjectsLocationsBucketsService) Get(name string) *ProjectsLocationsBucketsGetCall {
22234	c := &ProjectsLocationsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
22235	c.name = name
22236	return c
22237}
22238
22239// Fields allows partial responses to be retrieved. See
22240// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
22241// for more information.
22242func (c *ProjectsLocationsBucketsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsGetCall {
22243	c.urlParams_.Set("fields", googleapi.CombineFields(s))
22244	return c
22245}
22246
22247// IfNoneMatch sets the optional parameter which makes the operation
22248// fail if the object's ETag matches the given value. This is useful for
22249// getting updates only after the object has changed since the last
22250// request. Use googleapi.IsNotModified to check whether the response
22251// error from Do is the result of In-None-Match.
22252func (c *ProjectsLocationsBucketsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsGetCall {
22253	c.ifNoneMatch_ = entityTag
22254	return c
22255}
22256
22257// Context sets the context to be used in this call's Do method. Any
22258// pending HTTP request will be aborted if the provided context is
22259// canceled.
22260func (c *ProjectsLocationsBucketsGetCall) Context(ctx context.Context) *ProjectsLocationsBucketsGetCall {
22261	c.ctx_ = ctx
22262	return c
22263}
22264
22265// Header returns an http.Header that can be modified by the caller to
22266// add HTTP headers to the request.
22267func (c *ProjectsLocationsBucketsGetCall) Header() http.Header {
22268	if c.header_ == nil {
22269		c.header_ = make(http.Header)
22270	}
22271	return c.header_
22272}
22273
22274func (c *ProjectsLocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) {
22275	reqHeaders := make(http.Header)
22276	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
22277	for k, v := range c.header_ {
22278		reqHeaders[k] = v
22279	}
22280	reqHeaders.Set("User-Agent", c.s.userAgent())
22281	if c.ifNoneMatch_ != "" {
22282		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
22283	}
22284	var body io.Reader = nil
22285	c.urlParams_.Set("alt", alt)
22286	c.urlParams_.Set("prettyPrint", "false")
22287	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
22288	urls += "?" + c.urlParams_.Encode()
22289	req, err := http.NewRequest("GET", urls, body)
22290	if err != nil {
22291		return nil, err
22292	}
22293	req.Header = reqHeaders
22294	googleapi.Expand(req.URL, map[string]string{
22295		"name": c.name,
22296	})
22297	return gensupport.SendRequest(c.ctx_, c.s.client, req)
22298}
22299
22300// Do executes the "logging.projects.locations.buckets.get" call.
22301// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
22302// status code is an error. Response headers are in either
22303// *LogBucket.ServerResponse.Header or (if a response was returned at
22304// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
22305// to check whether the returned error was because
22306// http.StatusNotModified was returned.
22307func (c *ProjectsLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
22308	gensupport.SetOptions(c.urlParams_, opts...)
22309	res, err := c.doRequest("json")
22310	if res != nil && res.StatusCode == http.StatusNotModified {
22311		if res.Body != nil {
22312			res.Body.Close()
22313		}
22314		return nil, &googleapi.Error{
22315			Code:   res.StatusCode,
22316			Header: res.Header,
22317		}
22318	}
22319	if err != nil {
22320		return nil, err
22321	}
22322	defer googleapi.CloseBody(res)
22323	if err := googleapi.CheckResponse(res); err != nil {
22324		return nil, err
22325	}
22326	ret := &LogBucket{
22327		ServerResponse: googleapi.ServerResponse{
22328			Header:         res.Header,
22329			HTTPStatusCode: res.StatusCode,
22330		},
22331	}
22332	target := &ret
22333	if err := gensupport.DecodeResponse(target, res); err != nil {
22334		return nil, err
22335	}
22336	return ret, nil
22337	// {
22338	//   "description": "Gets a bucket.",
22339	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}",
22340	//   "httpMethod": "GET",
22341	//   "id": "logging.projects.locations.buckets.get",
22342	//   "parameterOrder": [
22343	//     "name"
22344	//   ],
22345	//   "parameters": {
22346	//     "name": {
22347	//       "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\".",
22348	//       "location": "path",
22349	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$",
22350	//       "required": true,
22351	//       "type": "string"
22352	//     }
22353	//   },
22354	//   "path": "v2/{+name}",
22355	//   "response": {
22356	//     "$ref": "LogBucket"
22357	//   },
22358	//   "scopes": [
22359	//     "https://www.googleapis.com/auth/cloud-platform",
22360	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
22361	//     "https://www.googleapis.com/auth/logging.admin",
22362	//     "https://www.googleapis.com/auth/logging.read"
22363	//   ]
22364	// }
22365
22366}
22367
22368// method id "logging.projects.locations.buckets.list":
22369
22370type ProjectsLocationsBucketsListCall struct {
22371	s            *Service
22372	parent       string
22373	urlParams_   gensupport.URLParams
22374	ifNoneMatch_ string
22375	ctx_         context.Context
22376	header_      http.Header
22377}
22378
22379// List: Lists buckets.
22380//
22381// - parent: The parent resource whose buckets are to be listed:
22382//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
22383//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
22384//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
22385//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations
22386//   portion of the resource must be specified, but supplying the
22387//   character - in place of LOCATION_ID will return all buckets.
22388func (r *ProjectsLocationsBucketsService) List(parent string) *ProjectsLocationsBucketsListCall {
22389	c := &ProjectsLocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
22390	c.parent = parent
22391	return c
22392}
22393
22394// PageSize sets the optional parameter "pageSize": The maximum number
22395// of results to return from this request. Non-positive values are
22396// ignored. The presence of nextPageToken in the response indicates that
22397// more results might be available.
22398func (c *ProjectsLocationsBucketsListCall) PageSize(pageSize int64) *ProjectsLocationsBucketsListCall {
22399	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
22400	return c
22401}
22402
22403// PageToken sets the optional parameter "pageToken": If present, then
22404// retrieve the next batch of results from the preceding call to this
22405// method. pageToken must be the value of nextPageToken from the
22406// previous response. The values of other method parameters should be
22407// identical to those in the previous call.
22408func (c *ProjectsLocationsBucketsListCall) PageToken(pageToken string) *ProjectsLocationsBucketsListCall {
22409	c.urlParams_.Set("pageToken", pageToken)
22410	return c
22411}
22412
22413// Fields allows partial responses to be retrieved. See
22414// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
22415// for more information.
22416func (c *ProjectsLocationsBucketsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsListCall {
22417	c.urlParams_.Set("fields", googleapi.CombineFields(s))
22418	return c
22419}
22420
22421// IfNoneMatch sets the optional parameter which makes the operation
22422// fail if the object's ETag matches the given value. This is useful for
22423// getting updates only after the object has changed since the last
22424// request. Use googleapi.IsNotModified to check whether the response
22425// error from Do is the result of In-None-Match.
22426func (c *ProjectsLocationsBucketsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsListCall {
22427	c.ifNoneMatch_ = entityTag
22428	return c
22429}
22430
22431// Context sets the context to be used in this call's Do method. Any
22432// pending HTTP request will be aborted if the provided context is
22433// canceled.
22434func (c *ProjectsLocationsBucketsListCall) Context(ctx context.Context) *ProjectsLocationsBucketsListCall {
22435	c.ctx_ = ctx
22436	return c
22437}
22438
22439// Header returns an http.Header that can be modified by the caller to
22440// add HTTP headers to the request.
22441func (c *ProjectsLocationsBucketsListCall) Header() http.Header {
22442	if c.header_ == nil {
22443		c.header_ = make(http.Header)
22444	}
22445	return c.header_
22446}
22447
22448func (c *ProjectsLocationsBucketsListCall) doRequest(alt string) (*http.Response, error) {
22449	reqHeaders := make(http.Header)
22450	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
22451	for k, v := range c.header_ {
22452		reqHeaders[k] = v
22453	}
22454	reqHeaders.Set("User-Agent", c.s.userAgent())
22455	if c.ifNoneMatch_ != "" {
22456		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
22457	}
22458	var body io.Reader = nil
22459	c.urlParams_.Set("alt", alt)
22460	c.urlParams_.Set("prettyPrint", "false")
22461	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
22462	urls += "?" + c.urlParams_.Encode()
22463	req, err := http.NewRequest("GET", urls, body)
22464	if err != nil {
22465		return nil, err
22466	}
22467	req.Header = reqHeaders
22468	googleapi.Expand(req.URL, map[string]string{
22469		"parent": c.parent,
22470	})
22471	return gensupport.SendRequest(c.ctx_, c.s.client, req)
22472}
22473
22474// Do executes the "logging.projects.locations.buckets.list" call.
22475// Exactly one of *ListBucketsResponse or error will be non-nil. Any
22476// non-2xx status code is an error. Response headers are in either
22477// *ListBucketsResponse.ServerResponse.Header or (if a response was
22478// returned at all) in error.(*googleapi.Error).Header. Use
22479// googleapi.IsNotModified to check whether the returned error was
22480// because http.StatusNotModified was returned.
22481func (c *ProjectsLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) {
22482	gensupport.SetOptions(c.urlParams_, opts...)
22483	res, err := c.doRequest("json")
22484	if res != nil && res.StatusCode == http.StatusNotModified {
22485		if res.Body != nil {
22486			res.Body.Close()
22487		}
22488		return nil, &googleapi.Error{
22489			Code:   res.StatusCode,
22490			Header: res.Header,
22491		}
22492	}
22493	if err != nil {
22494		return nil, err
22495	}
22496	defer googleapi.CloseBody(res)
22497	if err := googleapi.CheckResponse(res); err != nil {
22498		return nil, err
22499	}
22500	ret := &ListBucketsResponse{
22501		ServerResponse: googleapi.ServerResponse{
22502			Header:         res.Header,
22503			HTTPStatusCode: res.StatusCode,
22504		},
22505	}
22506	target := &ret
22507	if err := gensupport.DecodeResponse(target, res); err != nil {
22508		return nil, err
22509	}
22510	return ret, nil
22511	// {
22512	//   "description": "Lists buckets.",
22513	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets",
22514	//   "httpMethod": "GET",
22515	//   "id": "logging.projects.locations.buckets.list",
22516	//   "parameterOrder": [
22517	//     "parent"
22518	//   ],
22519	//   "parameters": {
22520	//     "pageSize": {
22521	//       "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.",
22522	//       "format": "int32",
22523	//       "location": "query",
22524	//       "type": "integer"
22525	//     },
22526	//     "pageToken": {
22527	//       "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.",
22528	//       "location": "query",
22529	//       "type": "string"
22530	//     },
22531	//     "parent": {
22532	//       "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.",
22533	//       "location": "path",
22534	//       "pattern": "^projects/[^/]+/locations/[^/]+$",
22535	//       "required": true,
22536	//       "type": "string"
22537	//     }
22538	//   },
22539	//   "path": "v2/{+parent}/buckets",
22540	//   "response": {
22541	//     "$ref": "ListBucketsResponse"
22542	//   },
22543	//   "scopes": [
22544	//     "https://www.googleapis.com/auth/cloud-platform",
22545	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
22546	//     "https://www.googleapis.com/auth/logging.admin",
22547	//     "https://www.googleapis.com/auth/logging.read"
22548	//   ]
22549	// }
22550
22551}
22552
22553// Pages invokes f for each page of results.
22554// A non-nil error returned from f will halt the iteration.
22555// The provided context supersedes any context provided to the Context method.
22556func (c *ProjectsLocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error {
22557	c.ctx_ = ctx
22558	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
22559	for {
22560		x, err := c.Do()
22561		if err != nil {
22562			return err
22563		}
22564		if err := f(x); err != nil {
22565			return err
22566		}
22567		if x.NextPageToken == "" {
22568			return nil
22569		}
22570		c.PageToken(x.NextPageToken)
22571	}
22572}
22573
22574// method id "logging.projects.locations.buckets.patch":
22575
22576type ProjectsLocationsBucketsPatchCall struct {
22577	s          *Service
22578	name       string
22579	logbucket  *LogBucket
22580	urlParams_ gensupport.URLParams
22581	ctx_       context.Context
22582	header_    http.Header
22583}
22584
22585// Patch: Updates a bucket. This method replaces the following fields in
22586// the existing bucket with values from the new bucket:
22587// retention_periodIf the retention period is decreased and the bucket
22588// is locked, FAILED_PRECONDITION will be returned.If the bucket has a
22589// LifecycleState of DELETE_REQUESTED, FAILED_PRECONDITION will be
22590// returned.A buckets region may not be modified after it is created.
22591//
22592// - name: The full resource name of the bucket to update.
22593//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
22594//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
22595//   CKET_ID]"
22596//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
22597//   s/[BUCKET_ID]"
22598//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
22599//   Example:
22600//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id".
22601//    Also requires permission "resourcemanager.projects.updateLiens" to
22602//   set the locked property.
22603func (r *ProjectsLocationsBucketsService) Patch(name string, logbucket *LogBucket) *ProjectsLocationsBucketsPatchCall {
22604	c := &ProjectsLocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
22605	c.name = name
22606	c.logbucket = logbucket
22607	return c
22608}
22609
22610// UpdateMask sets the optional parameter "updateMask": Required. Field
22611// mask that specifies the fields in bucket that need an update. A
22612// bucket field will be overwritten if, and only if, it is in the update
22613// mask. name and output only fields cannot be updated.For a detailed
22614// FieldMask definition, see
22615// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
22616// updateMask=retention_days.
22617func (c *ProjectsLocationsBucketsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsBucketsPatchCall {
22618	c.urlParams_.Set("updateMask", updateMask)
22619	return c
22620}
22621
22622// Fields allows partial responses to be retrieved. See
22623// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
22624// for more information.
22625func (c *ProjectsLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsPatchCall {
22626	c.urlParams_.Set("fields", googleapi.CombineFields(s))
22627	return c
22628}
22629
22630// Context sets the context to be used in this call's Do method. Any
22631// pending HTTP request will be aborted if the provided context is
22632// canceled.
22633func (c *ProjectsLocationsBucketsPatchCall) Context(ctx context.Context) *ProjectsLocationsBucketsPatchCall {
22634	c.ctx_ = ctx
22635	return c
22636}
22637
22638// Header returns an http.Header that can be modified by the caller to
22639// add HTTP headers to the request.
22640func (c *ProjectsLocationsBucketsPatchCall) Header() http.Header {
22641	if c.header_ == nil {
22642		c.header_ = make(http.Header)
22643	}
22644	return c.header_
22645}
22646
22647func (c *ProjectsLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
22648	reqHeaders := make(http.Header)
22649	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
22650	for k, v := range c.header_ {
22651		reqHeaders[k] = v
22652	}
22653	reqHeaders.Set("User-Agent", c.s.userAgent())
22654	var body io.Reader = nil
22655	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
22656	if err != nil {
22657		return nil, err
22658	}
22659	reqHeaders.Set("Content-Type", "application/json")
22660	c.urlParams_.Set("alt", alt)
22661	c.urlParams_.Set("prettyPrint", "false")
22662	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
22663	urls += "?" + c.urlParams_.Encode()
22664	req, err := http.NewRequest("PATCH", urls, body)
22665	if err != nil {
22666		return nil, err
22667	}
22668	req.Header = reqHeaders
22669	googleapi.Expand(req.URL, map[string]string{
22670		"name": c.name,
22671	})
22672	return gensupport.SendRequest(c.ctx_, c.s.client, req)
22673}
22674
22675// Do executes the "logging.projects.locations.buckets.patch" call.
22676// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
22677// status code is an error. Response headers are in either
22678// *LogBucket.ServerResponse.Header or (if a response was returned at
22679// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
22680// to check whether the returned error was because
22681// http.StatusNotModified was returned.
22682func (c *ProjectsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
22683	gensupport.SetOptions(c.urlParams_, opts...)
22684	res, err := c.doRequest("json")
22685	if res != nil && res.StatusCode == http.StatusNotModified {
22686		if res.Body != nil {
22687			res.Body.Close()
22688		}
22689		return nil, &googleapi.Error{
22690			Code:   res.StatusCode,
22691			Header: res.Header,
22692		}
22693	}
22694	if err != nil {
22695		return nil, err
22696	}
22697	defer googleapi.CloseBody(res)
22698	if err := googleapi.CheckResponse(res); err != nil {
22699		return nil, err
22700	}
22701	ret := &LogBucket{
22702		ServerResponse: googleapi.ServerResponse{
22703			Header:         res.Header,
22704			HTTPStatusCode: res.StatusCode,
22705		},
22706	}
22707	target := &ret
22708	if err := gensupport.DecodeResponse(target, res); err != nil {
22709		return nil, err
22710	}
22711	return ret, nil
22712	// {
22713	//   "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.",
22714	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}",
22715	//   "httpMethod": "PATCH",
22716	//   "id": "logging.projects.locations.buckets.patch",
22717	//   "parameterOrder": [
22718	//     "name"
22719	//   ],
22720	//   "parameters": {
22721	//     "name": {
22722	//       "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",
22723	//       "location": "path",
22724	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$",
22725	//       "required": true,
22726	//       "type": "string"
22727	//     },
22728	//     "updateMask": {
22729	//       "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.",
22730	//       "format": "google-fieldmask",
22731	//       "location": "query",
22732	//       "type": "string"
22733	//     }
22734	//   },
22735	//   "path": "v2/{+name}",
22736	//   "request": {
22737	//     "$ref": "LogBucket"
22738	//   },
22739	//   "response": {
22740	//     "$ref": "LogBucket"
22741	//   },
22742	//   "scopes": [
22743	//     "https://www.googleapis.com/auth/cloud-platform",
22744	//     "https://www.googleapis.com/auth/logging.admin"
22745	//   ]
22746	// }
22747
22748}
22749
22750// method id "logging.projects.locations.buckets.undelete":
22751
22752type ProjectsLocationsBucketsUndeleteCall struct {
22753	s                     *Service
22754	name                  string
22755	undeletebucketrequest *UndeleteBucketRequest
22756	urlParams_            gensupport.URLParams
22757	ctx_                  context.Context
22758	header_               http.Header
22759}
22760
22761// Undelete: Undeletes a bucket. A bucket that has been deleted may be
22762// undeleted within the grace period of 7 days.
22763//
22764// - name: The full resource name of the bucket to undelete.
22765//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
22766//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
22767//   CKET_ID]"
22768//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
22769//   s/[BUCKET_ID]"
22770//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
22771//   Example:
22772//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id".
22773func (r *ProjectsLocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *ProjectsLocationsBucketsUndeleteCall {
22774	c := &ProjectsLocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
22775	c.name = name
22776	c.undeletebucketrequest = undeletebucketrequest
22777	return c
22778}
22779
22780// Fields allows partial responses to be retrieved. See
22781// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
22782// for more information.
22783func (c *ProjectsLocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsUndeleteCall {
22784	c.urlParams_.Set("fields", googleapi.CombineFields(s))
22785	return c
22786}
22787
22788// Context sets the context to be used in this call's Do method. Any
22789// pending HTTP request will be aborted if the provided context is
22790// canceled.
22791func (c *ProjectsLocationsBucketsUndeleteCall) Context(ctx context.Context) *ProjectsLocationsBucketsUndeleteCall {
22792	c.ctx_ = ctx
22793	return c
22794}
22795
22796// Header returns an http.Header that can be modified by the caller to
22797// add HTTP headers to the request.
22798func (c *ProjectsLocationsBucketsUndeleteCall) Header() http.Header {
22799	if c.header_ == nil {
22800		c.header_ = make(http.Header)
22801	}
22802	return c.header_
22803}
22804
22805func (c *ProjectsLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) {
22806	reqHeaders := make(http.Header)
22807	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
22808	for k, v := range c.header_ {
22809		reqHeaders[k] = v
22810	}
22811	reqHeaders.Set("User-Agent", c.s.userAgent())
22812	var body io.Reader = nil
22813	body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest)
22814	if err != nil {
22815		return nil, err
22816	}
22817	reqHeaders.Set("Content-Type", "application/json")
22818	c.urlParams_.Set("alt", alt)
22819	c.urlParams_.Set("prettyPrint", "false")
22820	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete")
22821	urls += "?" + c.urlParams_.Encode()
22822	req, err := http.NewRequest("POST", urls, body)
22823	if err != nil {
22824		return nil, err
22825	}
22826	req.Header = reqHeaders
22827	googleapi.Expand(req.URL, map[string]string{
22828		"name": c.name,
22829	})
22830	return gensupport.SendRequest(c.ctx_, c.s.client, req)
22831}
22832
22833// Do executes the "logging.projects.locations.buckets.undelete" call.
22834// Exactly one of *Empty or error will be non-nil. Any non-2xx status
22835// code is an error. Response headers are in either
22836// *Empty.ServerResponse.Header or (if a response was returned at all)
22837// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
22838// check whether the returned error was because http.StatusNotModified
22839// was returned.
22840func (c *ProjectsLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
22841	gensupport.SetOptions(c.urlParams_, opts...)
22842	res, err := c.doRequest("json")
22843	if res != nil && res.StatusCode == http.StatusNotModified {
22844		if res.Body != nil {
22845			res.Body.Close()
22846		}
22847		return nil, &googleapi.Error{
22848			Code:   res.StatusCode,
22849			Header: res.Header,
22850		}
22851	}
22852	if err != nil {
22853		return nil, err
22854	}
22855	defer googleapi.CloseBody(res)
22856	if err := googleapi.CheckResponse(res); err != nil {
22857		return nil, err
22858	}
22859	ret := &Empty{
22860		ServerResponse: googleapi.ServerResponse{
22861			Header:         res.Header,
22862			HTTPStatusCode: res.StatusCode,
22863		},
22864	}
22865	target := &ret
22866	if err := gensupport.DecodeResponse(target, res); err != nil {
22867		return nil, err
22868	}
22869	return ret, nil
22870	// {
22871	//   "description": "Undeletes a bucket. A bucket that has been deleted may be undeleted within the grace period of 7 days.",
22872	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}:undelete",
22873	//   "httpMethod": "POST",
22874	//   "id": "logging.projects.locations.buckets.undelete",
22875	//   "parameterOrder": [
22876	//     "name"
22877	//   ],
22878	//   "parameters": {
22879	//     "name": {
22880	//       "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\".",
22881	//       "location": "path",
22882	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$",
22883	//       "required": true,
22884	//       "type": "string"
22885	//     }
22886	//   },
22887	//   "path": "v2/{+name}:undelete",
22888	//   "request": {
22889	//     "$ref": "UndeleteBucketRequest"
22890	//   },
22891	//   "response": {
22892	//     "$ref": "Empty"
22893	//   },
22894	//   "scopes": [
22895	//     "https://www.googleapis.com/auth/cloud-platform",
22896	//     "https://www.googleapis.com/auth/logging.admin"
22897	//   ]
22898	// }
22899
22900}
22901
22902// method id "logging.projects.locations.buckets.views.create":
22903
22904type ProjectsLocationsBucketsViewsCreateCall struct {
22905	s          *Service
22906	parent     string
22907	logview    *LogView
22908	urlParams_ gensupport.URLParams
22909	ctx_       context.Context
22910	header_    http.Header
22911}
22912
22913// Create: Creates a view over logs in a bucket. A bucket may contain a
22914// maximum of 50 views.
22915//
22916// - parent: The bucket in which to create the view
22917//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
22918//   Example:
22919//   "projects/my-logging-project/locations/my-location/buckets/my-bucket
22920//   ".
22921func (r *ProjectsLocationsBucketsViewsService) Create(parent string, logview *LogView) *ProjectsLocationsBucketsViewsCreateCall {
22922	c := &ProjectsLocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
22923	c.parent = parent
22924	c.logview = logview
22925	return c
22926}
22927
22928// ViewId sets the optional parameter "viewId": Required. The id to use
22929// for this view.
22930func (c *ProjectsLocationsBucketsViewsCreateCall) ViewId(viewId string) *ProjectsLocationsBucketsViewsCreateCall {
22931	c.urlParams_.Set("viewId", viewId)
22932	return c
22933}
22934
22935// Fields allows partial responses to be retrieved. See
22936// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
22937// for more information.
22938func (c *ProjectsLocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsCreateCall {
22939	c.urlParams_.Set("fields", googleapi.CombineFields(s))
22940	return c
22941}
22942
22943// Context sets the context to be used in this call's Do method. Any
22944// pending HTTP request will be aborted if the provided context is
22945// canceled.
22946func (c *ProjectsLocationsBucketsViewsCreateCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsCreateCall {
22947	c.ctx_ = ctx
22948	return c
22949}
22950
22951// Header returns an http.Header that can be modified by the caller to
22952// add HTTP headers to the request.
22953func (c *ProjectsLocationsBucketsViewsCreateCall) Header() http.Header {
22954	if c.header_ == nil {
22955		c.header_ = make(http.Header)
22956	}
22957	return c.header_
22958}
22959
22960func (c *ProjectsLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) {
22961	reqHeaders := make(http.Header)
22962	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
22963	for k, v := range c.header_ {
22964		reqHeaders[k] = v
22965	}
22966	reqHeaders.Set("User-Agent", c.s.userAgent())
22967	var body io.Reader = nil
22968	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
22969	if err != nil {
22970		return nil, err
22971	}
22972	reqHeaders.Set("Content-Type", "application/json")
22973	c.urlParams_.Set("alt", alt)
22974	c.urlParams_.Set("prettyPrint", "false")
22975	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
22976	urls += "?" + c.urlParams_.Encode()
22977	req, err := http.NewRequest("POST", urls, body)
22978	if err != nil {
22979		return nil, err
22980	}
22981	req.Header = reqHeaders
22982	googleapi.Expand(req.URL, map[string]string{
22983		"parent": c.parent,
22984	})
22985	return gensupport.SendRequest(c.ctx_, c.s.client, req)
22986}
22987
22988// Do executes the "logging.projects.locations.buckets.views.create" call.
22989// Exactly one of *LogView or error will be non-nil. Any non-2xx status
22990// code is an error. Response headers are in either
22991// *LogView.ServerResponse.Header or (if a response was returned at all)
22992// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
22993// check whether the returned error was because http.StatusNotModified
22994// was returned.
22995func (c *ProjectsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
22996	gensupport.SetOptions(c.urlParams_, opts...)
22997	res, err := c.doRequest("json")
22998	if res != nil && res.StatusCode == http.StatusNotModified {
22999		if res.Body != nil {
23000			res.Body.Close()
23001		}
23002		return nil, &googleapi.Error{
23003			Code:   res.StatusCode,
23004			Header: res.Header,
23005		}
23006	}
23007	if err != nil {
23008		return nil, err
23009	}
23010	defer googleapi.CloseBody(res)
23011	if err := googleapi.CheckResponse(res); err != nil {
23012		return nil, err
23013	}
23014	ret := &LogView{
23015		ServerResponse: googleapi.ServerResponse{
23016			Header:         res.Header,
23017			HTTPStatusCode: res.StatusCode,
23018		},
23019	}
23020	target := &ret
23021	if err := gensupport.DecodeResponse(target, res); err != nil {
23022		return nil, err
23023	}
23024	return ret, nil
23025	// {
23026	//   "description": "Creates a view over logs in a bucket. A bucket may contain a maximum of 50 views.",
23027	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views",
23028	//   "httpMethod": "POST",
23029	//   "id": "logging.projects.locations.buckets.views.create",
23030	//   "parameterOrder": [
23031	//     "parent"
23032	//   ],
23033	//   "parameters": {
23034	//     "parent": {
23035	//       "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\"",
23036	//       "location": "path",
23037	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$",
23038	//       "required": true,
23039	//       "type": "string"
23040	//     },
23041	//     "viewId": {
23042	//       "description": "Required. The id to use for this view.",
23043	//       "location": "query",
23044	//       "type": "string"
23045	//     }
23046	//   },
23047	//   "path": "v2/{+parent}/views",
23048	//   "request": {
23049	//     "$ref": "LogView"
23050	//   },
23051	//   "response": {
23052	//     "$ref": "LogView"
23053	//   },
23054	//   "scopes": [
23055	//     "https://www.googleapis.com/auth/cloud-platform",
23056	//     "https://www.googleapis.com/auth/logging.admin"
23057	//   ]
23058	// }
23059
23060}
23061
23062// method id "logging.projects.locations.buckets.views.delete":
23063
23064type ProjectsLocationsBucketsViewsDeleteCall struct {
23065	s          *Service
23066	name       string
23067	urlParams_ gensupport.URLParams
23068	ctx_       context.Context
23069	header_    http.Header
23070}
23071
23072// Delete: Deletes a view from a bucket.
23073//
23074// - name: The full resource name of the view to delete:
23075//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
23076//   iews/[VIEW_ID]" Example:
23077//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id/v
23078//   iews/my-view-id".
23079func (r *ProjectsLocationsBucketsViewsService) Delete(name string) *ProjectsLocationsBucketsViewsDeleteCall {
23080	c := &ProjectsLocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
23081	c.name = name
23082	return c
23083}
23084
23085// Fields allows partial responses to be retrieved. See
23086// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
23087// for more information.
23088func (c *ProjectsLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsDeleteCall {
23089	c.urlParams_.Set("fields", googleapi.CombineFields(s))
23090	return c
23091}
23092
23093// Context sets the context to be used in this call's Do method. Any
23094// pending HTTP request will be aborted if the provided context is
23095// canceled.
23096func (c *ProjectsLocationsBucketsViewsDeleteCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsDeleteCall {
23097	c.ctx_ = ctx
23098	return c
23099}
23100
23101// Header returns an http.Header that can be modified by the caller to
23102// add HTTP headers to the request.
23103func (c *ProjectsLocationsBucketsViewsDeleteCall) Header() http.Header {
23104	if c.header_ == nil {
23105		c.header_ = make(http.Header)
23106	}
23107	return c.header_
23108}
23109
23110func (c *ProjectsLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) {
23111	reqHeaders := make(http.Header)
23112	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
23113	for k, v := range c.header_ {
23114		reqHeaders[k] = v
23115	}
23116	reqHeaders.Set("User-Agent", c.s.userAgent())
23117	var body io.Reader = nil
23118	c.urlParams_.Set("alt", alt)
23119	c.urlParams_.Set("prettyPrint", "false")
23120	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
23121	urls += "?" + c.urlParams_.Encode()
23122	req, err := http.NewRequest("DELETE", urls, body)
23123	if err != nil {
23124		return nil, err
23125	}
23126	req.Header = reqHeaders
23127	googleapi.Expand(req.URL, map[string]string{
23128		"name": c.name,
23129	})
23130	return gensupport.SendRequest(c.ctx_, c.s.client, req)
23131}
23132
23133// Do executes the "logging.projects.locations.buckets.views.delete" call.
23134// Exactly one of *Empty or error will be non-nil. Any non-2xx status
23135// code is an error. Response headers are in either
23136// *Empty.ServerResponse.Header or (if a response was returned at all)
23137// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
23138// check whether the returned error was because http.StatusNotModified
23139// was returned.
23140func (c *ProjectsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
23141	gensupport.SetOptions(c.urlParams_, opts...)
23142	res, err := c.doRequest("json")
23143	if res != nil && res.StatusCode == http.StatusNotModified {
23144		if res.Body != nil {
23145			res.Body.Close()
23146		}
23147		return nil, &googleapi.Error{
23148			Code:   res.StatusCode,
23149			Header: res.Header,
23150		}
23151	}
23152	if err != nil {
23153		return nil, err
23154	}
23155	defer googleapi.CloseBody(res)
23156	if err := googleapi.CheckResponse(res); err != nil {
23157		return nil, err
23158	}
23159	ret := &Empty{
23160		ServerResponse: googleapi.ServerResponse{
23161			Header:         res.Header,
23162			HTTPStatusCode: res.StatusCode,
23163		},
23164	}
23165	target := &ret
23166	if err := gensupport.DecodeResponse(target, res); err != nil {
23167		return nil, err
23168	}
23169	return ret, nil
23170	// {
23171	//   "description": "Deletes a view from a bucket.",
23172	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
23173	//   "httpMethod": "DELETE",
23174	//   "id": "logging.projects.locations.buckets.views.delete",
23175	//   "parameterOrder": [
23176	//     "name"
23177	//   ],
23178	//   "parameters": {
23179	//     "name": {
23180	//       "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\".",
23181	//       "location": "path",
23182	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
23183	//       "required": true,
23184	//       "type": "string"
23185	//     }
23186	//   },
23187	//   "path": "v2/{+name}",
23188	//   "response": {
23189	//     "$ref": "Empty"
23190	//   },
23191	//   "scopes": [
23192	//     "https://www.googleapis.com/auth/cloud-platform",
23193	//     "https://www.googleapis.com/auth/logging.admin"
23194	//   ]
23195	// }
23196
23197}
23198
23199// method id "logging.projects.locations.buckets.views.get":
23200
23201type ProjectsLocationsBucketsViewsGetCall struct {
23202	s            *Service
23203	name         string
23204	urlParams_   gensupport.URLParams
23205	ifNoneMatch_ string
23206	ctx_         context.Context
23207	header_      http.Header
23208}
23209
23210// Get: Gets a view.
23211//
23212// - name: The resource name of the policy:
23213//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
23214//   iews/[VIEW_ID]" Example:
23215//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id/v
23216//   iews/my-view-id".
23217func (r *ProjectsLocationsBucketsViewsService) Get(name string) *ProjectsLocationsBucketsViewsGetCall {
23218	c := &ProjectsLocationsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
23219	c.name = name
23220	return c
23221}
23222
23223// Fields allows partial responses to be retrieved. See
23224// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
23225// for more information.
23226func (c *ProjectsLocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsGetCall {
23227	c.urlParams_.Set("fields", googleapi.CombineFields(s))
23228	return c
23229}
23230
23231// IfNoneMatch sets the optional parameter which makes the operation
23232// fail if the object's ETag matches the given value. This is useful for
23233// getting updates only after the object has changed since the last
23234// request. Use googleapi.IsNotModified to check whether the response
23235// error from Do is the result of In-None-Match.
23236func (c *ProjectsLocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsViewsGetCall {
23237	c.ifNoneMatch_ = entityTag
23238	return c
23239}
23240
23241// Context sets the context to be used in this call's Do method. Any
23242// pending HTTP request will be aborted if the provided context is
23243// canceled.
23244func (c *ProjectsLocationsBucketsViewsGetCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsGetCall {
23245	c.ctx_ = ctx
23246	return c
23247}
23248
23249// Header returns an http.Header that can be modified by the caller to
23250// add HTTP headers to the request.
23251func (c *ProjectsLocationsBucketsViewsGetCall) Header() http.Header {
23252	if c.header_ == nil {
23253		c.header_ = make(http.Header)
23254	}
23255	return c.header_
23256}
23257
23258func (c *ProjectsLocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) {
23259	reqHeaders := make(http.Header)
23260	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
23261	for k, v := range c.header_ {
23262		reqHeaders[k] = v
23263	}
23264	reqHeaders.Set("User-Agent", c.s.userAgent())
23265	if c.ifNoneMatch_ != "" {
23266		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
23267	}
23268	var body io.Reader = nil
23269	c.urlParams_.Set("alt", alt)
23270	c.urlParams_.Set("prettyPrint", "false")
23271	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
23272	urls += "?" + c.urlParams_.Encode()
23273	req, err := http.NewRequest("GET", urls, body)
23274	if err != nil {
23275		return nil, err
23276	}
23277	req.Header = reqHeaders
23278	googleapi.Expand(req.URL, map[string]string{
23279		"name": c.name,
23280	})
23281	return gensupport.SendRequest(c.ctx_, c.s.client, req)
23282}
23283
23284// Do executes the "logging.projects.locations.buckets.views.get" call.
23285// Exactly one of *LogView or error will be non-nil. Any non-2xx status
23286// code is an error. Response headers are in either
23287// *LogView.ServerResponse.Header or (if a response was returned at all)
23288// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
23289// check whether the returned error was because http.StatusNotModified
23290// was returned.
23291func (c *ProjectsLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
23292	gensupport.SetOptions(c.urlParams_, opts...)
23293	res, err := c.doRequest("json")
23294	if res != nil && res.StatusCode == http.StatusNotModified {
23295		if res.Body != nil {
23296			res.Body.Close()
23297		}
23298		return nil, &googleapi.Error{
23299			Code:   res.StatusCode,
23300			Header: res.Header,
23301		}
23302	}
23303	if err != nil {
23304		return nil, err
23305	}
23306	defer googleapi.CloseBody(res)
23307	if err := googleapi.CheckResponse(res); err != nil {
23308		return nil, err
23309	}
23310	ret := &LogView{
23311		ServerResponse: googleapi.ServerResponse{
23312			Header:         res.Header,
23313			HTTPStatusCode: res.StatusCode,
23314		},
23315	}
23316	target := &ret
23317	if err := gensupport.DecodeResponse(target, res); err != nil {
23318		return nil, err
23319	}
23320	return ret, nil
23321	// {
23322	//   "description": "Gets a view.",
23323	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
23324	//   "httpMethod": "GET",
23325	//   "id": "logging.projects.locations.buckets.views.get",
23326	//   "parameterOrder": [
23327	//     "name"
23328	//   ],
23329	//   "parameters": {
23330	//     "name": {
23331	//       "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\".",
23332	//       "location": "path",
23333	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
23334	//       "required": true,
23335	//       "type": "string"
23336	//     }
23337	//   },
23338	//   "path": "v2/{+name}",
23339	//   "response": {
23340	//     "$ref": "LogView"
23341	//   },
23342	//   "scopes": [
23343	//     "https://www.googleapis.com/auth/cloud-platform",
23344	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
23345	//     "https://www.googleapis.com/auth/logging.admin",
23346	//     "https://www.googleapis.com/auth/logging.read"
23347	//   ]
23348	// }
23349
23350}
23351
23352// method id "logging.projects.locations.buckets.views.list":
23353
23354type ProjectsLocationsBucketsViewsListCall struct {
23355	s            *Service
23356	parent       string
23357	urlParams_   gensupport.URLParams
23358	ifNoneMatch_ string
23359	ctx_         context.Context
23360	header_      http.Header
23361}
23362
23363// List: Lists views on a bucket.
23364//
23365// - parent: The bucket whose views are to be listed:
23366//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]".
23367func (r *ProjectsLocationsBucketsViewsService) List(parent string) *ProjectsLocationsBucketsViewsListCall {
23368	c := &ProjectsLocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
23369	c.parent = parent
23370	return c
23371}
23372
23373// PageSize sets the optional parameter "pageSize": The maximum number
23374// of results to return from this request. Non-positive values are
23375// ignored. The presence of nextPageToken in the response indicates that
23376// more results might be available.
23377func (c *ProjectsLocationsBucketsViewsListCall) PageSize(pageSize int64) *ProjectsLocationsBucketsViewsListCall {
23378	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
23379	return c
23380}
23381
23382// PageToken sets the optional parameter "pageToken": If present, then
23383// retrieve the next batch of results from the preceding call to this
23384// method. pageToken must be the value of nextPageToken from the
23385// previous response. The values of other method parameters should be
23386// identical to those in the previous call.
23387func (c *ProjectsLocationsBucketsViewsListCall) PageToken(pageToken string) *ProjectsLocationsBucketsViewsListCall {
23388	c.urlParams_.Set("pageToken", pageToken)
23389	return c
23390}
23391
23392// Fields allows partial responses to be retrieved. See
23393// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
23394// for more information.
23395func (c *ProjectsLocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsListCall {
23396	c.urlParams_.Set("fields", googleapi.CombineFields(s))
23397	return c
23398}
23399
23400// IfNoneMatch sets the optional parameter which makes the operation
23401// fail if the object's ETag matches the given value. This is useful for
23402// getting updates only after the object has changed since the last
23403// request. Use googleapi.IsNotModified to check whether the response
23404// error from Do is the result of In-None-Match.
23405func (c *ProjectsLocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsViewsListCall {
23406	c.ifNoneMatch_ = entityTag
23407	return c
23408}
23409
23410// Context sets the context to be used in this call's Do method. Any
23411// pending HTTP request will be aborted if the provided context is
23412// canceled.
23413func (c *ProjectsLocationsBucketsViewsListCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsListCall {
23414	c.ctx_ = ctx
23415	return c
23416}
23417
23418// Header returns an http.Header that can be modified by the caller to
23419// add HTTP headers to the request.
23420func (c *ProjectsLocationsBucketsViewsListCall) Header() http.Header {
23421	if c.header_ == nil {
23422		c.header_ = make(http.Header)
23423	}
23424	return c.header_
23425}
23426
23427func (c *ProjectsLocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) {
23428	reqHeaders := make(http.Header)
23429	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
23430	for k, v := range c.header_ {
23431		reqHeaders[k] = v
23432	}
23433	reqHeaders.Set("User-Agent", c.s.userAgent())
23434	if c.ifNoneMatch_ != "" {
23435		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
23436	}
23437	var body io.Reader = nil
23438	c.urlParams_.Set("alt", alt)
23439	c.urlParams_.Set("prettyPrint", "false")
23440	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
23441	urls += "?" + c.urlParams_.Encode()
23442	req, err := http.NewRequest("GET", urls, body)
23443	if err != nil {
23444		return nil, err
23445	}
23446	req.Header = reqHeaders
23447	googleapi.Expand(req.URL, map[string]string{
23448		"parent": c.parent,
23449	})
23450	return gensupport.SendRequest(c.ctx_, c.s.client, req)
23451}
23452
23453// Do executes the "logging.projects.locations.buckets.views.list" call.
23454// Exactly one of *ListViewsResponse or error will be non-nil. Any
23455// non-2xx status code is an error. Response headers are in either
23456// *ListViewsResponse.ServerResponse.Header or (if a response was
23457// returned at all) in error.(*googleapi.Error).Header. Use
23458// googleapi.IsNotModified to check whether the returned error was
23459// because http.StatusNotModified was returned.
23460func (c *ProjectsLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) {
23461	gensupport.SetOptions(c.urlParams_, opts...)
23462	res, err := c.doRequest("json")
23463	if res != nil && res.StatusCode == http.StatusNotModified {
23464		if res.Body != nil {
23465			res.Body.Close()
23466		}
23467		return nil, &googleapi.Error{
23468			Code:   res.StatusCode,
23469			Header: res.Header,
23470		}
23471	}
23472	if err != nil {
23473		return nil, err
23474	}
23475	defer googleapi.CloseBody(res)
23476	if err := googleapi.CheckResponse(res); err != nil {
23477		return nil, err
23478	}
23479	ret := &ListViewsResponse{
23480		ServerResponse: googleapi.ServerResponse{
23481			Header:         res.Header,
23482			HTTPStatusCode: res.StatusCode,
23483		},
23484	}
23485	target := &ret
23486	if err := gensupport.DecodeResponse(target, res); err != nil {
23487		return nil, err
23488	}
23489	return ret, nil
23490	// {
23491	//   "description": "Lists views on a bucket.",
23492	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views",
23493	//   "httpMethod": "GET",
23494	//   "id": "logging.projects.locations.buckets.views.list",
23495	//   "parameterOrder": [
23496	//     "parent"
23497	//   ],
23498	//   "parameters": {
23499	//     "pageSize": {
23500	//       "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.",
23501	//       "format": "int32",
23502	//       "location": "query",
23503	//       "type": "integer"
23504	//     },
23505	//     "pageToken": {
23506	//       "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.",
23507	//       "location": "query",
23508	//       "type": "string"
23509	//     },
23510	//     "parent": {
23511	//       "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ",
23512	//       "location": "path",
23513	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$",
23514	//       "required": true,
23515	//       "type": "string"
23516	//     }
23517	//   },
23518	//   "path": "v2/{+parent}/views",
23519	//   "response": {
23520	//     "$ref": "ListViewsResponse"
23521	//   },
23522	//   "scopes": [
23523	//     "https://www.googleapis.com/auth/cloud-platform",
23524	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
23525	//     "https://www.googleapis.com/auth/logging.admin",
23526	//     "https://www.googleapis.com/auth/logging.read"
23527	//   ]
23528	// }
23529
23530}
23531
23532// Pages invokes f for each page of results.
23533// A non-nil error returned from f will halt the iteration.
23534// The provided context supersedes any context provided to the Context method.
23535func (c *ProjectsLocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error {
23536	c.ctx_ = ctx
23537	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
23538	for {
23539		x, err := c.Do()
23540		if err != nil {
23541			return err
23542		}
23543		if err := f(x); err != nil {
23544			return err
23545		}
23546		if x.NextPageToken == "" {
23547			return nil
23548		}
23549		c.PageToken(x.NextPageToken)
23550	}
23551}
23552
23553// method id "logging.projects.locations.buckets.views.patch":
23554
23555type ProjectsLocationsBucketsViewsPatchCall struct {
23556	s          *Service
23557	name       string
23558	logview    *LogView
23559	urlParams_ gensupport.URLParams
23560	ctx_       context.Context
23561	header_    http.Header
23562}
23563
23564// Patch: Updates a view. This method replaces the following fields in
23565// the existing view with values from the new view: filter.
23566//
23567// - name: The full resource name of the view to update
23568//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
23569//   iews/[VIEW_ID]" Example:
23570//   "projects/my-project-id/locations/my-location/buckets/my-bucket-id/v
23571//   iews/my-view-id".
23572func (r *ProjectsLocationsBucketsViewsService) Patch(name string, logview *LogView) *ProjectsLocationsBucketsViewsPatchCall {
23573	c := &ProjectsLocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
23574	c.name = name
23575	c.logview = logview
23576	return c
23577}
23578
23579// UpdateMask sets the optional parameter "updateMask": Field mask that
23580// specifies the fields in view that need an update. A field will be
23581// overwritten if, and only if, it is in the update mask. name and
23582// output only fields cannot be updated.For a detailed FieldMask
23583// definition, see
23584// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
23585// updateMask=filter.
23586func (c *ProjectsLocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsBucketsViewsPatchCall {
23587	c.urlParams_.Set("updateMask", updateMask)
23588	return c
23589}
23590
23591// Fields allows partial responses to be retrieved. See
23592// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
23593// for more information.
23594func (c *ProjectsLocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsPatchCall {
23595	c.urlParams_.Set("fields", googleapi.CombineFields(s))
23596	return c
23597}
23598
23599// Context sets the context to be used in this call's Do method. Any
23600// pending HTTP request will be aborted if the provided context is
23601// canceled.
23602func (c *ProjectsLocationsBucketsViewsPatchCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsPatchCall {
23603	c.ctx_ = ctx
23604	return c
23605}
23606
23607// Header returns an http.Header that can be modified by the caller to
23608// add HTTP headers to the request.
23609func (c *ProjectsLocationsBucketsViewsPatchCall) Header() http.Header {
23610	if c.header_ == nil {
23611		c.header_ = make(http.Header)
23612	}
23613	return c.header_
23614}
23615
23616func (c *ProjectsLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) {
23617	reqHeaders := make(http.Header)
23618	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
23619	for k, v := range c.header_ {
23620		reqHeaders[k] = v
23621	}
23622	reqHeaders.Set("User-Agent", c.s.userAgent())
23623	var body io.Reader = nil
23624	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
23625	if err != nil {
23626		return nil, err
23627	}
23628	reqHeaders.Set("Content-Type", "application/json")
23629	c.urlParams_.Set("alt", alt)
23630	c.urlParams_.Set("prettyPrint", "false")
23631	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
23632	urls += "?" + c.urlParams_.Encode()
23633	req, err := http.NewRequest("PATCH", urls, body)
23634	if err != nil {
23635		return nil, err
23636	}
23637	req.Header = reqHeaders
23638	googleapi.Expand(req.URL, map[string]string{
23639		"name": c.name,
23640	})
23641	return gensupport.SendRequest(c.ctx_, c.s.client, req)
23642}
23643
23644// Do executes the "logging.projects.locations.buckets.views.patch" call.
23645// Exactly one of *LogView or error will be non-nil. Any non-2xx status
23646// code is an error. Response headers are in either
23647// *LogView.ServerResponse.Header or (if a response was returned at all)
23648// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
23649// check whether the returned error was because http.StatusNotModified
23650// was returned.
23651func (c *ProjectsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
23652	gensupport.SetOptions(c.urlParams_, opts...)
23653	res, err := c.doRequest("json")
23654	if res != nil && res.StatusCode == http.StatusNotModified {
23655		if res.Body != nil {
23656			res.Body.Close()
23657		}
23658		return nil, &googleapi.Error{
23659			Code:   res.StatusCode,
23660			Header: res.Header,
23661		}
23662	}
23663	if err != nil {
23664		return nil, err
23665	}
23666	defer googleapi.CloseBody(res)
23667	if err := googleapi.CheckResponse(res); err != nil {
23668		return nil, err
23669	}
23670	ret := &LogView{
23671		ServerResponse: googleapi.ServerResponse{
23672			Header:         res.Header,
23673			HTTPStatusCode: res.StatusCode,
23674		},
23675	}
23676	target := &ret
23677	if err := gensupport.DecodeResponse(target, res); err != nil {
23678		return nil, err
23679	}
23680	return ret, nil
23681	// {
23682	//   "description": "Updates a view. This method replaces the following fields in the existing view with values from the new view: filter.",
23683	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
23684	//   "httpMethod": "PATCH",
23685	//   "id": "logging.projects.locations.buckets.views.patch",
23686	//   "parameterOrder": [
23687	//     "name"
23688	//   ],
23689	//   "parameters": {
23690	//     "name": {
23691	//       "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\".",
23692	//       "location": "path",
23693	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
23694	//       "required": true,
23695	//       "type": "string"
23696	//     },
23697	//     "updateMask": {
23698	//       "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.",
23699	//       "format": "google-fieldmask",
23700	//       "location": "query",
23701	//       "type": "string"
23702	//     }
23703	//   },
23704	//   "path": "v2/{+name}",
23705	//   "request": {
23706	//     "$ref": "LogView"
23707	//   },
23708	//   "response": {
23709	//     "$ref": "LogView"
23710	//   },
23711	//   "scopes": [
23712	//     "https://www.googleapis.com/auth/cloud-platform",
23713	//     "https://www.googleapis.com/auth/logging.admin"
23714	//   ]
23715	// }
23716
23717}
23718
23719// method id "logging.projects.logs.delete":
23720
23721type ProjectsLogsDeleteCall struct {
23722	s          *Service
23723	logName    string
23724	urlParams_ gensupport.URLParams
23725	ctx_       context.Context
23726	header_    http.Header
23727}
23728
23729// Delete: Deletes all the log entries in a log for the _Default Log
23730// Bucket. The log reappears if it receives new entries. Log entries
23731// written shortly before the delete operation might not be deleted.
23732// Entries received after the delete operation with a timestamp before
23733// the operation will be deleted.
23734//
23735// - logName: The resource name of the log to delete:
23736//   projects/[PROJECT_ID]/logs/[LOG_ID]
23737//   organizations/[ORGANIZATION_ID]/logs/[LOG_ID]
23738//   billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]
23739//   folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For
23740//   example, "projects/my-project-id/logs/syslog",
23741//   "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For
23742//   more information about log names, see LogEntry.
23743func (r *ProjectsLogsService) Delete(logName string) *ProjectsLogsDeleteCall {
23744	c := &ProjectsLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
23745	c.logName = logName
23746	return c
23747}
23748
23749// Fields allows partial responses to be retrieved. See
23750// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
23751// for more information.
23752func (c *ProjectsLogsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLogsDeleteCall {
23753	c.urlParams_.Set("fields", googleapi.CombineFields(s))
23754	return c
23755}
23756
23757// Context sets the context to be used in this call's Do method. Any
23758// pending HTTP request will be aborted if the provided context is
23759// canceled.
23760func (c *ProjectsLogsDeleteCall) Context(ctx context.Context) *ProjectsLogsDeleteCall {
23761	c.ctx_ = ctx
23762	return c
23763}
23764
23765// Header returns an http.Header that can be modified by the caller to
23766// add HTTP headers to the request.
23767func (c *ProjectsLogsDeleteCall) Header() http.Header {
23768	if c.header_ == nil {
23769		c.header_ = make(http.Header)
23770	}
23771	return c.header_
23772}
23773
23774func (c *ProjectsLogsDeleteCall) doRequest(alt string) (*http.Response, error) {
23775	reqHeaders := make(http.Header)
23776	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
23777	for k, v := range c.header_ {
23778		reqHeaders[k] = v
23779	}
23780	reqHeaders.Set("User-Agent", c.s.userAgent())
23781	var body io.Reader = nil
23782	c.urlParams_.Set("alt", alt)
23783	c.urlParams_.Set("prettyPrint", "false")
23784	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}")
23785	urls += "?" + c.urlParams_.Encode()
23786	req, err := http.NewRequest("DELETE", urls, body)
23787	if err != nil {
23788		return nil, err
23789	}
23790	req.Header = reqHeaders
23791	googleapi.Expand(req.URL, map[string]string{
23792		"logName": c.logName,
23793	})
23794	return gensupport.SendRequest(c.ctx_, c.s.client, req)
23795}
23796
23797// Do executes the "logging.projects.logs.delete" call.
23798// Exactly one of *Empty or error will be non-nil. Any non-2xx status
23799// code is an error. Response headers are in either
23800// *Empty.ServerResponse.Header or (if a response was returned at all)
23801// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
23802// check whether the returned error was because http.StatusNotModified
23803// was returned.
23804func (c *ProjectsLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
23805	gensupport.SetOptions(c.urlParams_, opts...)
23806	res, err := c.doRequest("json")
23807	if res != nil && res.StatusCode == http.StatusNotModified {
23808		if res.Body != nil {
23809			res.Body.Close()
23810		}
23811		return nil, &googleapi.Error{
23812			Code:   res.StatusCode,
23813			Header: res.Header,
23814		}
23815	}
23816	if err != nil {
23817		return nil, err
23818	}
23819	defer googleapi.CloseBody(res)
23820	if err := googleapi.CheckResponse(res); err != nil {
23821		return nil, err
23822	}
23823	ret := &Empty{
23824		ServerResponse: googleapi.ServerResponse{
23825			Header:         res.Header,
23826			HTTPStatusCode: res.StatusCode,
23827		},
23828	}
23829	target := &ret
23830	if err := gensupport.DecodeResponse(target, res); err != nil {
23831		return nil, err
23832	}
23833	return ret, nil
23834	// {
23835	//   "description": "Deletes all the log entries in a log for the _Default Log Bucket. 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.",
23836	//   "flatPath": "v2/projects/{projectsId}/logs/{logsId}",
23837	//   "httpMethod": "DELETE",
23838	//   "id": "logging.projects.logs.delete",
23839	//   "parameterOrder": [
23840	//     "logName"
23841	//   ],
23842	//   "parameters": {
23843	//     "logName": {
23844	//       "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/123/logs/cloudaudit.googleapis.com%2Factivity\".For more information about log names, see LogEntry.",
23845	//       "location": "path",
23846	//       "pattern": "^projects/[^/]+/logs/[^/]+$",
23847	//       "required": true,
23848	//       "type": "string"
23849	//     }
23850	//   },
23851	//   "path": "v2/{+logName}",
23852	//   "response": {
23853	//     "$ref": "Empty"
23854	//   },
23855	//   "scopes": [
23856	//     "https://www.googleapis.com/auth/cloud-platform",
23857	//     "https://www.googleapis.com/auth/logging.admin"
23858	//   ]
23859	// }
23860
23861}
23862
23863// method id "logging.projects.logs.list":
23864
23865type ProjectsLogsListCall struct {
23866	s            *Service
23867	parent       string
23868	urlParams_   gensupport.URLParams
23869	ifNoneMatch_ string
23870	ctx_         context.Context
23871	header_      http.Header
23872}
23873
23874// List: Lists the logs in projects, organizations, folders, or billing
23875// accounts. Only logs that have entries are listed.
23876//
23877// - parent: The resource name that owns the logs: projects/[PROJECT_ID]
23878//   organizations/[ORGANIZATION_ID]
23879//   billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID].
23880func (r *ProjectsLogsService) List(parent string) *ProjectsLogsListCall {
23881	c := &ProjectsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
23882	c.parent = parent
23883	return c
23884}
23885
23886// PageSize sets the optional parameter "pageSize": The maximum number
23887// of results to return from this request. Non-positive values are
23888// ignored. The presence of nextPageToken in the response indicates that
23889// more results might be available.
23890func (c *ProjectsLogsListCall) PageSize(pageSize int64) *ProjectsLogsListCall {
23891	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
23892	return c
23893}
23894
23895// PageToken sets the optional parameter "pageToken": If present, then
23896// retrieve the next batch of results from the preceding call to this
23897// method. pageToken must be the value of nextPageToken from the
23898// previous response. The values of other method parameters should be
23899// identical to those in the previous call.
23900func (c *ProjectsLogsListCall) PageToken(pageToken string) *ProjectsLogsListCall {
23901	c.urlParams_.Set("pageToken", pageToken)
23902	return c
23903}
23904
23905// ResourceNames sets the optional parameter "resourceNames": The
23906// resource name that owns the logs:
23907// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view
23908// s/[VIEW_ID]
23909// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE
23910// T_ID]/views/[VIEW_ID]
23911// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[
23912// BUCKET_ID]/views/[VIEW_ID]
23913// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/
23914// [VIEW_ID]To support legacy queries, it could also be:
23915// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID]
23916// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]
23917func (c *ProjectsLogsListCall) ResourceNames(resourceNames ...string) *ProjectsLogsListCall {
23918	c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...))
23919	return c
23920}
23921
23922// Fields allows partial responses to be retrieved. See
23923// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
23924// for more information.
23925func (c *ProjectsLogsListCall) Fields(s ...googleapi.Field) *ProjectsLogsListCall {
23926	c.urlParams_.Set("fields", googleapi.CombineFields(s))
23927	return c
23928}
23929
23930// IfNoneMatch sets the optional parameter which makes the operation
23931// fail if the object's ETag matches the given value. This is useful for
23932// getting updates only after the object has changed since the last
23933// request. Use googleapi.IsNotModified to check whether the response
23934// error from Do is the result of In-None-Match.
23935func (c *ProjectsLogsListCall) IfNoneMatch(entityTag string) *ProjectsLogsListCall {
23936	c.ifNoneMatch_ = entityTag
23937	return c
23938}
23939
23940// Context sets the context to be used in this call's Do method. Any
23941// pending HTTP request will be aborted if the provided context is
23942// canceled.
23943func (c *ProjectsLogsListCall) Context(ctx context.Context) *ProjectsLogsListCall {
23944	c.ctx_ = ctx
23945	return c
23946}
23947
23948// Header returns an http.Header that can be modified by the caller to
23949// add HTTP headers to the request.
23950func (c *ProjectsLogsListCall) Header() http.Header {
23951	if c.header_ == nil {
23952		c.header_ = make(http.Header)
23953	}
23954	return c.header_
23955}
23956
23957func (c *ProjectsLogsListCall) doRequest(alt string) (*http.Response, error) {
23958	reqHeaders := make(http.Header)
23959	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
23960	for k, v := range c.header_ {
23961		reqHeaders[k] = v
23962	}
23963	reqHeaders.Set("User-Agent", c.s.userAgent())
23964	if c.ifNoneMatch_ != "" {
23965		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
23966	}
23967	var body io.Reader = nil
23968	c.urlParams_.Set("alt", alt)
23969	c.urlParams_.Set("prettyPrint", "false")
23970	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs")
23971	urls += "?" + c.urlParams_.Encode()
23972	req, err := http.NewRequest("GET", urls, body)
23973	if err != nil {
23974		return nil, err
23975	}
23976	req.Header = reqHeaders
23977	googleapi.Expand(req.URL, map[string]string{
23978		"parent": c.parent,
23979	})
23980	return gensupport.SendRequest(c.ctx_, c.s.client, req)
23981}
23982
23983// Do executes the "logging.projects.logs.list" call.
23984// Exactly one of *ListLogsResponse or error will be non-nil. Any
23985// non-2xx status code is an error. Response headers are in either
23986// *ListLogsResponse.ServerResponse.Header or (if a response was
23987// returned at all) in error.(*googleapi.Error).Header. Use
23988// googleapi.IsNotModified to check whether the returned error was
23989// because http.StatusNotModified was returned.
23990func (c *ProjectsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) {
23991	gensupport.SetOptions(c.urlParams_, opts...)
23992	res, err := c.doRequest("json")
23993	if res != nil && res.StatusCode == http.StatusNotModified {
23994		if res.Body != nil {
23995			res.Body.Close()
23996		}
23997		return nil, &googleapi.Error{
23998			Code:   res.StatusCode,
23999			Header: res.Header,
24000		}
24001	}
24002	if err != nil {
24003		return nil, err
24004	}
24005	defer googleapi.CloseBody(res)
24006	if err := googleapi.CheckResponse(res); err != nil {
24007		return nil, err
24008	}
24009	ret := &ListLogsResponse{
24010		ServerResponse: googleapi.ServerResponse{
24011			Header:         res.Header,
24012			HTTPStatusCode: res.StatusCode,
24013		},
24014	}
24015	target := &ret
24016	if err := gensupport.DecodeResponse(target, res); err != nil {
24017		return nil, err
24018	}
24019	return ret, nil
24020	// {
24021	//   "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.",
24022	//   "flatPath": "v2/projects/{projectsId}/logs",
24023	//   "httpMethod": "GET",
24024	//   "id": "logging.projects.logs.list",
24025	//   "parameterOrder": [
24026	//     "parent"
24027	//   ],
24028	//   "parameters": {
24029	//     "pageSize": {
24030	//       "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.",
24031	//       "format": "int32",
24032	//       "location": "query",
24033	//       "type": "integer"
24034	//     },
24035	//     "pageToken": {
24036	//       "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.",
24037	//       "location": "query",
24038	//       "type": "string"
24039	//     },
24040	//     "parent": {
24041	//       "description": "Required. The resource name that owns the logs: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]",
24042	//       "location": "path",
24043	//       "pattern": "^projects/[^/]+$",
24044	//       "required": true,
24045	//       "type": "string"
24046	//     },
24047	//     "resourceNames": {
24048	//       "description": "Optional. The resource name that owns the logs: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[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_ID]To support legacy queries, it could also be: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]",
24049	//       "location": "query",
24050	//       "repeated": true,
24051	//       "type": "string"
24052	//     }
24053	//   },
24054	//   "path": "v2/{+parent}/logs",
24055	//   "response": {
24056	//     "$ref": "ListLogsResponse"
24057	//   },
24058	//   "scopes": [
24059	//     "https://www.googleapis.com/auth/cloud-platform",
24060	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
24061	//     "https://www.googleapis.com/auth/logging.admin",
24062	//     "https://www.googleapis.com/auth/logging.read"
24063	//   ]
24064	// }
24065
24066}
24067
24068// Pages invokes f for each page of results.
24069// A non-nil error returned from f will halt the iteration.
24070// The provided context supersedes any context provided to the Context method.
24071func (c *ProjectsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error {
24072	c.ctx_ = ctx
24073	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
24074	for {
24075		x, err := c.Do()
24076		if err != nil {
24077			return err
24078		}
24079		if err := f(x); err != nil {
24080			return err
24081		}
24082		if x.NextPageToken == "" {
24083			return nil
24084		}
24085		c.PageToken(x.NextPageToken)
24086	}
24087}
24088
24089// method id "logging.projects.metrics.create":
24090
24091type ProjectsMetricsCreateCall struct {
24092	s          *Service
24093	parent     string
24094	logmetric  *LogMetric
24095	urlParams_ gensupport.URLParams
24096	ctx_       context.Context
24097	header_    http.Header
24098}
24099
24100// Create: Creates a logs-based metric.
24101//
24102// - parent: The resource name of the project in which to create the
24103//   metric: "projects/[PROJECT_ID]" The new metric must be provided in
24104//   the request.
24105func (r *ProjectsMetricsService) Create(parent string, logmetric *LogMetric) *ProjectsMetricsCreateCall {
24106	c := &ProjectsMetricsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
24107	c.parent = parent
24108	c.logmetric = logmetric
24109	return c
24110}
24111
24112// Fields allows partial responses to be retrieved. See
24113// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
24114// for more information.
24115func (c *ProjectsMetricsCreateCall) Fields(s ...googleapi.Field) *ProjectsMetricsCreateCall {
24116	c.urlParams_.Set("fields", googleapi.CombineFields(s))
24117	return c
24118}
24119
24120// Context sets the context to be used in this call's Do method. Any
24121// pending HTTP request will be aborted if the provided context is
24122// canceled.
24123func (c *ProjectsMetricsCreateCall) Context(ctx context.Context) *ProjectsMetricsCreateCall {
24124	c.ctx_ = ctx
24125	return c
24126}
24127
24128// Header returns an http.Header that can be modified by the caller to
24129// add HTTP headers to the request.
24130func (c *ProjectsMetricsCreateCall) Header() http.Header {
24131	if c.header_ == nil {
24132		c.header_ = make(http.Header)
24133	}
24134	return c.header_
24135}
24136
24137func (c *ProjectsMetricsCreateCall) doRequest(alt string) (*http.Response, error) {
24138	reqHeaders := make(http.Header)
24139	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
24140	for k, v := range c.header_ {
24141		reqHeaders[k] = v
24142	}
24143	reqHeaders.Set("User-Agent", c.s.userAgent())
24144	var body io.Reader = nil
24145	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logmetric)
24146	if err != nil {
24147		return nil, err
24148	}
24149	reqHeaders.Set("Content-Type", "application/json")
24150	c.urlParams_.Set("alt", alt)
24151	c.urlParams_.Set("prettyPrint", "false")
24152	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/metrics")
24153	urls += "?" + c.urlParams_.Encode()
24154	req, err := http.NewRequest("POST", urls, body)
24155	if err != nil {
24156		return nil, err
24157	}
24158	req.Header = reqHeaders
24159	googleapi.Expand(req.URL, map[string]string{
24160		"parent": c.parent,
24161	})
24162	return gensupport.SendRequest(c.ctx_, c.s.client, req)
24163}
24164
24165// Do executes the "logging.projects.metrics.create" call.
24166// Exactly one of *LogMetric or error will be non-nil. Any non-2xx
24167// status code is an error. Response headers are in either
24168// *LogMetric.ServerResponse.Header or (if a response was returned at
24169// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
24170// to check whether the returned error was because
24171// http.StatusNotModified was returned.
24172func (c *ProjectsMetricsCreateCall) Do(opts ...googleapi.CallOption) (*LogMetric, error) {
24173	gensupport.SetOptions(c.urlParams_, opts...)
24174	res, err := c.doRequest("json")
24175	if res != nil && res.StatusCode == http.StatusNotModified {
24176		if res.Body != nil {
24177			res.Body.Close()
24178		}
24179		return nil, &googleapi.Error{
24180			Code:   res.StatusCode,
24181			Header: res.Header,
24182		}
24183	}
24184	if err != nil {
24185		return nil, err
24186	}
24187	defer googleapi.CloseBody(res)
24188	if err := googleapi.CheckResponse(res); err != nil {
24189		return nil, err
24190	}
24191	ret := &LogMetric{
24192		ServerResponse: googleapi.ServerResponse{
24193			Header:         res.Header,
24194			HTTPStatusCode: res.StatusCode,
24195		},
24196	}
24197	target := &ret
24198	if err := gensupport.DecodeResponse(target, res); err != nil {
24199		return nil, err
24200	}
24201	return ret, nil
24202	// {
24203	//   "description": "Creates a logs-based metric.",
24204	//   "flatPath": "v2/projects/{projectsId}/metrics",
24205	//   "httpMethod": "POST",
24206	//   "id": "logging.projects.metrics.create",
24207	//   "parameterOrder": [
24208	//     "parent"
24209	//   ],
24210	//   "parameters": {
24211	//     "parent": {
24212	//       "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.",
24213	//       "location": "path",
24214	//       "pattern": "^projects/[^/]+$",
24215	//       "required": true,
24216	//       "type": "string"
24217	//     }
24218	//   },
24219	//   "path": "v2/{+parent}/metrics",
24220	//   "request": {
24221	//     "$ref": "LogMetric"
24222	//   },
24223	//   "response": {
24224	//     "$ref": "LogMetric"
24225	//   },
24226	//   "scopes": [
24227	//     "https://www.googleapis.com/auth/cloud-platform",
24228	//     "https://www.googleapis.com/auth/logging.admin",
24229	//     "https://www.googleapis.com/auth/logging.write"
24230	//   ]
24231	// }
24232
24233}
24234
24235// method id "logging.projects.metrics.delete":
24236
24237type ProjectsMetricsDeleteCall struct {
24238	s          *Service
24239	metricName string
24240	urlParams_ gensupport.URLParams
24241	ctx_       context.Context
24242	header_    http.Header
24243}
24244
24245// Delete: Deletes a logs-based metric.
24246//
24247// - metricName: The resource name of the metric to delete:
24248//   "projects/[PROJECT_ID]/metrics/[METRIC_ID]".
24249func (r *ProjectsMetricsService) Delete(metricName string) *ProjectsMetricsDeleteCall {
24250	c := &ProjectsMetricsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
24251	c.metricName = metricName
24252	return c
24253}
24254
24255// Fields allows partial responses to be retrieved. See
24256// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
24257// for more information.
24258func (c *ProjectsMetricsDeleteCall) Fields(s ...googleapi.Field) *ProjectsMetricsDeleteCall {
24259	c.urlParams_.Set("fields", googleapi.CombineFields(s))
24260	return c
24261}
24262
24263// Context sets the context to be used in this call's Do method. Any
24264// pending HTTP request will be aborted if the provided context is
24265// canceled.
24266func (c *ProjectsMetricsDeleteCall) Context(ctx context.Context) *ProjectsMetricsDeleteCall {
24267	c.ctx_ = ctx
24268	return c
24269}
24270
24271// Header returns an http.Header that can be modified by the caller to
24272// add HTTP headers to the request.
24273func (c *ProjectsMetricsDeleteCall) Header() http.Header {
24274	if c.header_ == nil {
24275		c.header_ = make(http.Header)
24276	}
24277	return c.header_
24278}
24279
24280func (c *ProjectsMetricsDeleteCall) doRequest(alt string) (*http.Response, error) {
24281	reqHeaders := make(http.Header)
24282	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
24283	for k, v := range c.header_ {
24284		reqHeaders[k] = v
24285	}
24286	reqHeaders.Set("User-Agent", c.s.userAgent())
24287	var body io.Reader = nil
24288	c.urlParams_.Set("alt", alt)
24289	c.urlParams_.Set("prettyPrint", "false")
24290	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+metricName}")
24291	urls += "?" + c.urlParams_.Encode()
24292	req, err := http.NewRequest("DELETE", urls, body)
24293	if err != nil {
24294		return nil, err
24295	}
24296	req.Header = reqHeaders
24297	googleapi.Expand(req.URL, map[string]string{
24298		"metricName": c.metricName,
24299	})
24300	return gensupport.SendRequest(c.ctx_, c.s.client, req)
24301}
24302
24303// Do executes the "logging.projects.metrics.delete" call.
24304// Exactly one of *Empty or error will be non-nil. Any non-2xx status
24305// code is an error. Response headers are in either
24306// *Empty.ServerResponse.Header or (if a response was returned at all)
24307// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
24308// check whether the returned error was because http.StatusNotModified
24309// was returned.
24310func (c *ProjectsMetricsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
24311	gensupport.SetOptions(c.urlParams_, opts...)
24312	res, err := c.doRequest("json")
24313	if res != nil && res.StatusCode == http.StatusNotModified {
24314		if res.Body != nil {
24315			res.Body.Close()
24316		}
24317		return nil, &googleapi.Error{
24318			Code:   res.StatusCode,
24319			Header: res.Header,
24320		}
24321	}
24322	if err != nil {
24323		return nil, err
24324	}
24325	defer googleapi.CloseBody(res)
24326	if err := googleapi.CheckResponse(res); err != nil {
24327		return nil, err
24328	}
24329	ret := &Empty{
24330		ServerResponse: googleapi.ServerResponse{
24331			Header:         res.Header,
24332			HTTPStatusCode: res.StatusCode,
24333		},
24334	}
24335	target := &ret
24336	if err := gensupport.DecodeResponse(target, res); err != nil {
24337		return nil, err
24338	}
24339	return ret, nil
24340	// {
24341	//   "description": "Deletes a logs-based metric.",
24342	//   "flatPath": "v2/projects/{projectsId}/metrics/{metricsId}",
24343	//   "httpMethod": "DELETE",
24344	//   "id": "logging.projects.metrics.delete",
24345	//   "parameterOrder": [
24346	//     "metricName"
24347	//   ],
24348	//   "parameters": {
24349	//     "metricName": {
24350	//       "description": "Required. The resource name of the metric to delete: \"projects/[PROJECT_ID]/metrics/[METRIC_ID]\" ",
24351	//       "location": "path",
24352	//       "pattern": "^projects/[^/]+/metrics/[^/]+$",
24353	//       "required": true,
24354	//       "type": "string"
24355	//     }
24356	//   },
24357	//   "path": "v2/{+metricName}",
24358	//   "response": {
24359	//     "$ref": "Empty"
24360	//   },
24361	//   "scopes": [
24362	//     "https://www.googleapis.com/auth/cloud-platform",
24363	//     "https://www.googleapis.com/auth/logging.admin",
24364	//     "https://www.googleapis.com/auth/logging.write"
24365	//   ]
24366	// }
24367
24368}
24369
24370// method id "logging.projects.metrics.get":
24371
24372type ProjectsMetricsGetCall struct {
24373	s            *Service
24374	metricName   string
24375	urlParams_   gensupport.URLParams
24376	ifNoneMatch_ string
24377	ctx_         context.Context
24378	header_      http.Header
24379}
24380
24381// Get: Gets a logs-based metric.
24382//
24383// - metricName: The resource name of the desired metric:
24384//   "projects/[PROJECT_ID]/metrics/[METRIC_ID]".
24385func (r *ProjectsMetricsService) Get(metricName string) *ProjectsMetricsGetCall {
24386	c := &ProjectsMetricsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
24387	c.metricName = metricName
24388	return c
24389}
24390
24391// Fields allows partial responses to be retrieved. See
24392// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
24393// for more information.
24394func (c *ProjectsMetricsGetCall) Fields(s ...googleapi.Field) *ProjectsMetricsGetCall {
24395	c.urlParams_.Set("fields", googleapi.CombineFields(s))
24396	return c
24397}
24398
24399// IfNoneMatch sets the optional parameter which makes the operation
24400// fail if the object's ETag matches the given value. This is useful for
24401// getting updates only after the object has changed since the last
24402// request. Use googleapi.IsNotModified to check whether the response
24403// error from Do is the result of In-None-Match.
24404func (c *ProjectsMetricsGetCall) IfNoneMatch(entityTag string) *ProjectsMetricsGetCall {
24405	c.ifNoneMatch_ = entityTag
24406	return c
24407}
24408
24409// Context sets the context to be used in this call's Do method. Any
24410// pending HTTP request will be aborted if the provided context is
24411// canceled.
24412func (c *ProjectsMetricsGetCall) Context(ctx context.Context) *ProjectsMetricsGetCall {
24413	c.ctx_ = ctx
24414	return c
24415}
24416
24417// Header returns an http.Header that can be modified by the caller to
24418// add HTTP headers to the request.
24419func (c *ProjectsMetricsGetCall) Header() http.Header {
24420	if c.header_ == nil {
24421		c.header_ = make(http.Header)
24422	}
24423	return c.header_
24424}
24425
24426func (c *ProjectsMetricsGetCall) doRequest(alt string) (*http.Response, error) {
24427	reqHeaders := make(http.Header)
24428	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
24429	for k, v := range c.header_ {
24430		reqHeaders[k] = v
24431	}
24432	reqHeaders.Set("User-Agent", c.s.userAgent())
24433	if c.ifNoneMatch_ != "" {
24434		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
24435	}
24436	var body io.Reader = nil
24437	c.urlParams_.Set("alt", alt)
24438	c.urlParams_.Set("prettyPrint", "false")
24439	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+metricName}")
24440	urls += "?" + c.urlParams_.Encode()
24441	req, err := http.NewRequest("GET", urls, body)
24442	if err != nil {
24443		return nil, err
24444	}
24445	req.Header = reqHeaders
24446	googleapi.Expand(req.URL, map[string]string{
24447		"metricName": c.metricName,
24448	})
24449	return gensupport.SendRequest(c.ctx_, c.s.client, req)
24450}
24451
24452// Do executes the "logging.projects.metrics.get" call.
24453// Exactly one of *LogMetric or error will be non-nil. Any non-2xx
24454// status code is an error. Response headers are in either
24455// *LogMetric.ServerResponse.Header or (if a response was returned at
24456// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
24457// to check whether the returned error was because
24458// http.StatusNotModified was returned.
24459func (c *ProjectsMetricsGetCall) Do(opts ...googleapi.CallOption) (*LogMetric, error) {
24460	gensupport.SetOptions(c.urlParams_, opts...)
24461	res, err := c.doRequest("json")
24462	if res != nil && res.StatusCode == http.StatusNotModified {
24463		if res.Body != nil {
24464			res.Body.Close()
24465		}
24466		return nil, &googleapi.Error{
24467			Code:   res.StatusCode,
24468			Header: res.Header,
24469		}
24470	}
24471	if err != nil {
24472		return nil, err
24473	}
24474	defer googleapi.CloseBody(res)
24475	if err := googleapi.CheckResponse(res); err != nil {
24476		return nil, err
24477	}
24478	ret := &LogMetric{
24479		ServerResponse: googleapi.ServerResponse{
24480			Header:         res.Header,
24481			HTTPStatusCode: res.StatusCode,
24482		},
24483	}
24484	target := &ret
24485	if err := gensupport.DecodeResponse(target, res); err != nil {
24486		return nil, err
24487	}
24488	return ret, nil
24489	// {
24490	//   "description": "Gets a logs-based metric.",
24491	//   "flatPath": "v2/projects/{projectsId}/metrics/{metricsId}",
24492	//   "httpMethod": "GET",
24493	//   "id": "logging.projects.metrics.get",
24494	//   "parameterOrder": [
24495	//     "metricName"
24496	//   ],
24497	//   "parameters": {
24498	//     "metricName": {
24499	//       "description": "Required. The resource name of the desired metric: \"projects/[PROJECT_ID]/metrics/[METRIC_ID]\" ",
24500	//       "location": "path",
24501	//       "pattern": "^projects/[^/]+/metrics/[^/]+$",
24502	//       "required": true,
24503	//       "type": "string"
24504	//     }
24505	//   },
24506	//   "path": "v2/{+metricName}",
24507	//   "response": {
24508	//     "$ref": "LogMetric"
24509	//   },
24510	//   "scopes": [
24511	//     "https://www.googleapis.com/auth/cloud-platform",
24512	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
24513	//     "https://www.googleapis.com/auth/logging.admin",
24514	//     "https://www.googleapis.com/auth/logging.read"
24515	//   ]
24516	// }
24517
24518}
24519
24520// method id "logging.projects.metrics.list":
24521
24522type ProjectsMetricsListCall struct {
24523	s            *Service
24524	parent       string
24525	urlParams_   gensupport.URLParams
24526	ifNoneMatch_ string
24527	ctx_         context.Context
24528	header_      http.Header
24529}
24530
24531// List: Lists logs-based metrics.
24532//
24533// - parent: The name of the project containing the metrics:
24534//   "projects/[PROJECT_ID]".
24535func (r *ProjectsMetricsService) List(parent string) *ProjectsMetricsListCall {
24536	c := &ProjectsMetricsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
24537	c.parent = parent
24538	return c
24539}
24540
24541// PageSize sets the optional parameter "pageSize": The maximum number
24542// of results to return from this request. Non-positive values are
24543// ignored. The presence of nextPageToken in the response indicates that
24544// more results might be available.
24545func (c *ProjectsMetricsListCall) PageSize(pageSize int64) *ProjectsMetricsListCall {
24546	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
24547	return c
24548}
24549
24550// PageToken sets the optional parameter "pageToken": If present, then
24551// retrieve the next batch of results from the preceding call to this
24552// method. pageToken must be the value of nextPageToken from the
24553// previous response. The values of other method parameters should be
24554// identical to those in the previous call.
24555func (c *ProjectsMetricsListCall) PageToken(pageToken string) *ProjectsMetricsListCall {
24556	c.urlParams_.Set("pageToken", pageToken)
24557	return c
24558}
24559
24560// Fields allows partial responses to be retrieved. See
24561// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
24562// for more information.
24563func (c *ProjectsMetricsListCall) Fields(s ...googleapi.Field) *ProjectsMetricsListCall {
24564	c.urlParams_.Set("fields", googleapi.CombineFields(s))
24565	return c
24566}
24567
24568// IfNoneMatch sets the optional parameter which makes the operation
24569// fail if the object's ETag matches the given value. This is useful for
24570// getting updates only after the object has changed since the last
24571// request. Use googleapi.IsNotModified to check whether the response
24572// error from Do is the result of In-None-Match.
24573func (c *ProjectsMetricsListCall) IfNoneMatch(entityTag string) *ProjectsMetricsListCall {
24574	c.ifNoneMatch_ = entityTag
24575	return c
24576}
24577
24578// Context sets the context to be used in this call's Do method. Any
24579// pending HTTP request will be aborted if the provided context is
24580// canceled.
24581func (c *ProjectsMetricsListCall) Context(ctx context.Context) *ProjectsMetricsListCall {
24582	c.ctx_ = ctx
24583	return c
24584}
24585
24586// Header returns an http.Header that can be modified by the caller to
24587// add HTTP headers to the request.
24588func (c *ProjectsMetricsListCall) Header() http.Header {
24589	if c.header_ == nil {
24590		c.header_ = make(http.Header)
24591	}
24592	return c.header_
24593}
24594
24595func (c *ProjectsMetricsListCall) doRequest(alt string) (*http.Response, error) {
24596	reqHeaders := make(http.Header)
24597	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
24598	for k, v := range c.header_ {
24599		reqHeaders[k] = v
24600	}
24601	reqHeaders.Set("User-Agent", c.s.userAgent())
24602	if c.ifNoneMatch_ != "" {
24603		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
24604	}
24605	var body io.Reader = nil
24606	c.urlParams_.Set("alt", alt)
24607	c.urlParams_.Set("prettyPrint", "false")
24608	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/metrics")
24609	urls += "?" + c.urlParams_.Encode()
24610	req, err := http.NewRequest("GET", urls, body)
24611	if err != nil {
24612		return nil, err
24613	}
24614	req.Header = reqHeaders
24615	googleapi.Expand(req.URL, map[string]string{
24616		"parent": c.parent,
24617	})
24618	return gensupport.SendRequest(c.ctx_, c.s.client, req)
24619}
24620
24621// Do executes the "logging.projects.metrics.list" call.
24622// Exactly one of *ListLogMetricsResponse or error will be non-nil. Any
24623// non-2xx status code is an error. Response headers are in either
24624// *ListLogMetricsResponse.ServerResponse.Header or (if a response was
24625// returned at all) in error.(*googleapi.Error).Header. Use
24626// googleapi.IsNotModified to check whether the returned error was
24627// because http.StatusNotModified was returned.
24628func (c *ProjectsMetricsListCall) Do(opts ...googleapi.CallOption) (*ListLogMetricsResponse, error) {
24629	gensupport.SetOptions(c.urlParams_, opts...)
24630	res, err := c.doRequest("json")
24631	if res != nil && res.StatusCode == http.StatusNotModified {
24632		if res.Body != nil {
24633			res.Body.Close()
24634		}
24635		return nil, &googleapi.Error{
24636			Code:   res.StatusCode,
24637			Header: res.Header,
24638		}
24639	}
24640	if err != nil {
24641		return nil, err
24642	}
24643	defer googleapi.CloseBody(res)
24644	if err := googleapi.CheckResponse(res); err != nil {
24645		return nil, err
24646	}
24647	ret := &ListLogMetricsResponse{
24648		ServerResponse: googleapi.ServerResponse{
24649			Header:         res.Header,
24650			HTTPStatusCode: res.StatusCode,
24651		},
24652	}
24653	target := &ret
24654	if err := gensupport.DecodeResponse(target, res); err != nil {
24655		return nil, err
24656	}
24657	return ret, nil
24658	// {
24659	//   "description": "Lists logs-based metrics.",
24660	//   "flatPath": "v2/projects/{projectsId}/metrics",
24661	//   "httpMethod": "GET",
24662	//   "id": "logging.projects.metrics.list",
24663	//   "parameterOrder": [
24664	//     "parent"
24665	//   ],
24666	//   "parameters": {
24667	//     "pageSize": {
24668	//       "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.",
24669	//       "format": "int32",
24670	//       "location": "query",
24671	//       "type": "integer"
24672	//     },
24673	//     "pageToken": {
24674	//       "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.",
24675	//       "location": "query",
24676	//       "type": "string"
24677	//     },
24678	//     "parent": {
24679	//       "description": "Required. The name of the project containing the metrics: \"projects/[PROJECT_ID]\" ",
24680	//       "location": "path",
24681	//       "pattern": "^projects/[^/]+$",
24682	//       "required": true,
24683	//       "type": "string"
24684	//     }
24685	//   },
24686	//   "path": "v2/{+parent}/metrics",
24687	//   "response": {
24688	//     "$ref": "ListLogMetricsResponse"
24689	//   },
24690	//   "scopes": [
24691	//     "https://www.googleapis.com/auth/cloud-platform",
24692	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
24693	//     "https://www.googleapis.com/auth/logging.admin",
24694	//     "https://www.googleapis.com/auth/logging.read"
24695	//   ]
24696	// }
24697
24698}
24699
24700// Pages invokes f for each page of results.
24701// A non-nil error returned from f will halt the iteration.
24702// The provided context supersedes any context provided to the Context method.
24703func (c *ProjectsMetricsListCall) Pages(ctx context.Context, f func(*ListLogMetricsResponse) error) error {
24704	c.ctx_ = ctx
24705	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
24706	for {
24707		x, err := c.Do()
24708		if err != nil {
24709			return err
24710		}
24711		if err := f(x); err != nil {
24712			return err
24713		}
24714		if x.NextPageToken == "" {
24715			return nil
24716		}
24717		c.PageToken(x.NextPageToken)
24718	}
24719}
24720
24721// method id "logging.projects.metrics.update":
24722
24723type ProjectsMetricsUpdateCall struct {
24724	s          *Service
24725	metricName string
24726	logmetric  *LogMetric
24727	urlParams_ gensupport.URLParams
24728	ctx_       context.Context
24729	header_    http.Header
24730}
24731
24732// Update: Creates or updates a logs-based metric.
24733//
24734// - metricName: The resource name of the metric to update:
24735//   "projects/[PROJECT_ID]/metrics/[METRIC_ID]" The updated metric must
24736//   be provided in the request and it's name field must be the same as
24737//   [METRIC_ID] If the metric does not exist in [PROJECT_ID], then a
24738//   new metric is created.
24739func (r *ProjectsMetricsService) Update(metricName string, logmetric *LogMetric) *ProjectsMetricsUpdateCall {
24740	c := &ProjectsMetricsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
24741	c.metricName = metricName
24742	c.logmetric = logmetric
24743	return c
24744}
24745
24746// Fields allows partial responses to be retrieved. See
24747// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
24748// for more information.
24749func (c *ProjectsMetricsUpdateCall) Fields(s ...googleapi.Field) *ProjectsMetricsUpdateCall {
24750	c.urlParams_.Set("fields", googleapi.CombineFields(s))
24751	return c
24752}
24753
24754// Context sets the context to be used in this call's Do method. Any
24755// pending HTTP request will be aborted if the provided context is
24756// canceled.
24757func (c *ProjectsMetricsUpdateCall) Context(ctx context.Context) *ProjectsMetricsUpdateCall {
24758	c.ctx_ = ctx
24759	return c
24760}
24761
24762// Header returns an http.Header that can be modified by the caller to
24763// add HTTP headers to the request.
24764func (c *ProjectsMetricsUpdateCall) Header() http.Header {
24765	if c.header_ == nil {
24766		c.header_ = make(http.Header)
24767	}
24768	return c.header_
24769}
24770
24771func (c *ProjectsMetricsUpdateCall) doRequest(alt string) (*http.Response, error) {
24772	reqHeaders := make(http.Header)
24773	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
24774	for k, v := range c.header_ {
24775		reqHeaders[k] = v
24776	}
24777	reqHeaders.Set("User-Agent", c.s.userAgent())
24778	var body io.Reader = nil
24779	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logmetric)
24780	if err != nil {
24781		return nil, err
24782	}
24783	reqHeaders.Set("Content-Type", "application/json")
24784	c.urlParams_.Set("alt", alt)
24785	c.urlParams_.Set("prettyPrint", "false")
24786	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+metricName}")
24787	urls += "?" + c.urlParams_.Encode()
24788	req, err := http.NewRequest("PUT", urls, body)
24789	if err != nil {
24790		return nil, err
24791	}
24792	req.Header = reqHeaders
24793	googleapi.Expand(req.URL, map[string]string{
24794		"metricName": c.metricName,
24795	})
24796	return gensupport.SendRequest(c.ctx_, c.s.client, req)
24797}
24798
24799// Do executes the "logging.projects.metrics.update" call.
24800// Exactly one of *LogMetric or error will be non-nil. Any non-2xx
24801// status code is an error. Response headers are in either
24802// *LogMetric.ServerResponse.Header or (if a response was returned at
24803// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
24804// to check whether the returned error was because
24805// http.StatusNotModified was returned.
24806func (c *ProjectsMetricsUpdateCall) Do(opts ...googleapi.CallOption) (*LogMetric, error) {
24807	gensupport.SetOptions(c.urlParams_, opts...)
24808	res, err := c.doRequest("json")
24809	if res != nil && res.StatusCode == http.StatusNotModified {
24810		if res.Body != nil {
24811			res.Body.Close()
24812		}
24813		return nil, &googleapi.Error{
24814			Code:   res.StatusCode,
24815			Header: res.Header,
24816		}
24817	}
24818	if err != nil {
24819		return nil, err
24820	}
24821	defer googleapi.CloseBody(res)
24822	if err := googleapi.CheckResponse(res); err != nil {
24823		return nil, err
24824	}
24825	ret := &LogMetric{
24826		ServerResponse: googleapi.ServerResponse{
24827			Header:         res.Header,
24828			HTTPStatusCode: res.StatusCode,
24829		},
24830	}
24831	target := &ret
24832	if err := gensupport.DecodeResponse(target, res); err != nil {
24833		return nil, err
24834	}
24835	return ret, nil
24836	// {
24837	//   "description": "Creates or updates a logs-based metric.",
24838	//   "flatPath": "v2/projects/{projectsId}/metrics/{metricsId}",
24839	//   "httpMethod": "PUT",
24840	//   "id": "logging.projects.metrics.update",
24841	//   "parameterOrder": [
24842	//     "metricName"
24843	//   ],
24844	//   "parameters": {
24845	//     "metricName": {
24846	//       "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.",
24847	//       "location": "path",
24848	//       "pattern": "^projects/[^/]+/metrics/[^/]+$",
24849	//       "required": true,
24850	//       "type": "string"
24851	//     }
24852	//   },
24853	//   "path": "v2/{+metricName}",
24854	//   "request": {
24855	//     "$ref": "LogMetric"
24856	//   },
24857	//   "response": {
24858	//     "$ref": "LogMetric"
24859	//   },
24860	//   "scopes": [
24861	//     "https://www.googleapis.com/auth/cloud-platform",
24862	//     "https://www.googleapis.com/auth/logging.admin",
24863	//     "https://www.googleapis.com/auth/logging.write"
24864	//   ]
24865	// }
24866
24867}
24868
24869// method id "logging.projects.sinks.create":
24870
24871type ProjectsSinksCreateCall struct {
24872	s          *Service
24873	parent     string
24874	logsink    *LogSink
24875	urlParams_ gensupport.URLParams
24876	ctx_       context.Context
24877	header_    http.Header
24878}
24879
24880// Create: Creates a sink that exports specified log entries to a
24881// destination. The export of newly-ingested log entries begins
24882// immediately, unless the sink's writer_identity is not permitted to
24883// write to the destination. A sink can export log entries only from the
24884// resource owning the sink.
24885//
24886// - parent: The resource in which to create the sink:
24887//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
24888//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
24889//   Examples: "projects/my-logging-project", "organizations/123456789".
24890func (r *ProjectsSinksService) Create(parent string, logsink *LogSink) *ProjectsSinksCreateCall {
24891	c := &ProjectsSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
24892	c.parent = parent
24893	c.logsink = logsink
24894	return c
24895}
24896
24897// UniqueWriterIdentity sets the optional parameter
24898// "uniqueWriterIdentity": Determines the kind of IAM identity returned
24899// as writer_identity in the new sink. If this value is omitted or set
24900// to false, and if the sink's parent is a project, then the value
24901// returned as writer_identity is the same group or service account used
24902// by Logging before the addition of writer identities to this API. The
24903// sink's destination must be in the same project as the sink itself.If
24904// this field is set to true, or if the sink is owned by a non-project
24905// resource such as an organization, then the value of writer_identity
24906// will be a unique service account used only for exports from the new
24907// sink. For more information, see writer_identity in LogSink.
24908func (c *ProjectsSinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *ProjectsSinksCreateCall {
24909	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
24910	return c
24911}
24912
24913// Fields allows partial responses to be retrieved. See
24914// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
24915// for more information.
24916func (c *ProjectsSinksCreateCall) Fields(s ...googleapi.Field) *ProjectsSinksCreateCall {
24917	c.urlParams_.Set("fields", googleapi.CombineFields(s))
24918	return c
24919}
24920
24921// Context sets the context to be used in this call's Do method. Any
24922// pending HTTP request will be aborted if the provided context is
24923// canceled.
24924func (c *ProjectsSinksCreateCall) Context(ctx context.Context) *ProjectsSinksCreateCall {
24925	c.ctx_ = ctx
24926	return c
24927}
24928
24929// Header returns an http.Header that can be modified by the caller to
24930// add HTTP headers to the request.
24931func (c *ProjectsSinksCreateCall) Header() http.Header {
24932	if c.header_ == nil {
24933		c.header_ = make(http.Header)
24934	}
24935	return c.header_
24936}
24937
24938func (c *ProjectsSinksCreateCall) doRequest(alt string) (*http.Response, error) {
24939	reqHeaders := make(http.Header)
24940	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
24941	for k, v := range c.header_ {
24942		reqHeaders[k] = v
24943	}
24944	reqHeaders.Set("User-Agent", c.s.userAgent())
24945	var body io.Reader = nil
24946	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
24947	if err != nil {
24948		return nil, err
24949	}
24950	reqHeaders.Set("Content-Type", "application/json")
24951	c.urlParams_.Set("alt", alt)
24952	c.urlParams_.Set("prettyPrint", "false")
24953	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
24954	urls += "?" + c.urlParams_.Encode()
24955	req, err := http.NewRequest("POST", urls, body)
24956	if err != nil {
24957		return nil, err
24958	}
24959	req.Header = reqHeaders
24960	googleapi.Expand(req.URL, map[string]string{
24961		"parent": c.parent,
24962	})
24963	return gensupport.SendRequest(c.ctx_, c.s.client, req)
24964}
24965
24966// Do executes the "logging.projects.sinks.create" call.
24967// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
24968// code is an error. Response headers are in either
24969// *LogSink.ServerResponse.Header or (if a response was returned at all)
24970// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
24971// check whether the returned error was because http.StatusNotModified
24972// was returned.
24973func (c *ProjectsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
24974	gensupport.SetOptions(c.urlParams_, opts...)
24975	res, err := c.doRequest("json")
24976	if res != nil && res.StatusCode == http.StatusNotModified {
24977		if res.Body != nil {
24978			res.Body.Close()
24979		}
24980		return nil, &googleapi.Error{
24981			Code:   res.StatusCode,
24982			Header: res.Header,
24983		}
24984	}
24985	if err != nil {
24986		return nil, err
24987	}
24988	defer googleapi.CloseBody(res)
24989	if err := googleapi.CheckResponse(res); err != nil {
24990		return nil, err
24991	}
24992	ret := &LogSink{
24993		ServerResponse: googleapi.ServerResponse{
24994			Header:         res.Header,
24995			HTTPStatusCode: res.StatusCode,
24996		},
24997	}
24998	target := &ret
24999	if err := gensupport.DecodeResponse(target, res); err != nil {
25000		return nil, err
25001	}
25002	return ret, nil
25003	// {
25004	//   "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.",
25005	//   "flatPath": "v2/projects/{projectsId}/sinks",
25006	//   "httpMethod": "POST",
25007	//   "id": "logging.projects.sinks.create",
25008	//   "parameterOrder": [
25009	//     "parent"
25010	//   ],
25011	//   "parameters": {
25012	//     "parent": {
25013	//       "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\".",
25014	//       "location": "path",
25015	//       "pattern": "^projects/[^/]+$",
25016	//       "required": true,
25017	//       "type": "string"
25018	//     },
25019	//     "uniqueWriterIdentity": {
25020	//       "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.",
25021	//       "location": "query",
25022	//       "type": "boolean"
25023	//     }
25024	//   },
25025	//   "path": "v2/{+parent}/sinks",
25026	//   "request": {
25027	//     "$ref": "LogSink"
25028	//   },
25029	//   "response": {
25030	//     "$ref": "LogSink"
25031	//   },
25032	//   "scopes": [
25033	//     "https://www.googleapis.com/auth/cloud-platform",
25034	//     "https://www.googleapis.com/auth/logging.admin"
25035	//   ]
25036	// }
25037
25038}
25039
25040// method id "logging.projects.sinks.delete":
25041
25042type ProjectsSinksDeleteCall struct {
25043	s          *Service
25044	sinkNameid string
25045	urlParams_ gensupport.URLParams
25046	ctx_       context.Context
25047	header_    http.Header
25048}
25049
25050// Delete: Deletes a sink. If the sink has a unique writer_identity,
25051// then that service account is also deleted.
25052//
25053// - sinkName: The full resource name of the sink to delete, including
25054//   the parent resource and the sink identifier:
25055//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
25056//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
25057//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
25058//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example:
25059//   "projects/my-project-id/sinks/my-sink-id".
25060func (r *ProjectsSinksService) Delete(sinkNameid string) *ProjectsSinksDeleteCall {
25061	c := &ProjectsSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
25062	c.sinkNameid = sinkNameid
25063	return c
25064}
25065
25066// Fields allows partial responses to be retrieved. See
25067// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
25068// for more information.
25069func (c *ProjectsSinksDeleteCall) Fields(s ...googleapi.Field) *ProjectsSinksDeleteCall {
25070	c.urlParams_.Set("fields", googleapi.CombineFields(s))
25071	return c
25072}
25073
25074// Context sets the context to be used in this call's Do method. Any
25075// pending HTTP request will be aborted if the provided context is
25076// canceled.
25077func (c *ProjectsSinksDeleteCall) Context(ctx context.Context) *ProjectsSinksDeleteCall {
25078	c.ctx_ = ctx
25079	return c
25080}
25081
25082// Header returns an http.Header that can be modified by the caller to
25083// add HTTP headers to the request.
25084func (c *ProjectsSinksDeleteCall) Header() http.Header {
25085	if c.header_ == nil {
25086		c.header_ = make(http.Header)
25087	}
25088	return c.header_
25089}
25090
25091func (c *ProjectsSinksDeleteCall) doRequest(alt string) (*http.Response, error) {
25092	reqHeaders := make(http.Header)
25093	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
25094	for k, v := range c.header_ {
25095		reqHeaders[k] = v
25096	}
25097	reqHeaders.Set("User-Agent", c.s.userAgent())
25098	var body io.Reader = nil
25099	c.urlParams_.Set("alt", alt)
25100	c.urlParams_.Set("prettyPrint", "false")
25101	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
25102	urls += "?" + c.urlParams_.Encode()
25103	req, err := http.NewRequest("DELETE", urls, body)
25104	if err != nil {
25105		return nil, err
25106	}
25107	req.Header = reqHeaders
25108	googleapi.Expand(req.URL, map[string]string{
25109		"sinkName": c.sinkNameid,
25110	})
25111	return gensupport.SendRequest(c.ctx_, c.s.client, req)
25112}
25113
25114// Do executes the "logging.projects.sinks.delete" call.
25115// Exactly one of *Empty or error will be non-nil. Any non-2xx status
25116// code is an error. Response headers are in either
25117// *Empty.ServerResponse.Header or (if a response was returned at all)
25118// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
25119// check whether the returned error was because http.StatusNotModified
25120// was returned.
25121func (c *ProjectsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
25122	gensupport.SetOptions(c.urlParams_, opts...)
25123	res, err := c.doRequest("json")
25124	if res != nil && res.StatusCode == http.StatusNotModified {
25125		if res.Body != nil {
25126			res.Body.Close()
25127		}
25128		return nil, &googleapi.Error{
25129			Code:   res.StatusCode,
25130			Header: res.Header,
25131		}
25132	}
25133	if err != nil {
25134		return nil, err
25135	}
25136	defer googleapi.CloseBody(res)
25137	if err := googleapi.CheckResponse(res); err != nil {
25138		return nil, err
25139	}
25140	ret := &Empty{
25141		ServerResponse: googleapi.ServerResponse{
25142			Header:         res.Header,
25143			HTTPStatusCode: res.StatusCode,
25144		},
25145	}
25146	target := &ret
25147	if err := gensupport.DecodeResponse(target, res); err != nil {
25148		return nil, err
25149	}
25150	return ret, nil
25151	// {
25152	//   "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.",
25153	//   "flatPath": "v2/projects/{projectsId}/sinks/{sinksId}",
25154	//   "httpMethod": "DELETE",
25155	//   "id": "logging.projects.sinks.delete",
25156	//   "parameterOrder": [
25157	//     "sinkName"
25158	//   ],
25159	//   "parameters": {
25160	//     "sinkName": {
25161	//       "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\".",
25162	//       "location": "path",
25163	//       "pattern": "^projects/[^/]+/sinks/[^/]+$",
25164	//       "required": true,
25165	//       "type": "string"
25166	//     }
25167	//   },
25168	//   "path": "v2/{+sinkName}",
25169	//   "response": {
25170	//     "$ref": "Empty"
25171	//   },
25172	//   "scopes": [
25173	//     "https://www.googleapis.com/auth/cloud-platform",
25174	//     "https://www.googleapis.com/auth/logging.admin"
25175	//   ]
25176	// }
25177
25178}
25179
25180// method id "logging.projects.sinks.get":
25181
25182type ProjectsSinksGetCall struct {
25183	s            *Service
25184	sinkName     string
25185	urlParams_   gensupport.URLParams
25186	ifNoneMatch_ string
25187	ctx_         context.Context
25188	header_      http.Header
25189}
25190
25191// Get: Gets a sink.
25192//
25193// - sinkName: The resource name of the sink:
25194//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
25195//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
25196//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
25197//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example:
25198//   "projects/my-project-id/sinks/my-sink-id".
25199func (r *ProjectsSinksService) Get(sinkName string) *ProjectsSinksGetCall {
25200	c := &ProjectsSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
25201	c.sinkName = sinkName
25202	return c
25203}
25204
25205// Fields allows partial responses to be retrieved. See
25206// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
25207// for more information.
25208func (c *ProjectsSinksGetCall) Fields(s ...googleapi.Field) *ProjectsSinksGetCall {
25209	c.urlParams_.Set("fields", googleapi.CombineFields(s))
25210	return c
25211}
25212
25213// IfNoneMatch sets the optional parameter which makes the operation
25214// fail if the object's ETag matches the given value. This is useful for
25215// getting updates only after the object has changed since the last
25216// request. Use googleapi.IsNotModified to check whether the response
25217// error from Do is the result of In-None-Match.
25218func (c *ProjectsSinksGetCall) IfNoneMatch(entityTag string) *ProjectsSinksGetCall {
25219	c.ifNoneMatch_ = entityTag
25220	return c
25221}
25222
25223// Context sets the context to be used in this call's Do method. Any
25224// pending HTTP request will be aborted if the provided context is
25225// canceled.
25226func (c *ProjectsSinksGetCall) Context(ctx context.Context) *ProjectsSinksGetCall {
25227	c.ctx_ = ctx
25228	return c
25229}
25230
25231// Header returns an http.Header that can be modified by the caller to
25232// add HTTP headers to the request.
25233func (c *ProjectsSinksGetCall) Header() http.Header {
25234	if c.header_ == nil {
25235		c.header_ = make(http.Header)
25236	}
25237	return c.header_
25238}
25239
25240func (c *ProjectsSinksGetCall) doRequest(alt string) (*http.Response, error) {
25241	reqHeaders := make(http.Header)
25242	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
25243	for k, v := range c.header_ {
25244		reqHeaders[k] = v
25245	}
25246	reqHeaders.Set("User-Agent", c.s.userAgent())
25247	if c.ifNoneMatch_ != "" {
25248		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
25249	}
25250	var body io.Reader = nil
25251	c.urlParams_.Set("alt", alt)
25252	c.urlParams_.Set("prettyPrint", "false")
25253	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
25254	urls += "?" + c.urlParams_.Encode()
25255	req, err := http.NewRequest("GET", urls, body)
25256	if err != nil {
25257		return nil, err
25258	}
25259	req.Header = reqHeaders
25260	googleapi.Expand(req.URL, map[string]string{
25261		"sinkName": c.sinkName,
25262	})
25263	return gensupport.SendRequest(c.ctx_, c.s.client, req)
25264}
25265
25266// Do executes the "logging.projects.sinks.get" call.
25267// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
25268// code is an error. Response headers are in either
25269// *LogSink.ServerResponse.Header or (if a response was returned at all)
25270// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
25271// check whether the returned error was because http.StatusNotModified
25272// was returned.
25273func (c *ProjectsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
25274	gensupport.SetOptions(c.urlParams_, opts...)
25275	res, err := c.doRequest("json")
25276	if res != nil && res.StatusCode == http.StatusNotModified {
25277		if res.Body != nil {
25278			res.Body.Close()
25279		}
25280		return nil, &googleapi.Error{
25281			Code:   res.StatusCode,
25282			Header: res.Header,
25283		}
25284	}
25285	if err != nil {
25286		return nil, err
25287	}
25288	defer googleapi.CloseBody(res)
25289	if err := googleapi.CheckResponse(res); err != nil {
25290		return nil, err
25291	}
25292	ret := &LogSink{
25293		ServerResponse: googleapi.ServerResponse{
25294			Header:         res.Header,
25295			HTTPStatusCode: res.StatusCode,
25296		},
25297	}
25298	target := &ret
25299	if err := gensupport.DecodeResponse(target, res); err != nil {
25300		return nil, err
25301	}
25302	return ret, nil
25303	// {
25304	//   "description": "Gets a sink.",
25305	//   "flatPath": "v2/projects/{projectsId}/sinks/{sinksId}",
25306	//   "httpMethod": "GET",
25307	//   "id": "logging.projects.sinks.get",
25308	//   "parameterOrder": [
25309	//     "sinkName"
25310	//   ],
25311	//   "parameters": {
25312	//     "sinkName": {
25313	//       "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\".",
25314	//       "location": "path",
25315	//       "pattern": "^projects/[^/]+/sinks/[^/]+$",
25316	//       "required": true,
25317	//       "type": "string"
25318	//     }
25319	//   },
25320	//   "path": "v2/{+sinkName}",
25321	//   "response": {
25322	//     "$ref": "LogSink"
25323	//   },
25324	//   "scopes": [
25325	//     "https://www.googleapis.com/auth/cloud-platform",
25326	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
25327	//     "https://www.googleapis.com/auth/logging.admin",
25328	//     "https://www.googleapis.com/auth/logging.read"
25329	//   ]
25330	// }
25331
25332}
25333
25334// method id "logging.projects.sinks.list":
25335
25336type ProjectsSinksListCall struct {
25337	s            *Service
25338	parent       string
25339	urlParams_   gensupport.URLParams
25340	ifNoneMatch_ string
25341	ctx_         context.Context
25342	header_      http.Header
25343}
25344
25345// List: Lists sinks.
25346//
25347// - parent: The parent resource whose sinks are to be listed:
25348//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
25349//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]".
25350func (r *ProjectsSinksService) List(parent string) *ProjectsSinksListCall {
25351	c := &ProjectsSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
25352	c.parent = parent
25353	return c
25354}
25355
25356// PageSize sets the optional parameter "pageSize": The maximum number
25357// of results to return from this request. Non-positive values are
25358// ignored. The presence of nextPageToken in the response indicates that
25359// more results might be available.
25360func (c *ProjectsSinksListCall) PageSize(pageSize int64) *ProjectsSinksListCall {
25361	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
25362	return c
25363}
25364
25365// PageToken sets the optional parameter "pageToken": If present, then
25366// retrieve the next batch of results from the preceding call to this
25367// method. pageToken must be the value of nextPageToken from the
25368// previous response. The values of other method parameters should be
25369// identical to those in the previous call.
25370func (c *ProjectsSinksListCall) PageToken(pageToken string) *ProjectsSinksListCall {
25371	c.urlParams_.Set("pageToken", pageToken)
25372	return c
25373}
25374
25375// Fields allows partial responses to be retrieved. See
25376// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
25377// for more information.
25378func (c *ProjectsSinksListCall) Fields(s ...googleapi.Field) *ProjectsSinksListCall {
25379	c.urlParams_.Set("fields", googleapi.CombineFields(s))
25380	return c
25381}
25382
25383// IfNoneMatch sets the optional parameter which makes the operation
25384// fail if the object's ETag matches the given value. This is useful for
25385// getting updates only after the object has changed since the last
25386// request. Use googleapi.IsNotModified to check whether the response
25387// error from Do is the result of In-None-Match.
25388func (c *ProjectsSinksListCall) IfNoneMatch(entityTag string) *ProjectsSinksListCall {
25389	c.ifNoneMatch_ = entityTag
25390	return c
25391}
25392
25393// Context sets the context to be used in this call's Do method. Any
25394// pending HTTP request will be aborted if the provided context is
25395// canceled.
25396func (c *ProjectsSinksListCall) Context(ctx context.Context) *ProjectsSinksListCall {
25397	c.ctx_ = ctx
25398	return c
25399}
25400
25401// Header returns an http.Header that can be modified by the caller to
25402// add HTTP headers to the request.
25403func (c *ProjectsSinksListCall) Header() http.Header {
25404	if c.header_ == nil {
25405		c.header_ = make(http.Header)
25406	}
25407	return c.header_
25408}
25409
25410func (c *ProjectsSinksListCall) doRequest(alt string) (*http.Response, error) {
25411	reqHeaders := make(http.Header)
25412	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
25413	for k, v := range c.header_ {
25414		reqHeaders[k] = v
25415	}
25416	reqHeaders.Set("User-Agent", c.s.userAgent())
25417	if c.ifNoneMatch_ != "" {
25418		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
25419	}
25420	var body io.Reader = nil
25421	c.urlParams_.Set("alt", alt)
25422	c.urlParams_.Set("prettyPrint", "false")
25423	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
25424	urls += "?" + c.urlParams_.Encode()
25425	req, err := http.NewRequest("GET", urls, body)
25426	if err != nil {
25427		return nil, err
25428	}
25429	req.Header = reqHeaders
25430	googleapi.Expand(req.URL, map[string]string{
25431		"parent": c.parent,
25432	})
25433	return gensupport.SendRequest(c.ctx_, c.s.client, req)
25434}
25435
25436// Do executes the "logging.projects.sinks.list" call.
25437// Exactly one of *ListSinksResponse or error will be non-nil. Any
25438// non-2xx status code is an error. Response headers are in either
25439// *ListSinksResponse.ServerResponse.Header or (if a response was
25440// returned at all) in error.(*googleapi.Error).Header. Use
25441// googleapi.IsNotModified to check whether the returned error was
25442// because http.StatusNotModified was returned.
25443func (c *ProjectsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) {
25444	gensupport.SetOptions(c.urlParams_, opts...)
25445	res, err := c.doRequest("json")
25446	if res != nil && res.StatusCode == http.StatusNotModified {
25447		if res.Body != nil {
25448			res.Body.Close()
25449		}
25450		return nil, &googleapi.Error{
25451			Code:   res.StatusCode,
25452			Header: res.Header,
25453		}
25454	}
25455	if err != nil {
25456		return nil, err
25457	}
25458	defer googleapi.CloseBody(res)
25459	if err := googleapi.CheckResponse(res); err != nil {
25460		return nil, err
25461	}
25462	ret := &ListSinksResponse{
25463		ServerResponse: googleapi.ServerResponse{
25464			Header:         res.Header,
25465			HTTPStatusCode: res.StatusCode,
25466		},
25467	}
25468	target := &ret
25469	if err := gensupport.DecodeResponse(target, res); err != nil {
25470		return nil, err
25471	}
25472	return ret, nil
25473	// {
25474	//   "description": "Lists sinks.",
25475	//   "flatPath": "v2/projects/{projectsId}/sinks",
25476	//   "httpMethod": "GET",
25477	//   "id": "logging.projects.sinks.list",
25478	//   "parameterOrder": [
25479	//     "parent"
25480	//   ],
25481	//   "parameters": {
25482	//     "pageSize": {
25483	//       "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.",
25484	//       "format": "int32",
25485	//       "location": "query",
25486	//       "type": "integer"
25487	//     },
25488	//     "pageToken": {
25489	//       "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.",
25490	//       "location": "query",
25491	//       "type": "string"
25492	//     },
25493	//     "parent": {
25494	//       "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
25495	//       "location": "path",
25496	//       "pattern": "^projects/[^/]+$",
25497	//       "required": true,
25498	//       "type": "string"
25499	//     }
25500	//   },
25501	//   "path": "v2/{+parent}/sinks",
25502	//   "response": {
25503	//     "$ref": "ListSinksResponse"
25504	//   },
25505	//   "scopes": [
25506	//     "https://www.googleapis.com/auth/cloud-platform",
25507	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
25508	//     "https://www.googleapis.com/auth/logging.admin",
25509	//     "https://www.googleapis.com/auth/logging.read"
25510	//   ]
25511	// }
25512
25513}
25514
25515// Pages invokes f for each page of results.
25516// A non-nil error returned from f will halt the iteration.
25517// The provided context supersedes any context provided to the Context method.
25518func (c *ProjectsSinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error {
25519	c.ctx_ = ctx
25520	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
25521	for {
25522		x, err := c.Do()
25523		if err != nil {
25524			return err
25525		}
25526		if err := f(x); err != nil {
25527			return err
25528		}
25529		if x.NextPageToken == "" {
25530			return nil
25531		}
25532		c.PageToken(x.NextPageToken)
25533	}
25534}
25535
25536// method id "logging.projects.sinks.patch":
25537
25538type ProjectsSinksPatchCall struct {
25539	s          *Service
25540	sinkNameid string
25541	logsink    *LogSink
25542	urlParams_ gensupport.URLParams
25543	ctx_       context.Context
25544	header_    http.Header
25545}
25546
25547// Patch: Updates a sink. This method replaces the following fields in
25548// the existing sink with values from the new sink: destination, and
25549// filter.The updated sink might also have a new writer_identity; see
25550// the unique_writer_identity field.
25551//
25552// - sinkName: The full resource name of the sink to update, including
25553//   the parent resource and the sink identifier:
25554//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
25555//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
25556//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
25557//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example:
25558//   "projects/my-project-id/sinks/my-sink-id".
25559func (r *ProjectsSinksService) Patch(sinkNameid string, logsink *LogSink) *ProjectsSinksPatchCall {
25560	c := &ProjectsSinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
25561	c.sinkNameid = sinkNameid
25562	c.logsink = logsink
25563	return c
25564}
25565
25566// UniqueWriterIdentity sets the optional parameter
25567// "uniqueWriterIdentity": See sinks.create for a description of this
25568// field. When updating a sink, the effect of this field on the value of
25569// writer_identity in the updated sink depends on both the old and new
25570// values of this field: If the old and new values of this field are
25571// both false or both true, then there is no change to the sink's
25572// writer_identity. If the old value is false and the new value is true,
25573// then writer_identity is changed to a unique service account. It is an
25574// error if the old value is true and the new value is set to false or
25575// defaulted to false.
25576func (c *ProjectsSinksPatchCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *ProjectsSinksPatchCall {
25577	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
25578	return c
25579}
25580
25581// UpdateMask sets the optional parameter "updateMask": Field mask that
25582// specifies the fields in sink that need an update. A sink field will
25583// be overwritten if, and only if, it is in the update mask. name and
25584// output only fields cannot be updated.An empty updateMask is
25585// temporarily treated as using the following mask for backwards
25586// compatibility purposes: destination,filter,includeChildren At some
25587// point in the future, behavior will be removed and specifying an empty
25588// updateMask will be an error.For a detailed FieldMask definition, see
25589// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
25590// updateMask=filter.
25591func (c *ProjectsSinksPatchCall) UpdateMask(updateMask string) *ProjectsSinksPatchCall {
25592	c.urlParams_.Set("updateMask", updateMask)
25593	return c
25594}
25595
25596// Fields allows partial responses to be retrieved. See
25597// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
25598// for more information.
25599func (c *ProjectsSinksPatchCall) Fields(s ...googleapi.Field) *ProjectsSinksPatchCall {
25600	c.urlParams_.Set("fields", googleapi.CombineFields(s))
25601	return c
25602}
25603
25604// Context sets the context to be used in this call's Do method. Any
25605// pending HTTP request will be aborted if the provided context is
25606// canceled.
25607func (c *ProjectsSinksPatchCall) Context(ctx context.Context) *ProjectsSinksPatchCall {
25608	c.ctx_ = ctx
25609	return c
25610}
25611
25612// Header returns an http.Header that can be modified by the caller to
25613// add HTTP headers to the request.
25614func (c *ProjectsSinksPatchCall) Header() http.Header {
25615	if c.header_ == nil {
25616		c.header_ = make(http.Header)
25617	}
25618	return c.header_
25619}
25620
25621func (c *ProjectsSinksPatchCall) doRequest(alt string) (*http.Response, error) {
25622	reqHeaders := make(http.Header)
25623	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
25624	for k, v := range c.header_ {
25625		reqHeaders[k] = v
25626	}
25627	reqHeaders.Set("User-Agent", c.s.userAgent())
25628	var body io.Reader = nil
25629	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
25630	if err != nil {
25631		return nil, err
25632	}
25633	reqHeaders.Set("Content-Type", "application/json")
25634	c.urlParams_.Set("alt", alt)
25635	c.urlParams_.Set("prettyPrint", "false")
25636	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
25637	urls += "?" + c.urlParams_.Encode()
25638	req, err := http.NewRequest("PATCH", urls, body)
25639	if err != nil {
25640		return nil, err
25641	}
25642	req.Header = reqHeaders
25643	googleapi.Expand(req.URL, map[string]string{
25644		"sinkName": c.sinkNameid,
25645	})
25646	return gensupport.SendRequest(c.ctx_, c.s.client, req)
25647}
25648
25649// Do executes the "logging.projects.sinks.patch" call.
25650// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
25651// code is an error. Response headers are in either
25652// *LogSink.ServerResponse.Header or (if a response was returned at all)
25653// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
25654// check whether the returned error was because http.StatusNotModified
25655// was returned.
25656func (c *ProjectsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
25657	gensupport.SetOptions(c.urlParams_, opts...)
25658	res, err := c.doRequest("json")
25659	if res != nil && res.StatusCode == http.StatusNotModified {
25660		if res.Body != nil {
25661			res.Body.Close()
25662		}
25663		return nil, &googleapi.Error{
25664			Code:   res.StatusCode,
25665			Header: res.Header,
25666		}
25667	}
25668	if err != nil {
25669		return nil, err
25670	}
25671	defer googleapi.CloseBody(res)
25672	if err := googleapi.CheckResponse(res); err != nil {
25673		return nil, err
25674	}
25675	ret := &LogSink{
25676		ServerResponse: googleapi.ServerResponse{
25677			Header:         res.Header,
25678			HTTPStatusCode: res.StatusCode,
25679		},
25680	}
25681	target := &ret
25682	if err := gensupport.DecodeResponse(target, res); err != nil {
25683		return nil, err
25684	}
25685	return ret, nil
25686	// {
25687	//   "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.",
25688	//   "flatPath": "v2/projects/{projectsId}/sinks/{sinksId}",
25689	//   "httpMethod": "PATCH",
25690	//   "id": "logging.projects.sinks.patch",
25691	//   "parameterOrder": [
25692	//     "sinkName"
25693	//   ],
25694	//   "parameters": {
25695	//     "sinkName": {
25696	//       "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\".",
25697	//       "location": "path",
25698	//       "pattern": "^projects/[^/]+/sinks/[^/]+$",
25699	//       "required": true,
25700	//       "type": "string"
25701	//     },
25702	//     "uniqueWriterIdentity": {
25703	//       "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.",
25704	//       "location": "query",
25705	//       "type": "boolean"
25706	//     },
25707	//     "updateMask": {
25708	//       "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.",
25709	//       "format": "google-fieldmask",
25710	//       "location": "query",
25711	//       "type": "string"
25712	//     }
25713	//   },
25714	//   "path": "v2/{+sinkName}",
25715	//   "request": {
25716	//     "$ref": "LogSink"
25717	//   },
25718	//   "response": {
25719	//     "$ref": "LogSink"
25720	//   },
25721	//   "scopes": [
25722	//     "https://www.googleapis.com/auth/cloud-platform",
25723	//     "https://www.googleapis.com/auth/logging.admin"
25724	//   ]
25725	// }
25726
25727}
25728
25729// method id "logging.projects.sinks.update":
25730
25731type ProjectsSinksUpdateCall struct {
25732	s          *Service
25733	sinkNameid string
25734	logsink    *LogSink
25735	urlParams_ gensupport.URLParams
25736	ctx_       context.Context
25737	header_    http.Header
25738}
25739
25740// Update: Updates a sink. This method replaces the following fields in
25741// the existing sink with values from the new sink: destination, and
25742// filter.The updated sink might also have a new writer_identity; see
25743// the unique_writer_identity field.
25744//
25745// - sinkName: The full resource name of the sink to update, including
25746//   the parent resource and the sink identifier:
25747//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
25748//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
25749//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
25750//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example:
25751//   "projects/my-project-id/sinks/my-sink-id".
25752func (r *ProjectsSinksService) Update(sinkNameid string, logsink *LogSink) *ProjectsSinksUpdateCall {
25753	c := &ProjectsSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
25754	c.sinkNameid = sinkNameid
25755	c.logsink = logsink
25756	return c
25757}
25758
25759// UniqueWriterIdentity sets the optional parameter
25760// "uniqueWriterIdentity": See sinks.create for a description of this
25761// field. When updating a sink, the effect of this field on the value of
25762// writer_identity in the updated sink depends on both the old and new
25763// values of this field: If the old and new values of this field are
25764// both false or both true, then there is no change to the sink's
25765// writer_identity. If the old value is false and the new value is true,
25766// then writer_identity is changed to a unique service account. It is an
25767// error if the old value is true and the new value is set to false or
25768// defaulted to false.
25769func (c *ProjectsSinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *ProjectsSinksUpdateCall {
25770	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
25771	return c
25772}
25773
25774// UpdateMask sets the optional parameter "updateMask": Field mask that
25775// specifies the fields in sink that need an update. A sink field will
25776// be overwritten if, and only if, it is in the update mask. name and
25777// output only fields cannot be updated.An empty updateMask is
25778// temporarily treated as using the following mask for backwards
25779// compatibility purposes: destination,filter,includeChildren At some
25780// point in the future, behavior will be removed and specifying an empty
25781// updateMask will be an error.For a detailed FieldMask definition, see
25782// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
25783// updateMask=filter.
25784func (c *ProjectsSinksUpdateCall) UpdateMask(updateMask string) *ProjectsSinksUpdateCall {
25785	c.urlParams_.Set("updateMask", updateMask)
25786	return c
25787}
25788
25789// Fields allows partial responses to be retrieved. See
25790// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
25791// for more information.
25792func (c *ProjectsSinksUpdateCall) Fields(s ...googleapi.Field) *ProjectsSinksUpdateCall {
25793	c.urlParams_.Set("fields", googleapi.CombineFields(s))
25794	return c
25795}
25796
25797// Context sets the context to be used in this call's Do method. Any
25798// pending HTTP request will be aborted if the provided context is
25799// canceled.
25800func (c *ProjectsSinksUpdateCall) Context(ctx context.Context) *ProjectsSinksUpdateCall {
25801	c.ctx_ = ctx
25802	return c
25803}
25804
25805// Header returns an http.Header that can be modified by the caller to
25806// add HTTP headers to the request.
25807func (c *ProjectsSinksUpdateCall) Header() http.Header {
25808	if c.header_ == nil {
25809		c.header_ = make(http.Header)
25810	}
25811	return c.header_
25812}
25813
25814func (c *ProjectsSinksUpdateCall) doRequest(alt string) (*http.Response, error) {
25815	reqHeaders := make(http.Header)
25816	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
25817	for k, v := range c.header_ {
25818		reqHeaders[k] = v
25819	}
25820	reqHeaders.Set("User-Agent", c.s.userAgent())
25821	var body io.Reader = nil
25822	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
25823	if err != nil {
25824		return nil, err
25825	}
25826	reqHeaders.Set("Content-Type", "application/json")
25827	c.urlParams_.Set("alt", alt)
25828	c.urlParams_.Set("prettyPrint", "false")
25829	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
25830	urls += "?" + c.urlParams_.Encode()
25831	req, err := http.NewRequest("PUT", urls, body)
25832	if err != nil {
25833		return nil, err
25834	}
25835	req.Header = reqHeaders
25836	googleapi.Expand(req.URL, map[string]string{
25837		"sinkName": c.sinkNameid,
25838	})
25839	return gensupport.SendRequest(c.ctx_, c.s.client, req)
25840}
25841
25842// Do executes the "logging.projects.sinks.update" call.
25843// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
25844// code is an error. Response headers are in either
25845// *LogSink.ServerResponse.Header or (if a response was returned at all)
25846// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
25847// check whether the returned error was because http.StatusNotModified
25848// was returned.
25849func (c *ProjectsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
25850	gensupport.SetOptions(c.urlParams_, opts...)
25851	res, err := c.doRequest("json")
25852	if res != nil && res.StatusCode == http.StatusNotModified {
25853		if res.Body != nil {
25854			res.Body.Close()
25855		}
25856		return nil, &googleapi.Error{
25857			Code:   res.StatusCode,
25858			Header: res.Header,
25859		}
25860	}
25861	if err != nil {
25862		return nil, err
25863	}
25864	defer googleapi.CloseBody(res)
25865	if err := googleapi.CheckResponse(res); err != nil {
25866		return nil, err
25867	}
25868	ret := &LogSink{
25869		ServerResponse: googleapi.ServerResponse{
25870			Header:         res.Header,
25871			HTTPStatusCode: res.StatusCode,
25872		},
25873	}
25874	target := &ret
25875	if err := gensupport.DecodeResponse(target, res); err != nil {
25876		return nil, err
25877	}
25878	return ret, nil
25879	// {
25880	//   "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.",
25881	//   "flatPath": "v2/projects/{projectsId}/sinks/{sinksId}",
25882	//   "httpMethod": "PUT",
25883	//   "id": "logging.projects.sinks.update",
25884	//   "parameterOrder": [
25885	//     "sinkName"
25886	//   ],
25887	//   "parameters": {
25888	//     "sinkName": {
25889	//       "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\".",
25890	//       "location": "path",
25891	//       "pattern": "^projects/[^/]+/sinks/[^/]+$",
25892	//       "required": true,
25893	//       "type": "string"
25894	//     },
25895	//     "uniqueWriterIdentity": {
25896	//       "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.",
25897	//       "location": "query",
25898	//       "type": "boolean"
25899	//     },
25900	//     "updateMask": {
25901	//       "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.",
25902	//       "format": "google-fieldmask",
25903	//       "location": "query",
25904	//       "type": "string"
25905	//     }
25906	//   },
25907	//   "path": "v2/{+sinkName}",
25908	//   "request": {
25909	//     "$ref": "LogSink"
25910	//   },
25911	//   "response": {
25912	//     "$ref": "LogSink"
25913	//   },
25914	//   "scopes": [
25915	//     "https://www.googleapis.com/auth/cloud-platform",
25916	//     "https://www.googleapis.com/auth/logging.admin"
25917	//   ]
25918	// }
25919
25920}
25921
25922// method id "logging.sinks.create":
25923
25924type SinksCreateCall struct {
25925	s          *Service
25926	parent     string
25927	logsink    *LogSink
25928	urlParams_ gensupport.URLParams
25929	ctx_       context.Context
25930	header_    http.Header
25931}
25932
25933// Create: Creates a sink that exports specified log entries to a
25934// destination. The export of newly-ingested log entries begins
25935// immediately, unless the sink's writer_identity is not permitted to
25936// write to the destination. A sink can export log entries only from the
25937// resource owning the sink.
25938//
25939// - parent: The resource in which to create the sink:
25940//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
25941//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]"
25942//   Examples: "projects/my-logging-project", "organizations/123456789".
25943func (r *SinksService) Create(parent string, logsink *LogSink) *SinksCreateCall {
25944	c := &SinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
25945	c.parent = parent
25946	c.logsink = logsink
25947	return c
25948}
25949
25950// UniqueWriterIdentity sets the optional parameter
25951// "uniqueWriterIdentity": Determines the kind of IAM identity returned
25952// as writer_identity in the new sink. If this value is omitted or set
25953// to false, and if the sink's parent is a project, then the value
25954// returned as writer_identity is the same group or service account used
25955// by Logging before the addition of writer identities to this API. The
25956// sink's destination must be in the same project as the sink itself.If
25957// this field is set to true, or if the sink is owned by a non-project
25958// resource such as an organization, then the value of writer_identity
25959// will be a unique service account used only for exports from the new
25960// sink. For more information, see writer_identity in LogSink.
25961func (c *SinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *SinksCreateCall {
25962	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
25963	return c
25964}
25965
25966// Fields allows partial responses to be retrieved. See
25967// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
25968// for more information.
25969func (c *SinksCreateCall) Fields(s ...googleapi.Field) *SinksCreateCall {
25970	c.urlParams_.Set("fields", googleapi.CombineFields(s))
25971	return c
25972}
25973
25974// Context sets the context to be used in this call's Do method. Any
25975// pending HTTP request will be aborted if the provided context is
25976// canceled.
25977func (c *SinksCreateCall) Context(ctx context.Context) *SinksCreateCall {
25978	c.ctx_ = ctx
25979	return c
25980}
25981
25982// Header returns an http.Header that can be modified by the caller to
25983// add HTTP headers to the request.
25984func (c *SinksCreateCall) Header() http.Header {
25985	if c.header_ == nil {
25986		c.header_ = make(http.Header)
25987	}
25988	return c.header_
25989}
25990
25991func (c *SinksCreateCall) doRequest(alt string) (*http.Response, error) {
25992	reqHeaders := make(http.Header)
25993	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
25994	for k, v := range c.header_ {
25995		reqHeaders[k] = v
25996	}
25997	reqHeaders.Set("User-Agent", c.s.userAgent())
25998	var body io.Reader = nil
25999	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
26000	if err != nil {
26001		return nil, err
26002	}
26003	reqHeaders.Set("Content-Type", "application/json")
26004	c.urlParams_.Set("alt", alt)
26005	c.urlParams_.Set("prettyPrint", "false")
26006	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
26007	urls += "?" + c.urlParams_.Encode()
26008	req, err := http.NewRequest("POST", urls, body)
26009	if err != nil {
26010		return nil, err
26011	}
26012	req.Header = reqHeaders
26013	googleapi.Expand(req.URL, map[string]string{
26014		"parent": c.parent,
26015	})
26016	return gensupport.SendRequest(c.ctx_, c.s.client, req)
26017}
26018
26019// Do executes the "logging.sinks.create" call.
26020// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
26021// code is an error. Response headers are in either
26022// *LogSink.ServerResponse.Header or (if a response was returned at all)
26023// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
26024// check whether the returned error was because http.StatusNotModified
26025// was returned.
26026func (c *SinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
26027	gensupport.SetOptions(c.urlParams_, opts...)
26028	res, err := c.doRequest("json")
26029	if res != nil && res.StatusCode == http.StatusNotModified {
26030		if res.Body != nil {
26031			res.Body.Close()
26032		}
26033		return nil, &googleapi.Error{
26034			Code:   res.StatusCode,
26035			Header: res.Header,
26036		}
26037	}
26038	if err != nil {
26039		return nil, err
26040	}
26041	defer googleapi.CloseBody(res)
26042	if err := googleapi.CheckResponse(res); err != nil {
26043		return nil, err
26044	}
26045	ret := &LogSink{
26046		ServerResponse: googleapi.ServerResponse{
26047			Header:         res.Header,
26048			HTTPStatusCode: res.StatusCode,
26049		},
26050	}
26051	target := &ret
26052	if err := gensupport.DecodeResponse(target, res); err != nil {
26053		return nil, err
26054	}
26055	return ret, nil
26056	// {
26057	//   "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.",
26058	//   "flatPath": "v2/{v2Id}/{v2Id1}/sinks",
26059	//   "httpMethod": "POST",
26060	//   "id": "logging.sinks.create",
26061	//   "parameterOrder": [
26062	//     "parent"
26063	//   ],
26064	//   "parameters": {
26065	//     "parent": {
26066	//       "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\".",
26067	//       "location": "path",
26068	//       "pattern": "^[^/]+/[^/]+$",
26069	//       "required": true,
26070	//       "type": "string"
26071	//     },
26072	//     "uniqueWriterIdentity": {
26073	//       "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.",
26074	//       "location": "query",
26075	//       "type": "boolean"
26076	//     }
26077	//   },
26078	//   "path": "v2/{+parent}/sinks",
26079	//   "request": {
26080	//     "$ref": "LogSink"
26081	//   },
26082	//   "response": {
26083	//     "$ref": "LogSink"
26084	//   },
26085	//   "scopes": [
26086	//     "https://www.googleapis.com/auth/cloud-platform",
26087	//     "https://www.googleapis.com/auth/logging.admin"
26088	//   ]
26089	// }
26090
26091}
26092
26093// method id "logging.sinks.delete":
26094
26095type SinksDeleteCall struct {
26096	s          *Service
26097	sinkNameid string
26098	urlParams_ gensupport.URLParams
26099	ctx_       context.Context
26100	header_    http.Header
26101}
26102
26103// Delete: Deletes a sink. If the sink has a unique writer_identity,
26104// then that service account is also deleted.
26105//
26106// - sinkName: The full resource name of the sink to delete, including
26107//   the parent resource and the sink identifier:
26108//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
26109//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
26110//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
26111//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example:
26112//   "projects/my-project-id/sinks/my-sink-id".
26113func (r *SinksService) Delete(sinkNameid string) *SinksDeleteCall {
26114	c := &SinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
26115	c.sinkNameid = sinkNameid
26116	return c
26117}
26118
26119// Fields allows partial responses to be retrieved. See
26120// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
26121// for more information.
26122func (c *SinksDeleteCall) Fields(s ...googleapi.Field) *SinksDeleteCall {
26123	c.urlParams_.Set("fields", googleapi.CombineFields(s))
26124	return c
26125}
26126
26127// Context sets the context to be used in this call's Do method. Any
26128// pending HTTP request will be aborted if the provided context is
26129// canceled.
26130func (c *SinksDeleteCall) Context(ctx context.Context) *SinksDeleteCall {
26131	c.ctx_ = ctx
26132	return c
26133}
26134
26135// Header returns an http.Header that can be modified by the caller to
26136// add HTTP headers to the request.
26137func (c *SinksDeleteCall) Header() http.Header {
26138	if c.header_ == nil {
26139		c.header_ = make(http.Header)
26140	}
26141	return c.header_
26142}
26143
26144func (c *SinksDeleteCall) doRequest(alt string) (*http.Response, error) {
26145	reqHeaders := make(http.Header)
26146	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
26147	for k, v := range c.header_ {
26148		reqHeaders[k] = v
26149	}
26150	reqHeaders.Set("User-Agent", c.s.userAgent())
26151	var body io.Reader = nil
26152	c.urlParams_.Set("alt", alt)
26153	c.urlParams_.Set("prettyPrint", "false")
26154	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
26155	urls += "?" + c.urlParams_.Encode()
26156	req, err := http.NewRequest("DELETE", urls, body)
26157	if err != nil {
26158		return nil, err
26159	}
26160	req.Header = reqHeaders
26161	googleapi.Expand(req.URL, map[string]string{
26162		"sinkName": c.sinkNameid,
26163	})
26164	return gensupport.SendRequest(c.ctx_, c.s.client, req)
26165}
26166
26167// Do executes the "logging.sinks.delete" call.
26168// Exactly one of *Empty or error will be non-nil. Any non-2xx status
26169// code is an error. Response headers are in either
26170// *Empty.ServerResponse.Header or (if a response was returned at all)
26171// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
26172// check whether the returned error was because http.StatusNotModified
26173// was returned.
26174func (c *SinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
26175	gensupport.SetOptions(c.urlParams_, opts...)
26176	res, err := c.doRequest("json")
26177	if res != nil && res.StatusCode == http.StatusNotModified {
26178		if res.Body != nil {
26179			res.Body.Close()
26180		}
26181		return nil, &googleapi.Error{
26182			Code:   res.StatusCode,
26183			Header: res.Header,
26184		}
26185	}
26186	if err != nil {
26187		return nil, err
26188	}
26189	defer googleapi.CloseBody(res)
26190	if err := googleapi.CheckResponse(res); err != nil {
26191		return nil, err
26192	}
26193	ret := &Empty{
26194		ServerResponse: googleapi.ServerResponse{
26195			Header:         res.Header,
26196			HTTPStatusCode: res.StatusCode,
26197		},
26198	}
26199	target := &ret
26200	if err := gensupport.DecodeResponse(target, res); err != nil {
26201		return nil, err
26202	}
26203	return ret, nil
26204	// {
26205	//   "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.",
26206	//   "flatPath": "v2/{v2Id}/{v2Id1}/sinks/{sinksId}",
26207	//   "httpMethod": "DELETE",
26208	//   "id": "logging.sinks.delete",
26209	//   "parameterOrder": [
26210	//     "sinkName"
26211	//   ],
26212	//   "parameters": {
26213	//     "sinkName": {
26214	//       "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\".",
26215	//       "location": "path",
26216	//       "pattern": "^[^/]+/[^/]+/sinks/[^/]+$",
26217	//       "required": true,
26218	//       "type": "string"
26219	//     }
26220	//   },
26221	//   "path": "v2/{+sinkName}",
26222	//   "response": {
26223	//     "$ref": "Empty"
26224	//   },
26225	//   "scopes": [
26226	//     "https://www.googleapis.com/auth/cloud-platform",
26227	//     "https://www.googleapis.com/auth/logging.admin"
26228	//   ]
26229	// }
26230
26231}
26232
26233// method id "logging.sinks.get":
26234
26235type SinksGetCall struct {
26236	s            *Service
26237	sinkName     string
26238	urlParams_   gensupport.URLParams
26239	ifNoneMatch_ string
26240	ctx_         context.Context
26241	header_      http.Header
26242}
26243
26244// Get: Gets a sink.
26245//
26246// - sinkName: The resource name of the sink:
26247//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
26248//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
26249//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
26250//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example:
26251//   "projects/my-project-id/sinks/my-sink-id".
26252func (r *SinksService) Get(sinkName string) *SinksGetCall {
26253	c := &SinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
26254	c.sinkName = sinkName
26255	return c
26256}
26257
26258// Fields allows partial responses to be retrieved. See
26259// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
26260// for more information.
26261func (c *SinksGetCall) Fields(s ...googleapi.Field) *SinksGetCall {
26262	c.urlParams_.Set("fields", googleapi.CombineFields(s))
26263	return c
26264}
26265
26266// IfNoneMatch sets the optional parameter which makes the operation
26267// fail if the object's ETag matches the given value. This is useful for
26268// getting updates only after the object has changed since the last
26269// request. Use googleapi.IsNotModified to check whether the response
26270// error from Do is the result of In-None-Match.
26271func (c *SinksGetCall) IfNoneMatch(entityTag string) *SinksGetCall {
26272	c.ifNoneMatch_ = entityTag
26273	return c
26274}
26275
26276// Context sets the context to be used in this call's Do method. Any
26277// pending HTTP request will be aborted if the provided context is
26278// canceled.
26279func (c *SinksGetCall) Context(ctx context.Context) *SinksGetCall {
26280	c.ctx_ = ctx
26281	return c
26282}
26283
26284// Header returns an http.Header that can be modified by the caller to
26285// add HTTP headers to the request.
26286func (c *SinksGetCall) Header() http.Header {
26287	if c.header_ == nil {
26288		c.header_ = make(http.Header)
26289	}
26290	return c.header_
26291}
26292
26293func (c *SinksGetCall) doRequest(alt string) (*http.Response, error) {
26294	reqHeaders := make(http.Header)
26295	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
26296	for k, v := range c.header_ {
26297		reqHeaders[k] = v
26298	}
26299	reqHeaders.Set("User-Agent", c.s.userAgent())
26300	if c.ifNoneMatch_ != "" {
26301		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
26302	}
26303	var body io.Reader = nil
26304	c.urlParams_.Set("alt", alt)
26305	c.urlParams_.Set("prettyPrint", "false")
26306	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
26307	urls += "?" + c.urlParams_.Encode()
26308	req, err := http.NewRequest("GET", urls, body)
26309	if err != nil {
26310		return nil, err
26311	}
26312	req.Header = reqHeaders
26313	googleapi.Expand(req.URL, map[string]string{
26314		"sinkName": c.sinkName,
26315	})
26316	return gensupport.SendRequest(c.ctx_, c.s.client, req)
26317}
26318
26319// Do executes the "logging.sinks.get" call.
26320// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
26321// code is an error. Response headers are in either
26322// *LogSink.ServerResponse.Header or (if a response was returned at all)
26323// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
26324// check whether the returned error was because http.StatusNotModified
26325// was returned.
26326func (c *SinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
26327	gensupport.SetOptions(c.urlParams_, opts...)
26328	res, err := c.doRequest("json")
26329	if res != nil && res.StatusCode == http.StatusNotModified {
26330		if res.Body != nil {
26331			res.Body.Close()
26332		}
26333		return nil, &googleapi.Error{
26334			Code:   res.StatusCode,
26335			Header: res.Header,
26336		}
26337	}
26338	if err != nil {
26339		return nil, err
26340	}
26341	defer googleapi.CloseBody(res)
26342	if err := googleapi.CheckResponse(res); err != nil {
26343		return nil, err
26344	}
26345	ret := &LogSink{
26346		ServerResponse: googleapi.ServerResponse{
26347			Header:         res.Header,
26348			HTTPStatusCode: res.StatusCode,
26349		},
26350	}
26351	target := &ret
26352	if err := gensupport.DecodeResponse(target, res); err != nil {
26353		return nil, err
26354	}
26355	return ret, nil
26356	// {
26357	//   "description": "Gets a sink.",
26358	//   "flatPath": "v2/{v2Id}/{v2Id1}/sinks/{sinksId}",
26359	//   "httpMethod": "GET",
26360	//   "id": "logging.sinks.get",
26361	//   "parameterOrder": [
26362	//     "sinkName"
26363	//   ],
26364	//   "parameters": {
26365	//     "sinkName": {
26366	//       "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\".",
26367	//       "location": "path",
26368	//       "pattern": "^[^/]+/[^/]+/sinks/[^/]+$",
26369	//       "required": true,
26370	//       "type": "string"
26371	//     }
26372	//   },
26373	//   "path": "v2/{+sinkName}",
26374	//   "response": {
26375	//     "$ref": "LogSink"
26376	//   },
26377	//   "scopes": [
26378	//     "https://www.googleapis.com/auth/cloud-platform",
26379	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
26380	//     "https://www.googleapis.com/auth/logging.admin",
26381	//     "https://www.googleapis.com/auth/logging.read"
26382	//   ]
26383	// }
26384
26385}
26386
26387// method id "logging.sinks.list":
26388
26389type SinksListCall struct {
26390	s            *Service
26391	parent       string
26392	urlParams_   gensupport.URLParams
26393	ifNoneMatch_ string
26394	ctx_         context.Context
26395	header_      http.Header
26396}
26397
26398// List: Lists sinks.
26399//
26400// - parent: The parent resource whose sinks are to be listed:
26401//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
26402//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]".
26403func (r *SinksService) List(parent string) *SinksListCall {
26404	c := &SinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
26405	c.parent = parent
26406	return c
26407}
26408
26409// PageSize sets the optional parameter "pageSize": The maximum number
26410// of results to return from this request. Non-positive values are
26411// ignored. The presence of nextPageToken in the response indicates that
26412// more results might be available.
26413func (c *SinksListCall) PageSize(pageSize int64) *SinksListCall {
26414	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
26415	return c
26416}
26417
26418// PageToken sets the optional parameter "pageToken": If present, then
26419// retrieve the next batch of results from the preceding call to this
26420// method. pageToken must be the value of nextPageToken from the
26421// previous response. The values of other method parameters should be
26422// identical to those in the previous call.
26423func (c *SinksListCall) PageToken(pageToken string) *SinksListCall {
26424	c.urlParams_.Set("pageToken", pageToken)
26425	return c
26426}
26427
26428// Fields allows partial responses to be retrieved. See
26429// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
26430// for more information.
26431func (c *SinksListCall) Fields(s ...googleapi.Field) *SinksListCall {
26432	c.urlParams_.Set("fields", googleapi.CombineFields(s))
26433	return c
26434}
26435
26436// IfNoneMatch sets the optional parameter which makes the operation
26437// fail if the object's ETag matches the given value. This is useful for
26438// getting updates only after the object has changed since the last
26439// request. Use googleapi.IsNotModified to check whether the response
26440// error from Do is the result of In-None-Match.
26441func (c *SinksListCall) IfNoneMatch(entityTag string) *SinksListCall {
26442	c.ifNoneMatch_ = entityTag
26443	return c
26444}
26445
26446// Context sets the context to be used in this call's Do method. Any
26447// pending HTTP request will be aborted if the provided context is
26448// canceled.
26449func (c *SinksListCall) Context(ctx context.Context) *SinksListCall {
26450	c.ctx_ = ctx
26451	return c
26452}
26453
26454// Header returns an http.Header that can be modified by the caller to
26455// add HTTP headers to the request.
26456func (c *SinksListCall) Header() http.Header {
26457	if c.header_ == nil {
26458		c.header_ = make(http.Header)
26459	}
26460	return c.header_
26461}
26462
26463func (c *SinksListCall) doRequest(alt string) (*http.Response, error) {
26464	reqHeaders := make(http.Header)
26465	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
26466	for k, v := range c.header_ {
26467		reqHeaders[k] = v
26468	}
26469	reqHeaders.Set("User-Agent", c.s.userAgent())
26470	if c.ifNoneMatch_ != "" {
26471		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
26472	}
26473	var body io.Reader = nil
26474	c.urlParams_.Set("alt", alt)
26475	c.urlParams_.Set("prettyPrint", "false")
26476	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
26477	urls += "?" + c.urlParams_.Encode()
26478	req, err := http.NewRequest("GET", urls, body)
26479	if err != nil {
26480		return nil, err
26481	}
26482	req.Header = reqHeaders
26483	googleapi.Expand(req.URL, map[string]string{
26484		"parent": c.parent,
26485	})
26486	return gensupport.SendRequest(c.ctx_, c.s.client, req)
26487}
26488
26489// Do executes the "logging.sinks.list" call.
26490// Exactly one of *ListSinksResponse or error will be non-nil. Any
26491// non-2xx status code is an error. Response headers are in either
26492// *ListSinksResponse.ServerResponse.Header or (if a response was
26493// returned at all) in error.(*googleapi.Error).Header. Use
26494// googleapi.IsNotModified to check whether the returned error was
26495// because http.StatusNotModified was returned.
26496func (c *SinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) {
26497	gensupport.SetOptions(c.urlParams_, opts...)
26498	res, err := c.doRequest("json")
26499	if res != nil && res.StatusCode == http.StatusNotModified {
26500		if res.Body != nil {
26501			res.Body.Close()
26502		}
26503		return nil, &googleapi.Error{
26504			Code:   res.StatusCode,
26505			Header: res.Header,
26506		}
26507	}
26508	if err != nil {
26509		return nil, err
26510	}
26511	defer googleapi.CloseBody(res)
26512	if err := googleapi.CheckResponse(res); err != nil {
26513		return nil, err
26514	}
26515	ret := &ListSinksResponse{
26516		ServerResponse: googleapi.ServerResponse{
26517			Header:         res.Header,
26518			HTTPStatusCode: res.StatusCode,
26519		},
26520	}
26521	target := &ret
26522	if err := gensupport.DecodeResponse(target, res); err != nil {
26523		return nil, err
26524	}
26525	return ret, nil
26526	// {
26527	//   "description": "Lists sinks.",
26528	//   "flatPath": "v2/{v2Id}/{v2Id1}/sinks",
26529	//   "httpMethod": "GET",
26530	//   "id": "logging.sinks.list",
26531	//   "parameterOrder": [
26532	//     "parent"
26533	//   ],
26534	//   "parameters": {
26535	//     "pageSize": {
26536	//       "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.",
26537	//       "format": "int32",
26538	//       "location": "query",
26539	//       "type": "integer"
26540	//     },
26541	//     "pageToken": {
26542	//       "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.",
26543	//       "location": "query",
26544	//       "type": "string"
26545	//     },
26546	//     "parent": {
26547	//       "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
26548	//       "location": "path",
26549	//       "pattern": "^[^/]+/[^/]+$",
26550	//       "required": true,
26551	//       "type": "string"
26552	//     }
26553	//   },
26554	//   "path": "v2/{+parent}/sinks",
26555	//   "response": {
26556	//     "$ref": "ListSinksResponse"
26557	//   },
26558	//   "scopes": [
26559	//     "https://www.googleapis.com/auth/cloud-platform",
26560	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
26561	//     "https://www.googleapis.com/auth/logging.admin",
26562	//     "https://www.googleapis.com/auth/logging.read"
26563	//   ]
26564	// }
26565
26566}
26567
26568// Pages invokes f for each page of results.
26569// A non-nil error returned from f will halt the iteration.
26570// The provided context supersedes any context provided to the Context method.
26571func (c *SinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error {
26572	c.ctx_ = ctx
26573	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
26574	for {
26575		x, err := c.Do()
26576		if err != nil {
26577			return err
26578		}
26579		if err := f(x); err != nil {
26580			return err
26581		}
26582		if x.NextPageToken == "" {
26583			return nil
26584		}
26585		c.PageToken(x.NextPageToken)
26586	}
26587}
26588
26589// method id "logging.sinks.update":
26590
26591type SinksUpdateCall struct {
26592	s          *Service
26593	sinkNameid string
26594	logsink    *LogSink
26595	urlParams_ gensupport.URLParams
26596	ctx_       context.Context
26597	header_    http.Header
26598}
26599
26600// Update: Updates a sink. This method replaces the following fields in
26601// the existing sink with values from the new sink: destination, and
26602// filter.The updated sink might also have a new writer_identity; see
26603// the unique_writer_identity field.
26604//
26605// - sinkName: The full resource name of the sink to update, including
26606//   the parent resource and the sink identifier:
26607//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
26608//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
26609//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
26610//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" Example:
26611//   "projects/my-project-id/sinks/my-sink-id".
26612func (r *SinksService) Update(sinkNameid string, logsink *LogSink) *SinksUpdateCall {
26613	c := &SinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
26614	c.sinkNameid = sinkNameid
26615	c.logsink = logsink
26616	return c
26617}
26618
26619// UniqueWriterIdentity sets the optional parameter
26620// "uniqueWriterIdentity": See sinks.create for a description of this
26621// field. When updating a sink, the effect of this field on the value of
26622// writer_identity in the updated sink depends on both the old and new
26623// values of this field: If the old and new values of this field are
26624// both false or both true, then there is no change to the sink's
26625// writer_identity. If the old value is false and the new value is true,
26626// then writer_identity is changed to a unique service account. It is an
26627// error if the old value is true and the new value is set to false or
26628// defaulted to false.
26629func (c *SinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *SinksUpdateCall {
26630	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
26631	return c
26632}
26633
26634// UpdateMask sets the optional parameter "updateMask": Field mask that
26635// specifies the fields in sink that need an update. A sink field will
26636// be overwritten if, and only if, it is in the update mask. name and
26637// output only fields cannot be updated.An empty updateMask is
26638// temporarily treated as using the following mask for backwards
26639// compatibility purposes: destination,filter,includeChildren At some
26640// point in the future, behavior will be removed and specifying an empty
26641// updateMask will be an error.For a detailed FieldMask definition, see
26642// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskExample:
26643// updateMask=filter.
26644func (c *SinksUpdateCall) UpdateMask(updateMask string) *SinksUpdateCall {
26645	c.urlParams_.Set("updateMask", updateMask)
26646	return c
26647}
26648
26649// Fields allows partial responses to be retrieved. See
26650// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
26651// for more information.
26652func (c *SinksUpdateCall) Fields(s ...googleapi.Field) *SinksUpdateCall {
26653	c.urlParams_.Set("fields", googleapi.CombineFields(s))
26654	return c
26655}
26656
26657// Context sets the context to be used in this call's Do method. Any
26658// pending HTTP request will be aborted if the provided context is
26659// canceled.
26660func (c *SinksUpdateCall) Context(ctx context.Context) *SinksUpdateCall {
26661	c.ctx_ = ctx
26662	return c
26663}
26664
26665// Header returns an http.Header that can be modified by the caller to
26666// add HTTP headers to the request.
26667func (c *SinksUpdateCall) Header() http.Header {
26668	if c.header_ == nil {
26669		c.header_ = make(http.Header)
26670	}
26671	return c.header_
26672}
26673
26674func (c *SinksUpdateCall) doRequest(alt string) (*http.Response, error) {
26675	reqHeaders := make(http.Header)
26676	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
26677	for k, v := range c.header_ {
26678		reqHeaders[k] = v
26679	}
26680	reqHeaders.Set("User-Agent", c.s.userAgent())
26681	var body io.Reader = nil
26682	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
26683	if err != nil {
26684		return nil, err
26685	}
26686	reqHeaders.Set("Content-Type", "application/json")
26687	c.urlParams_.Set("alt", alt)
26688	c.urlParams_.Set("prettyPrint", "false")
26689	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
26690	urls += "?" + c.urlParams_.Encode()
26691	req, err := http.NewRequest("PUT", urls, body)
26692	if err != nil {
26693		return nil, err
26694	}
26695	req.Header = reqHeaders
26696	googleapi.Expand(req.URL, map[string]string{
26697		"sinkName": c.sinkNameid,
26698	})
26699	return gensupport.SendRequest(c.ctx_, c.s.client, req)
26700}
26701
26702// Do executes the "logging.sinks.update" call.
26703// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
26704// code is an error. Response headers are in either
26705// *LogSink.ServerResponse.Header or (if a response was returned at all)
26706// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
26707// check whether the returned error was because http.StatusNotModified
26708// was returned.
26709func (c *SinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
26710	gensupport.SetOptions(c.urlParams_, opts...)
26711	res, err := c.doRequest("json")
26712	if res != nil && res.StatusCode == http.StatusNotModified {
26713		if res.Body != nil {
26714			res.Body.Close()
26715		}
26716		return nil, &googleapi.Error{
26717			Code:   res.StatusCode,
26718			Header: res.Header,
26719		}
26720	}
26721	if err != nil {
26722		return nil, err
26723	}
26724	defer googleapi.CloseBody(res)
26725	if err := googleapi.CheckResponse(res); err != nil {
26726		return nil, err
26727	}
26728	ret := &LogSink{
26729		ServerResponse: googleapi.ServerResponse{
26730			Header:         res.Header,
26731			HTTPStatusCode: res.StatusCode,
26732		},
26733	}
26734	target := &ret
26735	if err := gensupport.DecodeResponse(target, res); err != nil {
26736		return nil, err
26737	}
26738	return ret, nil
26739	// {
26740	//   "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.",
26741	//   "flatPath": "v2/{v2Id}/{v2Id1}/sinks/{sinksId}",
26742	//   "httpMethod": "PUT",
26743	//   "id": "logging.sinks.update",
26744	//   "parameterOrder": [
26745	//     "sinkName"
26746	//   ],
26747	//   "parameters": {
26748	//     "sinkName": {
26749	//       "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\".",
26750	//       "location": "path",
26751	//       "pattern": "^[^/]+/[^/]+/sinks/[^/]+$",
26752	//       "required": true,
26753	//       "type": "string"
26754	//     },
26755	//     "uniqueWriterIdentity": {
26756	//       "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.",
26757	//       "location": "query",
26758	//       "type": "boolean"
26759	//     },
26760	//     "updateMask": {
26761	//       "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.",
26762	//       "format": "google-fieldmask",
26763	//       "location": "query",
26764	//       "type": "string"
26765	//     }
26766	//   },
26767	//   "path": "v2/{+sinkName}",
26768	//   "request": {
26769	//     "$ref": "LogSink"
26770	//   },
26771	//   "response": {
26772	//     "$ref": "LogSink"
26773	//   },
26774	//   "scopes": [
26775	//     "https://www.googleapis.com/auth/cloud-platform",
26776	//     "https://www.googleapis.com/auth/logging.admin"
26777	//   ]
26778	// }
26779
26780}
26781
26782// method id "logging.getCmekSettings":
26783
26784type V2GetCmekSettingsCall struct {
26785	s            *Service
26786	name         string
26787	urlParams_   gensupport.URLParams
26788	ifNoneMatch_ string
26789	ctx_         context.Context
26790	header_      http.Header
26791}
26792
26793// GetCmekSettings: Gets the Logs Router CMEK settings for the given
26794// resource.Note: CMEK for the Logs Router can currently only be
26795// configured for GCP organizations. Once configured, it applies to all
26796// projects and folders in the GCP organization.See Enabling CMEK for
26797// Logs Router
26798// (https://cloud.google.com/logging/docs/routing/managed-encryption)
26799// for more information.
26800//
26801// - name: The resource for which to retrieve CMEK settings.
26802//   "projects/[PROJECT_ID]/cmekSettings"
26803//   "organizations/[ORGANIZATION_ID]/cmekSettings"
26804//   "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
26805//   "folders/[FOLDER_ID]/cmekSettings" Example:
26806//   "organizations/12345/cmekSettings".Note: CMEK for the Logs Router
26807//   can currently only be configured for GCP organizations. Once
26808//   configured, it applies to all projects and folders in the GCP
26809//   organization.
26810func (r *V2Service) GetCmekSettings(name string) *V2GetCmekSettingsCall {
26811	c := &V2GetCmekSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
26812	c.name = name
26813	return c
26814}
26815
26816// Fields allows partial responses to be retrieved. See
26817// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
26818// for more information.
26819func (c *V2GetCmekSettingsCall) Fields(s ...googleapi.Field) *V2GetCmekSettingsCall {
26820	c.urlParams_.Set("fields", googleapi.CombineFields(s))
26821	return c
26822}
26823
26824// IfNoneMatch sets the optional parameter which makes the operation
26825// fail if the object's ETag matches the given value. This is useful for
26826// getting updates only after the object has changed since the last
26827// request. Use googleapi.IsNotModified to check whether the response
26828// error from Do is the result of In-None-Match.
26829func (c *V2GetCmekSettingsCall) IfNoneMatch(entityTag string) *V2GetCmekSettingsCall {
26830	c.ifNoneMatch_ = entityTag
26831	return c
26832}
26833
26834// Context sets the context to be used in this call's Do method. Any
26835// pending HTTP request will be aborted if the provided context is
26836// canceled.
26837func (c *V2GetCmekSettingsCall) Context(ctx context.Context) *V2GetCmekSettingsCall {
26838	c.ctx_ = ctx
26839	return c
26840}
26841
26842// Header returns an http.Header that can be modified by the caller to
26843// add HTTP headers to the request.
26844func (c *V2GetCmekSettingsCall) Header() http.Header {
26845	if c.header_ == nil {
26846		c.header_ = make(http.Header)
26847	}
26848	return c.header_
26849}
26850
26851func (c *V2GetCmekSettingsCall) doRequest(alt string) (*http.Response, error) {
26852	reqHeaders := make(http.Header)
26853	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
26854	for k, v := range c.header_ {
26855		reqHeaders[k] = v
26856	}
26857	reqHeaders.Set("User-Agent", c.s.userAgent())
26858	if c.ifNoneMatch_ != "" {
26859		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
26860	}
26861	var body io.Reader = nil
26862	c.urlParams_.Set("alt", alt)
26863	c.urlParams_.Set("prettyPrint", "false")
26864	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings")
26865	urls += "?" + c.urlParams_.Encode()
26866	req, err := http.NewRequest("GET", urls, body)
26867	if err != nil {
26868		return nil, err
26869	}
26870	req.Header = reqHeaders
26871	googleapi.Expand(req.URL, map[string]string{
26872		"name": c.name,
26873	})
26874	return gensupport.SendRequest(c.ctx_, c.s.client, req)
26875}
26876
26877// Do executes the "logging.getCmekSettings" call.
26878// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx
26879// status code is an error. Response headers are in either
26880// *CmekSettings.ServerResponse.Header or (if a response was returned at
26881// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
26882// to check whether the returned error was because
26883// http.StatusNotModified was returned.
26884func (c *V2GetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) {
26885	gensupport.SetOptions(c.urlParams_, opts...)
26886	res, err := c.doRequest("json")
26887	if res != nil && res.StatusCode == http.StatusNotModified {
26888		if res.Body != nil {
26889			res.Body.Close()
26890		}
26891		return nil, &googleapi.Error{
26892			Code:   res.StatusCode,
26893			Header: res.Header,
26894		}
26895	}
26896	if err != nil {
26897		return nil, err
26898	}
26899	defer googleapi.CloseBody(res)
26900	if err := googleapi.CheckResponse(res); err != nil {
26901		return nil, err
26902	}
26903	ret := &CmekSettings{
26904		ServerResponse: googleapi.ServerResponse{
26905			Header:         res.Header,
26906			HTTPStatusCode: res.StatusCode,
26907		},
26908	}
26909	target := &ret
26910	if err := gensupport.DecodeResponse(target, res); err != nil {
26911		return nil, err
26912	}
26913	return ret, nil
26914	// {
26915	//   "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.",
26916	//   "flatPath": "v2/{v2Id}/{v2Id1}/cmekSettings",
26917	//   "httpMethod": "GET",
26918	//   "id": "logging.getCmekSettings",
26919	//   "parameterOrder": [
26920	//     "name"
26921	//   ],
26922	//   "parameters": {
26923	//     "name": {
26924	//       "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.",
26925	//       "location": "path",
26926	//       "pattern": "^[^/]+/[^/]+$",
26927	//       "required": true,
26928	//       "type": "string"
26929	//     }
26930	//   },
26931	//   "path": "v2/{+name}/cmekSettings",
26932	//   "response": {
26933	//     "$ref": "CmekSettings"
26934	//   },
26935	//   "scopes": [
26936	//     "https://www.googleapis.com/auth/cloud-platform",
26937	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
26938	//     "https://www.googleapis.com/auth/logging.admin",
26939	//     "https://www.googleapis.com/auth/logging.read"
26940	//   ]
26941	// }
26942
26943}
26944
26945// method id "logging.updateCmekSettings":
26946
26947type V2UpdateCmekSettingsCall struct {
26948	s            *Service
26949	name         string
26950	cmeksettings *CmekSettings
26951	urlParams_   gensupport.URLParams
26952	ctx_         context.Context
26953	header_      http.Header
26954}
26955
26956// UpdateCmekSettings: Updates the Logs Router CMEK settings for the
26957// given resource.Note: CMEK for the Logs Router can currently only be
26958// configured for GCP organizations. Once configured, it applies to all
26959// projects and folders in the GCP organization.UpdateCmekSettings will
26960// fail if 1) kms_key_name is invalid, or 2) the associated service
26961// account does not have the required
26962// roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for the key,
26963// or 3) access to the key is disabled.See Enabling CMEK for Logs Router
26964// (https://cloud.google.com/logging/docs/routing/managed-encryption)
26965// for more information.
26966//
26967// - name: The resource name for the CMEK settings to update.
26968//   "projects/[PROJECT_ID]/cmekSettings"
26969//   "organizations/[ORGANIZATION_ID]/cmekSettings"
26970//   "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
26971//   "folders/[FOLDER_ID]/cmekSettings" Example:
26972//   "organizations/12345/cmekSettings".Note: CMEK for the Logs Router
26973//   can currently only be configured for GCP organizations. Once
26974//   configured, it applies to all projects and folders in the GCP
26975//   organization.
26976func (r *V2Service) UpdateCmekSettings(name string, cmeksettings *CmekSettings) *V2UpdateCmekSettingsCall {
26977	c := &V2UpdateCmekSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
26978	c.name = name
26979	c.cmeksettings = cmeksettings
26980	return c
26981}
26982
26983// UpdateMask sets the optional parameter "updateMask": Field mask
26984// identifying which fields from cmek_settings should be updated. A
26985// field will be overwritten if and only if it is in the update mask.
26986// Output only fields cannot be updated.See FieldMask for more
26987// information.Example: "updateMask=kmsKeyName"
26988func (c *V2UpdateCmekSettingsCall) UpdateMask(updateMask string) *V2UpdateCmekSettingsCall {
26989	c.urlParams_.Set("updateMask", updateMask)
26990	return c
26991}
26992
26993// Fields allows partial responses to be retrieved. See
26994// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
26995// for more information.
26996func (c *V2UpdateCmekSettingsCall) Fields(s ...googleapi.Field) *V2UpdateCmekSettingsCall {
26997	c.urlParams_.Set("fields", googleapi.CombineFields(s))
26998	return c
26999}
27000
27001// Context sets the context to be used in this call's Do method. Any
27002// pending HTTP request will be aborted if the provided context is
27003// canceled.
27004func (c *V2UpdateCmekSettingsCall) Context(ctx context.Context) *V2UpdateCmekSettingsCall {
27005	c.ctx_ = ctx
27006	return c
27007}
27008
27009// Header returns an http.Header that can be modified by the caller to
27010// add HTTP headers to the request.
27011func (c *V2UpdateCmekSettingsCall) Header() http.Header {
27012	if c.header_ == nil {
27013		c.header_ = make(http.Header)
27014	}
27015	return c.header_
27016}
27017
27018func (c *V2UpdateCmekSettingsCall) doRequest(alt string) (*http.Response, error) {
27019	reqHeaders := make(http.Header)
27020	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502")
27021	for k, v := range c.header_ {
27022		reqHeaders[k] = v
27023	}
27024	reqHeaders.Set("User-Agent", c.s.userAgent())
27025	var body io.Reader = nil
27026	body, err := googleapi.WithoutDataWrapper.JSONReader(c.cmeksettings)
27027	if err != nil {
27028		return nil, err
27029	}
27030	reqHeaders.Set("Content-Type", "application/json")
27031	c.urlParams_.Set("alt", alt)
27032	c.urlParams_.Set("prettyPrint", "false")
27033	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings")
27034	urls += "?" + c.urlParams_.Encode()
27035	req, err := http.NewRequest("PATCH", urls, body)
27036	if err != nil {
27037		return nil, err
27038	}
27039	req.Header = reqHeaders
27040	googleapi.Expand(req.URL, map[string]string{
27041		"name": c.name,
27042	})
27043	return gensupport.SendRequest(c.ctx_, c.s.client, req)
27044}
27045
27046// Do executes the "logging.updateCmekSettings" call.
27047// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx
27048// status code is an error. Response headers are in either
27049// *CmekSettings.ServerResponse.Header or (if a response was returned at
27050// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
27051// to check whether the returned error was because
27052// http.StatusNotModified was returned.
27053func (c *V2UpdateCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) {
27054	gensupport.SetOptions(c.urlParams_, opts...)
27055	res, err := c.doRequest("json")
27056	if res != nil && res.StatusCode == http.StatusNotModified {
27057		if res.Body != nil {
27058			res.Body.Close()
27059		}
27060		return nil, &googleapi.Error{
27061			Code:   res.StatusCode,
27062			Header: res.Header,
27063		}
27064	}
27065	if err != nil {
27066		return nil, err
27067	}
27068	defer googleapi.CloseBody(res)
27069	if err := googleapi.CheckResponse(res); err != nil {
27070		return nil, err
27071	}
27072	ret := &CmekSettings{
27073		ServerResponse: googleapi.ServerResponse{
27074			Header:         res.Header,
27075			HTTPStatusCode: res.StatusCode,
27076		},
27077	}
27078	target := &ret
27079	if err := gensupport.DecodeResponse(target, res); err != nil {
27080		return nil, err
27081	}
27082	return ret, nil
27083	// {
27084	//   "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.",
27085	//   "flatPath": "v2/{v2Id}/{v2Id1}/cmekSettings",
27086	//   "httpMethod": "PATCH",
27087	//   "id": "logging.updateCmekSettings",
27088	//   "parameterOrder": [
27089	//     "name"
27090	//   ],
27091	//   "parameters": {
27092	//     "name": {
27093	//       "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.",
27094	//       "location": "path",
27095	//       "pattern": "^[^/]+/[^/]+$",
27096	//       "required": true,
27097	//       "type": "string"
27098	//     },
27099	//     "updateMask": {
27100	//       "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\"",
27101	//       "format": "google-fieldmask",
27102	//       "location": "query",
27103	//       "type": "string"
27104	//     }
27105	//   },
27106	//   "path": "v2/{+name}/cmekSettings",
27107	//   "request": {
27108	//     "$ref": "CmekSettings"
27109	//   },
27110	//   "response": {
27111	//     "$ref": "CmekSettings"
27112	//   },
27113	//   "scopes": [
27114	//     "https://www.googleapis.com/auth/cloud-platform",
27115	//     "https://www.googleapis.com/auth/logging.admin"
27116	//   ]
27117	// }
27118
27119}
27120