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 data and see the
89	// email address for your Google Account.
90	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
91
92	// View your data across Google Cloud services and see the email address
93	// of your Google Account
94	CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
95
96	// Administrate log data for your projects
97	LoggingAdminScope = "https://www.googleapis.com/auth/logging.admin"
98
99	// View log data for your projects
100	LoggingReadScope = "https://www.googleapis.com/auth/logging.read"
101
102	// Submit log data for your projects
103	LoggingWriteScope = "https://www.googleapis.com/auth/logging.write"
104)
105
106// NewService creates a new Service.
107func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
108	scopesOption := option.WithScopes(
109		"https://www.googleapis.com/auth/cloud-platform",
110		"https://www.googleapis.com/auth/cloud-platform.read-only",
111		"https://www.googleapis.com/auth/logging.admin",
112		"https://www.googleapis.com/auth/logging.read",
113		"https://www.googleapis.com/auth/logging.write",
114	)
115	// NOTE: prepend, so we don't override user-specified scopes.
116	opts = append([]option.ClientOption{scopesOption}, opts...)
117	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
118	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
119	client, endpoint, err := htransport.NewClient(ctx, opts...)
120	if err != nil {
121		return nil, err
122	}
123	s, err := New(client)
124	if err != nil {
125		return nil, err
126	}
127	if endpoint != "" {
128		s.BasePath = endpoint
129	}
130	return s, nil
131}
132
133// New creates a new Service. It uses the provided http.Client for requests.
134//
135// Deprecated: please use NewService instead.
136// To provide a custom HTTP client, use option.WithHTTPClient.
137// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
138func New(client *http.Client) (*Service, error) {
139	if client == nil {
140		return nil, errors.New("client is nil")
141	}
142	s := &Service{client: client, BasePath: basePath}
143	s.BillingAccounts = NewBillingAccountsService(s)
144	s.Entries = NewEntriesService(s)
145	s.Exclusions = NewExclusionsService(s)
146	s.Folders = NewFoldersService(s)
147	s.Locations = NewLocationsService(s)
148	s.Logs = NewLogsService(s)
149	s.MonitoredResourceDescriptors = NewMonitoredResourceDescriptorsService(s)
150	s.Organizations = NewOrganizationsService(s)
151	s.Projects = NewProjectsService(s)
152	s.Sinks = NewSinksService(s)
153	s.V2 = NewV2Service(s)
154	return s, nil
155}
156
157type Service struct {
158	client    *http.Client
159	BasePath  string // API endpoint base URL
160	UserAgent string // optional additional User-Agent fragment
161
162	BillingAccounts *BillingAccountsService
163
164	Entries *EntriesService
165
166	Exclusions *ExclusionsService
167
168	Folders *FoldersService
169
170	Locations *LocationsService
171
172	Logs *LogsService
173
174	MonitoredResourceDescriptors *MonitoredResourceDescriptorsService
175
176	Organizations *OrganizationsService
177
178	Projects *ProjectsService
179
180	Sinks *SinksService
181
182	V2 *V2Service
183}
184
185func (s *Service) userAgent() string {
186	if s.UserAgent == "" {
187		return googleapi.UserAgent
188	}
189	return googleapi.UserAgent + " " + s.UserAgent
190}
191
192func NewBillingAccountsService(s *Service) *BillingAccountsService {
193	rs := &BillingAccountsService{s: s}
194	rs.Buckets = NewBillingAccountsBucketsService(s)
195	rs.Exclusions = NewBillingAccountsExclusionsService(s)
196	rs.Locations = NewBillingAccountsLocationsService(s)
197	rs.Logs = NewBillingAccountsLogsService(s)
198	rs.Operations = NewBillingAccountsOperationsService(s)
199	rs.Sinks = NewBillingAccountsSinksService(s)
200	return rs
201}
202
203type BillingAccountsService struct {
204	s *Service
205
206	Buckets *BillingAccountsBucketsService
207
208	Exclusions *BillingAccountsExclusionsService
209
210	Locations *BillingAccountsLocationsService
211
212	Logs *BillingAccountsLogsService
213
214	Operations *BillingAccountsOperationsService
215
216	Sinks *BillingAccountsSinksService
217}
218
219func NewBillingAccountsBucketsService(s *Service) *BillingAccountsBucketsService {
220	rs := &BillingAccountsBucketsService{s: s}
221	rs.Views = NewBillingAccountsBucketsViewsService(s)
222	return rs
223}
224
225type BillingAccountsBucketsService struct {
226	s *Service
227
228	Views *BillingAccountsBucketsViewsService
229}
230
231func NewBillingAccountsBucketsViewsService(s *Service) *BillingAccountsBucketsViewsService {
232	rs := &BillingAccountsBucketsViewsService{s: s}
233	return rs
234}
235
236type BillingAccountsBucketsViewsService struct {
237	s *Service
238}
239
240func NewBillingAccountsExclusionsService(s *Service) *BillingAccountsExclusionsService {
241	rs := &BillingAccountsExclusionsService{s: s}
242	return rs
243}
244
245type BillingAccountsExclusionsService struct {
246	s *Service
247}
248
249func NewBillingAccountsLocationsService(s *Service) *BillingAccountsLocationsService {
250	rs := &BillingAccountsLocationsService{s: s}
251	rs.Buckets = NewBillingAccountsLocationsBucketsService(s)
252	rs.Operations = NewBillingAccountsLocationsOperationsService(s)
253	return rs
254}
255
256type BillingAccountsLocationsService struct {
257	s *Service
258
259	Buckets *BillingAccountsLocationsBucketsService
260
261	Operations *BillingAccountsLocationsOperationsService
262}
263
264func NewBillingAccountsLocationsBucketsService(s *Service) *BillingAccountsLocationsBucketsService {
265	rs := &BillingAccountsLocationsBucketsService{s: s}
266	rs.Views = NewBillingAccountsLocationsBucketsViewsService(s)
267	return rs
268}
269
270type BillingAccountsLocationsBucketsService struct {
271	s *Service
272
273	Views *BillingAccountsLocationsBucketsViewsService
274}
275
276func NewBillingAccountsLocationsBucketsViewsService(s *Service) *BillingAccountsLocationsBucketsViewsService {
277	rs := &BillingAccountsLocationsBucketsViewsService{s: s}
278	return rs
279}
280
281type BillingAccountsLocationsBucketsViewsService struct {
282	s *Service
283}
284
285func NewBillingAccountsLocationsOperationsService(s *Service) *BillingAccountsLocationsOperationsService {
286	rs := &BillingAccountsLocationsOperationsService{s: s}
287	return rs
288}
289
290type BillingAccountsLocationsOperationsService struct {
291	s *Service
292}
293
294func NewBillingAccountsLogsService(s *Service) *BillingAccountsLogsService {
295	rs := &BillingAccountsLogsService{s: s}
296	return rs
297}
298
299type BillingAccountsLogsService struct {
300	s *Service
301}
302
303func NewBillingAccountsOperationsService(s *Service) *BillingAccountsOperationsService {
304	rs := &BillingAccountsOperationsService{s: s}
305	return rs
306}
307
308type BillingAccountsOperationsService struct {
309	s *Service
310}
311
312func NewBillingAccountsSinksService(s *Service) *BillingAccountsSinksService {
313	rs := &BillingAccountsSinksService{s: s}
314	return rs
315}
316
317type BillingAccountsSinksService struct {
318	s *Service
319}
320
321func NewEntriesService(s *Service) *EntriesService {
322	rs := &EntriesService{s: s}
323	return rs
324}
325
326type EntriesService struct {
327	s *Service
328}
329
330func NewExclusionsService(s *Service) *ExclusionsService {
331	rs := &ExclusionsService{s: s}
332	return rs
333}
334
335type ExclusionsService struct {
336	s *Service
337}
338
339func NewFoldersService(s *Service) *FoldersService {
340	rs := &FoldersService{s: s}
341	rs.Exclusions = NewFoldersExclusionsService(s)
342	rs.Locations = NewFoldersLocationsService(s)
343	rs.Logs = NewFoldersLogsService(s)
344	rs.Sinks = NewFoldersSinksService(s)
345	return rs
346}
347
348type FoldersService struct {
349	s *Service
350
351	Exclusions *FoldersExclusionsService
352
353	Locations *FoldersLocationsService
354
355	Logs *FoldersLogsService
356
357	Sinks *FoldersSinksService
358}
359
360func NewFoldersExclusionsService(s *Service) *FoldersExclusionsService {
361	rs := &FoldersExclusionsService{s: s}
362	return rs
363}
364
365type FoldersExclusionsService struct {
366	s *Service
367}
368
369func NewFoldersLocationsService(s *Service) *FoldersLocationsService {
370	rs := &FoldersLocationsService{s: s}
371	rs.Buckets = NewFoldersLocationsBucketsService(s)
372	rs.Operations = NewFoldersLocationsOperationsService(s)
373	return rs
374}
375
376type FoldersLocationsService struct {
377	s *Service
378
379	Buckets *FoldersLocationsBucketsService
380
381	Operations *FoldersLocationsOperationsService
382}
383
384func NewFoldersLocationsBucketsService(s *Service) *FoldersLocationsBucketsService {
385	rs := &FoldersLocationsBucketsService{s: s}
386	rs.Views = NewFoldersLocationsBucketsViewsService(s)
387	return rs
388}
389
390type FoldersLocationsBucketsService struct {
391	s *Service
392
393	Views *FoldersLocationsBucketsViewsService
394}
395
396func NewFoldersLocationsBucketsViewsService(s *Service) *FoldersLocationsBucketsViewsService {
397	rs := &FoldersLocationsBucketsViewsService{s: s}
398	return rs
399}
400
401type FoldersLocationsBucketsViewsService struct {
402	s *Service
403}
404
405func NewFoldersLocationsOperationsService(s *Service) *FoldersLocationsOperationsService {
406	rs := &FoldersLocationsOperationsService{s: s}
407	return rs
408}
409
410type FoldersLocationsOperationsService struct {
411	s *Service
412}
413
414func NewFoldersLogsService(s *Service) *FoldersLogsService {
415	rs := &FoldersLogsService{s: s}
416	return rs
417}
418
419type FoldersLogsService struct {
420	s *Service
421}
422
423func NewFoldersSinksService(s *Service) *FoldersSinksService {
424	rs := &FoldersSinksService{s: s}
425	return rs
426}
427
428type FoldersSinksService struct {
429	s *Service
430}
431
432func NewLocationsService(s *Service) *LocationsService {
433	rs := &LocationsService{s: s}
434	rs.Buckets = NewLocationsBucketsService(s)
435	rs.Operations = NewLocationsOperationsService(s)
436	return rs
437}
438
439type LocationsService struct {
440	s *Service
441
442	Buckets *LocationsBucketsService
443
444	Operations *LocationsOperationsService
445}
446
447func NewLocationsBucketsService(s *Service) *LocationsBucketsService {
448	rs := &LocationsBucketsService{s: s}
449	rs.Views = NewLocationsBucketsViewsService(s)
450	return rs
451}
452
453type LocationsBucketsService struct {
454	s *Service
455
456	Views *LocationsBucketsViewsService
457}
458
459func NewLocationsBucketsViewsService(s *Service) *LocationsBucketsViewsService {
460	rs := &LocationsBucketsViewsService{s: s}
461	return rs
462}
463
464type LocationsBucketsViewsService struct {
465	s *Service
466}
467
468func NewLocationsOperationsService(s *Service) *LocationsOperationsService {
469	rs := &LocationsOperationsService{s: s}
470	return rs
471}
472
473type LocationsOperationsService struct {
474	s *Service
475}
476
477func NewLogsService(s *Service) *LogsService {
478	rs := &LogsService{s: s}
479	return rs
480}
481
482type LogsService struct {
483	s *Service
484}
485
486func NewMonitoredResourceDescriptorsService(s *Service) *MonitoredResourceDescriptorsService {
487	rs := &MonitoredResourceDescriptorsService{s: s}
488	return rs
489}
490
491type MonitoredResourceDescriptorsService struct {
492	s *Service
493}
494
495func NewOrganizationsService(s *Service) *OrganizationsService {
496	rs := &OrganizationsService{s: s}
497	rs.Exclusions = NewOrganizationsExclusionsService(s)
498	rs.Locations = NewOrganizationsLocationsService(s)
499	rs.Logs = NewOrganizationsLogsService(s)
500	rs.Sinks = NewOrganizationsSinksService(s)
501	return rs
502}
503
504type OrganizationsService struct {
505	s *Service
506
507	Exclusions *OrganizationsExclusionsService
508
509	Locations *OrganizationsLocationsService
510
511	Logs *OrganizationsLogsService
512
513	Sinks *OrganizationsSinksService
514}
515
516func NewOrganizationsExclusionsService(s *Service) *OrganizationsExclusionsService {
517	rs := &OrganizationsExclusionsService{s: s}
518	return rs
519}
520
521type OrganizationsExclusionsService struct {
522	s *Service
523}
524
525func NewOrganizationsLocationsService(s *Service) *OrganizationsLocationsService {
526	rs := &OrganizationsLocationsService{s: s}
527	rs.Buckets = NewOrganizationsLocationsBucketsService(s)
528	rs.Operations = NewOrganizationsLocationsOperationsService(s)
529	return rs
530}
531
532type OrganizationsLocationsService struct {
533	s *Service
534
535	Buckets *OrganizationsLocationsBucketsService
536
537	Operations *OrganizationsLocationsOperationsService
538}
539
540func NewOrganizationsLocationsBucketsService(s *Service) *OrganizationsLocationsBucketsService {
541	rs := &OrganizationsLocationsBucketsService{s: s}
542	rs.Views = NewOrganizationsLocationsBucketsViewsService(s)
543	return rs
544}
545
546type OrganizationsLocationsBucketsService struct {
547	s *Service
548
549	Views *OrganizationsLocationsBucketsViewsService
550}
551
552func NewOrganizationsLocationsBucketsViewsService(s *Service) *OrganizationsLocationsBucketsViewsService {
553	rs := &OrganizationsLocationsBucketsViewsService{s: s}
554	return rs
555}
556
557type OrganizationsLocationsBucketsViewsService struct {
558	s *Service
559}
560
561func NewOrganizationsLocationsOperationsService(s *Service) *OrganizationsLocationsOperationsService {
562	rs := &OrganizationsLocationsOperationsService{s: s}
563	return rs
564}
565
566type OrganizationsLocationsOperationsService struct {
567	s *Service
568}
569
570func NewOrganizationsLogsService(s *Service) *OrganizationsLogsService {
571	rs := &OrganizationsLogsService{s: s}
572	return rs
573}
574
575type OrganizationsLogsService struct {
576	s *Service
577}
578
579func NewOrganizationsSinksService(s *Service) *OrganizationsSinksService {
580	rs := &OrganizationsSinksService{s: s}
581	return rs
582}
583
584type OrganizationsSinksService struct {
585	s *Service
586}
587
588func NewProjectsService(s *Service) *ProjectsService {
589	rs := &ProjectsService{s: s}
590	rs.Exclusions = NewProjectsExclusionsService(s)
591	rs.Locations = NewProjectsLocationsService(s)
592	rs.Logs = NewProjectsLogsService(s)
593	rs.Metrics = NewProjectsMetricsService(s)
594	rs.Sinks = NewProjectsSinksService(s)
595	return rs
596}
597
598type ProjectsService struct {
599	s *Service
600
601	Exclusions *ProjectsExclusionsService
602
603	Locations *ProjectsLocationsService
604
605	Logs *ProjectsLogsService
606
607	Metrics *ProjectsMetricsService
608
609	Sinks *ProjectsSinksService
610}
611
612func NewProjectsExclusionsService(s *Service) *ProjectsExclusionsService {
613	rs := &ProjectsExclusionsService{s: s}
614	return rs
615}
616
617type ProjectsExclusionsService struct {
618	s *Service
619}
620
621func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
622	rs := &ProjectsLocationsService{s: s}
623	rs.Buckets = NewProjectsLocationsBucketsService(s)
624	rs.Operations = NewProjectsLocationsOperationsService(s)
625	return rs
626}
627
628type ProjectsLocationsService struct {
629	s *Service
630
631	Buckets *ProjectsLocationsBucketsService
632
633	Operations *ProjectsLocationsOperationsService
634}
635
636func NewProjectsLocationsBucketsService(s *Service) *ProjectsLocationsBucketsService {
637	rs := &ProjectsLocationsBucketsService{s: s}
638	rs.Views = NewProjectsLocationsBucketsViewsService(s)
639	return rs
640}
641
642type ProjectsLocationsBucketsService struct {
643	s *Service
644
645	Views *ProjectsLocationsBucketsViewsService
646}
647
648func NewProjectsLocationsBucketsViewsService(s *Service) *ProjectsLocationsBucketsViewsService {
649	rs := &ProjectsLocationsBucketsViewsService{s: s}
650	return rs
651}
652
653type ProjectsLocationsBucketsViewsService struct {
654	s *Service
655}
656
657func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
658	rs := &ProjectsLocationsOperationsService{s: s}
659	return rs
660}
661
662type ProjectsLocationsOperationsService struct {
663	s *Service
664}
665
666func NewProjectsLogsService(s *Service) *ProjectsLogsService {
667	rs := &ProjectsLogsService{s: s}
668	return rs
669}
670
671type ProjectsLogsService struct {
672	s *Service
673}
674
675func NewProjectsMetricsService(s *Service) *ProjectsMetricsService {
676	rs := &ProjectsMetricsService{s: s}
677	return rs
678}
679
680type ProjectsMetricsService struct {
681	s *Service
682}
683
684func NewProjectsSinksService(s *Service) *ProjectsSinksService {
685	rs := &ProjectsSinksService{s: s}
686	return rs
687}
688
689type ProjectsSinksService struct {
690	s *Service
691}
692
693func NewSinksService(s *Service) *SinksService {
694	rs := &SinksService{s: s}
695	return rs
696}
697
698type SinksService struct {
699	s *Service
700}
701
702func NewV2Service(s *Service) *V2Service {
703	rs := &V2Service{s: s}
704	return rs
705}
706
707type V2Service struct {
708	s *Service
709}
710
711// BigQueryOptions: Options that change functionality of a sink
712// exporting data to BigQuery.
713type BigQueryOptions struct {
714	// UsePartitionedTables: Optional. Whether to use BigQuery's partition
715	// tables (https://cloud.google.com/bigquery/docs/partitioned-tables).
716	// By default, Cloud Logging creates dated tables based on the log
717	// entries' timestamps, e.g. syslog_20170523. With partitioned tables
718	// the date suffix is no longer present and special query syntax
719	// (https://cloud.google.com/bigquery/docs/querying-partitioned-tables)
720	// has to be used instead. In both cases, tables are sharded based on
721	// UTC timezone.
722	UsePartitionedTables bool `json:"usePartitionedTables,omitempty"`
723
724	// UsesTimestampColumnPartitioning: Output only. True if new timestamp
725	// column based partitioning is in use, false if legacy ingestion-time
726	// partitioning is in use.All new sinks will have this field set true
727	// and will use timestamp column based partitioning. If
728	// use_partitioned_tables is false, this value has no meaning and will
729	// be false. Legacy sinks using partitioned tables will have this field
730	// set to false.
731	UsesTimestampColumnPartitioning bool `json:"usesTimestampColumnPartitioning,omitempty"`
732
733	// ForceSendFields is a list of field names (e.g.
734	// "UsePartitionedTables") to unconditionally include in API requests.
735	// By default, fields with empty or default values are omitted from API
736	// requests. However, any non-pointer, non-interface field appearing in
737	// ForceSendFields will be sent to the server regardless of whether the
738	// field is empty or not. This may be used to include empty fields in
739	// Patch requests.
740	ForceSendFields []string `json:"-"`
741
742	// NullFields is a list of field names (e.g. "UsePartitionedTables") to
743	// include in API requests with the JSON null value. By default, fields
744	// with empty values are omitted from API requests. However, any field
745	// with an empty value appearing in NullFields will be sent to the
746	// server as null. It is an error if a field in this list has a
747	// non-empty value. This may be used to include null fields in Patch
748	// requests.
749	NullFields []string `json:"-"`
750}
751
752func (s *BigQueryOptions) MarshalJSON() ([]byte, error) {
753	type NoMethod BigQueryOptions
754	raw := NoMethod(*s)
755	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
756}
757
758// BucketOptions: BucketOptions describes the bucket boundaries used to
759// create a histogram for the distribution. The buckets can be in a
760// linear sequence, an exponential sequence, or each bucket can be
761// specified explicitly. BucketOptions does not include the number of
762// values in each bucket.A bucket has an inclusive lower bound and
763// exclusive upper bound for the values that are counted for that
764// bucket. The upper bound of a bucket must be strictly greater than the
765// lower bound. The sequence of N buckets for a distribution consists of
766// an underflow bucket (number 0), zero or more finite buckets (number 1
767// through N - 2) and an overflow bucket (number N - 1). The buckets are
768// contiguous: the lower bound of bucket i (i > 0) is the same as the
769// upper bound of bucket i - 1. The buckets span the whole range of
770// finite values: lower bound of the underflow bucket is -infinity and
771// the upper bound of the overflow bucket is +infinity. The finite
772// buckets are so-called because both bounds are finite.
773type BucketOptions struct {
774	// ExplicitBuckets: The explicit buckets.
775	ExplicitBuckets *Explicit `json:"explicitBuckets,omitempty"`
776
777	// ExponentialBuckets: The exponential buckets.
778	ExponentialBuckets *Exponential `json:"exponentialBuckets,omitempty"`
779
780	// LinearBuckets: The linear bucket.
781	LinearBuckets *Linear `json:"linearBuckets,omitempty"`
782
783	// ForceSendFields is a list of field names (e.g. "ExplicitBuckets") to
784	// unconditionally include in API requests. By default, fields with
785	// empty or default values are omitted from API requests. However, any
786	// non-pointer, non-interface field appearing in ForceSendFields will be
787	// sent to the server regardless of whether the field is empty or not.
788	// This may be used to include empty fields in Patch requests.
789	ForceSendFields []string `json:"-"`
790
791	// NullFields is a list of field names (e.g. "ExplicitBuckets") to
792	// include in API requests with the JSON null value. By default, fields
793	// with empty values are omitted from API requests. However, any field
794	// with an empty value appearing in NullFields will be sent to the
795	// server as null. It is an error if a field in this list has a
796	// non-empty value. This may be used to include null fields in Patch
797	// requests.
798	NullFields []string `json:"-"`
799}
800
801func (s *BucketOptions) MarshalJSON() ([]byte, error) {
802	type NoMethod BucketOptions
803	raw := NoMethod(*s)
804	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
805}
806
807// CancelOperationRequest: The request message for
808// Operations.CancelOperation.
809type CancelOperationRequest struct {
810}
811
812// CmekSettings: Describes the customer-managed encryption key (CMEK)
813// settings associated with a project, folder, organization, billing
814// account, or flexible resource.Note: CMEK for the Logs Router can
815// currently only be configured for Google Cloud organizations. Once
816// configured, it applies to all projects and folders in the Google
817// Cloud organization.See Enabling CMEK for Logs Router
818// (https://cloud.google.com/logging/docs/routing/managed-encryption)
819// for more information.
820type CmekSettings struct {
821	// KmsKeyName: The resource name for the configured Cloud KMS key.KMS
822	// key name format:
823	// "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoK
824	// eys/[KEY]" For
825	// example:"projects/my-project/locations/us-central1/keyRings/my-ring/cr
826	// yptoKeys/my-key"To enable CMEK for the Logs Router, set this field to
827	// a valid kms_key_name for which the associated service account has the
828	// required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for
829	// the key.The Cloud KMS key used by the Log Router can be updated by
830	// changing the kms_key_name to a new valid key name. Encryption
831	// operations that are in progress will be completed with the key that
832	// was in use when they started. Decryption operations will be completed
833	// using the key that was used at the time of encryption unless access
834	// to that key has been revoked.To disable CMEK for the Logs Router, set
835	// this field to an empty string.See Enabling CMEK for Logs Router
836	// (https://cloud.google.com/logging/docs/routing/managed-encryption)
837	// for more information.
838	KmsKeyName string `json:"kmsKeyName,omitempty"`
839
840	// Name: Output only. The resource name of the CMEK settings.
841	Name string `json:"name,omitempty"`
842
843	// ServiceAccountId: Output only. The service account that will be used
844	// by the Logs Router to access your Cloud KMS key.Before enabling CMEK
845	// for Logs Router, you must first assign the role
846	// roles/cloudkms.cryptoKeyEncrypterDecrypter to the service account
847	// that the Logs Router will use to access your Cloud KMS key. Use
848	// GetCmekSettings to obtain the service account ID.See Enabling CMEK
849	// for Logs Router
850	// (https://cloud.google.com/logging/docs/routing/managed-encryption)
851	// for more information.
852	ServiceAccountId string `json:"serviceAccountId,omitempty"`
853
854	// ServerResponse contains the HTTP response code and headers from the
855	// server.
856	googleapi.ServerResponse `json:"-"`
857
858	// ForceSendFields is a list of field names (e.g. "KmsKeyName") to
859	// unconditionally include in API requests. By default, fields with
860	// empty or default values are omitted from API requests. However, any
861	// non-pointer, non-interface field appearing in ForceSendFields will be
862	// sent to the server regardless of whether the field is empty or not.
863	// This may be used to include empty fields in Patch requests.
864	ForceSendFields []string `json:"-"`
865
866	// NullFields is a list of field names (e.g. "KmsKeyName") to include in
867	// API requests with the JSON null value. By default, fields with empty
868	// values are omitted from API requests. However, any field with an
869	// empty value appearing in NullFields will be sent to the server as
870	// null. It is an error if a field in this list has a non-empty value.
871	// This may be used to include null fields in Patch requests.
872	NullFields []string `json:"-"`
873}
874
875func (s *CmekSettings) MarshalJSON() ([]byte, error) {
876	type NoMethod CmekSettings
877	raw := NoMethod(*s)
878	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
879}
880
881// CopyLogEntriesMetadata: Metadata for CopyLogEntries long running
882// operations.
883type CopyLogEntriesMetadata struct {
884	// CancellationRequested: Identifies whether the user has requested
885	// cancellation of the operation.
886	CancellationRequested bool `json:"cancellationRequested,omitempty"`
887
888	// EndTime: The end time of an operation.
889	EndTime string `json:"endTime,omitempty"`
890
891	// Progress: Estimated progress of the operation (0 - 100%).
892	Progress int64 `json:"progress,omitempty"`
893
894	// Request: CopyLogEntries RPC request.
895	Request *CopyLogEntriesRequest `json:"request,omitempty"`
896
897	// StartTime: The create time of an operation.
898	StartTime string `json:"startTime,omitempty"`
899
900	// State: State of an operation.
901	//
902	// Possible values:
903	//   "OPERATION_STATE_UNSPECIFIED" - Should not be used.
904	//   "OPERATION_STATE_SCHEDULED" - The operation is scheduled.
905	//   "OPERATION_STATE_WAITING_FOR_PERMISSIONS" - Waiting for necessary
906	// permissions.
907	//   "OPERATION_STATE_RUNNING" - The operation is running.
908	//   "OPERATION_STATE_SUCCEEDED" - The operation was completed
909	// successfully.
910	//   "OPERATION_STATE_FAILED" - The operation failed.
911	//   "OPERATION_STATE_CANCELLED" - The operation was cancelled by the
912	// user.
913	State string `json:"state,omitempty"`
914
915	// WriterIdentity: The IAM identity of a service account that must be
916	// granted access to the destination.If the service account is not
917	// granted permission to the destination within an hour, the operation
918	// will be cancelled.For example: "serviceAccount:foo@bar.com"
919	WriterIdentity string `json:"writerIdentity,omitempty"`
920
921	// ForceSendFields is a list of field names (e.g.
922	// "CancellationRequested") to unconditionally include in API requests.
923	// By default, fields with empty or default values are omitted from API
924	// requests. However, any non-pointer, non-interface field appearing in
925	// ForceSendFields will be sent to the server regardless of whether the
926	// field is empty or not. This may be used to include empty fields in
927	// Patch requests.
928	ForceSendFields []string `json:"-"`
929
930	// NullFields is a list of field names (e.g. "CancellationRequested") to
931	// include in API requests with the JSON null value. By default, fields
932	// with empty values are omitted from API requests. However, any field
933	// with an empty value appearing in NullFields will be sent to the
934	// server as null. It is an error if a field in this list has a
935	// non-empty value. This may be used to include null fields in Patch
936	// requests.
937	NullFields []string `json:"-"`
938}
939
940func (s *CopyLogEntriesMetadata) MarshalJSON() ([]byte, error) {
941	type NoMethod CopyLogEntriesMetadata
942	raw := NoMethod(*s)
943	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
944}
945
946// CopyLogEntriesRequest: The parameters to CopyLogEntries.
947type CopyLogEntriesRequest struct {
948	// Destination: Required. Destination to which to copy log entries.
949	Destination string `json:"destination,omitempty"`
950
951	// Filter: Optional. A filter specifying which log entries to copy. The
952	// filter must be no more than 20k characters. An empty filter matches
953	// all log entries.
954	Filter string `json:"filter,omitempty"`
955
956	// Name: Required. Log bucket from which to copy log entries.For
957	// example:"projects/my-project/locations/global/buckets/my-source-bucket
958	// "
959	Name string `json:"name,omitempty"`
960
961	// ForceSendFields is a list of field names (e.g. "Destination") to
962	// unconditionally include in API requests. By default, fields with
963	// empty or default values are omitted from API requests. However, any
964	// non-pointer, non-interface field appearing in ForceSendFields will be
965	// sent to the server regardless of whether the field is empty or not.
966	// This may be used to include empty fields in Patch requests.
967	ForceSendFields []string `json:"-"`
968
969	// NullFields is a list of field names (e.g. "Destination") to include
970	// in API requests with the JSON null value. By default, fields with
971	// empty values are omitted from API requests. However, any field with
972	// an empty value appearing in NullFields will be sent to the server as
973	// null. It is an error if a field in this list has a non-empty value.
974	// This may be used to include null fields in Patch requests.
975	NullFields []string `json:"-"`
976}
977
978func (s *CopyLogEntriesRequest) MarshalJSON() ([]byte, error) {
979	type NoMethod CopyLogEntriesRequest
980	raw := NoMethod(*s)
981	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
982}
983
984// CopyLogEntriesResponse: Response type for CopyLogEntries long running
985// operations.
986type CopyLogEntriesResponse struct {
987	// LogEntriesCopiedCount: Number of log entries copied.
988	LogEntriesCopiedCount int64 `json:"logEntriesCopiedCount,omitempty,string"`
989
990	// ForceSendFields is a list of field names (e.g.
991	// "LogEntriesCopiedCount") to unconditionally include in API requests.
992	// By default, fields with empty or default values are omitted from API
993	// requests. However, any non-pointer, non-interface field appearing in
994	// ForceSendFields will be sent to the server regardless of whether the
995	// field is empty or not. This may be used to include empty fields in
996	// Patch requests.
997	ForceSendFields []string `json:"-"`
998
999	// NullFields is a list of field names (e.g. "LogEntriesCopiedCount") to
1000	// include in API requests with the JSON null value. By default, fields
1001	// with empty values are omitted from API requests. However, any field
1002	// with an empty value appearing in NullFields will be sent to the
1003	// server as null. It is an error if a field in this list has a
1004	// non-empty value. This may be used to include null fields in Patch
1005	// requests.
1006	NullFields []string `json:"-"`
1007}
1008
1009func (s *CopyLogEntriesResponse) MarshalJSON() ([]byte, error) {
1010	type NoMethod CopyLogEntriesResponse
1011	raw := NoMethod(*s)
1012	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1013}
1014
1015// Empty: A generic empty message that you can re-use to avoid defining
1016// duplicated empty messages in your APIs. A typical example is to use
1017// it as the request or the response type of an API method. For
1018// instance: service Foo { rpc Bar(google.protobuf.Empty) returns
1019// (google.protobuf.Empty); } The JSON representation for Empty is empty
1020// JSON object {}.
1021type Empty struct {
1022	// ServerResponse contains the HTTP response code and headers from the
1023	// server.
1024	googleapi.ServerResponse `json:"-"`
1025}
1026
1027// Explicit: Specifies a set of buckets with arbitrary widths.There are
1028// size(bounds) + 1 (= N) buckets. Bucket i has the following
1029// boundaries:Upper bound (0 <= i < N-1): boundsi Lower bound (1 <= i <
1030// N); boundsi - 1The bounds field must contain at least one element. If
1031// bounds has only one element, then there are no finite buckets, and
1032// that single element is the common boundary of the overflow and
1033// underflow buckets.
1034type Explicit struct {
1035	// Bounds: The values must be monotonically increasing.
1036	Bounds []float64 `json:"bounds,omitempty"`
1037
1038	// ForceSendFields is a list of field names (e.g. "Bounds") to
1039	// unconditionally include in API requests. By default, fields with
1040	// empty or default values are omitted from API requests. However, any
1041	// non-pointer, non-interface field appearing in ForceSendFields will be
1042	// sent to the server regardless of whether the field is empty or not.
1043	// This may be used to include empty fields in Patch requests.
1044	ForceSendFields []string `json:"-"`
1045
1046	// NullFields is a list of field names (e.g. "Bounds") to include in API
1047	// requests with the JSON null value. By default, fields with empty
1048	// values are omitted from API requests. However, any field with an
1049	// empty value appearing in NullFields will be sent to the server as
1050	// null. It is an error if a field in this list has a non-empty value.
1051	// This may be used to include null fields in Patch requests.
1052	NullFields []string `json:"-"`
1053}
1054
1055func (s *Explicit) MarshalJSON() ([]byte, error) {
1056	type NoMethod Explicit
1057	raw := NoMethod(*s)
1058	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1059}
1060
1061// Exponential: Specifies an exponential sequence of buckets that have a
1062// width that is proportional to the value of the lower bound. Each
1063// bucket represents a constant relative uncertainty on a specific value
1064// in the bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket
1065// i has the following boundaries:Upper bound (0 <= i < N-1): scale *
1066// (growth_factor ^ i). Lower bound (1 <= i < N): scale * (growth_factor
1067// ^ (i - 1)).
1068type Exponential struct {
1069	// GrowthFactor: Must be greater than 1.
1070	GrowthFactor float64 `json:"growthFactor,omitempty"`
1071
1072	// NumFiniteBuckets: Must be greater than 0.
1073	NumFiniteBuckets int64 `json:"numFiniteBuckets,omitempty"`
1074
1075	// Scale: Must be greater than 0.
1076	Scale float64 `json:"scale,omitempty"`
1077
1078	// ForceSendFields is a list of field names (e.g. "GrowthFactor") to
1079	// unconditionally include in API requests. By default, fields with
1080	// empty or default values are omitted from API requests. However, any
1081	// non-pointer, non-interface field appearing in ForceSendFields will be
1082	// sent to the server regardless of whether the field is empty or not.
1083	// This may be used to include empty fields in Patch requests.
1084	ForceSendFields []string `json:"-"`
1085
1086	// NullFields is a list of field names (e.g. "GrowthFactor") to include
1087	// in API requests with the JSON null value. By default, fields with
1088	// empty values are omitted from API requests. However, any field with
1089	// an empty value appearing in NullFields will be sent to the server as
1090	// null. It is an error if a field in this list has a non-empty value.
1091	// This may be used to include null fields in Patch requests.
1092	NullFields []string `json:"-"`
1093}
1094
1095func (s *Exponential) MarshalJSON() ([]byte, error) {
1096	type NoMethod Exponential
1097	raw := NoMethod(*s)
1098	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1099}
1100
1101func (s *Exponential) UnmarshalJSON(data []byte) error {
1102	type NoMethod Exponential
1103	var s1 struct {
1104		GrowthFactor gensupport.JSONFloat64 `json:"growthFactor"`
1105		Scale        gensupport.JSONFloat64 `json:"scale"`
1106		*NoMethod
1107	}
1108	s1.NoMethod = (*NoMethod)(s)
1109	if err := json.Unmarshal(data, &s1); err != nil {
1110		return err
1111	}
1112	s.GrowthFactor = float64(s1.GrowthFactor)
1113	s.Scale = float64(s1.Scale)
1114	return nil
1115}
1116
1117// HttpRequest: A common proto for logging HTTP requests. Only contains
1118// semantics defined by the HTTP specification. Product-specific logging
1119// information MUST be defined in a separate message.
1120type HttpRequest struct {
1121	// CacheFillBytes: The number of HTTP response bytes inserted into
1122	// cache. Set only when a cache fill was attempted.
1123	CacheFillBytes int64 `json:"cacheFillBytes,omitempty,string"`
1124
1125	// CacheHit: Whether or not an entity was served from cache (with or
1126	// without validation).
1127	CacheHit bool `json:"cacheHit,omitempty"`
1128
1129	// CacheLookup: Whether or not a cache lookup was attempted.
1130	CacheLookup bool `json:"cacheLookup,omitempty"`
1131
1132	// CacheValidatedWithOriginServer: Whether or not the response was
1133	// validated with the origin server before being served from cache. This
1134	// field is only meaningful if cache_hit is True.
1135	CacheValidatedWithOriginServer bool `json:"cacheValidatedWithOriginServer,omitempty"`
1136
1137	// Latency: The request processing latency on the server, from the time
1138	// the request was received until the response was sent.
1139	Latency string `json:"latency,omitempty"`
1140
1141	// Protocol: Protocol used for the request. Examples: "HTTP/1.1",
1142	// "HTTP/2", "websocket"
1143	Protocol string `json:"protocol,omitempty"`
1144
1145	// Referer: The referer URL of the request, as defined in HTTP/1.1
1146	// Header Field Definitions
1147	// (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
1148	Referer string `json:"referer,omitempty"`
1149
1150	// RemoteIp: The IP address (IPv4 or IPv6) of the client that issued the
1151	// HTTP request. This field can include port information. Examples:
1152	// "192.168.1.1", "10.0.0.1:80", "FE80::0202:B3FF:FE1E:8329".
1153	RemoteIp string `json:"remoteIp,omitempty"`
1154
1155	// RequestMethod: The request method. Examples: "GET", "HEAD", "PUT",
1156	// "POST".
1157	RequestMethod string `json:"requestMethod,omitempty"`
1158
1159	// RequestSize: The size of the HTTP request message in bytes, including
1160	// the request headers and the request body.
1161	RequestSize int64 `json:"requestSize,omitempty,string"`
1162
1163	// RequestUrl: The scheme (http, https), the host name, the path and the
1164	// query portion of the URL that was requested. Example:
1165	// "http://example.com/some/info?color=red".
1166	RequestUrl string `json:"requestUrl,omitempty"`
1167
1168	// ResponseSize: The size of the HTTP response message sent back to the
1169	// client, in bytes, including the response headers and the response
1170	// body.
1171	ResponseSize int64 `json:"responseSize,omitempty,string"`
1172
1173	// ServerIp: The IP address (IPv4 or IPv6) of the origin server that the
1174	// request was sent to. This field can include port information.
1175	// Examples: "192.168.1.1", "10.0.0.1:80", "FE80::0202:B3FF:FE1E:8329".
1176	ServerIp string `json:"serverIp,omitempty"`
1177
1178	// Status: The response code indicating the status of response.
1179	// Examples: 200, 404.
1180	Status int64 `json:"status,omitempty"`
1181
1182	// UserAgent: The user agent sent by the client. Example: "Mozilla/4.0
1183	// (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)".
1184	UserAgent string `json:"userAgent,omitempty"`
1185
1186	// ForceSendFields is a list of field names (e.g. "CacheFillBytes") to
1187	// unconditionally include in API requests. By default, fields with
1188	// empty or default values are omitted from API requests. However, any
1189	// non-pointer, non-interface field appearing in ForceSendFields will be
1190	// sent to the server regardless of whether the field is empty or not.
1191	// This may be used to include empty fields in Patch requests.
1192	ForceSendFields []string `json:"-"`
1193
1194	// NullFields is a list of field names (e.g. "CacheFillBytes") to
1195	// include in API requests with the JSON null value. By default, fields
1196	// with empty values are omitted from API requests. However, any field
1197	// with an empty value appearing in NullFields will be sent to the
1198	// server as null. It is an error if a field in this list has a
1199	// non-empty value. This may be used to include null fields in Patch
1200	// requests.
1201	NullFields []string `json:"-"`
1202}
1203
1204func (s *HttpRequest) MarshalJSON() ([]byte, error) {
1205	type NoMethod HttpRequest
1206	raw := NoMethod(*s)
1207	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1208}
1209
1210// LabelDescriptor: A description of a label.
1211type LabelDescriptor struct {
1212	// Description: A human-readable description for the label.
1213	Description string `json:"description,omitempty"`
1214
1215	// Key: The label key.
1216	Key string `json:"key,omitempty"`
1217
1218	// ValueType: The type of data that can be assigned to the label.
1219	//
1220	// Possible values:
1221	//   "STRING" - A variable-length string. This is the default.
1222	//   "BOOL" - Boolean; true or false.
1223	//   "INT64" - A 64-bit signed integer.
1224	ValueType string `json:"valueType,omitempty"`
1225
1226	// ForceSendFields is a list of field names (e.g. "Description") to
1227	// unconditionally include in API requests. By default, fields with
1228	// empty or default values are omitted from API requests. However, any
1229	// non-pointer, non-interface field appearing in ForceSendFields will be
1230	// sent to the server regardless of whether the field is empty or not.
1231	// This may be used to include empty fields in Patch requests.
1232	ForceSendFields []string `json:"-"`
1233
1234	// NullFields is a list of field names (e.g. "Description") to include
1235	// in API requests with the JSON null value. By default, fields with
1236	// empty values are omitted from API requests. However, any field with
1237	// an empty value appearing in NullFields will be sent to the server as
1238	// null. It is an error if a field in this list has a non-empty value.
1239	// This may be used to include null fields in Patch requests.
1240	NullFields []string `json:"-"`
1241}
1242
1243func (s *LabelDescriptor) MarshalJSON() ([]byte, error) {
1244	type NoMethod LabelDescriptor
1245	raw := NoMethod(*s)
1246	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1247}
1248
1249// Linear: Specifies a linear sequence of buckets that all have the same
1250// width (except overflow and underflow). Each bucket represents a
1251// constant absolute uncertainty on the specific value in the
1252// bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket i has
1253// the following boundaries:Upper bound (0 <= i < N-1): offset + (width
1254// * i). Lower bound (1 <= i < N): offset + (width * (i - 1)).
1255type Linear struct {
1256	// NumFiniteBuckets: Must be greater than 0.
1257	NumFiniteBuckets int64 `json:"numFiniteBuckets,omitempty"`
1258
1259	// Offset: Lower bound of the first bucket.
1260	Offset float64 `json:"offset,omitempty"`
1261
1262	// Width: Must be greater than 0.
1263	Width float64 `json:"width,omitempty"`
1264
1265	// ForceSendFields is a list of field names (e.g. "NumFiniteBuckets") to
1266	// unconditionally include in API requests. By default, fields with
1267	// empty or default values are omitted from API requests. However, any
1268	// non-pointer, non-interface field appearing in ForceSendFields will be
1269	// sent to the server regardless of whether the field is empty or not.
1270	// This may be used to include empty fields in Patch requests.
1271	ForceSendFields []string `json:"-"`
1272
1273	// NullFields is a list of field names (e.g. "NumFiniteBuckets") to
1274	// include in API requests with the JSON null value. By default, fields
1275	// with empty values are omitted from API requests. However, any field
1276	// with an empty value appearing in NullFields will be sent to the
1277	// server as null. It is an error if a field in this list has a
1278	// non-empty value. This may be used to include null fields in Patch
1279	// requests.
1280	NullFields []string `json:"-"`
1281}
1282
1283func (s *Linear) MarshalJSON() ([]byte, error) {
1284	type NoMethod Linear
1285	raw := NoMethod(*s)
1286	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1287}
1288
1289func (s *Linear) UnmarshalJSON(data []byte) error {
1290	type NoMethod Linear
1291	var s1 struct {
1292		Offset gensupport.JSONFloat64 `json:"offset"`
1293		Width  gensupport.JSONFloat64 `json:"width"`
1294		*NoMethod
1295	}
1296	s1.NoMethod = (*NoMethod)(s)
1297	if err := json.Unmarshal(data, &s1); err != nil {
1298		return err
1299	}
1300	s.Offset = float64(s1.Offset)
1301	s.Width = float64(s1.Width)
1302	return nil
1303}
1304
1305// ListBucketsResponse: The response from ListBuckets.
1306type ListBucketsResponse struct {
1307	// Buckets: A list of buckets.
1308	Buckets []*LogBucket `json:"buckets,omitempty"`
1309
1310	// NextPageToken: If there might be more results than appear in this
1311	// response, then nextPageToken is included. To get the next set of
1312	// results, call the same method again using the value of nextPageToken
1313	// as pageToken.
1314	NextPageToken string `json:"nextPageToken,omitempty"`
1315
1316	// ServerResponse contains the HTTP response code and headers from the
1317	// server.
1318	googleapi.ServerResponse `json:"-"`
1319
1320	// ForceSendFields is a list of field names (e.g. "Buckets") to
1321	// unconditionally include in API requests. By default, fields with
1322	// empty or default values are omitted from API requests. However, any
1323	// non-pointer, non-interface field appearing in ForceSendFields will be
1324	// sent to the server regardless of whether the field is empty or not.
1325	// This may be used to include empty fields in Patch requests.
1326	ForceSendFields []string `json:"-"`
1327
1328	// NullFields is a list of field names (e.g. "Buckets") to include in
1329	// API requests with the JSON null value. By default, fields with empty
1330	// values are omitted from API requests. However, any field with an
1331	// empty value appearing in NullFields will be sent to the server as
1332	// null. It is an error if a field in this list has a non-empty value.
1333	// This may be used to include null fields in Patch requests.
1334	NullFields []string `json:"-"`
1335}
1336
1337func (s *ListBucketsResponse) MarshalJSON() ([]byte, error) {
1338	type NoMethod ListBucketsResponse
1339	raw := NoMethod(*s)
1340	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1341}
1342
1343// ListExclusionsResponse: Result returned from ListExclusions.
1344type ListExclusionsResponse struct {
1345	// Exclusions: A list of exclusions.
1346	Exclusions []*LogExclusion `json:"exclusions,omitempty"`
1347
1348	// NextPageToken: If there might be more results than appear in this
1349	// response, then nextPageToken is included. To get the next set of
1350	// results, call the same method again using the value of nextPageToken
1351	// as pageToken.
1352	NextPageToken string `json:"nextPageToken,omitempty"`
1353
1354	// ServerResponse contains the HTTP response code and headers from the
1355	// server.
1356	googleapi.ServerResponse `json:"-"`
1357
1358	// ForceSendFields is a list of field names (e.g. "Exclusions") to
1359	// unconditionally include in API requests. By default, fields with
1360	// empty or default values are omitted from API requests. However, any
1361	// non-pointer, non-interface field appearing in ForceSendFields will be
1362	// sent to the server regardless of whether the field is empty or not.
1363	// This may be used to include empty fields in Patch requests.
1364	ForceSendFields []string `json:"-"`
1365
1366	// NullFields is a list of field names (e.g. "Exclusions") to include in
1367	// API requests with the JSON null value. By default, fields with empty
1368	// values are omitted from API requests. However, any field with an
1369	// empty value appearing in NullFields will be sent to the server as
1370	// null. It is an error if a field in this list has a non-empty value.
1371	// This may be used to include null fields in Patch requests.
1372	NullFields []string `json:"-"`
1373}
1374
1375func (s *ListExclusionsResponse) MarshalJSON() ([]byte, error) {
1376	type NoMethod ListExclusionsResponse
1377	raw := NoMethod(*s)
1378	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1379}
1380
1381// ListLocationsResponse: The response message for
1382// Locations.ListLocations.
1383type ListLocationsResponse struct {
1384	// Locations: A list of locations that matches the specified filter in
1385	// the request.
1386	Locations []*Location `json:"locations,omitempty"`
1387
1388	// NextPageToken: The standard List next-page token.
1389	NextPageToken string `json:"nextPageToken,omitempty"`
1390
1391	// ServerResponse contains the HTTP response code and headers from the
1392	// server.
1393	googleapi.ServerResponse `json:"-"`
1394
1395	// ForceSendFields is a list of field names (e.g. "Locations") to
1396	// unconditionally include in API requests. By default, fields with
1397	// empty or default values are omitted from API requests. However, any
1398	// non-pointer, non-interface field appearing in ForceSendFields will be
1399	// sent to the server regardless of whether the field is empty or not.
1400	// This may be used to include empty fields in Patch requests.
1401	ForceSendFields []string `json:"-"`
1402
1403	// NullFields is a list of field names (e.g. "Locations") to include in
1404	// API requests with the JSON null value. By default, fields with empty
1405	// values are omitted from API requests. However, any field with an
1406	// empty value appearing in NullFields will be sent to the server as
1407	// null. It is an error if a field in this list has a non-empty value.
1408	// This may be used to include null fields in Patch requests.
1409	NullFields []string `json:"-"`
1410}
1411
1412func (s *ListLocationsResponse) MarshalJSON() ([]byte, error) {
1413	type NoMethod ListLocationsResponse
1414	raw := NoMethod(*s)
1415	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1416}
1417
1418// ListLogEntriesRequest: The parameters to ListLogEntries.
1419type ListLogEntriesRequest struct {
1420	// Filter: Optional. A filter that chooses which log entries to return.
1421	// See Advanced Logs Queries
1422	// (https://cloud.google.com/logging/docs/view/advanced-queries). Only
1423	// log entries that match the filter are returned. An empty filter
1424	// matches all log entries in the resources listed in resource_names.
1425	// Referencing a parent resource that is not listed in resource_names
1426	// will cause the filter to return no results. The maximum length of the
1427	// filter is 20000 characters.
1428	Filter string `json:"filter,omitempty"`
1429
1430	// OrderBy: Optional. How the results should be sorted. Presently, the
1431	// only permitted values are "timestamp asc" (default) and "timestamp
1432	// desc". The first option returns entries in order of increasing values
1433	// of LogEntry.timestamp (oldest first), and the second option returns
1434	// entries in order of decreasing timestamps (newest first). Entries
1435	// with equal timestamps are returned in order of their insert_id
1436	// values.
1437	OrderBy string `json:"orderBy,omitempty"`
1438
1439	// PageSize: Optional. The maximum number of results to return from this
1440	// request. Default is 50. If the value is negative or exceeds 1000, the
1441	// request is rejected. The presence of next_page_token in the response
1442	// indicates that more results might be available.
1443	PageSize int64 `json:"pageSize,omitempty"`
1444
1445	// PageToken: Optional. If present, then retrieve the next batch of
1446	// results from the preceding call to this method. page_token must be
1447	// the value of next_page_token from the previous response. The values
1448	// of other method parameters should be identical to those in the
1449	// previous call.
1450	PageToken string `json:"pageToken,omitempty"`
1451
1452	// ProjectIds: Optional. Deprecated. Use resource_names instead. One or
1453	// more project identifiers or project numbers from which to retrieve
1454	// log entries. Example: "my-project-1A".
1455	ProjectIds []string `json:"projectIds,omitempty"`
1456
1457	// ResourceNames: Required. Names of one or more parent resources from
1458	// which to retrieve log entries: projects/[PROJECT_ID]
1459	// organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID]
1460	// folders/[FOLDER_ID]May alternatively be one or more views:
1461	// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view
1462	// s/[VIEW_ID]
1463	// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE
1464	// T_ID]/views/[VIEW_ID]
1465	// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[
1466	// BUCKET_ID]/views/[VIEW_ID]
1467	// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/
1468	// [VIEW_ID]Projects listed in the project_ids field are added to this
1469	// list.
1470	ResourceNames []string `json:"resourceNames,omitempty"`
1471
1472	// ForceSendFields is a list of field names (e.g. "Filter") to
1473	// unconditionally include in API requests. By default, fields with
1474	// empty or default values are omitted from API requests. However, any
1475	// non-pointer, non-interface field appearing in ForceSendFields will be
1476	// sent to the server regardless of whether the field is empty or not.
1477	// This may be used to include empty fields in Patch requests.
1478	ForceSendFields []string `json:"-"`
1479
1480	// NullFields is a list of field names (e.g. "Filter") to include in API
1481	// requests with the JSON null value. By default, fields with empty
1482	// values are omitted from API requests. However, any field with an
1483	// empty value appearing in NullFields will be sent to the server as
1484	// null. It is an error if a field in this list has a non-empty value.
1485	// This may be used to include null fields in Patch requests.
1486	NullFields []string `json:"-"`
1487}
1488
1489func (s *ListLogEntriesRequest) MarshalJSON() ([]byte, error) {
1490	type NoMethod ListLogEntriesRequest
1491	raw := NoMethod(*s)
1492	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1493}
1494
1495// ListLogEntriesResponse: Result returned from ListLogEntries.
1496type ListLogEntriesResponse struct {
1497	// Entries: A list of log entries. If entries is empty, nextPageToken
1498	// may still be returned, indicating that more entries may exist. See
1499	// nextPageToken for more information.
1500	Entries []*LogEntry `json:"entries,omitempty"`
1501
1502	// NextPageToken: If there might be more results than those appearing in
1503	// this response, then nextPageToken is included. To get the next set of
1504	// results, call this method again using the value of nextPageToken as
1505	// pageToken.If a value for next_page_token appears and the entries
1506	// field is empty, it means that the search found no log entries so far
1507	// but it did not have time to search all the possible log entries.
1508	// Retry the method with this value for page_token to continue the
1509	// search. Alternatively, consider speeding up the search by changing
1510	// your filter to specify a single log name or resource type, or to
1511	// narrow the time range of the search.
1512	NextPageToken string `json:"nextPageToken,omitempty"`
1513
1514	// ServerResponse contains the HTTP response code and headers from the
1515	// server.
1516	googleapi.ServerResponse `json:"-"`
1517
1518	// ForceSendFields is a list of field names (e.g. "Entries") to
1519	// unconditionally include in API requests. By default, fields with
1520	// empty or default values are omitted from API requests. However, any
1521	// non-pointer, non-interface field appearing in ForceSendFields will be
1522	// sent to the server regardless of whether the field is empty or not.
1523	// This may be used to include empty fields in Patch requests.
1524	ForceSendFields []string `json:"-"`
1525
1526	// NullFields is a list of field names (e.g. "Entries") to include in
1527	// API requests with the JSON null value. By default, fields with empty
1528	// values are omitted from API requests. However, any field with an
1529	// empty value appearing in NullFields will be sent to the server as
1530	// null. It is an error if a field in this list has a non-empty value.
1531	// This may be used to include null fields in Patch requests.
1532	NullFields []string `json:"-"`
1533}
1534
1535func (s *ListLogEntriesResponse) MarshalJSON() ([]byte, error) {
1536	type NoMethod ListLogEntriesResponse
1537	raw := NoMethod(*s)
1538	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1539}
1540
1541// ListLogMetricsResponse: Result returned from ListLogMetrics.
1542type ListLogMetricsResponse struct {
1543	// Metrics: A list of logs-based metrics.
1544	Metrics []*LogMetric `json:"metrics,omitempty"`
1545
1546	// NextPageToken: If there might be more results than appear in this
1547	// response, then nextPageToken is included. To get the next set of
1548	// results, call this method again using the value of nextPageToken as
1549	// pageToken.
1550	NextPageToken string `json:"nextPageToken,omitempty"`
1551
1552	// ServerResponse contains the HTTP response code and headers from the
1553	// server.
1554	googleapi.ServerResponse `json:"-"`
1555
1556	// ForceSendFields is a list of field names (e.g. "Metrics") to
1557	// unconditionally include in API requests. By default, fields with
1558	// empty or default values are omitted from API requests. However, any
1559	// non-pointer, non-interface field appearing in ForceSendFields will be
1560	// sent to the server regardless of whether the field is empty or not.
1561	// This may be used to include empty fields in Patch requests.
1562	ForceSendFields []string `json:"-"`
1563
1564	// NullFields is a list of field names (e.g. "Metrics") to include in
1565	// API requests with the JSON null value. By default, fields with empty
1566	// values are omitted from API requests. However, any field with an
1567	// empty value appearing in NullFields will be sent to the server as
1568	// null. It is an error if a field in this list has a non-empty value.
1569	// This may be used to include null fields in Patch requests.
1570	NullFields []string `json:"-"`
1571}
1572
1573func (s *ListLogMetricsResponse) MarshalJSON() ([]byte, error) {
1574	type NoMethod ListLogMetricsResponse
1575	raw := NoMethod(*s)
1576	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1577}
1578
1579// ListLogsResponse: Result returned from ListLogs.
1580type ListLogsResponse struct {
1581	// LogNames: A list of log names. For example,
1582	// "projects/my-project/logs/syslog" or
1583	// "organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity
1584	// ".
1585	LogNames []string `json:"logNames,omitempty"`
1586
1587	// NextPageToken: If there might be more results than those appearing in
1588	// this response, then nextPageToken is included. To get the next set of
1589	// results, call this method again using the value of nextPageToken as
1590	// pageToken.
1591	NextPageToken string `json:"nextPageToken,omitempty"`
1592
1593	// ServerResponse contains the HTTP response code and headers from the
1594	// server.
1595	googleapi.ServerResponse `json:"-"`
1596
1597	// ForceSendFields is a list of field names (e.g. "LogNames") to
1598	// unconditionally include in API requests. By default, fields with
1599	// empty or default values are omitted from API requests. However, any
1600	// non-pointer, non-interface field appearing in ForceSendFields will be
1601	// sent to the server regardless of whether the field is empty or not.
1602	// This may be used to include empty fields in Patch requests.
1603	ForceSendFields []string `json:"-"`
1604
1605	// NullFields is a list of field names (e.g. "LogNames") to include in
1606	// API requests with the JSON null value. By default, fields with empty
1607	// values are omitted from API requests. However, any field with an
1608	// empty value appearing in NullFields will be sent to the server as
1609	// null. It is an error if a field in this list has a non-empty value.
1610	// This may be used to include null fields in Patch requests.
1611	NullFields []string `json:"-"`
1612}
1613
1614func (s *ListLogsResponse) MarshalJSON() ([]byte, error) {
1615	type NoMethod ListLogsResponse
1616	raw := NoMethod(*s)
1617	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1618}
1619
1620// ListMonitoredResourceDescriptorsResponse: Result returned from
1621// ListMonitoredResourceDescriptors.
1622type ListMonitoredResourceDescriptorsResponse struct {
1623	// NextPageToken: If there might be more results than those appearing in
1624	// this response, then nextPageToken is included. To get the next set of
1625	// results, call this method again using the value of nextPageToken as
1626	// pageToken.
1627	NextPageToken string `json:"nextPageToken,omitempty"`
1628
1629	// ResourceDescriptors: A list of resource descriptors.
1630	ResourceDescriptors []*MonitoredResourceDescriptor `json:"resourceDescriptors,omitempty"`
1631
1632	// ServerResponse contains the HTTP response code and headers from the
1633	// server.
1634	googleapi.ServerResponse `json:"-"`
1635
1636	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
1637	// unconditionally include in API requests. By default, fields with
1638	// empty or default values are omitted from API requests. However, any
1639	// non-pointer, non-interface field appearing in ForceSendFields will be
1640	// sent to the server regardless of whether the field is empty or not.
1641	// This may be used to include empty fields in Patch requests.
1642	ForceSendFields []string `json:"-"`
1643
1644	// NullFields is a list of field names (e.g. "NextPageToken") to include
1645	// in API requests with the JSON null value. By default, fields with
1646	// empty values are omitted from API requests. However, any field with
1647	// an empty value appearing in NullFields will be sent to the server as
1648	// null. It is an error if a field in this list has a non-empty value.
1649	// This may be used to include null fields in Patch requests.
1650	NullFields []string `json:"-"`
1651}
1652
1653func (s *ListMonitoredResourceDescriptorsResponse) MarshalJSON() ([]byte, error) {
1654	type NoMethod ListMonitoredResourceDescriptorsResponse
1655	raw := NoMethod(*s)
1656	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1657}
1658
1659// ListOperationsResponse: The response message for
1660// Operations.ListOperations.
1661type ListOperationsResponse struct {
1662	// NextPageToken: The standard List next-page token.
1663	NextPageToken string `json:"nextPageToken,omitempty"`
1664
1665	// Operations: A list of operations that matches the specified filter in
1666	// the request.
1667	Operations []*Operation `json:"operations,omitempty"`
1668
1669	// ServerResponse contains the HTTP response code and headers from the
1670	// server.
1671	googleapi.ServerResponse `json:"-"`
1672
1673	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
1674	// unconditionally include in API requests. By default, fields with
1675	// empty or default values are omitted from API requests. However, any
1676	// non-pointer, non-interface field appearing in ForceSendFields will be
1677	// sent to the server regardless of whether the field is empty or not.
1678	// This may be used to include empty fields in Patch requests.
1679	ForceSendFields []string `json:"-"`
1680
1681	// NullFields is a list of field names (e.g. "NextPageToken") to include
1682	// in API requests with the JSON null value. By default, fields with
1683	// empty values are omitted from API requests. However, any field with
1684	// an empty value appearing in NullFields will be sent to the server as
1685	// null. It is an error if a field in this list has a non-empty value.
1686	// This may be used to include null fields in Patch requests.
1687	NullFields []string `json:"-"`
1688}
1689
1690func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
1691	type NoMethod ListOperationsResponse
1692	raw := NoMethod(*s)
1693	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1694}
1695
1696// ListSinksResponse: Result returned from ListSinks.
1697type ListSinksResponse struct {
1698	// NextPageToken: If there might be more results than appear in this
1699	// response, then nextPageToken is included. To get the next set of
1700	// results, call the same method again using the value of nextPageToken
1701	// as pageToken.
1702	NextPageToken string `json:"nextPageToken,omitempty"`
1703
1704	// Sinks: A list of sinks.
1705	Sinks []*LogSink `json:"sinks,omitempty"`
1706
1707	// ServerResponse contains the HTTP response code and headers from the
1708	// server.
1709	googleapi.ServerResponse `json:"-"`
1710
1711	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
1712	// unconditionally include in API requests. By default, fields with
1713	// empty or default values are omitted from API requests. However, any
1714	// non-pointer, non-interface field appearing in ForceSendFields will be
1715	// sent to the server regardless of whether the field is empty or not.
1716	// This may be used to include empty fields in Patch requests.
1717	ForceSendFields []string `json:"-"`
1718
1719	// NullFields is a list of field names (e.g. "NextPageToken") to include
1720	// in API requests with the JSON null value. By default, fields with
1721	// empty values are omitted from API requests. However, any field with
1722	// an empty value appearing in NullFields will be sent to the server as
1723	// null. It is an error if a field in this list has a non-empty value.
1724	// This may be used to include null fields in Patch requests.
1725	NullFields []string `json:"-"`
1726}
1727
1728func (s *ListSinksResponse) MarshalJSON() ([]byte, error) {
1729	type NoMethod ListSinksResponse
1730	raw := NoMethod(*s)
1731	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1732}
1733
1734// ListViewsResponse: The response from ListViews.
1735type ListViewsResponse struct {
1736	// NextPageToken: If there might be more results than appear in this
1737	// response, then nextPageToken is included. To get the next set of
1738	// results, call the same method again using the value of nextPageToken
1739	// as pageToken.
1740	NextPageToken string `json:"nextPageToken,omitempty"`
1741
1742	// Views: A list of views.
1743	Views []*LogView `json:"views,omitempty"`
1744
1745	// ServerResponse contains the HTTP response code and headers from the
1746	// server.
1747	googleapi.ServerResponse `json:"-"`
1748
1749	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
1750	// unconditionally include in API requests. By default, fields with
1751	// empty or default values are omitted from API requests. However, any
1752	// non-pointer, non-interface field appearing in ForceSendFields will be
1753	// sent to the server regardless of whether the field is empty or not.
1754	// This may be used to include empty fields in Patch requests.
1755	ForceSendFields []string `json:"-"`
1756
1757	// NullFields is a list of field names (e.g. "NextPageToken") to include
1758	// in API requests with the JSON null value. By default, fields with
1759	// empty values are omitted from API requests. However, any field with
1760	// an empty value appearing in NullFields will be sent to the server as
1761	// null. It is an error if a field in this list has a non-empty value.
1762	// This may be used to include null fields in Patch requests.
1763	NullFields []string `json:"-"`
1764}
1765
1766func (s *ListViewsResponse) MarshalJSON() ([]byte, error) {
1767	type NoMethod ListViewsResponse
1768	raw := NoMethod(*s)
1769	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1770}
1771
1772// Location: A resource that represents Google Cloud Platform location.
1773type Location struct {
1774	// DisplayName: The friendly name for this location, typically a nearby
1775	// city name. For example, "Tokyo".
1776	DisplayName string `json:"displayName,omitempty"`
1777
1778	// Labels: Cross-service attributes for the location. For example
1779	// {"cloud.googleapis.com/region": "us-east1"}
1780	Labels map[string]string `json:"labels,omitempty"`
1781
1782	// LocationId: The canonical id for this location. For example:
1783	// "us-east1".
1784	LocationId string `json:"locationId,omitempty"`
1785
1786	// Metadata: Service-specific metadata. For example the available
1787	// capacity at the given location.
1788	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
1789
1790	// Name: Resource name for the location, which may vary between
1791	// implementations. For example:
1792	// "projects/example-project/locations/us-east1"
1793	Name string `json:"name,omitempty"`
1794
1795	// ServerResponse contains the HTTP response code and headers from the
1796	// server.
1797	googleapi.ServerResponse `json:"-"`
1798
1799	// ForceSendFields is a list of field names (e.g. "DisplayName") to
1800	// unconditionally include in API requests. By default, fields with
1801	// empty or default values are omitted from API requests. However, any
1802	// non-pointer, non-interface field appearing in ForceSendFields will be
1803	// sent to the server regardless of whether the field is empty or not.
1804	// This may be used to include empty fields in Patch requests.
1805	ForceSendFields []string `json:"-"`
1806
1807	// NullFields is a list of field names (e.g. "DisplayName") to include
1808	// in API requests with the JSON null value. By default, fields with
1809	// empty values are omitted from API requests. However, any field with
1810	// an empty value appearing in NullFields will be sent to the server as
1811	// null. It is an error if a field in this list has a non-empty value.
1812	// This may be used to include null fields in Patch requests.
1813	NullFields []string `json:"-"`
1814}
1815
1816func (s *Location) MarshalJSON() ([]byte, error) {
1817	type NoMethod Location
1818	raw := NoMethod(*s)
1819	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1820}
1821
1822// LogBucket: Describes a repository in which log entries are stored.
1823type LogBucket struct {
1824	// CreateTime: Output only. The creation timestamp of the bucket. This
1825	// is not set for any of the default buckets.
1826	CreateTime string `json:"createTime,omitempty"`
1827
1828	// Description: Describes this bucket.
1829	Description string `json:"description,omitempty"`
1830
1831	// LifecycleState: Output only. The bucket lifecycle state.
1832	//
1833	// Possible values:
1834	//   "LIFECYCLE_STATE_UNSPECIFIED" - Unspecified state. This is only
1835	// used/useful for distinguishing unset values.
1836	//   "ACTIVE" - The normal and active state.
1837	//   "DELETE_REQUESTED" - The bucket has been marked for deletion by the
1838	// user.
1839	LifecycleState string `json:"lifecycleState,omitempty"`
1840
1841	// Locked: Whether the bucket is locked.The retention period on a locked
1842	// bucket cannot be changed. Locked buckets may only be deleted if they
1843	// are empty.
1844	Locked bool `json:"locked,omitempty"`
1845
1846	// Name: Output only. The resource name of the bucket.For
1847	// example:projects/my-project/locations/global/buckets/my-bucketFor a
1848	// list of supported locations, see Supported Regions
1849	// (https://cloud.google.com/logging/docs/region-support)For the
1850	// location of global it is unspecified where log entries are actually
1851	// stored.After a bucket has been created, the location cannot be
1852	// changed.
1853	Name string `json:"name,omitempty"`
1854
1855	// RestrictedFields: Log entry field paths that are denied access in
1856	// this bucket.The following fields and their children are eligible:
1857	// textPayload, jsonPayload, protoPayload, httpRequest, labels,
1858	// sourceLocation.Restricting a repeated field will restrict all values.
1859	// Adding a parent will block all child fields. (e.g. foo.bar will block
1860	// foo.bar.baz)
1861	RestrictedFields []string `json:"restrictedFields,omitempty"`
1862
1863	// RetentionDays: Logs will be retained by default for this amount of
1864	// time, after which they will automatically be deleted. The minimum
1865	// retention period is 1 day. If this value is set to zero at bucket
1866	// creation time, the default time of 30 days will be used.
1867	RetentionDays int64 `json:"retentionDays,omitempty"`
1868
1869	// UpdateTime: Output only. The last update timestamp of the bucket.
1870	UpdateTime string `json:"updateTime,omitempty"`
1871
1872	// ServerResponse contains the HTTP response code and headers from the
1873	// server.
1874	googleapi.ServerResponse `json:"-"`
1875
1876	// ForceSendFields is a list of field names (e.g. "CreateTime") to
1877	// unconditionally include in API requests. By default, fields with
1878	// empty or default values are omitted from API requests. However, any
1879	// non-pointer, non-interface field appearing in ForceSendFields will be
1880	// sent to the server regardless of whether the field is empty or not.
1881	// This may be used to include empty fields in Patch requests.
1882	ForceSendFields []string `json:"-"`
1883
1884	// NullFields is a list of field names (e.g. "CreateTime") to include in
1885	// API requests with the JSON null value. By default, fields with empty
1886	// values are omitted from API requests. However, any field with an
1887	// empty value appearing in NullFields will be sent to the server as
1888	// null. It is an error if a field in this list has a non-empty value.
1889	// This may be used to include null fields in Patch requests.
1890	NullFields []string `json:"-"`
1891}
1892
1893func (s *LogBucket) MarshalJSON() ([]byte, error) {
1894	type NoMethod LogBucket
1895	raw := NoMethod(*s)
1896	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
1897}
1898
1899// LogEntry: An individual entry in a log.
1900type LogEntry struct {
1901	// HttpRequest: Optional. Information about the HTTP request associated
1902	// with this log entry, if applicable.
1903	HttpRequest *HttpRequest `json:"httpRequest,omitempty"`
1904
1905	// InsertId: Optional. A unique identifier for the log entry. If you
1906	// provide a value, then Logging considers other log entries in the same
1907	// project, with the same timestamp, and with the same insert_id to be
1908	// duplicates which are removed in a single query result. However, there
1909	// are no guarantees of de-duplication in the export of logs.If the
1910	// insert_id is omitted when writing a log entry, the Logging API
1911	// assigns its own unique identifier in this field.In queries, the
1912	// insert_id is also used to order log entries that have the same
1913	// log_name and timestamp values.
1914	InsertId string `json:"insertId,omitempty"`
1915
1916	// JsonPayload: The log entry payload, represented as a structure that
1917	// is expressed as a JSON object.
1918	JsonPayload googleapi.RawMessage `json:"jsonPayload,omitempty"`
1919
1920	// Labels: Optional. A map of key, value pairs that provides additional
1921	// information about the log entry. The labels can be user-defined or
1922	// system-defined.User-defined labels are arbitrary key, value pairs
1923	// that you can use to classify logs.System-defined labels are defined
1924	// by GCP services for platform logs. They have two components - a
1925	// service namespace component and the attribute name. For example:
1926	// compute.googleapis.com/resource_name.Cloud Logging truncates label
1927	// keys that exceed 512 B and label values that exceed 64 KB upon their
1928	// associated log entry being written. The truncation is indicated by an
1929	// ellipsis at the end of the character string.
1930	Labels map[string]string `json:"labels,omitempty"`
1931
1932	// LogName: Required. The resource name of the log to which this log
1933	// entry belongs: "projects/[PROJECT_ID]/logs/[LOG_ID]"
1934	// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
1935	// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
1936	// "folders/[FOLDER_ID]/logs/[LOG_ID]" A project number may be used in
1937	// place of PROJECT_ID. The project number is translated to its
1938	// corresponding PROJECT_ID internally and the log_name field will
1939	// contain PROJECT_ID in queries and exports.[LOG_ID] must be
1940	// URL-encoded within log_name. Example:
1941	// "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Fa
1942	// ctivity".[LOG_ID] must be less than 512 characters long and can only
1943	// include the following characters: upper and lower case alphanumeric
1944	// characters, forward-slash, underscore, hyphen, and period.For
1945	// backward compatibility, if log_name begins with a forward-slash, such
1946	// as /projects/..., then the log entry is ingested as usual, but the
1947	// forward-slash is removed. Listing the log entry will not show the
1948	// leading slash and filtering for a log name with a leading slash will
1949	// never return any results.
1950	LogName string `json:"logName,omitempty"`
1951
1952	// Metadata: Output only. Deprecated. This field is not used by Logging.
1953	// Any value written to it is cleared.
1954	Metadata *MonitoredResourceMetadata `json:"metadata,omitempty"`
1955
1956	// Operation: Optional. Information about an operation associated with
1957	// the log entry, if applicable.
1958	Operation *LogEntryOperation `json:"operation,omitempty"`
1959
1960	// ProtoPayload: The log entry payload, represented as a protocol
1961	// buffer. Some Google Cloud Platform services use this field for their
1962	// log entry payloads.The following protocol buffer types are supported;
1963	// user-defined types are not
1964	// supported:"type.googleapis.com/google.cloud.audit.AuditLog"
1965	// "type.googleapis.com/google.appengine.logging.v1.RequestLog"
1966	ProtoPayload googleapi.RawMessage `json:"protoPayload,omitempty"`
1967
1968	// ReceiveTimestamp: Output only. The time the log entry was received by
1969	// Logging.
1970	ReceiveTimestamp string `json:"receiveTimestamp,omitempty"`
1971
1972	// Resource: Required. The monitored resource that produced this log
1973	// entry.Example: a log entry that reports a database error would be
1974	// associated with the monitored resource designating the particular
1975	// database that reported the error.
1976	Resource *MonitoredResource `json:"resource,omitempty"`
1977
1978	// Severity: Optional. The severity of the log entry. The default value
1979	// is LogSeverity.DEFAULT.
1980	//
1981	// Possible values:
1982	//   "DEFAULT" - (0) The log entry has no assigned severity level.
1983	//   "DEBUG" - (100) Debug or trace information.
1984	//   "INFO" - (200) Routine information, such as ongoing status or
1985	// performance.
1986	//   "NOTICE" - (300) Normal but significant events, such as start up,
1987	// shut down, or a configuration change.
1988	//   "WARNING" - (400) Warning events might cause problems.
1989	//   "ERROR" - (500) Error events are likely to cause problems.
1990	//   "CRITICAL" - (600) Critical events cause more severe problems or
1991	// outages.
1992	//   "ALERT" - (700) A person must take an action immediately.
1993	//   "EMERGENCY" - (800) One or more systems are unusable.
1994	Severity string `json:"severity,omitempty"`
1995
1996	// SourceLocation: Optional. Source code location information associated
1997	// with the log entry, if any.
1998	SourceLocation *LogEntrySourceLocation `json:"sourceLocation,omitempty"`
1999
2000	// SpanId: Optional. The span ID within the trace associated with the
2001	// log entry.For Trace spans, this is the same format that the Trace API
2002	// v2 uses: a 16-character hexadecimal encoding of an 8-byte array, such
2003	// as 000000000000004a.
2004	SpanId string `json:"spanId,omitempty"`
2005
2006	// TextPayload: The log entry payload, represented as a Unicode string
2007	// (UTF-8).
2008	TextPayload string `json:"textPayload,omitempty"`
2009
2010	// Timestamp: Optional. The time the event described by the log entry
2011	// occurred. This time is used to compute the log entry's age and to
2012	// enforce the logs retention period. If this field is omitted in a new
2013	// log entry, then Logging assigns it the current time. Timestamps have
2014	// nanosecond accuracy, but trailing zeros in the fractional seconds
2015	// might be omitted when the timestamp is displayed.Incoming log entries
2016	// must have timestamps that don't exceed the logs retention period
2017	// (https://cloud.google.com/logging/quotas#logs_retention_periods) in
2018	// the past, and that don't exceed 24 hours in the future. Log entries
2019	// outside those time boundaries aren't ingested by Logging.
2020	Timestamp string `json:"timestamp,omitempty"`
2021
2022	// Trace: Optional. Resource name of the trace associated with the log
2023	// entry, if any. If it contains a relative resource name, the name is
2024	// assumed to be relative to //tracing.googleapis.com. Example:
2025	// projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824
2026	Trace string `json:"trace,omitempty"`
2027
2028	// TraceSampled: Optional. The sampling decision of the trace associated
2029	// with the log entry.True means that the trace resource name in the
2030	// trace field was sampled for storage in a trace backend. False means
2031	// that the trace was not sampled for storage when this log entry was
2032	// written, or the sampling decision was unknown at the time. A
2033	// non-sampled trace value is still useful as a request correlation
2034	// identifier. The default is False.
2035	TraceSampled bool `json:"traceSampled,omitempty"`
2036
2037	// ForceSendFields is a list of field names (e.g. "HttpRequest") to
2038	// unconditionally include in API requests. By default, fields with
2039	// empty or default values are omitted from API requests. However, any
2040	// non-pointer, non-interface field appearing in ForceSendFields will be
2041	// sent to the server regardless of whether the field is empty or not.
2042	// This may be used to include empty fields in Patch requests.
2043	ForceSendFields []string `json:"-"`
2044
2045	// NullFields is a list of field names (e.g. "HttpRequest") to include
2046	// in API requests with the JSON null value. By default, fields with
2047	// empty values are omitted from API requests. However, any field with
2048	// an empty value appearing in NullFields will be sent to the server as
2049	// null. It is an error if a field in this list has a non-empty value.
2050	// This may be used to include null fields in Patch requests.
2051	NullFields []string `json:"-"`
2052}
2053
2054func (s *LogEntry) MarshalJSON() ([]byte, error) {
2055	type NoMethod LogEntry
2056	raw := NoMethod(*s)
2057	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2058}
2059
2060// LogEntryOperation: Additional information about a potentially
2061// long-running operation with which a log entry is associated.
2062type LogEntryOperation struct {
2063	// First: Optional. Set this to True if this is the first log entry in
2064	// the operation.
2065	First bool `json:"first,omitempty"`
2066
2067	// Id: Optional. An arbitrary operation identifier. Log entries with the
2068	// same identifier are assumed to be part of the same operation.
2069	Id string `json:"id,omitempty"`
2070
2071	// Last: Optional. Set this to True if this is the last log entry in the
2072	// operation.
2073	Last bool `json:"last,omitempty"`
2074
2075	// Producer: Optional. An arbitrary producer identifier. The combination
2076	// of id and producer must be globally unique. Examples for producer:
2077	// "MyDivision.MyBigCompany.com", "github.com/MyProject/MyApplication".
2078	Producer string `json:"producer,omitempty"`
2079
2080	// ForceSendFields is a list of field names (e.g. "First") to
2081	// unconditionally include in API requests. By default, fields with
2082	// empty or default values are omitted from API requests. However, any
2083	// non-pointer, non-interface field appearing in ForceSendFields will be
2084	// sent to the server regardless of whether the field is empty or not.
2085	// This may be used to include empty fields in Patch requests.
2086	ForceSendFields []string `json:"-"`
2087
2088	// NullFields is a list of field names (e.g. "First") to include in API
2089	// requests with the JSON null value. By default, fields with empty
2090	// values are omitted from API requests. However, any field with an
2091	// empty value appearing in NullFields will be sent to the server as
2092	// null. It is an error if a field in this list has a non-empty value.
2093	// This may be used to include null fields in Patch requests.
2094	NullFields []string `json:"-"`
2095}
2096
2097func (s *LogEntryOperation) MarshalJSON() ([]byte, error) {
2098	type NoMethod LogEntryOperation
2099	raw := NoMethod(*s)
2100	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2101}
2102
2103// LogEntrySourceLocation: Additional information about the source code
2104// location that produced the log entry.
2105type LogEntrySourceLocation struct {
2106	// File: Optional. Source file name. Depending on the runtime
2107	// environment, this might be a simple name or a fully-qualified name.
2108	File string `json:"file,omitempty"`
2109
2110	// Function: Optional. Human-readable name of the function or method
2111	// being invoked, with optional context such as the class or package
2112	// name. This information may be used in contexts such as the logs
2113	// viewer, where a file and line number are less meaningful. The format
2114	// can vary by language. For example: qual.if.ied.Class.method (Java),
2115	// dir/package.func (Go), function (Python).
2116	Function string `json:"function,omitempty"`
2117
2118	// Line: Optional. Line within the source file. 1-based; 0 indicates no
2119	// line number available.
2120	Line int64 `json:"line,omitempty,string"`
2121
2122	// ForceSendFields is a list of field names (e.g. "File") to
2123	// unconditionally include in API requests. By default, fields with
2124	// empty or default values are omitted from API requests. However, any
2125	// non-pointer, non-interface field appearing in ForceSendFields will be
2126	// sent to the server regardless of whether the field is empty or not.
2127	// This may be used to include empty fields in Patch requests.
2128	ForceSendFields []string `json:"-"`
2129
2130	// NullFields is a list of field names (e.g. "File") to include in API
2131	// requests with the JSON null value. By default, fields with empty
2132	// values are omitted from API requests. However, any field with an
2133	// 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 *LogEntrySourceLocation) MarshalJSON() ([]byte, error) {
2140	type NoMethod LogEntrySourceLocation
2141	raw := NoMethod(*s)
2142	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2143}
2144
2145// LogExclusion: Specifies a set of log entries that are filtered out by
2146// a sink. If your Google Cloud resource receives a large volume of log
2147// entries, you can use exclusions to reduce your chargeable logs. Note
2148// that exclusions on organization-level and folder-level sinks don't
2149// apply to child resources. Note also that you cannot modify the
2150// _Required sink or exclude logs from it.
2151type LogExclusion struct {
2152	// CreateTime: Output only. The creation timestamp of the exclusion.This
2153	// field may not be present for older exclusions.
2154	CreateTime string `json:"createTime,omitempty"`
2155
2156	// Description: Optional. A description of this exclusion.
2157	Description string `json:"description,omitempty"`
2158
2159	// Disabled: Optional. If set to True, then this exclusion is disabled
2160	// and it does not exclude any log entries. You can update an exclusion
2161	// to change the value of this field.
2162	Disabled bool `json:"disabled,omitempty"`
2163
2164	// Filter: Required. An advanced logs filter
2165	// (https://cloud.google.com/logging/docs/view/advanced-queries) that
2166	// matches the log entries to be excluded. By using the sample function
2167	// (https://cloud.google.com/logging/docs/view/advanced-queries#sample),
2168	// you can exclude less than 100% of the matching log entries.For
2169	// example, the following query matches 99% of low-severity log entries
2170	// from Google Cloud Storage buckets:resource.type=gcs_bucket
2171	// severity<ERROR sample(insertId, 0.99)
2172	Filter string `json:"filter,omitempty"`
2173
2174	// Name: Required. A client-assigned identifier, such as
2175	// "load-balancer-exclusion". Identifiers are limited to 100 characters
2176	// and can include only letters, digits, underscores, hyphens, and
2177	// periods. First character has to be alphanumeric.
2178	Name string `json:"name,omitempty"`
2179
2180	// UpdateTime: Output only. The last update timestamp of the
2181	// exclusion.This field may not be present for older exclusions.
2182	UpdateTime string `json:"updateTime,omitempty"`
2183
2184	// ServerResponse contains the HTTP response code and headers from the
2185	// server.
2186	googleapi.ServerResponse `json:"-"`
2187
2188	// ForceSendFields is a list of field names (e.g. "CreateTime") to
2189	// unconditionally include in API requests. By default, fields with
2190	// empty or default values are omitted from API requests. However, any
2191	// non-pointer, non-interface field appearing in ForceSendFields will be
2192	// sent to the server regardless of whether the field is empty or not.
2193	// This may be used to include empty fields in Patch requests.
2194	ForceSendFields []string `json:"-"`
2195
2196	// NullFields is a list of field names (e.g. "CreateTime") to include in
2197	// API requests with the JSON null value. By default, fields with empty
2198	// values are omitted from API requests. However, any field with an
2199	// empty value appearing in NullFields will be sent to the server as
2200	// null. It is an error if a field in this list has a non-empty value.
2201	// This may be used to include null fields in Patch requests.
2202	NullFields []string `json:"-"`
2203}
2204
2205func (s *LogExclusion) MarshalJSON() ([]byte, error) {
2206	type NoMethod LogExclusion
2207	raw := NoMethod(*s)
2208	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2209}
2210
2211// LogLine: Application log line emitted while processing a request.
2212type LogLine struct {
2213	// LogMessage: App-provided log message.
2214	LogMessage string `json:"logMessage,omitempty"`
2215
2216	// Severity: Severity of this log entry.
2217	//
2218	// Possible values:
2219	//   "DEFAULT" - (0) The log entry has no assigned severity level.
2220	//   "DEBUG" - (100) Debug or trace information.
2221	//   "INFO" - (200) Routine information, such as ongoing status or
2222	// performance.
2223	//   "NOTICE" - (300) Normal but significant events, such as start up,
2224	// shut down, or a configuration change.
2225	//   "WARNING" - (400) Warning events might cause problems.
2226	//   "ERROR" - (500) Error events are likely to cause problems.
2227	//   "CRITICAL" - (600) Critical events cause more severe problems or
2228	// outages.
2229	//   "ALERT" - (700) A person must take an action immediately.
2230	//   "EMERGENCY" - (800) One or more systems are unusable.
2231	Severity string `json:"severity,omitempty"`
2232
2233	// SourceLocation: Where in the source code this log message was
2234	// written.
2235	SourceLocation *SourceLocation `json:"sourceLocation,omitempty"`
2236
2237	// Time: Approximate time when this log entry was made.
2238	Time string `json:"time,omitempty"`
2239
2240	// ForceSendFields is a list of field names (e.g. "LogMessage") to
2241	// unconditionally include in API requests. By default, fields with
2242	// empty or default values are omitted from API requests. However, any
2243	// non-pointer, non-interface field appearing in ForceSendFields will be
2244	// sent to the server regardless of whether the field is empty or not.
2245	// This may be used to include empty fields in Patch requests.
2246	ForceSendFields []string `json:"-"`
2247
2248	// NullFields is a list of field names (e.g. "LogMessage") to include in
2249	// API requests with the JSON null value. By default, fields with empty
2250	// values are omitted from API requests. However, any field with an
2251	// empty value appearing in NullFields will be sent to the server as
2252	// null. It is an error if a field in this list has a non-empty value.
2253	// This may be used to include null fields in Patch requests.
2254	NullFields []string `json:"-"`
2255}
2256
2257func (s *LogLine) MarshalJSON() ([]byte, error) {
2258	type NoMethod LogLine
2259	raw := NoMethod(*s)
2260	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2261}
2262
2263// LogMetric: Describes a logs-based metric. The value of the metric is
2264// the number of log entries that match a logs filter in a given time
2265// interval.Logs-based metrics can also be used to extract values from
2266// logs and create a distribution of the values. The distribution
2267// records the statistics of the extracted values along with an optional
2268// histogram of the values as specified by the bucket options.
2269type LogMetric struct {
2270	// BucketOptions: Optional. The bucket_options are required when the
2271	// logs-based metric is using a DISTRIBUTION value type and it describes
2272	// the bucket boundaries used to create a histogram of the extracted
2273	// values.
2274	BucketOptions *BucketOptions `json:"bucketOptions,omitempty"`
2275
2276	// CreateTime: Output only. The creation timestamp of the metric.This
2277	// field may not be present for older metrics.
2278	CreateTime string `json:"createTime,omitempty"`
2279
2280	// Description: Optional. A description of this metric, which is used in
2281	// documentation. The maximum length of the description is 8000
2282	// characters.
2283	Description string `json:"description,omitempty"`
2284
2285	// Disabled: Optional. If set to True, then this metric is disabled and
2286	// it does not generate any points.
2287	Disabled bool `json:"disabled,omitempty"`
2288
2289	// Filter: Required. An advanced logs filter
2290	// (https://cloud.google.com/logging/docs/view/advanced_filters) which
2291	// is used to match log entries. Example: "resource.type=gae_app AND
2292	// severity>=ERROR" The maximum length of the filter is 20000
2293	// characters.
2294	Filter string `json:"filter,omitempty"`
2295
2296	// LabelExtractors: Optional. A map from a label key string to an
2297	// extractor expression which is used to extract data from a log entry
2298	// field and assign as the label value. Each label key specified in the
2299	// LabelDescriptor must have an associated extractor expression in this
2300	// map. The syntax of the extractor expression is the same as for the
2301	// value_extractor field.The extracted value is converted to the type
2302	// defined in the label descriptor. If the either the extraction or the
2303	// type conversion fails, the label will have a default value. The
2304	// default value for a string label is an empty string, for an integer
2305	// label its 0, and for a boolean label its false.Note that there are
2306	// upper bounds on the maximum number of labels and the number of active
2307	// time series that are allowed in a project.
2308	LabelExtractors map[string]string `json:"labelExtractors,omitempty"`
2309
2310	// MetricDescriptor: Optional. The metric descriptor associated with the
2311	// logs-based metric. If unspecified, it uses a default metric
2312	// descriptor with a DELTA metric kind, INT64 value type, with no labels
2313	// and a unit of "1". Such a metric counts the number of log entries
2314	// matching the filter expression.The name, type, and description fields
2315	// in the metric_descriptor are output only, and is constructed using
2316	// the name and description field in the LogMetric.To create a
2317	// logs-based metric that records a distribution of log values, a DELTA
2318	// metric kind with a DISTRIBUTION value type must be used along with a
2319	// value_extractor expression in the LogMetric.Each label in the metric
2320	// descriptor must have a matching label name as the key and an
2321	// extractor expression as the value in the label_extractors map.The
2322	// metric_kind and value_type fields in the metric_descriptor cannot be
2323	// updated once initially configured. New labels can be added in the
2324	// metric_descriptor, but existing labels cannot be modified except for
2325	// their description.
2326	MetricDescriptor *MetricDescriptor `json:"metricDescriptor,omitempty"`
2327
2328	// Name: Required. The client-assigned metric identifier. Examples:
2329	// "error_count", "nginx/requests".Metric identifiers are limited to 100
2330	// characters and can include only the following characters: A-Z, a-z,
2331	// 0-9, and the special characters _-.,+!*',()%/. The forward-slash
2332	// character (/) denotes a hierarchy of name pieces, and it cannot be
2333	// the first character of the name.The metric identifier in this field
2334	// must not be URL-encoded
2335	// (https://en.wikipedia.org/wiki/Percent-encoding). However, when the
2336	// metric identifier appears as the [METRIC_ID] part of a metric_name
2337	// API parameter, then the metric identifier must be URL-encoded.
2338	// Example: "projects/my-project/metrics/nginx%2Frequests".
2339	Name string `json:"name,omitempty"`
2340
2341	// UpdateTime: Output only. The last update timestamp of the metric.This
2342	// field may not be present for older metrics.
2343	UpdateTime string `json:"updateTime,omitempty"`
2344
2345	// ValueExtractor: Optional. A value_extractor is required when using a
2346	// distribution logs-based metric to extract the values to record from a
2347	// log entry. Two functions are supported for value extraction:
2348	// EXTRACT(field) or REGEXP_EXTRACT(field, regex). The argument are: 1.
2349	// field: The name of the log entry field from which the value is to be
2350	// extracted. 2. regex: A regular expression using the Google RE2 syntax
2351	// (https://github.com/google/re2/wiki/Syntax) with a single capture
2352	// group to extract data from the specified log entry field. The value
2353	// of the field is converted to a string before applying the regex. It
2354	// is an error to specify a regex that does not include exactly one
2355	// capture group.The result of the extraction must be convertible to a
2356	// double type, as the distribution always records double values. If
2357	// either the extraction or the conversion to double fails, then those
2358	// values are not recorded in the distribution.Example:
2359	// REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")
2360	ValueExtractor string `json:"valueExtractor,omitempty"`
2361
2362	// Version: Deprecated. The API version that created or updated this
2363	// metric. The v2 format is used by default and cannot be changed.
2364	//
2365	// Possible values:
2366	//   "V2" - Logging API v2.
2367	//   "V1" - Logging API v1.
2368	Version string `json:"version,omitempty"`
2369
2370	// ServerResponse contains the HTTP response code and headers from the
2371	// server.
2372	googleapi.ServerResponse `json:"-"`
2373
2374	// ForceSendFields is a list of field names (e.g. "BucketOptions") to
2375	// unconditionally include in API requests. By default, fields with
2376	// empty or default values are omitted from API requests. However, any
2377	// non-pointer, non-interface field appearing in ForceSendFields will be
2378	// sent to the server regardless of whether the field is empty or not.
2379	// This may be used to include empty fields in Patch requests.
2380	ForceSendFields []string `json:"-"`
2381
2382	// NullFields is a list of field names (e.g. "BucketOptions") to include
2383	// in API requests with the JSON null value. By default, fields with
2384	// empty values are omitted from API requests. However, any field with
2385	// an empty value appearing in NullFields will be sent to the server as
2386	// null. It is an error if a field in this list has a non-empty value.
2387	// This may be used to include null fields in Patch requests.
2388	NullFields []string `json:"-"`
2389}
2390
2391func (s *LogMetric) MarshalJSON() ([]byte, error) {
2392	type NoMethod LogMetric
2393	raw := NoMethod(*s)
2394	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2395}
2396
2397// LogSink: Describes a sink used to export log entries to one of the
2398// following destinations in any project: a Cloud Storage bucket, a
2399// BigQuery dataset, a Pub/Sub topic or a Cloud Logging log bucket. A
2400// logs filter controls which log entries are exported. The sink must be
2401// created within a project, organization, billing account, or folder.
2402type LogSink struct {
2403	// BigqueryOptions: Optional. Options that affect sinks exporting data
2404	// to BigQuery.
2405	BigqueryOptions *BigQueryOptions `json:"bigqueryOptions,omitempty"`
2406
2407	// CreateTime: Output only. The creation timestamp of the sink.This
2408	// field may not be present for older sinks.
2409	CreateTime string `json:"createTime,omitempty"`
2410
2411	// Description: Optional. A description of this sink.The maximum length
2412	// of the description is 8000 characters.
2413	Description string `json:"description,omitempty"`
2414
2415	// Destination: Required. The export destination:
2416	// "storage.googleapis.com/[GCS_BUCKET]"
2417	// "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
2418	// "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" The
2419	// sink's writer_identity, set when the sink is created, must have
2420	// permission to write to the destination or else the log entries are
2421	// not exported. For more information, see Exporting Logs with Sinks
2422	// (https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
2423	Destination string `json:"destination,omitempty"`
2424
2425	// Disabled: Optional. If set to true, then this sink is disabled and it
2426	// does not export any log entries.
2427	Disabled bool `json:"disabled,omitempty"`
2428
2429	// Exclusions: Optional. Log entries that match any of these exclusion
2430	// filters will not be exported.If a log entry is matched by both filter
2431	// and one of exclusion_filters it will not be exported.
2432	Exclusions []*LogExclusion `json:"exclusions,omitempty"`
2433
2434	// Filter: Optional. An advanced logs filter
2435	// (https://cloud.google.com/logging/docs/view/advanced-queries). The
2436	// only exported log entries are those that are in the resource owning
2437	// the sink and that match the filter.For
2438	// example:logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND
2439	// severity>=ERROR
2440	Filter string `json:"filter,omitempty"`
2441
2442	// IncludeChildren: Optional. This field applies only to sinks owned by
2443	// organizations and folders. If the field is false, the default, only
2444	// the logs owned by the sink's parent resource are available for
2445	// export. If the field is true, then log entries from all the projects,
2446	// folders, and billing accounts contained in the sink's parent resource
2447	// are also available for export. Whether a particular log entry from
2448	// the children is exported depends on the sink's filter expression.For
2449	// example, if this field is true, then the filter
2450	// resource.type=gce_instance would export all Compute Engine VM
2451	// instance log entries from all projects in the sink's parent.To only
2452	// export entries from certain child projects, filter on the project
2453	// part of the log name:logName:("projects/test-project1/" OR
2454	// "projects/test-project2/") AND resource.type=gce_instance
2455	IncludeChildren bool `json:"includeChildren,omitempty"`
2456
2457	// Name: Required. The client-assigned sink identifier, unique within
2458	// the project.For example: "my-syslog-errors-to-pubsub". Sink
2459	// identifiers are limited to 100 characters and can include only the
2460	// following characters: upper and lower-case alphanumeric characters,
2461	// underscores, hyphens, and periods. First character has to be
2462	// alphanumeric.
2463	Name string `json:"name,omitempty"`
2464
2465	// OutputVersionFormat: Deprecated. This field is unused.
2466	//
2467	// Possible values:
2468	//   "VERSION_FORMAT_UNSPECIFIED" - An unspecified format version that
2469	// will default to V2.
2470	//   "V2" - LogEntry version 2 format.
2471	//   "V1" - LogEntry version 1 format.
2472	OutputVersionFormat string `json:"outputVersionFormat,omitempty"`
2473
2474	// UpdateTime: Output only. The last update timestamp of the sink.This
2475	// field may not be present for older sinks.
2476	UpdateTime string `json:"updateTime,omitempty"`
2477
2478	// WriterIdentity: Output only. An IAM identity—a service account or
2479	// group—under which Cloud Logging writes the exported log entries to
2480	// the sink's destination. This field is set by sinks.create and
2481	// sinks.update based on the value of unique_writer_identity in those
2482	// methods.Until you grant this identity write-access to the
2483	// destination, log entry exports from this sink will fail. For more
2484	// information, see Granting Access for a Resource
2485	// (https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
2486	// Consult the destination service's documentation to determine the
2487	// appropriate IAM roles to assign to the identity.Sinks that have a
2488	// destination that is a log bucket in the same project as the sink do
2489	// not have a writer_identity and no additional permissions are
2490	// required.
2491	WriterIdentity string `json:"writerIdentity,omitempty"`
2492
2493	// ServerResponse contains the HTTP response code and headers from the
2494	// server.
2495	googleapi.ServerResponse `json:"-"`
2496
2497	// ForceSendFields is a list of field names (e.g. "BigqueryOptions") to
2498	// unconditionally include in API requests. By default, fields with
2499	// empty or default values are omitted from API requests. However, any
2500	// non-pointer, non-interface field appearing in ForceSendFields will be
2501	// sent to the server regardless of whether the field is empty or not.
2502	// This may be used to include empty fields in Patch requests.
2503	ForceSendFields []string `json:"-"`
2504
2505	// NullFields is a list of field names (e.g. "BigqueryOptions") to
2506	// include in API requests with the JSON null value. By default, fields
2507	// with empty values are omitted from API requests. However, any field
2508	// with an empty value appearing in NullFields will be sent to the
2509	// server as null. It is an error if a field in this list has a
2510	// non-empty value. This may be used to include null fields in Patch
2511	// requests.
2512	NullFields []string `json:"-"`
2513}
2514
2515func (s *LogSink) MarshalJSON() ([]byte, error) {
2516	type NoMethod LogSink
2517	raw := NoMethod(*s)
2518	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2519}
2520
2521// LogView: Describes a view over log entries in a bucket.
2522type LogView struct {
2523	// CreateTime: Output only. The creation timestamp of the view.
2524	CreateTime string `json:"createTime,omitempty"`
2525
2526	// Description: Describes this view.
2527	Description string `json:"description,omitempty"`
2528
2529	// Filter: Filter that restricts which log entries in a bucket are
2530	// visible in this view.Filters are restricted to be a logical AND of
2531	// ==/!= of any of the following: originating
2532	// project/folder/organization/billing account. resource type log idFor
2533	// example:SOURCE("projects/myproject") AND resource.type =
2534	// "gce_instance" AND LOG_ID("stdout")
2535	Filter string `json:"filter,omitempty"`
2536
2537	// Name: The resource name of the view.For
2538	// example:projects/my-project/locations/global/buckets/my-bucket/views/m
2539	// y-view
2540	Name string `json:"name,omitempty"`
2541
2542	// UpdateTime: Output only. The last update timestamp of the view.
2543	UpdateTime string `json:"updateTime,omitempty"`
2544
2545	// ServerResponse contains the HTTP response code and headers from the
2546	// server.
2547	googleapi.ServerResponse `json:"-"`
2548
2549	// ForceSendFields is a list of field names (e.g. "CreateTime") to
2550	// unconditionally include in API requests. By default, fields with
2551	// empty or default values are omitted from API requests. However, any
2552	// non-pointer, non-interface field appearing in ForceSendFields will be
2553	// sent to the server regardless of whether the field is empty or not.
2554	// This may be used to include empty fields in Patch requests.
2555	ForceSendFields []string `json:"-"`
2556
2557	// NullFields is a list of field names (e.g. "CreateTime") to include in
2558	// API requests with the JSON null value. By default, fields with empty
2559	// values are omitted from API requests. However, any field with an
2560	// empty value appearing in NullFields will be sent to the server as
2561	// null. It is an error if a field in this list has a non-empty value.
2562	// This may be used to include null fields in Patch requests.
2563	NullFields []string `json:"-"`
2564}
2565
2566func (s *LogView) MarshalJSON() ([]byte, error) {
2567	type NoMethod LogView
2568	raw := NoMethod(*s)
2569	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2570}
2571
2572// MetricDescriptor: Defines a metric type and its schema. Once a metric
2573// descriptor is created, deleting or altering it stops data collection
2574// and makes the metric type's existing data unusable.
2575type MetricDescriptor struct {
2576	// Description: A detailed description of the metric, which can be used
2577	// in documentation.
2578	Description string `json:"description,omitempty"`
2579
2580	// DisplayName: A concise name for the metric, which can be displayed in
2581	// user interfaces. Use sentence case without an ending period, for
2582	// example "Request count". This field is optional but it is recommended
2583	// to be set for any metrics associated with user-visible concepts, such
2584	// as Quota.
2585	DisplayName string `json:"displayName,omitempty"`
2586
2587	// Labels: The set of labels that can be used to describe a specific
2588	// instance of this metric type. For example, the
2589	// appengine.googleapis.com/http/server/response_latencies metric type
2590	// has a label for the HTTP response code, response_code, so you can
2591	// look at latencies for successful responses or just for responses that
2592	// failed.
2593	Labels []*LabelDescriptor `json:"labels,omitempty"`
2594
2595	// LaunchStage: Optional. The launch stage of the metric definition.
2596	//
2597	// Possible values:
2598	//   "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value.
2599	//   "UNIMPLEMENTED" - The feature is not yet implemented. Users can not
2600	// use it.
2601	//   "PRELAUNCH" - Prelaunch features are hidden from users and are only
2602	// visible internally.
2603	//   "EARLY_ACCESS" - Early Access features are limited to a closed
2604	// group of testers. To use these features, you must sign up in advance
2605	// and sign a Trusted Tester agreement (which includes confidentiality
2606	// provisions). These features may be unstable, changed in
2607	// backward-incompatible ways, and are not guaranteed to be released.
2608	//   "ALPHA" - Alpha is a limited availability test for releases before
2609	// they are cleared for widespread use. By Alpha, all significant design
2610	// issues are resolved and we are in the process of verifying
2611	// functionality. Alpha customers need to apply for access, agree to
2612	// applicable terms, and have their projects allowlisted. Alpha releases
2613	// don’t have to be feature complete, no SLAs are provided, and there
2614	// are no technical support obligations, but they will be far enough
2615	// along that customers can actually use them in test environments or
2616	// for limited-use tests -- just like they would in normal production
2617	// cases.
2618	//   "BETA" - Beta is the point at which we are ready to open a release
2619	// for any customer to use. There are no SLA or technical support
2620	// obligations in a Beta release. Products will be complete from a
2621	// feature perspective, but may have some open outstanding issues. Beta
2622	// releases are suitable for limited production use cases.
2623	//   "GA" - GA features are open to all developers and are considered
2624	// stable and fully qualified for production use.
2625	//   "DEPRECATED" - Deprecated features are scheduled to be shut down
2626	// and removed. For more information, see the “Deprecation Policy”
2627	// section of our Terms of Service (https://cloud.google.com/terms/) and
2628	// the Google Cloud Platform Subject to the Deprecation Policy
2629	// (https://cloud.google.com/terms/deprecation) documentation.
2630	LaunchStage string `json:"launchStage,omitempty"`
2631
2632	// Metadata: Optional. Metadata which can be used to guide usage of the
2633	// metric.
2634	Metadata *MetricDescriptorMetadata `json:"metadata,omitempty"`
2635
2636	// MetricKind: Whether the metric records instantaneous values, changes
2637	// to a value, etc. Some combinations of metric_kind and value_type
2638	// might not be supported.
2639	//
2640	// Possible values:
2641	//   "METRIC_KIND_UNSPECIFIED" - Do not use this default value.
2642	//   "GAUGE" - An instantaneous measurement of a value.
2643	//   "DELTA" - The change in a value during a time interval.
2644	//   "CUMULATIVE" - A value accumulated over a time interval. Cumulative
2645	// measurements in a time series should have the same start time and
2646	// increasing end times, until an event resets the cumulative value to
2647	// zero and sets a new start time for the following points.
2648	MetricKind string `json:"metricKind,omitempty"`
2649
2650	// MonitoredResourceTypes: Read-only. If present, then a time series,
2651	// which is identified partially by a metric type and a
2652	// MonitoredResourceDescriptor, that is associated with this metric type
2653	// can only be associated with one of the monitored resource types
2654	// listed here.
2655	MonitoredResourceTypes []string `json:"monitoredResourceTypes,omitempty"`
2656
2657	// Name: The resource name of the metric descriptor.
2658	Name string `json:"name,omitempty"`
2659
2660	// Type: The metric type, including its DNS name prefix. The type is not
2661	// URL-encoded. All user-defined metric types have the DNS name
2662	// custom.googleapis.com or external.googleapis.com. Metric types should
2663	// use a natural hierarchical grouping. For example:
2664	// "custom.googleapis.com/invoice/paid/amount"
2665	// "external.googleapis.com/prometheus/up"
2666	// "appengine.googleapis.com/http/server/response_latencies"
2667	Type string `json:"type,omitempty"`
2668
2669	// Unit: The units in which the metric value is reported. It is only
2670	// applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The
2671	// unit defines the representation of the stored metric values.Different
2672	// systems might scale the values to be more easily displayed (so a
2673	// value of 0.02kBy might be displayed as 20By, and a value of 3523kBy
2674	// might be displayed as 3.5MBy). However, if the unit is kBy, then the
2675	// value of the metric is always in thousands of bytes, no matter how it
2676	// might be displayed.If you want a custom metric to record the exact
2677	// number of CPU-seconds used by a job, you can create an INT64
2678	// CUMULATIVE metric whose unit is s{CPU} (or equivalently 1s{CPU} or
2679	// just s). If the job uses 12,005 CPU-seconds, then the value is
2680	// written as 12005.Alternatively, if you want a custom metric to record
2681	// data in a more granular way, you can create a DOUBLE CUMULATIVE
2682	// metric whose unit is ks{CPU}, and then write the value 12.005 (which
2683	// is 12005/1000), or use Kis{CPU} and write 11.723 (which is
2684	// 12005/1024).The supported units are a subset of The Unified Code for
2685	// Units of Measure (https://unitsofmeasure.org/ucum.html)
2686	// standard:Basic units (UNIT) bit bit By byte s second min minute h
2687	// hour d day 1 dimensionlessPrefixes (PREFIX) k kilo (10^3) M mega
2688	// (10^6) G giga (10^9) T tera (10^12) P peta (10^15) E exa (10^18) Z
2689	// zetta (10^21) Y yotta (10^24) m milli (10^-3) u micro (10^-6) n nano
2690	// (10^-9) p pico (10^-12) f femto (10^-15) a atto (10^-18) z zepto
2691	// (10^-21) y yocto (10^-24) Ki kibi (2^10) Mi mebi (2^20) Gi gibi
2692	// (2^30) Ti tebi (2^40) Pi pebi (2^50)GrammarThe grammar also includes
2693	// these connectors: / division or ratio (as an infix operator). For
2694	// examples, kBy/{email} or MiBy/10ms (although you should almost never
2695	// have /s in a metric unit; rates should always be computed at query
2696	// time from the underlying cumulative or delta value). . multiplication
2697	// or composition (as an infix operator). For examples, GBy.d or
2698	// k{watt}.h.The grammar for a unit is as follows: Expression =
2699	// Component { "." Component } { "/" Component } ; Component = ( [
2700	// PREFIX ] UNIT | "%" ) [ Annotation ] | Annotation | "1" ; Annotation
2701	// = "{" NAME "}" ; Notes: Annotation is just a comment if it follows a
2702	// UNIT. If the annotation is used alone, then the unit is equivalent to
2703	// 1. For examples, {request}/s == 1/s, By{transmitted}/s == By/s. NAME
2704	// is a sequence of non-blank printable ASCII characters not containing
2705	// { or }. 1 represents a unitary dimensionless unit
2706	// (https://en.wikipedia.org/wiki/Dimensionless_quantity) of 1, such as
2707	// in 1/s. It is typically used when none of the basic units are
2708	// appropriate. For example, "new users per day" can be represented as
2709	// 1/d or {new-users}/d (and a metric value 5 would mean "5 new users).
2710	// Alternatively, "thousands of page views per day" would be represented
2711	// as 1000/d or k1/d or k{page_views}/d (and a metric value of 5.3 would
2712	// mean "5300 page views per day"). % represents dimensionless value of
2713	// 1/100, and annotates values giving a percentage (so the metric values
2714	// are typically in the range of 0..100, and a metric value 3 means "3
2715	// percent"). 10^2.% indicates a metric contains a ratio, typically in
2716	// the range 0..1, that will be multiplied by 100 and displayed as a
2717	// percentage (so a metric value 0.03 means "3 percent").
2718	Unit string `json:"unit,omitempty"`
2719
2720	// ValueType: Whether the measurement is an integer, a floating-point
2721	// number, etc. Some combinations of metric_kind and value_type might
2722	// not be supported.
2723	//
2724	// Possible values:
2725	//   "VALUE_TYPE_UNSPECIFIED" - Do not use this default value.
2726	//   "BOOL" - The value is a boolean. This value type can be used only
2727	// if the metric kind is GAUGE.
2728	//   "INT64" - The value is a signed 64-bit integer.
2729	//   "DOUBLE" - The value is a double precision floating point number.
2730	//   "STRING" - The value is a text string. This value type can be used
2731	// only if the metric kind is GAUGE.
2732	//   "DISTRIBUTION" - The value is a Distribution.
2733	//   "MONEY" - The value is money.
2734	ValueType string `json:"valueType,omitempty"`
2735
2736	// ForceSendFields is a list of field names (e.g. "Description") to
2737	// unconditionally include in API requests. By default, fields with
2738	// empty or default values are omitted from API requests. However, any
2739	// non-pointer, non-interface field appearing in ForceSendFields will be
2740	// sent to the server regardless of whether the field is empty or not.
2741	// This may be used to include empty fields in Patch requests.
2742	ForceSendFields []string `json:"-"`
2743
2744	// NullFields is a list of field names (e.g. "Description") to include
2745	// in API requests with the JSON null value. By default, fields with
2746	// empty values are omitted from API requests. However, any field with
2747	// an empty value appearing in NullFields will be sent to the server as
2748	// null. It is an error if a field in this list has a non-empty value.
2749	// This may be used to include null fields in Patch requests.
2750	NullFields []string `json:"-"`
2751}
2752
2753func (s *MetricDescriptor) MarshalJSON() ([]byte, error) {
2754	type NoMethod MetricDescriptor
2755	raw := NoMethod(*s)
2756	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2757}
2758
2759// MetricDescriptorMetadata: Additional annotations that can be used to
2760// guide the usage of a metric.
2761type MetricDescriptorMetadata struct {
2762	// IngestDelay: The delay of data points caused by ingestion. Data
2763	// points older than this age are guaranteed to be ingested and
2764	// available to be read, excluding data loss due to errors.
2765	IngestDelay string `json:"ingestDelay,omitempty"`
2766
2767	// LaunchStage: Deprecated. Must use the MetricDescriptor.launch_stage
2768	// instead.
2769	//
2770	// Possible values:
2771	//   "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value.
2772	//   "UNIMPLEMENTED" - The feature is not yet implemented. Users can not
2773	// use it.
2774	//   "PRELAUNCH" - Prelaunch features are hidden from users and are only
2775	// visible internally.
2776	//   "EARLY_ACCESS" - Early Access features are limited to a closed
2777	// group of testers. To use these features, you must sign up in advance
2778	// and sign a Trusted Tester agreement (which includes confidentiality
2779	// provisions). These features may be unstable, changed in
2780	// backward-incompatible ways, and are not guaranteed to be released.
2781	//   "ALPHA" - Alpha is a limited availability test for releases before
2782	// they are cleared for widespread use. By Alpha, all significant design
2783	// issues are resolved and we are in the process of verifying
2784	// functionality. Alpha customers need to apply for access, agree to
2785	// applicable terms, and have their projects allowlisted. Alpha releases
2786	// don’t have to be feature complete, no SLAs are provided, and there
2787	// are no technical support obligations, but they will be far enough
2788	// along that customers can actually use them in test environments or
2789	// for limited-use tests -- just like they would in normal production
2790	// cases.
2791	//   "BETA" - Beta is the point at which we are ready to open a release
2792	// for any customer to use. There are no SLA or technical support
2793	// obligations in a Beta release. Products will be complete from a
2794	// feature perspective, but may have some open outstanding issues. Beta
2795	// releases are suitable for limited production use cases.
2796	//   "GA" - GA features are open to all developers and are considered
2797	// stable and fully qualified for production use.
2798	//   "DEPRECATED" - Deprecated features are scheduled to be shut down
2799	// and removed. For more information, see the “Deprecation Policy”
2800	// section of our Terms of Service (https://cloud.google.com/terms/) and
2801	// the Google Cloud Platform Subject to the Deprecation Policy
2802	// (https://cloud.google.com/terms/deprecation) documentation.
2803	LaunchStage string `json:"launchStage,omitempty"`
2804
2805	// SamplePeriod: The sampling period of metric data points. For metrics
2806	// which are written periodically, consecutive data points are stored at
2807	// this time interval, excluding data loss due to errors. Metrics with a
2808	// higher granularity have a smaller sampling period.
2809	SamplePeriod string `json:"samplePeriod,omitempty"`
2810
2811	// ForceSendFields is a list of field names (e.g. "IngestDelay") to
2812	// unconditionally include in API requests. By default, fields with
2813	// empty or default values are omitted from API requests. However, any
2814	// non-pointer, non-interface field appearing in ForceSendFields will be
2815	// sent to the server regardless of whether the field is empty or not.
2816	// This may be used to include empty fields in Patch requests.
2817	ForceSendFields []string `json:"-"`
2818
2819	// NullFields is a list of field names (e.g. "IngestDelay") to include
2820	// in API requests with the JSON null value. By default, fields with
2821	// empty values are omitted from API requests. However, any field with
2822	// an empty value appearing in NullFields will be sent to the server as
2823	// null. It is an error if a field in this list has a non-empty value.
2824	// This may be used to include null fields in Patch requests.
2825	NullFields []string `json:"-"`
2826}
2827
2828func (s *MetricDescriptorMetadata) MarshalJSON() ([]byte, error) {
2829	type NoMethod MetricDescriptorMetadata
2830	raw := NoMethod(*s)
2831	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2832}
2833
2834// MonitoredResource: An object representing a resource that can be used
2835// for monitoring, logging, billing, or other purposes. Examples include
2836// virtual machine instances, databases, and storage devices such as
2837// disks. The type field identifies a MonitoredResourceDescriptor object
2838// that describes the resource's schema. Information in the labels field
2839// identifies the actual resource and its attributes according to the
2840// schema. For example, a particular Compute Engine VM instance could be
2841// represented by the following object, because the
2842// MonitoredResourceDescriptor for "gce_instance" has labels
2843// "instance_id" and "zone": { "type": "gce_instance", "labels": {
2844// "instance_id": "12345678901234", "zone": "us-central1-a" }}
2845type MonitoredResource struct {
2846	// Labels: Required. Values for all of the labels listed in the
2847	// associated monitored resource descriptor. For example, Compute Engine
2848	// VM instances use the labels "project_id", "instance_id", and "zone".
2849	Labels map[string]string `json:"labels,omitempty"`
2850
2851	// Type: Required. The monitored resource type. This field must match
2852	// the type field of a MonitoredResourceDescriptor object. For example,
2853	// the type of a Compute Engine VM instance is gce_instance.
2854	Type string `json:"type,omitempty"`
2855
2856	// ForceSendFields is a list of field names (e.g. "Labels") to
2857	// unconditionally include in API requests. By default, fields with
2858	// empty or default values are omitted from API requests. However, any
2859	// non-pointer, non-interface field appearing in ForceSendFields will be
2860	// sent to the server regardless of whether the field is empty or not.
2861	// This may be used to include empty fields in Patch requests.
2862	ForceSendFields []string `json:"-"`
2863
2864	// NullFields is a list of field names (e.g. "Labels") to include in API
2865	// requests with the JSON null value. By default, fields with empty
2866	// values are omitted from API requests. However, any field with an
2867	// empty value appearing in NullFields will be sent to the server as
2868	// null. It is an error if a field in this list has a non-empty value.
2869	// This may be used to include null fields in Patch requests.
2870	NullFields []string `json:"-"`
2871}
2872
2873func (s *MonitoredResource) MarshalJSON() ([]byte, error) {
2874	type NoMethod MonitoredResource
2875	raw := NoMethod(*s)
2876	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2877}
2878
2879// MonitoredResourceDescriptor: An object that describes the schema of a
2880// MonitoredResource object using a type name and a set of labels. For
2881// example, the monitored resource descriptor for Google Compute Engine
2882// VM instances has a type of "gce_instance" and specifies the use of
2883// the labels "instance_id" and "zone" to identify particular VM
2884// instances.Different APIs can support different monitored resource
2885// types. APIs generally provide a list method that returns the
2886// monitored resource descriptors used by the API.
2887type MonitoredResourceDescriptor struct {
2888	// Description: Optional. A detailed description of the monitored
2889	// resource type that might be used in documentation.
2890	Description string `json:"description,omitempty"`
2891
2892	// DisplayName: Optional. A concise name for the monitored resource type
2893	// that might be displayed in user interfaces. It should be a Title
2894	// Cased Noun Phrase, without any article or other determiners. For
2895	// example, "Google Cloud SQL Database".
2896	DisplayName string `json:"displayName,omitempty"`
2897
2898	// Labels: Required. A set of labels used to describe instances of this
2899	// monitored resource type. For example, an individual Google Cloud SQL
2900	// database is identified by values for the labels "database_id" and
2901	// "zone".
2902	Labels []*LabelDescriptor `json:"labels,omitempty"`
2903
2904	// LaunchStage: Optional. The launch stage of the monitored resource
2905	// definition.
2906	//
2907	// Possible values:
2908	//   "LAUNCH_STAGE_UNSPECIFIED" - Do not use this default value.
2909	//   "UNIMPLEMENTED" - The feature is not yet implemented. Users can not
2910	// use it.
2911	//   "PRELAUNCH" - Prelaunch features are hidden from users and are only
2912	// visible internally.
2913	//   "EARLY_ACCESS" - Early Access features are limited to a closed
2914	// group of testers. To use these features, you must sign up in advance
2915	// and sign a Trusted Tester agreement (which includes confidentiality
2916	// provisions). These features may be unstable, changed in
2917	// backward-incompatible ways, and are not guaranteed to be released.
2918	//   "ALPHA" - Alpha is a limited availability test for releases before
2919	// they are cleared for widespread use. By Alpha, all significant design
2920	// issues are resolved and we are in the process of verifying
2921	// functionality. Alpha customers need to apply for access, agree to
2922	// applicable terms, and have their projects allowlisted. Alpha releases
2923	// don’t have to be feature complete, no SLAs are provided, and there
2924	// are no technical support obligations, but they will be far enough
2925	// along that customers can actually use them in test environments or
2926	// for limited-use tests -- just like they would in normal production
2927	// cases.
2928	//   "BETA" - Beta is the point at which we are ready to open a release
2929	// for any customer to use. There are no SLA or technical support
2930	// obligations in a Beta release. Products will be complete from a
2931	// feature perspective, but may have some open outstanding issues. Beta
2932	// releases are suitable for limited production use cases.
2933	//   "GA" - GA features are open to all developers and are considered
2934	// stable and fully qualified for production use.
2935	//   "DEPRECATED" - Deprecated features are scheduled to be shut down
2936	// and removed. For more information, see the “Deprecation Policy”
2937	// section of our Terms of Service (https://cloud.google.com/terms/) and
2938	// the Google Cloud Platform Subject to the Deprecation Policy
2939	// (https://cloud.google.com/terms/deprecation) documentation.
2940	LaunchStage string `json:"launchStage,omitempty"`
2941
2942	// Name: Optional. The resource name of the monitored resource
2943	// descriptor:
2944	// "projects/{project_id}/monitoredResourceDescriptors/{type}" where
2945	// {type} is the value of the type field in this object and {project_id}
2946	// is a project ID that provides API-specific context for accessing the
2947	// type. APIs that do not use project information can use the resource
2948	// name format "monitoredResourceDescriptors/{type}".
2949	Name string `json:"name,omitempty"`
2950
2951	// Type: Required. The monitored resource type. For example, the type
2952	// "cloudsql_database" represents databases in Google Cloud SQL. For a
2953	// list of types, see Monitoring resource types
2954	// (https://cloud.google.com/monitoring/api/resources) and Logging
2955	// resource types
2956	// (https://cloud.google.com/logging/docs/api/v2/resource-list).
2957	Type string `json:"type,omitempty"`
2958
2959	// ForceSendFields is a list of field names (e.g. "Description") to
2960	// unconditionally include in API requests. By default, fields with
2961	// empty or default values are omitted from API requests. However, any
2962	// non-pointer, non-interface field appearing in ForceSendFields will be
2963	// sent to the server regardless of whether the field is empty or not.
2964	// This may be used to include empty fields in Patch requests.
2965	ForceSendFields []string `json:"-"`
2966
2967	// NullFields is a list of field names (e.g. "Description") to include
2968	// in API requests with the JSON null value. By default, fields with
2969	// empty values are omitted from API requests. However, any field with
2970	// an empty value appearing in NullFields will be sent to the server as
2971	// null. It is an error if a field in this list has a non-empty value.
2972	// This may be used to include null fields in Patch requests.
2973	NullFields []string `json:"-"`
2974}
2975
2976func (s *MonitoredResourceDescriptor) MarshalJSON() ([]byte, error) {
2977	type NoMethod MonitoredResourceDescriptor
2978	raw := NoMethod(*s)
2979	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
2980}
2981
2982// MonitoredResourceMetadata: Auxiliary metadata for a MonitoredResource
2983// object. MonitoredResource objects contain the minimum set of
2984// information to uniquely identify a monitored resource instance. There
2985// is some other useful auxiliary metadata. Monitoring and Logging use
2986// an ingestion pipeline to extract metadata for cloud resources of all
2987// types, and store the metadata in this message.
2988type MonitoredResourceMetadata struct {
2989	// SystemLabels: Output only. Values for predefined system metadata
2990	// labels. System labels are a kind of metadata extracted by Google,
2991	// including "machine_image", "vpc", "subnet_id", "security_group",
2992	// "name", etc. System label values can be only strings, Boolean values,
2993	// or a list of strings. For example: { "name": "my-test-instance",
2994	// "security_group": ["a", "b", "c"], "spot_instance": false }
2995	SystemLabels googleapi.RawMessage `json:"systemLabels,omitempty"`
2996
2997	// UserLabels: Output only. A map of user-defined metadata labels.
2998	UserLabels map[string]string `json:"userLabels,omitempty"`
2999
3000	// ForceSendFields is a list of field names (e.g. "SystemLabels") to
3001	// unconditionally include in API requests. By default, fields with
3002	// empty or default values are omitted from API requests. However, any
3003	// non-pointer, non-interface field appearing in ForceSendFields will be
3004	// sent to the server regardless of whether the field is empty or not.
3005	// This may be used to include empty fields in Patch requests.
3006	ForceSendFields []string `json:"-"`
3007
3008	// NullFields is a list of field names (e.g. "SystemLabels") to include
3009	// in API requests with the JSON null value. By default, fields with
3010	// empty values are omitted from API requests. However, any field with
3011	// an empty value appearing in NullFields will be sent to the server as
3012	// null. It is an error if a field in this list has a non-empty value.
3013	// This may be used to include null fields in Patch requests.
3014	NullFields []string `json:"-"`
3015}
3016
3017func (s *MonitoredResourceMetadata) MarshalJSON() ([]byte, error) {
3018	type NoMethod MonitoredResourceMetadata
3019	raw := NoMethod(*s)
3020	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3021}
3022
3023// Operation: This resource represents a long-running operation that is
3024// the result of a network API call.
3025type Operation struct {
3026	// Done: If the value is false, it means the operation is still in
3027	// progress. If true, the operation is completed, and either error or
3028	// response is available.
3029	Done bool `json:"done,omitempty"`
3030
3031	// Error: The error result of the operation in case of failure or
3032	// cancellation.
3033	Error *Status `json:"error,omitempty"`
3034
3035	// Metadata: Service-specific metadata associated with the operation. It
3036	// typically contains progress information and common metadata such as
3037	// create time. Some services might not provide such metadata. Any
3038	// method that returns a long-running operation should document the
3039	// metadata type, if any.
3040	Metadata googleapi.RawMessage `json:"metadata,omitempty"`
3041
3042	// Name: The server-assigned name, which is only unique within the same
3043	// service that originally returns it. If you use the default HTTP
3044	// mapping, the name should be a resource name ending with
3045	// operations/{unique_id}.
3046	Name string `json:"name,omitempty"`
3047
3048	// Response: The normal response of the operation in case of success. If
3049	// the original method returns no data on success, such as Delete, the
3050	// response is google.protobuf.Empty. If the original method is standard
3051	// Get/Create/Update, the response should be the resource. For other
3052	// methods, the response should have the type XxxResponse, where Xxx is
3053	// the original method name. For example, if the original method name is
3054	// TakeSnapshot(), the inferred response type is TakeSnapshotResponse.
3055	Response googleapi.RawMessage `json:"response,omitempty"`
3056
3057	// ServerResponse contains the HTTP response code and headers from the
3058	// server.
3059	googleapi.ServerResponse `json:"-"`
3060
3061	// ForceSendFields is a list of field names (e.g. "Done") to
3062	// unconditionally include in API requests. By default, fields with
3063	// empty or default values are omitted from API requests. However, any
3064	// non-pointer, non-interface field appearing in ForceSendFields will be
3065	// sent to the server regardless of whether the field is empty or not.
3066	// This may be used to include empty fields in Patch requests.
3067	ForceSendFields []string `json:"-"`
3068
3069	// NullFields is a list of field names (e.g. "Done") to include in API
3070	// requests with the JSON null value. By default, fields with empty
3071	// values are omitted from API requests. However, any field with an
3072	// empty value appearing in NullFields will be sent to the server as
3073	// null. It is an error if a field in this list has a non-empty value.
3074	// This may be used to include null fields in Patch requests.
3075	NullFields []string `json:"-"`
3076}
3077
3078func (s *Operation) MarshalJSON() ([]byte, error) {
3079	type NoMethod Operation
3080	raw := NoMethod(*s)
3081	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3082}
3083
3084// RequestLog: Complete log information about a single HTTP request to
3085// an App Engine application.
3086type RequestLog struct {
3087	// AppEngineRelease: App Engine release version.
3088	AppEngineRelease string `json:"appEngineRelease,omitempty"`
3089
3090	// AppId: Application that handled this request.
3091	AppId string `json:"appId,omitempty"`
3092
3093	// Cost: An indication of the relative cost of serving this request.
3094	Cost float64 `json:"cost,omitempty"`
3095
3096	// EndTime: Time when the request finished.
3097	EndTime string `json:"endTime,omitempty"`
3098
3099	// Finished: Whether this request is finished or active.
3100	Finished bool `json:"finished,omitempty"`
3101
3102	// First: Whether this is the first RequestLog entry for this request.
3103	// If an active request has several RequestLog entries written to
3104	// Stackdriver Logging, then this field will be set for one of them.
3105	First bool `json:"first,omitempty"`
3106
3107	// Host: Internet host and port number of the resource being requested.
3108	Host string `json:"host,omitempty"`
3109
3110	// HttpVersion: HTTP version of request. Example: "HTTP/1.1".
3111	HttpVersion string `json:"httpVersion,omitempty"`
3112
3113	// InstanceId: An identifier for the instance that handled the request.
3114	InstanceId string `json:"instanceId,omitempty"`
3115
3116	// InstanceIndex: If the instance processing this request belongs to a
3117	// manually scaled module, then this is the 0-based index of the
3118	// instance. Otherwise, this value is -1.
3119	InstanceIndex int64 `json:"instanceIndex,omitempty"`
3120
3121	// Ip: Origin IP address.
3122	Ip string `json:"ip,omitempty"`
3123
3124	// Latency: Latency of the request.
3125	Latency string `json:"latency,omitempty"`
3126
3127	// Line: A list of log lines emitted by the application while serving
3128	// this request.
3129	Line []*LogLine `json:"line,omitempty"`
3130
3131	// MegaCycles: Number of CPU megacycles used to process request.
3132	MegaCycles int64 `json:"megaCycles,omitempty,string"`
3133
3134	// Method: Request method. Example: "GET", "HEAD", "PUT", "POST",
3135	// "DELETE".
3136	Method string `json:"method,omitempty"`
3137
3138	// ModuleId: Module of the application that handled this request.
3139	ModuleId string `json:"moduleId,omitempty"`
3140
3141	// Nickname: The logged-in user who made the request.Most likely, this
3142	// is the part of the user's email before the @ sign. The field value is
3143	// the same for different requests from the same user, but different
3144	// users can have similar names. This information is also available to
3145	// the application via the App Engine Users API.This field will be
3146	// populated starting with App Engine 1.9.21.
3147	Nickname string `json:"nickname,omitempty"`
3148
3149	// PendingTime: Time this request spent in the pending request queue.
3150	PendingTime string `json:"pendingTime,omitempty"`
3151
3152	// Referrer: Referrer URL of request.
3153	Referrer string `json:"referrer,omitempty"`
3154
3155	// RequestId: Globally unique identifier for a request, which is based
3156	// on the request start time. Request IDs for requests which started
3157	// later will compare greater as strings than those for requests which
3158	// started earlier.
3159	RequestId string `json:"requestId,omitempty"`
3160
3161	// Resource: Contains the path and query portion of the URL that was
3162	// requested. For example, if the URL was
3163	// "http://example.com/app?name=val", the resource would be
3164	// "/app?name=val". The fragment identifier, which is identified by the
3165	// # character, is not included.
3166	Resource string `json:"resource,omitempty"`
3167
3168	// ResponseSize: Size in bytes sent back to client by request.
3169	ResponseSize int64 `json:"responseSize,omitempty,string"`
3170
3171	// SourceReference: Source code for the application that handled this
3172	// request. There can be more than one source reference per deployed
3173	// application if source code is distributed among multiple
3174	// repositories.
3175	SourceReference []*SourceReference `json:"sourceReference,omitempty"`
3176
3177	// StartTime: Time when the request started.
3178	StartTime string `json:"startTime,omitempty"`
3179
3180	// Status: HTTP response status code. Example: 200, 404.
3181	Status int64 `json:"status,omitempty"`
3182
3183	// TaskName: Task name of the request, in the case of an offline
3184	// request.
3185	TaskName string `json:"taskName,omitempty"`
3186
3187	// TaskQueueName: Queue name of the request, in the case of an offline
3188	// request.
3189	TaskQueueName string `json:"taskQueueName,omitempty"`
3190
3191	// TraceId: Stackdriver Trace identifier for this request.
3192	TraceId string `json:"traceId,omitempty"`
3193
3194	// TraceSampled: If true, the value in the 'trace_id' field was sampled
3195	// for storage in a trace backend.
3196	TraceSampled bool `json:"traceSampled,omitempty"`
3197
3198	// UrlMapEntry: File or class that handled the request.
3199	UrlMapEntry string `json:"urlMapEntry,omitempty"`
3200
3201	// UserAgent: User agent that made the request.
3202	UserAgent string `json:"userAgent,omitempty"`
3203
3204	// VersionId: Version of the application that handled this request.
3205	VersionId string `json:"versionId,omitempty"`
3206
3207	// WasLoadingRequest: Whether this was a loading request for the
3208	// instance.
3209	WasLoadingRequest bool `json:"wasLoadingRequest,omitempty"`
3210
3211	// ForceSendFields is a list of field names (e.g. "AppEngineRelease") to
3212	// unconditionally include in API requests. By default, fields with
3213	// empty or default values are omitted from API requests. However, any
3214	// non-pointer, non-interface field appearing in ForceSendFields will be
3215	// sent to the server regardless of whether the field is empty or not.
3216	// This may be used to include empty fields in Patch requests.
3217	ForceSendFields []string `json:"-"`
3218
3219	// NullFields is a list of field names (e.g. "AppEngineRelease") to
3220	// include in API requests with the JSON null value. By default, fields
3221	// with empty values are omitted from API requests. However, any field
3222	// with an empty value appearing in NullFields will be sent to the
3223	// server as null. It is an error if a field in this list has a
3224	// non-empty value. This may be used to include null fields in Patch
3225	// requests.
3226	NullFields []string `json:"-"`
3227}
3228
3229func (s *RequestLog) MarshalJSON() ([]byte, error) {
3230	type NoMethod RequestLog
3231	raw := NoMethod(*s)
3232	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3233}
3234
3235func (s *RequestLog) UnmarshalJSON(data []byte) error {
3236	type NoMethod RequestLog
3237	var s1 struct {
3238		Cost gensupport.JSONFloat64 `json:"cost"`
3239		*NoMethod
3240	}
3241	s1.NoMethod = (*NoMethod)(s)
3242	if err := json.Unmarshal(data, &s1); err != nil {
3243		return err
3244	}
3245	s.Cost = float64(s1.Cost)
3246	return nil
3247}
3248
3249// SourceLocation: Specifies a location in a source code file.
3250type SourceLocation struct {
3251	// File: Source file name. Depending on the runtime environment, this
3252	// might be a simple name or a fully-qualified name.
3253	File string `json:"file,omitempty"`
3254
3255	// FunctionName: Human-readable name of the function or method being
3256	// invoked, with optional context such as the class or package name.
3257	// This information is used in contexts such as the logs viewer, where a
3258	// file and line number are less meaningful. The format can vary by
3259	// language. For example: qual.if.ied.Class.method (Java),
3260	// dir/package.func (Go), function (Python).
3261	FunctionName string `json:"functionName,omitempty"`
3262
3263	// Line: Line within the source file.
3264	Line int64 `json:"line,omitempty,string"`
3265
3266	// ForceSendFields is a list of field names (e.g. "File") to
3267	// unconditionally include in API requests. By default, fields with
3268	// empty or default values are omitted from API requests. However, any
3269	// non-pointer, non-interface field appearing in ForceSendFields will be
3270	// sent to the server regardless of whether the field is empty or not.
3271	// This may be used to include empty fields in Patch requests.
3272	ForceSendFields []string `json:"-"`
3273
3274	// NullFields is a list of field names (e.g. "File") to include in API
3275	// requests with the JSON null value. By default, fields with empty
3276	// values are omitted from API requests. However, any field with an
3277	// empty value appearing in NullFields will be sent to the server as
3278	// null. It is an error if a field in this list has a non-empty value.
3279	// This may be used to include null fields in Patch requests.
3280	NullFields []string `json:"-"`
3281}
3282
3283func (s *SourceLocation) MarshalJSON() ([]byte, error) {
3284	type NoMethod SourceLocation
3285	raw := NoMethod(*s)
3286	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3287}
3288
3289// SourceReference: A reference to a particular snapshot of the source
3290// tree used to build and deploy an application.
3291type SourceReference struct {
3292	// Repository: Optional. A URI string identifying the repository.
3293	// Example: "https://github.com/GoogleCloudPlatform/kubernetes.git"
3294	Repository string `json:"repository,omitempty"`
3295
3296	// RevisionId: The canonical and persistent identifier of the deployed
3297	// revision. Example (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b"
3298	RevisionId string `json:"revisionId,omitempty"`
3299
3300	// ForceSendFields is a list of field names (e.g. "Repository") to
3301	// unconditionally include in API requests. By default, fields with
3302	// empty or default values are omitted from API requests. However, any
3303	// non-pointer, non-interface field appearing in ForceSendFields will be
3304	// sent to the server regardless of whether the field is empty or not.
3305	// This may be used to include empty fields in Patch requests.
3306	ForceSendFields []string `json:"-"`
3307
3308	// NullFields is a list of field names (e.g. "Repository") to include in
3309	// API requests with the JSON null value. By default, fields with empty
3310	// values are omitted from API requests. However, any field with an
3311	// empty value appearing in NullFields will be sent to the server as
3312	// null. It is an error if a field in this list has a non-empty value.
3313	// This may be used to include null fields in Patch requests.
3314	NullFields []string `json:"-"`
3315}
3316
3317func (s *SourceReference) MarshalJSON() ([]byte, error) {
3318	type NoMethod SourceReference
3319	raw := NoMethod(*s)
3320	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3321}
3322
3323// Status: The Status type defines a logical error model that is
3324// suitable for different programming environments, including REST APIs
3325// and RPC APIs. It is used by gRPC (https://github.com/grpc). Each
3326// Status message contains three pieces of data: error code, error
3327// message, and error details.You can find out more about this error
3328// model and how to work with it in the API Design Guide
3329// (https://cloud.google.com/apis/design/errors).
3330type Status struct {
3331	// Code: The status code, which should be an enum value of
3332	// google.rpc.Code.
3333	Code int64 `json:"code,omitempty"`
3334
3335	// Details: A list of messages that carry the error details. There is a
3336	// common set of message types for APIs to use.
3337	Details []googleapi.RawMessage `json:"details,omitempty"`
3338
3339	// Message: A developer-facing error message, which should be in
3340	// English. Any user-facing error message should be localized and sent
3341	// in the google.rpc.Status.details field, or localized by the client.
3342	Message string `json:"message,omitempty"`
3343
3344	// ForceSendFields is a list of field names (e.g. "Code") to
3345	// unconditionally include in API requests. By default, fields with
3346	// empty or default values are omitted from API requests. However, any
3347	// non-pointer, non-interface field appearing in ForceSendFields will be
3348	// sent to the server regardless of whether the field is empty or not.
3349	// This may be used to include empty fields in Patch requests.
3350	ForceSendFields []string `json:"-"`
3351
3352	// NullFields is a list of field names (e.g. "Code") to include in API
3353	// requests with the JSON null value. By default, fields with empty
3354	// values are omitted from API requests. However, any field with an
3355	// empty value appearing in NullFields will be sent to the server as
3356	// null. It is an error if a field in this list has a non-empty value.
3357	// This may be used to include null fields in Patch requests.
3358	NullFields []string `json:"-"`
3359}
3360
3361func (s *Status) MarshalJSON() ([]byte, error) {
3362	type NoMethod Status
3363	raw := NoMethod(*s)
3364	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3365}
3366
3367// SuppressionInfo: Information about entries that were omitted from the
3368// session.
3369type SuppressionInfo struct {
3370	// Reason: The reason that entries were omitted from the session.
3371	//
3372	// Possible values:
3373	//   "REASON_UNSPECIFIED" - Unexpected default.
3374	//   "RATE_LIMIT" - Indicates suppression occurred due to relevant
3375	// entries being received in excess of rate limits. For quotas and
3376	// limits, see Logging API quotas and limits
3377	// (https://cloud.google.com/logging/quotas#api-limits).
3378	//   "NOT_CONSUMED" - Indicates suppression occurred due to the client
3379	// not consuming responses quickly enough.
3380	Reason string `json:"reason,omitempty"`
3381
3382	// SuppressedCount: A lower bound on the count of entries omitted due to
3383	// reason.
3384	SuppressedCount int64 `json:"suppressedCount,omitempty"`
3385
3386	// ForceSendFields is a list of field names (e.g. "Reason") to
3387	// unconditionally include in API requests. By default, fields with
3388	// empty or default values are omitted from API requests. However, any
3389	// non-pointer, non-interface field appearing in ForceSendFields will be
3390	// sent to the server regardless of whether the field is empty or not.
3391	// This may be used to include empty fields in Patch requests.
3392	ForceSendFields []string `json:"-"`
3393
3394	// NullFields is a list of field names (e.g. "Reason") to include in API
3395	// requests with the JSON null value. By default, fields with empty
3396	// values are omitted from API requests. However, any field with an
3397	// empty value appearing in NullFields will be sent to the server as
3398	// null. It is an error if a field in this list has a non-empty value.
3399	// This may be used to include null fields in Patch requests.
3400	NullFields []string `json:"-"`
3401}
3402
3403func (s *SuppressionInfo) MarshalJSON() ([]byte, error) {
3404	type NoMethod SuppressionInfo
3405	raw := NoMethod(*s)
3406	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3407}
3408
3409// TailLogEntriesRequest: The parameters to TailLogEntries.
3410type TailLogEntriesRequest struct {
3411	// BufferWindow: Optional. The amount of time to buffer log entries at
3412	// the server before being returned to prevent out of order results due
3413	// to late arriving log entries. Valid values are between 0-60000
3414	// milliseconds. Defaults to 2000 milliseconds.
3415	BufferWindow string `json:"bufferWindow,omitempty"`
3416
3417	// Filter: Optional. A filter that chooses which log entries to return.
3418	// See Advanced Logs Filters
3419	// (https://cloud.google.com/logging/docs/view/advanced_filters). Only
3420	// log entries that match the filter are returned. An empty filter
3421	// matches all log entries in the resources listed in resource_names.
3422	// Referencing a parent resource that is not in resource_names will
3423	// cause the filter to return no results. The maximum length of the
3424	// filter is 20000 characters.
3425	Filter string `json:"filter,omitempty"`
3426
3427	// ResourceNames: Required. Name of a parent resource from which to
3428	// retrieve log entries: projects/[PROJECT_ID]
3429	// organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID]
3430	// folders/[FOLDER_ID]May alternatively be one or more views:
3431	// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view
3432	// s/[VIEW_ID]
3433	// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE
3434	// T_ID]/views/[VIEW_ID]
3435	// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[
3436	// BUCKET_ID]/views/[VIEW_ID]
3437	// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/
3438	// [VIEW_ID]
3439	ResourceNames []string `json:"resourceNames,omitempty"`
3440
3441	// ForceSendFields is a list of field names (e.g. "BufferWindow") to
3442	// unconditionally include in API requests. By default, fields with
3443	// empty or default values are omitted from API requests. However, any
3444	// non-pointer, non-interface field appearing in ForceSendFields will be
3445	// sent to the server regardless of whether the field is empty or not.
3446	// This may be used to include empty fields in Patch requests.
3447	ForceSendFields []string `json:"-"`
3448
3449	// NullFields is a list of field names (e.g. "BufferWindow") to include
3450	// in API requests with the JSON null value. By default, fields with
3451	// empty values are omitted from API requests. However, any field with
3452	// an empty value appearing in NullFields will be sent to the server as
3453	// null. It is an error if a field in this list has a non-empty value.
3454	// This may be used to include null fields in Patch requests.
3455	NullFields []string `json:"-"`
3456}
3457
3458func (s *TailLogEntriesRequest) MarshalJSON() ([]byte, error) {
3459	type NoMethod TailLogEntriesRequest
3460	raw := NoMethod(*s)
3461	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3462}
3463
3464// TailLogEntriesResponse: Result returned from TailLogEntries.
3465type TailLogEntriesResponse struct {
3466	// Entries: A list of log entries. Each response in the stream will
3467	// order entries with increasing values of LogEntry.timestamp. Ordering
3468	// is not guaranteed between separate responses.
3469	Entries []*LogEntry `json:"entries,omitempty"`
3470
3471	// SuppressionInfo: If entries that otherwise would have been included
3472	// in the session were not sent back to the client, counts of relevant
3473	// entries omitted from the session with the reason that they were not
3474	// included. There will be at most one of each reason per response. The
3475	// counts represent the number of suppressed entries since the last
3476	// streamed response.
3477	SuppressionInfo []*SuppressionInfo `json:"suppressionInfo,omitempty"`
3478
3479	// ServerResponse contains the HTTP response code and headers from the
3480	// server.
3481	googleapi.ServerResponse `json:"-"`
3482
3483	// ForceSendFields is a list of field names (e.g. "Entries") to
3484	// unconditionally include in API requests. By default, fields with
3485	// empty or default values are omitted from API requests. However, any
3486	// non-pointer, non-interface field appearing in ForceSendFields will be
3487	// sent to the server regardless of whether the field is empty or not.
3488	// This may be used to include empty fields in Patch requests.
3489	ForceSendFields []string `json:"-"`
3490
3491	// NullFields is a list of field names (e.g. "Entries") to include in
3492	// API requests with the JSON null value. By default, fields with empty
3493	// values are omitted from API requests. However, any field with an
3494	// empty value appearing in NullFields will be sent to the server as
3495	// null. It is an error if a field in this list has a non-empty value.
3496	// This may be used to include null fields in Patch requests.
3497	NullFields []string `json:"-"`
3498}
3499
3500func (s *TailLogEntriesResponse) MarshalJSON() ([]byte, error) {
3501	type NoMethod TailLogEntriesResponse
3502	raw := NoMethod(*s)
3503	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3504}
3505
3506// UndeleteBucketRequest: The parameters to UndeleteBucket.
3507type UndeleteBucketRequest struct {
3508}
3509
3510// WriteLogEntriesRequest: The parameters to WriteLogEntries.
3511type WriteLogEntriesRequest struct {
3512	// DryRun: Optional. If true, the request should expect normal response,
3513	// but the entries won't be persisted nor exported. Useful for checking
3514	// whether the logging API endpoints are working properly before sending
3515	// valuable data.
3516	DryRun bool `json:"dryRun,omitempty"`
3517
3518	// Entries: Required. The log entries to send to Logging. The order of
3519	// log entries in this list does not matter. Values supplied in this
3520	// method's log_name, resource, and labels fields are copied into those
3521	// log entries in this list that do not include values for their
3522	// corresponding fields. For more information, see the LogEntry type.If
3523	// the timestamp or insert_id fields are missing in log entries, then
3524	// this method supplies the current time or a unique identifier,
3525	// respectively. The supplied values are chosen so that, among the log
3526	// entries that did not supply their own values, the entries earlier in
3527	// the list will sort before the entries later in the list. See the
3528	// entries.list method.Log entries with timestamps that are more than
3529	// the logs retention period (https://cloud.google.com/logging/quotas)
3530	// in the past or more than 24 hours in the future will not be available
3531	// when calling entries.list. However, those log entries can still be
3532	// exported with LogSinks
3533	// (https://cloud.google.com/logging/docs/api/tasks/exporting-logs).To
3534	// improve throughput and to avoid exceeding the quota limit
3535	// (https://cloud.google.com/logging/quotas) for calls to entries.write,
3536	// you should try to include several log entries in this list, rather
3537	// than calling this method for each individual log entry.
3538	Entries []*LogEntry `json:"entries,omitempty"`
3539
3540	// Labels: Optional. Default labels that are added to the labels field
3541	// of all log entries in entries. If a log entry already has a label
3542	// with the same key as a label in this parameter, then the log entry's
3543	// label is not changed. See LogEntry.
3544	Labels map[string]string `json:"labels,omitempty"`
3545
3546	// LogName: Optional. A default log resource name that is assigned to
3547	// all log entries in entries that do not specify a value for log_name:
3548	// projects/[PROJECT_ID]/logs/[LOG_ID]
3549	// organizations/[ORGANIZATION_ID]/logs/[LOG_ID]
3550	// billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]
3551	// folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For
3552	// example: "projects/my-project-id/logs/syslog"
3553	// "organizations/123/logs/cloudaudit.googleapis.com%2Factivity" The
3554	// permission logging.logEntries.create is needed on each project,
3555	// organization, billing account, or folder that is receiving new log
3556	// entries, whether the resource is specified in logName or in an
3557	// individual log entry.
3558	LogName string `json:"logName,omitempty"`
3559
3560	// PartialSuccess: Optional. Whether valid entries should be written
3561	// even if some other entries fail due to INVALID_ARGUMENT or
3562	// PERMISSION_DENIED errors. If any entry is not written, then the
3563	// response status is the error associated with one of the failed
3564	// entries and the response includes error details keyed by the entries'
3565	// zero-based index in the entries.write method.
3566	PartialSuccess bool `json:"partialSuccess,omitempty"`
3567
3568	// Resource: Optional. A default monitored resource object that is
3569	// assigned to all log entries in entries that do not specify a value
3570	// for resource. Example: { "type": "gce_instance", "labels": { "zone":
3571	// "us-central1-a", "instance_id": "00000000000000000000" }} See
3572	// LogEntry.
3573	Resource *MonitoredResource `json:"resource,omitempty"`
3574
3575	// ForceSendFields is a list of field names (e.g. "DryRun") to
3576	// unconditionally include in API requests. By default, fields with
3577	// empty or default values are omitted from API requests. However, any
3578	// non-pointer, non-interface field appearing in ForceSendFields will be
3579	// sent to the server regardless of whether the field is empty or not.
3580	// This may be used to include empty fields in Patch requests.
3581	ForceSendFields []string `json:"-"`
3582
3583	// NullFields is a list of field names (e.g. "DryRun") to include in API
3584	// requests with the JSON null value. By default, fields with empty
3585	// values are omitted from API requests. However, any field with an
3586	// empty value appearing in NullFields will be sent to the server as
3587	// null. It is an error if a field in this list has a non-empty value.
3588	// This may be used to include null fields in Patch requests.
3589	NullFields []string `json:"-"`
3590}
3591
3592func (s *WriteLogEntriesRequest) MarshalJSON() ([]byte, error) {
3593	type NoMethod WriteLogEntriesRequest
3594	raw := NoMethod(*s)
3595	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
3596}
3597
3598// WriteLogEntriesResponse: Result returned from WriteLogEntries.
3599type WriteLogEntriesResponse struct {
3600	// ServerResponse contains the HTTP response code and headers from the
3601	// server.
3602	googleapi.ServerResponse `json:"-"`
3603}
3604
3605// method id "logging.billingAccounts.buckets.get":
3606
3607type BillingAccountsBucketsGetCall struct {
3608	s            *Service
3609	name         string
3610	urlParams_   gensupport.URLParams
3611	ifNoneMatch_ string
3612	ctx_         context.Context
3613	header_      http.Header
3614}
3615
3616// Get: Gets a log bucket.
3617//
3618// - name: The resource name of the bucket:
3619//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
3620//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
3621//   CKET_ID]"
3622//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
3623//   s/[BUCKET_ID]"
3624//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
3625//   For
3626//   example:"projects/my-project/locations/global/buckets/my-bucket".
3627func (r *BillingAccountsBucketsService) Get(name string) *BillingAccountsBucketsGetCall {
3628	c := &BillingAccountsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3629	c.name = name
3630	return c
3631}
3632
3633// Fields allows partial responses to be retrieved. See
3634// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3635// for more information.
3636func (c *BillingAccountsBucketsGetCall) Fields(s ...googleapi.Field) *BillingAccountsBucketsGetCall {
3637	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3638	return c
3639}
3640
3641// IfNoneMatch sets the optional parameter which makes the operation
3642// fail if the object's ETag matches the given value. This is useful for
3643// getting updates only after the object has changed since the last
3644// request. Use googleapi.IsNotModified to check whether the response
3645// error from Do is the result of In-None-Match.
3646func (c *BillingAccountsBucketsGetCall) IfNoneMatch(entityTag string) *BillingAccountsBucketsGetCall {
3647	c.ifNoneMatch_ = entityTag
3648	return c
3649}
3650
3651// Context sets the context to be used in this call's Do method. Any
3652// pending HTTP request will be aborted if the provided context is
3653// canceled.
3654func (c *BillingAccountsBucketsGetCall) Context(ctx context.Context) *BillingAccountsBucketsGetCall {
3655	c.ctx_ = ctx
3656	return c
3657}
3658
3659// Header returns an http.Header that can be modified by the caller to
3660// add HTTP headers to the request.
3661func (c *BillingAccountsBucketsGetCall) Header() http.Header {
3662	if c.header_ == nil {
3663		c.header_ = make(http.Header)
3664	}
3665	return c.header_
3666}
3667
3668func (c *BillingAccountsBucketsGetCall) doRequest(alt string) (*http.Response, error) {
3669	reqHeaders := make(http.Header)
3670	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
3671	for k, v := range c.header_ {
3672		reqHeaders[k] = v
3673	}
3674	reqHeaders.Set("User-Agent", c.s.userAgent())
3675	if c.ifNoneMatch_ != "" {
3676		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3677	}
3678	var body io.Reader = nil
3679	c.urlParams_.Set("alt", alt)
3680	c.urlParams_.Set("prettyPrint", "false")
3681	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
3682	urls += "?" + c.urlParams_.Encode()
3683	req, err := http.NewRequest("GET", urls, body)
3684	if err != nil {
3685		return nil, err
3686	}
3687	req.Header = reqHeaders
3688	googleapi.Expand(req.URL, map[string]string{
3689		"name": c.name,
3690	})
3691	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3692}
3693
3694// Do executes the "logging.billingAccounts.buckets.get" call.
3695// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
3696// status code is an error. Response headers are in either
3697// *LogBucket.ServerResponse.Header or (if a response was returned at
3698// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
3699// to check whether the returned error was because
3700// http.StatusNotModified was returned.
3701func (c *BillingAccountsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
3702	gensupport.SetOptions(c.urlParams_, opts...)
3703	res, err := c.doRequest("json")
3704	if res != nil && res.StatusCode == http.StatusNotModified {
3705		if res.Body != nil {
3706			res.Body.Close()
3707		}
3708		return nil, &googleapi.Error{
3709			Code:   res.StatusCode,
3710			Header: res.Header,
3711		}
3712	}
3713	if err != nil {
3714		return nil, err
3715	}
3716	defer googleapi.CloseBody(res)
3717	if err := googleapi.CheckResponse(res); err != nil {
3718		return nil, err
3719	}
3720	ret := &LogBucket{
3721		ServerResponse: googleapi.ServerResponse{
3722			Header:         res.Header,
3723			HTTPStatusCode: res.StatusCode,
3724		},
3725	}
3726	target := &ret
3727	if err := gensupport.DecodeResponse(target, res); err != nil {
3728		return nil, err
3729	}
3730	return ret, nil
3731	// {
3732	//   "description": "Gets a log bucket.",
3733	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/buckets/{bucketsId}",
3734	//   "httpMethod": "GET",
3735	//   "id": "logging.billingAccounts.buckets.get",
3736	//   "parameterOrder": [
3737	//     "name"
3738	//   ],
3739	//   "parameters": {
3740	//     "name": {
3741	//       "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]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"",
3742	//       "location": "path",
3743	//       "pattern": "^billingAccounts/[^/]+/buckets/[^/]+$",
3744	//       "required": true,
3745	//       "type": "string"
3746	//     }
3747	//   },
3748	//   "path": "v2/{+name}",
3749	//   "response": {
3750	//     "$ref": "LogBucket"
3751	//   },
3752	//   "scopes": [
3753	//     "https://www.googleapis.com/auth/cloud-platform",
3754	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
3755	//     "https://www.googleapis.com/auth/logging.admin",
3756	//     "https://www.googleapis.com/auth/logging.read"
3757	//   ]
3758	// }
3759
3760}
3761
3762// method id "logging.billingAccounts.buckets.views.get":
3763
3764type BillingAccountsBucketsViewsGetCall struct {
3765	s            *Service
3766	name         string
3767	urlParams_   gensupport.URLParams
3768	ifNoneMatch_ string
3769	ctx_         context.Context
3770	header_      http.Header
3771}
3772
3773// Get: Gets a view on a log bucket..
3774//
3775// - name: The resource name of the policy:
3776//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
3777//   iews/[VIEW_ID]" For
3778//   example:"projects/my-project/locations/global/buckets/my-bucket/view
3779//   s/my-view".
3780func (r *BillingAccountsBucketsViewsService) Get(name string) *BillingAccountsBucketsViewsGetCall {
3781	c := &BillingAccountsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3782	c.name = name
3783	return c
3784}
3785
3786// Fields allows partial responses to be retrieved. See
3787// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3788// for more information.
3789func (c *BillingAccountsBucketsViewsGetCall) Fields(s ...googleapi.Field) *BillingAccountsBucketsViewsGetCall {
3790	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3791	return c
3792}
3793
3794// IfNoneMatch sets the optional parameter which makes the operation
3795// fail if the object's ETag matches the given value. This is useful for
3796// getting updates only after the object has changed since the last
3797// request. Use googleapi.IsNotModified to check whether the response
3798// error from Do is the result of In-None-Match.
3799func (c *BillingAccountsBucketsViewsGetCall) IfNoneMatch(entityTag string) *BillingAccountsBucketsViewsGetCall {
3800	c.ifNoneMatch_ = entityTag
3801	return c
3802}
3803
3804// Context sets the context to be used in this call's Do method. Any
3805// pending HTTP request will be aborted if the provided context is
3806// canceled.
3807func (c *BillingAccountsBucketsViewsGetCall) Context(ctx context.Context) *BillingAccountsBucketsViewsGetCall {
3808	c.ctx_ = ctx
3809	return c
3810}
3811
3812// Header returns an http.Header that can be modified by the caller to
3813// add HTTP headers to the request.
3814func (c *BillingAccountsBucketsViewsGetCall) Header() http.Header {
3815	if c.header_ == nil {
3816		c.header_ = make(http.Header)
3817	}
3818	return c.header_
3819}
3820
3821func (c *BillingAccountsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) {
3822	reqHeaders := make(http.Header)
3823	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
3824	for k, v := range c.header_ {
3825		reqHeaders[k] = v
3826	}
3827	reqHeaders.Set("User-Agent", c.s.userAgent())
3828	if c.ifNoneMatch_ != "" {
3829		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3830	}
3831	var body io.Reader = nil
3832	c.urlParams_.Set("alt", alt)
3833	c.urlParams_.Set("prettyPrint", "false")
3834	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
3835	urls += "?" + c.urlParams_.Encode()
3836	req, err := http.NewRequest("GET", urls, body)
3837	if err != nil {
3838		return nil, err
3839	}
3840	req.Header = reqHeaders
3841	googleapi.Expand(req.URL, map[string]string{
3842		"name": c.name,
3843	})
3844	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3845}
3846
3847// Do executes the "logging.billingAccounts.buckets.views.get" call.
3848// Exactly one of *LogView or error will be non-nil. Any non-2xx status
3849// code is an error. Response headers are in either
3850// *LogView.ServerResponse.Header or (if a response was returned at all)
3851// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3852// check whether the returned error was because http.StatusNotModified
3853// was returned.
3854func (c *BillingAccountsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
3855	gensupport.SetOptions(c.urlParams_, opts...)
3856	res, err := c.doRequest("json")
3857	if res != nil && res.StatusCode == http.StatusNotModified {
3858		if res.Body != nil {
3859			res.Body.Close()
3860		}
3861		return nil, &googleapi.Error{
3862			Code:   res.StatusCode,
3863			Header: res.Header,
3864		}
3865	}
3866	if err != nil {
3867		return nil, err
3868	}
3869	defer googleapi.CloseBody(res)
3870	if err := googleapi.CheckResponse(res); err != nil {
3871		return nil, err
3872	}
3873	ret := &LogView{
3874		ServerResponse: googleapi.ServerResponse{
3875			Header:         res.Header,
3876			HTTPStatusCode: res.StatusCode,
3877		},
3878	}
3879	target := &ret
3880	if err := gensupport.DecodeResponse(target, res); err != nil {
3881		return nil, err
3882	}
3883	return ret, nil
3884	// {
3885	//   "description": "Gets a view on a log bucket..",
3886	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/buckets/{bucketsId}/views/{viewsId}",
3887	//   "httpMethod": "GET",
3888	//   "id": "logging.billingAccounts.buckets.views.get",
3889	//   "parameterOrder": [
3890	//     "name"
3891	//   ],
3892	//   "parameters": {
3893	//     "name": {
3894	//       "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"",
3895	//       "location": "path",
3896	//       "pattern": "^billingAccounts/[^/]+/buckets/[^/]+/views/[^/]+$",
3897	//       "required": true,
3898	//       "type": "string"
3899	//     }
3900	//   },
3901	//   "path": "v2/{+name}",
3902	//   "response": {
3903	//     "$ref": "LogView"
3904	//   },
3905	//   "scopes": [
3906	//     "https://www.googleapis.com/auth/cloud-platform",
3907	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
3908	//     "https://www.googleapis.com/auth/logging.admin",
3909	//     "https://www.googleapis.com/auth/logging.read"
3910	//   ]
3911	// }
3912
3913}
3914
3915// method id "logging.billingAccounts.exclusions.create":
3916
3917type BillingAccountsExclusionsCreateCall struct {
3918	s            *Service
3919	parent       string
3920	logexclusion *LogExclusion
3921	urlParams_   gensupport.URLParams
3922	ctx_         context.Context
3923	header_      http.Header
3924}
3925
3926// Create: Creates a new exclusion in the _Default sink in a specified
3927// parent resource. Only log entries belonging to that resource can be
3928// excluded. You can have up to 10 exclusions in a resource.
3929//
3930// - parent: The parent resource in which to create the exclusion:
3931//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
3932//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For
3933//   examples:"projects/my-logging-project" "organizations/123456789".
3934func (r *BillingAccountsExclusionsService) Create(parent string, logexclusion *LogExclusion) *BillingAccountsExclusionsCreateCall {
3935	c := &BillingAccountsExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3936	c.parent = parent
3937	c.logexclusion = logexclusion
3938	return c
3939}
3940
3941// Fields allows partial responses to be retrieved. See
3942// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3943// for more information.
3944func (c *BillingAccountsExclusionsCreateCall) Fields(s ...googleapi.Field) *BillingAccountsExclusionsCreateCall {
3945	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3946	return c
3947}
3948
3949// Context sets the context to be used in this call's Do method. Any
3950// pending HTTP request will be aborted if the provided context is
3951// canceled.
3952func (c *BillingAccountsExclusionsCreateCall) Context(ctx context.Context) *BillingAccountsExclusionsCreateCall {
3953	c.ctx_ = ctx
3954	return c
3955}
3956
3957// Header returns an http.Header that can be modified by the caller to
3958// add HTTP headers to the request.
3959func (c *BillingAccountsExclusionsCreateCall) Header() http.Header {
3960	if c.header_ == nil {
3961		c.header_ = make(http.Header)
3962	}
3963	return c.header_
3964}
3965
3966func (c *BillingAccountsExclusionsCreateCall) doRequest(alt string) (*http.Response, error) {
3967	reqHeaders := make(http.Header)
3968	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
3969	for k, v := range c.header_ {
3970		reqHeaders[k] = v
3971	}
3972	reqHeaders.Set("User-Agent", c.s.userAgent())
3973	var body io.Reader = nil
3974	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
3975	if err != nil {
3976		return nil, err
3977	}
3978	reqHeaders.Set("Content-Type", "application/json")
3979	c.urlParams_.Set("alt", alt)
3980	c.urlParams_.Set("prettyPrint", "false")
3981	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
3982	urls += "?" + c.urlParams_.Encode()
3983	req, err := http.NewRequest("POST", urls, body)
3984	if err != nil {
3985		return nil, err
3986	}
3987	req.Header = reqHeaders
3988	googleapi.Expand(req.URL, map[string]string{
3989		"parent": c.parent,
3990	})
3991	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3992}
3993
3994// Do executes the "logging.billingAccounts.exclusions.create" call.
3995// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
3996// status code is an error. Response headers are in either
3997// *LogExclusion.ServerResponse.Header or (if a response was returned at
3998// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
3999// to check whether the returned error was because
4000// http.StatusNotModified was returned.
4001func (c *BillingAccountsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
4002	gensupport.SetOptions(c.urlParams_, opts...)
4003	res, err := c.doRequest("json")
4004	if res != nil && res.StatusCode == http.StatusNotModified {
4005		if res.Body != nil {
4006			res.Body.Close()
4007		}
4008		return nil, &googleapi.Error{
4009			Code:   res.StatusCode,
4010			Header: res.Header,
4011		}
4012	}
4013	if err != nil {
4014		return nil, err
4015	}
4016	defer googleapi.CloseBody(res)
4017	if err := googleapi.CheckResponse(res); err != nil {
4018		return nil, err
4019	}
4020	ret := &LogExclusion{
4021		ServerResponse: googleapi.ServerResponse{
4022			Header:         res.Header,
4023			HTTPStatusCode: res.StatusCode,
4024		},
4025	}
4026	target := &ret
4027	if err := gensupport.DecodeResponse(target, res); err != nil {
4028		return nil, err
4029	}
4030	return ret, nil
4031	// {
4032	//   "description": "Creates a new exclusion in the _Default sink 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.",
4033	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions",
4034	//   "httpMethod": "POST",
4035	//   "id": "logging.billingAccounts.exclusions.create",
4036	//   "parameterOrder": [
4037	//     "parent"
4038	//   ],
4039	//   "parameters": {
4040	//     "parent": {
4041	//       "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-logging-project\" \"organizations/123456789\"",
4042	//       "location": "path",
4043	//       "pattern": "^billingAccounts/[^/]+$",
4044	//       "required": true,
4045	//       "type": "string"
4046	//     }
4047	//   },
4048	//   "path": "v2/{+parent}/exclusions",
4049	//   "request": {
4050	//     "$ref": "LogExclusion"
4051	//   },
4052	//   "response": {
4053	//     "$ref": "LogExclusion"
4054	//   },
4055	//   "scopes": [
4056	//     "https://www.googleapis.com/auth/cloud-platform",
4057	//     "https://www.googleapis.com/auth/logging.admin"
4058	//   ]
4059	// }
4060
4061}
4062
4063// method id "logging.billingAccounts.exclusions.delete":
4064
4065type BillingAccountsExclusionsDeleteCall struct {
4066	s          *Service
4067	name       string
4068	urlParams_ gensupport.URLParams
4069	ctx_       context.Context
4070	header_    http.Header
4071}
4072
4073// Delete: Deletes an exclusion in the _Default sink.
4074//
4075// - name: The resource name of an existing exclusion to delete:
4076//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
4077//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
4078//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
4079//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For
4080//   example:"projects/my-project/exclusions/my-exclusion".
4081func (r *BillingAccountsExclusionsService) Delete(name string) *BillingAccountsExclusionsDeleteCall {
4082	c := &BillingAccountsExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4083	c.name = name
4084	return c
4085}
4086
4087// Fields allows partial responses to be retrieved. See
4088// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4089// for more information.
4090func (c *BillingAccountsExclusionsDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsExclusionsDeleteCall {
4091	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4092	return c
4093}
4094
4095// Context sets the context to be used in this call's Do method. Any
4096// pending HTTP request will be aborted if the provided context is
4097// canceled.
4098func (c *BillingAccountsExclusionsDeleteCall) Context(ctx context.Context) *BillingAccountsExclusionsDeleteCall {
4099	c.ctx_ = ctx
4100	return c
4101}
4102
4103// Header returns an http.Header that can be modified by the caller to
4104// add HTTP headers to the request.
4105func (c *BillingAccountsExclusionsDeleteCall) Header() http.Header {
4106	if c.header_ == nil {
4107		c.header_ = make(http.Header)
4108	}
4109	return c.header_
4110}
4111
4112func (c *BillingAccountsExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) {
4113	reqHeaders := make(http.Header)
4114	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
4115	for k, v := range c.header_ {
4116		reqHeaders[k] = v
4117	}
4118	reqHeaders.Set("User-Agent", c.s.userAgent())
4119	var body io.Reader = nil
4120	c.urlParams_.Set("alt", alt)
4121	c.urlParams_.Set("prettyPrint", "false")
4122	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
4123	urls += "?" + c.urlParams_.Encode()
4124	req, err := http.NewRequest("DELETE", urls, body)
4125	if err != nil {
4126		return nil, err
4127	}
4128	req.Header = reqHeaders
4129	googleapi.Expand(req.URL, map[string]string{
4130		"name": c.name,
4131	})
4132	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4133}
4134
4135// Do executes the "logging.billingAccounts.exclusions.delete" call.
4136// Exactly one of *Empty or error will be non-nil. Any non-2xx status
4137// code is an error. Response headers are in either
4138// *Empty.ServerResponse.Header or (if a response was returned at all)
4139// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
4140// check whether the returned error was because http.StatusNotModified
4141// was returned.
4142func (c *BillingAccountsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
4143	gensupport.SetOptions(c.urlParams_, opts...)
4144	res, err := c.doRequest("json")
4145	if res != nil && res.StatusCode == http.StatusNotModified {
4146		if res.Body != nil {
4147			res.Body.Close()
4148		}
4149		return nil, &googleapi.Error{
4150			Code:   res.StatusCode,
4151			Header: res.Header,
4152		}
4153	}
4154	if err != nil {
4155		return nil, err
4156	}
4157	defer googleapi.CloseBody(res)
4158	if err := googleapi.CheckResponse(res); err != nil {
4159		return nil, err
4160	}
4161	ret := &Empty{
4162		ServerResponse: googleapi.ServerResponse{
4163			Header:         res.Header,
4164			HTTPStatusCode: res.StatusCode,
4165		},
4166	}
4167	target := &ret
4168	if err := gensupport.DecodeResponse(target, res); err != nil {
4169		return nil, err
4170	}
4171	return ret, nil
4172	// {
4173	//   "description": "Deletes an exclusion in the _Default sink.",
4174	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions/{exclusionsId}",
4175	//   "httpMethod": "DELETE",
4176	//   "id": "logging.billingAccounts.exclusions.delete",
4177	//   "parameterOrder": [
4178	//     "name"
4179	//   ],
4180	//   "parameters": {
4181	//     "name": {
4182	//       "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]\" For example:\"projects/my-project/exclusions/my-exclusion\"",
4183	//       "location": "path",
4184	//       "pattern": "^billingAccounts/[^/]+/exclusions/[^/]+$",
4185	//       "required": true,
4186	//       "type": "string"
4187	//     }
4188	//   },
4189	//   "path": "v2/{+name}",
4190	//   "response": {
4191	//     "$ref": "Empty"
4192	//   },
4193	//   "scopes": [
4194	//     "https://www.googleapis.com/auth/cloud-platform",
4195	//     "https://www.googleapis.com/auth/logging.admin"
4196	//   ]
4197	// }
4198
4199}
4200
4201// method id "logging.billingAccounts.exclusions.get":
4202
4203type BillingAccountsExclusionsGetCall struct {
4204	s            *Service
4205	name         string
4206	urlParams_   gensupport.URLParams
4207	ifNoneMatch_ string
4208	ctx_         context.Context
4209	header_      http.Header
4210}
4211
4212// Get: Gets the description of an exclusion in the _Default sink.
4213//
4214// - name: The resource name of an existing exclusion:
4215//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
4216//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
4217//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
4218//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For
4219//   example:"projects/my-project/exclusions/my-exclusion".
4220func (r *BillingAccountsExclusionsService) Get(name string) *BillingAccountsExclusionsGetCall {
4221	c := &BillingAccountsExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4222	c.name = name
4223	return c
4224}
4225
4226// Fields allows partial responses to be retrieved. See
4227// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4228// for more information.
4229func (c *BillingAccountsExclusionsGetCall) Fields(s ...googleapi.Field) *BillingAccountsExclusionsGetCall {
4230	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4231	return c
4232}
4233
4234// IfNoneMatch sets the optional parameter which makes the operation
4235// fail if the object's ETag matches the given value. This is useful for
4236// getting updates only after the object has changed since the last
4237// request. Use googleapi.IsNotModified to check whether the response
4238// error from Do is the result of In-None-Match.
4239func (c *BillingAccountsExclusionsGetCall) IfNoneMatch(entityTag string) *BillingAccountsExclusionsGetCall {
4240	c.ifNoneMatch_ = entityTag
4241	return c
4242}
4243
4244// Context sets the context to be used in this call's Do method. Any
4245// pending HTTP request will be aborted if the provided context is
4246// canceled.
4247func (c *BillingAccountsExclusionsGetCall) Context(ctx context.Context) *BillingAccountsExclusionsGetCall {
4248	c.ctx_ = ctx
4249	return c
4250}
4251
4252// Header returns an http.Header that can be modified by the caller to
4253// add HTTP headers to the request.
4254func (c *BillingAccountsExclusionsGetCall) Header() http.Header {
4255	if c.header_ == nil {
4256		c.header_ = make(http.Header)
4257	}
4258	return c.header_
4259}
4260
4261func (c *BillingAccountsExclusionsGetCall) doRequest(alt string) (*http.Response, error) {
4262	reqHeaders := make(http.Header)
4263	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
4264	for k, v := range c.header_ {
4265		reqHeaders[k] = v
4266	}
4267	reqHeaders.Set("User-Agent", c.s.userAgent())
4268	if c.ifNoneMatch_ != "" {
4269		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4270	}
4271	var body io.Reader = nil
4272	c.urlParams_.Set("alt", alt)
4273	c.urlParams_.Set("prettyPrint", "false")
4274	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
4275	urls += "?" + c.urlParams_.Encode()
4276	req, err := http.NewRequest("GET", urls, body)
4277	if err != nil {
4278		return nil, err
4279	}
4280	req.Header = reqHeaders
4281	googleapi.Expand(req.URL, map[string]string{
4282		"name": c.name,
4283	})
4284	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4285}
4286
4287// Do executes the "logging.billingAccounts.exclusions.get" call.
4288// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
4289// status code is an error. Response headers are in either
4290// *LogExclusion.ServerResponse.Header or (if a response was returned at
4291// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4292// to check whether the returned error was because
4293// http.StatusNotModified was returned.
4294func (c *BillingAccountsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
4295	gensupport.SetOptions(c.urlParams_, opts...)
4296	res, err := c.doRequest("json")
4297	if res != nil && res.StatusCode == http.StatusNotModified {
4298		if res.Body != nil {
4299			res.Body.Close()
4300		}
4301		return nil, &googleapi.Error{
4302			Code:   res.StatusCode,
4303			Header: res.Header,
4304		}
4305	}
4306	if err != nil {
4307		return nil, err
4308	}
4309	defer googleapi.CloseBody(res)
4310	if err := googleapi.CheckResponse(res); err != nil {
4311		return nil, err
4312	}
4313	ret := &LogExclusion{
4314		ServerResponse: googleapi.ServerResponse{
4315			Header:         res.Header,
4316			HTTPStatusCode: res.StatusCode,
4317		},
4318	}
4319	target := &ret
4320	if err := gensupport.DecodeResponse(target, res); err != nil {
4321		return nil, err
4322	}
4323	return ret, nil
4324	// {
4325	//   "description": "Gets the description of an exclusion in the _Default sink.",
4326	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions/{exclusionsId}",
4327	//   "httpMethod": "GET",
4328	//   "id": "logging.billingAccounts.exclusions.get",
4329	//   "parameterOrder": [
4330	//     "name"
4331	//   ],
4332	//   "parameters": {
4333	//     "name": {
4334	//       "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]\" For example:\"projects/my-project/exclusions/my-exclusion\"",
4335	//       "location": "path",
4336	//       "pattern": "^billingAccounts/[^/]+/exclusions/[^/]+$",
4337	//       "required": true,
4338	//       "type": "string"
4339	//     }
4340	//   },
4341	//   "path": "v2/{+name}",
4342	//   "response": {
4343	//     "$ref": "LogExclusion"
4344	//   },
4345	//   "scopes": [
4346	//     "https://www.googleapis.com/auth/cloud-platform",
4347	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
4348	//     "https://www.googleapis.com/auth/logging.admin",
4349	//     "https://www.googleapis.com/auth/logging.read"
4350	//   ]
4351	// }
4352
4353}
4354
4355// method id "logging.billingAccounts.exclusions.list":
4356
4357type BillingAccountsExclusionsListCall struct {
4358	s            *Service
4359	parent       string
4360	urlParams_   gensupport.URLParams
4361	ifNoneMatch_ string
4362	ctx_         context.Context
4363	header_      http.Header
4364}
4365
4366// List: Lists all the exclusions on the _Default sink in a parent
4367// resource.
4368//
4369// - parent: The parent resource whose exclusions are to be listed.
4370//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
4371//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]".
4372func (r *BillingAccountsExclusionsService) List(parent string) *BillingAccountsExclusionsListCall {
4373	c := &BillingAccountsExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4374	c.parent = parent
4375	return c
4376}
4377
4378// PageSize sets the optional parameter "pageSize": The maximum number
4379// of results to return from this request. Non-positive values are
4380// ignored. The presence of nextPageToken in the response indicates that
4381// more results might be available.
4382func (c *BillingAccountsExclusionsListCall) PageSize(pageSize int64) *BillingAccountsExclusionsListCall {
4383	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4384	return c
4385}
4386
4387// PageToken sets the optional parameter "pageToken": If present, then
4388// retrieve the next batch of results from the preceding call to this
4389// method. pageToken must be the value of nextPageToken from the
4390// previous response. The values of other method parameters should be
4391// identical to those in the previous call.
4392func (c *BillingAccountsExclusionsListCall) PageToken(pageToken string) *BillingAccountsExclusionsListCall {
4393	c.urlParams_.Set("pageToken", pageToken)
4394	return c
4395}
4396
4397// Fields allows partial responses to be retrieved. See
4398// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4399// for more information.
4400func (c *BillingAccountsExclusionsListCall) Fields(s ...googleapi.Field) *BillingAccountsExclusionsListCall {
4401	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4402	return c
4403}
4404
4405// IfNoneMatch sets the optional parameter which makes the operation
4406// fail if the object's ETag matches the given value. This is useful for
4407// getting updates only after the object has changed since the last
4408// request. Use googleapi.IsNotModified to check whether the response
4409// error from Do is the result of In-None-Match.
4410func (c *BillingAccountsExclusionsListCall) IfNoneMatch(entityTag string) *BillingAccountsExclusionsListCall {
4411	c.ifNoneMatch_ = entityTag
4412	return c
4413}
4414
4415// Context sets the context to be used in this call's Do method. Any
4416// pending HTTP request will be aborted if the provided context is
4417// canceled.
4418func (c *BillingAccountsExclusionsListCall) Context(ctx context.Context) *BillingAccountsExclusionsListCall {
4419	c.ctx_ = ctx
4420	return c
4421}
4422
4423// Header returns an http.Header that can be modified by the caller to
4424// add HTTP headers to the request.
4425func (c *BillingAccountsExclusionsListCall) Header() http.Header {
4426	if c.header_ == nil {
4427		c.header_ = make(http.Header)
4428	}
4429	return c.header_
4430}
4431
4432func (c *BillingAccountsExclusionsListCall) doRequest(alt string) (*http.Response, error) {
4433	reqHeaders := make(http.Header)
4434	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
4435	for k, v := range c.header_ {
4436		reqHeaders[k] = v
4437	}
4438	reqHeaders.Set("User-Agent", c.s.userAgent())
4439	if c.ifNoneMatch_ != "" {
4440		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4441	}
4442	var body io.Reader = nil
4443	c.urlParams_.Set("alt", alt)
4444	c.urlParams_.Set("prettyPrint", "false")
4445	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
4446	urls += "?" + c.urlParams_.Encode()
4447	req, err := http.NewRequest("GET", urls, body)
4448	if err != nil {
4449		return nil, err
4450	}
4451	req.Header = reqHeaders
4452	googleapi.Expand(req.URL, map[string]string{
4453		"parent": c.parent,
4454	})
4455	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4456}
4457
4458// Do executes the "logging.billingAccounts.exclusions.list" call.
4459// Exactly one of *ListExclusionsResponse or error will be non-nil. Any
4460// non-2xx status code is an error. Response headers are in either
4461// *ListExclusionsResponse.ServerResponse.Header or (if a response was
4462// returned at all) in error.(*googleapi.Error).Header. Use
4463// googleapi.IsNotModified to check whether the returned error was
4464// because http.StatusNotModified was returned.
4465func (c *BillingAccountsExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) {
4466	gensupport.SetOptions(c.urlParams_, opts...)
4467	res, err := c.doRequest("json")
4468	if res != nil && res.StatusCode == http.StatusNotModified {
4469		if res.Body != nil {
4470			res.Body.Close()
4471		}
4472		return nil, &googleapi.Error{
4473			Code:   res.StatusCode,
4474			Header: res.Header,
4475		}
4476	}
4477	if err != nil {
4478		return nil, err
4479	}
4480	defer googleapi.CloseBody(res)
4481	if err := googleapi.CheckResponse(res); err != nil {
4482		return nil, err
4483	}
4484	ret := &ListExclusionsResponse{
4485		ServerResponse: googleapi.ServerResponse{
4486			Header:         res.Header,
4487			HTTPStatusCode: res.StatusCode,
4488		},
4489	}
4490	target := &ret
4491	if err := gensupport.DecodeResponse(target, res); err != nil {
4492		return nil, err
4493	}
4494	return ret, nil
4495	// {
4496	//   "description": "Lists all the exclusions on the _Default sink in a parent resource.",
4497	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions",
4498	//   "httpMethod": "GET",
4499	//   "id": "logging.billingAccounts.exclusions.list",
4500	//   "parameterOrder": [
4501	//     "parent"
4502	//   ],
4503	//   "parameters": {
4504	//     "pageSize": {
4505	//       "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.",
4506	//       "format": "int32",
4507	//       "location": "query",
4508	//       "type": "integer"
4509	//     },
4510	//     "pageToken": {
4511	//       "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.",
4512	//       "location": "query",
4513	//       "type": "string"
4514	//     },
4515	//     "parent": {
4516	//       "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
4517	//       "location": "path",
4518	//       "pattern": "^billingAccounts/[^/]+$",
4519	//       "required": true,
4520	//       "type": "string"
4521	//     }
4522	//   },
4523	//   "path": "v2/{+parent}/exclusions",
4524	//   "response": {
4525	//     "$ref": "ListExclusionsResponse"
4526	//   },
4527	//   "scopes": [
4528	//     "https://www.googleapis.com/auth/cloud-platform",
4529	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
4530	//     "https://www.googleapis.com/auth/logging.admin",
4531	//     "https://www.googleapis.com/auth/logging.read"
4532	//   ]
4533	// }
4534
4535}
4536
4537// Pages invokes f for each page of results.
4538// A non-nil error returned from f will halt the iteration.
4539// The provided context supersedes any context provided to the Context method.
4540func (c *BillingAccountsExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error {
4541	c.ctx_ = ctx
4542	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
4543	for {
4544		x, err := c.Do()
4545		if err != nil {
4546			return err
4547		}
4548		if err := f(x); err != nil {
4549			return err
4550		}
4551		if x.NextPageToken == "" {
4552			return nil
4553		}
4554		c.PageToken(x.NextPageToken)
4555	}
4556}
4557
4558// method id "logging.billingAccounts.exclusions.patch":
4559
4560type BillingAccountsExclusionsPatchCall struct {
4561	s            *Service
4562	name         string
4563	logexclusion *LogExclusion
4564	urlParams_   gensupport.URLParams
4565	ctx_         context.Context
4566	header_      http.Header
4567}
4568
4569// Patch: Changes one or more properties of an existing exclusion in the
4570// _Default sink.
4571//
4572// - name: The resource name of the exclusion to update:
4573//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
4574//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
4575//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
4576//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For
4577//   example:"projects/my-project/exclusions/my-exclusion".
4578func (r *BillingAccountsExclusionsService) Patch(name string, logexclusion *LogExclusion) *BillingAccountsExclusionsPatchCall {
4579	c := &BillingAccountsExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4580	c.name = name
4581	c.logexclusion = logexclusion
4582	return c
4583}
4584
4585// UpdateMask sets the optional parameter "updateMask": Required. A
4586// non-empty list of fields to change in the existing exclusion. New
4587// values for the fields are taken from the corresponding fields in the
4588// LogExclusion included in this request. Fields not mentioned in
4589// update_mask are not changed and are ignored in the request.For
4590// example, to change the filter and description of an exclusion,
4591// specify an update_mask of "filter,description".
4592func (c *BillingAccountsExclusionsPatchCall) UpdateMask(updateMask string) *BillingAccountsExclusionsPatchCall {
4593	c.urlParams_.Set("updateMask", updateMask)
4594	return c
4595}
4596
4597// Fields allows partial responses to be retrieved. See
4598// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4599// for more information.
4600func (c *BillingAccountsExclusionsPatchCall) Fields(s ...googleapi.Field) *BillingAccountsExclusionsPatchCall {
4601	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4602	return c
4603}
4604
4605// Context sets the context to be used in this call's Do method. Any
4606// pending HTTP request will be aborted if the provided context is
4607// canceled.
4608func (c *BillingAccountsExclusionsPatchCall) Context(ctx context.Context) *BillingAccountsExclusionsPatchCall {
4609	c.ctx_ = ctx
4610	return c
4611}
4612
4613// Header returns an http.Header that can be modified by the caller to
4614// add HTTP headers to the request.
4615func (c *BillingAccountsExclusionsPatchCall) Header() http.Header {
4616	if c.header_ == nil {
4617		c.header_ = make(http.Header)
4618	}
4619	return c.header_
4620}
4621
4622func (c *BillingAccountsExclusionsPatchCall) doRequest(alt string) (*http.Response, error) {
4623	reqHeaders := make(http.Header)
4624	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
4625	for k, v := range c.header_ {
4626		reqHeaders[k] = v
4627	}
4628	reqHeaders.Set("User-Agent", c.s.userAgent())
4629	var body io.Reader = nil
4630	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
4631	if err != nil {
4632		return nil, err
4633	}
4634	reqHeaders.Set("Content-Type", "application/json")
4635	c.urlParams_.Set("alt", alt)
4636	c.urlParams_.Set("prettyPrint", "false")
4637	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
4638	urls += "?" + c.urlParams_.Encode()
4639	req, err := http.NewRequest("PATCH", urls, body)
4640	if err != nil {
4641		return nil, err
4642	}
4643	req.Header = reqHeaders
4644	googleapi.Expand(req.URL, map[string]string{
4645		"name": c.name,
4646	})
4647	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4648}
4649
4650// Do executes the "logging.billingAccounts.exclusions.patch" call.
4651// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
4652// status code is an error. Response headers are in either
4653// *LogExclusion.ServerResponse.Header or (if a response was returned at
4654// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
4655// to check whether the returned error was because
4656// http.StatusNotModified was returned.
4657func (c *BillingAccountsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
4658	gensupport.SetOptions(c.urlParams_, opts...)
4659	res, err := c.doRequest("json")
4660	if res != nil && res.StatusCode == http.StatusNotModified {
4661		if res.Body != nil {
4662			res.Body.Close()
4663		}
4664		return nil, &googleapi.Error{
4665			Code:   res.StatusCode,
4666			Header: res.Header,
4667		}
4668	}
4669	if err != nil {
4670		return nil, err
4671	}
4672	defer googleapi.CloseBody(res)
4673	if err := googleapi.CheckResponse(res); err != nil {
4674		return nil, err
4675	}
4676	ret := &LogExclusion{
4677		ServerResponse: googleapi.ServerResponse{
4678			Header:         res.Header,
4679			HTTPStatusCode: res.StatusCode,
4680		},
4681	}
4682	target := &ret
4683	if err := gensupport.DecodeResponse(target, res); err != nil {
4684		return nil, err
4685	}
4686	return ret, nil
4687	// {
4688	//   "description": "Changes one or more properties of an existing exclusion in the _Default sink.",
4689	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/exclusions/{exclusionsId}",
4690	//   "httpMethod": "PATCH",
4691	//   "id": "logging.billingAccounts.exclusions.patch",
4692	//   "parameterOrder": [
4693	//     "name"
4694	//   ],
4695	//   "parameters": {
4696	//     "name": {
4697	//       "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]\" For example:\"projects/my-project/exclusions/my-exclusion\"",
4698	//       "location": "path",
4699	//       "pattern": "^billingAccounts/[^/]+/exclusions/[^/]+$",
4700	//       "required": true,
4701	//       "type": "string"
4702	//     },
4703	//     "updateMask": {
4704	//       "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\".",
4705	//       "format": "google-fieldmask",
4706	//       "location": "query",
4707	//       "type": "string"
4708	//     }
4709	//   },
4710	//   "path": "v2/{+name}",
4711	//   "request": {
4712	//     "$ref": "LogExclusion"
4713	//   },
4714	//   "response": {
4715	//     "$ref": "LogExclusion"
4716	//   },
4717	//   "scopes": [
4718	//     "https://www.googleapis.com/auth/cloud-platform",
4719	//     "https://www.googleapis.com/auth/logging.admin"
4720	//   ]
4721	// }
4722
4723}
4724
4725// method id "logging.billingAccounts.locations.get":
4726
4727type BillingAccountsLocationsGetCall struct {
4728	s            *Service
4729	name         string
4730	urlParams_   gensupport.URLParams
4731	ifNoneMatch_ string
4732	ctx_         context.Context
4733	header_      http.Header
4734}
4735
4736// Get: Gets information about a location.
4737//
4738// - name: Resource name for the location.
4739func (r *BillingAccountsLocationsService) Get(name string) *BillingAccountsLocationsGetCall {
4740	c := &BillingAccountsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4741	c.name = name
4742	return c
4743}
4744
4745// Fields allows partial responses to be retrieved. See
4746// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4747// for more information.
4748func (c *BillingAccountsLocationsGetCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsGetCall {
4749	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4750	return c
4751}
4752
4753// IfNoneMatch sets the optional parameter which makes the operation
4754// fail if the object's ETag matches the given value. This is useful for
4755// getting updates only after the object has changed since the last
4756// request. Use googleapi.IsNotModified to check whether the response
4757// error from Do is the result of In-None-Match.
4758func (c *BillingAccountsLocationsGetCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsGetCall {
4759	c.ifNoneMatch_ = entityTag
4760	return c
4761}
4762
4763// Context sets the context to be used in this call's Do method. Any
4764// pending HTTP request will be aborted if the provided context is
4765// canceled.
4766func (c *BillingAccountsLocationsGetCall) Context(ctx context.Context) *BillingAccountsLocationsGetCall {
4767	c.ctx_ = ctx
4768	return c
4769}
4770
4771// Header returns an http.Header that can be modified by the caller to
4772// add HTTP headers to the request.
4773func (c *BillingAccountsLocationsGetCall) Header() http.Header {
4774	if c.header_ == nil {
4775		c.header_ = make(http.Header)
4776	}
4777	return c.header_
4778}
4779
4780func (c *BillingAccountsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
4781	reqHeaders := make(http.Header)
4782	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
4783	for k, v := range c.header_ {
4784		reqHeaders[k] = v
4785	}
4786	reqHeaders.Set("User-Agent", c.s.userAgent())
4787	if c.ifNoneMatch_ != "" {
4788		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4789	}
4790	var body io.Reader = nil
4791	c.urlParams_.Set("alt", alt)
4792	c.urlParams_.Set("prettyPrint", "false")
4793	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
4794	urls += "?" + c.urlParams_.Encode()
4795	req, err := http.NewRequest("GET", urls, body)
4796	if err != nil {
4797		return nil, err
4798	}
4799	req.Header = reqHeaders
4800	googleapi.Expand(req.URL, map[string]string{
4801		"name": c.name,
4802	})
4803	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4804}
4805
4806// Do executes the "logging.billingAccounts.locations.get" call.
4807// Exactly one of *Location or error will be non-nil. Any non-2xx status
4808// code is an error. Response headers are in either
4809// *Location.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 *BillingAccountsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, 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 := &Location{
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": "Gets information about a location.",
4845	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}",
4846	//   "httpMethod": "GET",
4847	//   "id": "logging.billingAccounts.locations.get",
4848	//   "parameterOrder": [
4849	//     "name"
4850	//   ],
4851	//   "parameters": {
4852	//     "name": {
4853	//       "description": "Resource name for the location.",
4854	//       "location": "path",
4855	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+$",
4856	//       "required": true,
4857	//       "type": "string"
4858	//     }
4859	//   },
4860	//   "path": "v2/{+name}",
4861	//   "response": {
4862	//     "$ref": "Location"
4863	//   },
4864	//   "scopes": [
4865	//     "https://www.googleapis.com/auth/cloud-platform",
4866	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
4867	//     "https://www.googleapis.com/auth/logging.admin",
4868	//     "https://www.googleapis.com/auth/logging.read"
4869	//   ]
4870	// }
4871
4872}
4873
4874// method id "logging.billingAccounts.locations.list":
4875
4876type BillingAccountsLocationsListCall struct {
4877	s            *Service
4878	name         string
4879	urlParams_   gensupport.URLParams
4880	ifNoneMatch_ string
4881	ctx_         context.Context
4882	header_      http.Header
4883}
4884
4885// List: Lists information about the supported locations for this
4886// service.
4887//
4888// - name: The resource that owns the locations collection, if
4889//   applicable.
4890func (r *BillingAccountsLocationsService) List(name string) *BillingAccountsLocationsListCall {
4891	c := &BillingAccountsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
4892	c.name = name
4893	return c
4894}
4895
4896// Filter sets the optional parameter "filter": A filter to narrow down
4897// results to a preferred subset. The filtering language accepts strings
4898// like "displayName=tokyo", and is documented in more detail in AIP-160
4899// (https://google.aip.dev/160).
4900func (c *BillingAccountsLocationsListCall) Filter(filter string) *BillingAccountsLocationsListCall {
4901	c.urlParams_.Set("filter", filter)
4902	return c
4903}
4904
4905// PageSize sets the optional parameter "pageSize": The maximum number
4906// of results to return. If not set, the service selects a default.
4907func (c *BillingAccountsLocationsListCall) PageSize(pageSize int64) *BillingAccountsLocationsListCall {
4908	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4909	return c
4910}
4911
4912// PageToken sets the optional parameter "pageToken": A page token
4913// received from the next_page_token field in the response. Send that
4914// page token to receive the subsequent page.
4915func (c *BillingAccountsLocationsListCall) PageToken(pageToken string) *BillingAccountsLocationsListCall {
4916	c.urlParams_.Set("pageToken", pageToken)
4917	return c
4918}
4919
4920// Fields allows partial responses to be retrieved. See
4921// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
4922// for more information.
4923func (c *BillingAccountsLocationsListCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsListCall {
4924	c.urlParams_.Set("fields", googleapi.CombineFields(s))
4925	return c
4926}
4927
4928// IfNoneMatch sets the optional parameter which makes the operation
4929// fail if the object's ETag matches the given value. This is useful for
4930// getting updates only after the object has changed since the last
4931// request. Use googleapi.IsNotModified to check whether the response
4932// error from Do is the result of In-None-Match.
4933func (c *BillingAccountsLocationsListCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsListCall {
4934	c.ifNoneMatch_ = entityTag
4935	return c
4936}
4937
4938// Context sets the context to be used in this call's Do method. Any
4939// pending HTTP request will be aborted if the provided context is
4940// canceled.
4941func (c *BillingAccountsLocationsListCall) Context(ctx context.Context) *BillingAccountsLocationsListCall {
4942	c.ctx_ = ctx
4943	return c
4944}
4945
4946// Header returns an http.Header that can be modified by the caller to
4947// add HTTP headers to the request.
4948func (c *BillingAccountsLocationsListCall) Header() http.Header {
4949	if c.header_ == nil {
4950		c.header_ = make(http.Header)
4951	}
4952	return c.header_
4953}
4954
4955func (c *BillingAccountsLocationsListCall) doRequest(alt string) (*http.Response, error) {
4956	reqHeaders := make(http.Header)
4957	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
4958	for k, v := range c.header_ {
4959		reqHeaders[k] = v
4960	}
4961	reqHeaders.Set("User-Agent", c.s.userAgent())
4962	if c.ifNoneMatch_ != "" {
4963		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
4964	}
4965	var body io.Reader = nil
4966	c.urlParams_.Set("alt", alt)
4967	c.urlParams_.Set("prettyPrint", "false")
4968	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations")
4969	urls += "?" + c.urlParams_.Encode()
4970	req, err := http.NewRequest("GET", urls, body)
4971	if err != nil {
4972		return nil, err
4973	}
4974	req.Header = reqHeaders
4975	googleapi.Expand(req.URL, map[string]string{
4976		"name": c.name,
4977	})
4978	return gensupport.SendRequest(c.ctx_, c.s.client, req)
4979}
4980
4981// Do executes the "logging.billingAccounts.locations.list" call.
4982// Exactly one of *ListLocationsResponse or error will be non-nil. Any
4983// non-2xx status code is an error. Response headers are in either
4984// *ListLocationsResponse.ServerResponse.Header or (if a response was
4985// returned at all) in error.(*googleapi.Error).Header. Use
4986// googleapi.IsNotModified to check whether the returned error was
4987// because http.StatusNotModified was returned.
4988func (c *BillingAccountsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
4989	gensupport.SetOptions(c.urlParams_, opts...)
4990	res, err := c.doRequest("json")
4991	if res != nil && res.StatusCode == http.StatusNotModified {
4992		if res.Body != nil {
4993			res.Body.Close()
4994		}
4995		return nil, &googleapi.Error{
4996			Code:   res.StatusCode,
4997			Header: res.Header,
4998		}
4999	}
5000	if err != nil {
5001		return nil, err
5002	}
5003	defer googleapi.CloseBody(res)
5004	if err := googleapi.CheckResponse(res); err != nil {
5005		return nil, err
5006	}
5007	ret := &ListLocationsResponse{
5008		ServerResponse: googleapi.ServerResponse{
5009			Header:         res.Header,
5010			HTTPStatusCode: res.StatusCode,
5011		},
5012	}
5013	target := &ret
5014	if err := gensupport.DecodeResponse(target, res); err != nil {
5015		return nil, err
5016	}
5017	return ret, nil
5018	// {
5019	//   "description": "Lists information about the supported locations for this service.",
5020	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations",
5021	//   "httpMethod": "GET",
5022	//   "id": "logging.billingAccounts.locations.list",
5023	//   "parameterOrder": [
5024	//     "name"
5025	//   ],
5026	//   "parameters": {
5027	//     "filter": {
5028	//       "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).",
5029	//       "location": "query",
5030	//       "type": "string"
5031	//     },
5032	//     "name": {
5033	//       "description": "The resource that owns the locations collection, if applicable.",
5034	//       "location": "path",
5035	//       "pattern": "^billingAccounts/[^/]+$",
5036	//       "required": true,
5037	//       "type": "string"
5038	//     },
5039	//     "pageSize": {
5040	//       "description": "The maximum number of results to return. If not set, the service selects a default.",
5041	//       "format": "int32",
5042	//       "location": "query",
5043	//       "type": "integer"
5044	//     },
5045	//     "pageToken": {
5046	//       "description": "A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.",
5047	//       "location": "query",
5048	//       "type": "string"
5049	//     }
5050	//   },
5051	//   "path": "v2/{+name}/locations",
5052	//   "response": {
5053	//     "$ref": "ListLocationsResponse"
5054	//   },
5055	//   "scopes": [
5056	//     "https://www.googleapis.com/auth/cloud-platform",
5057	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
5058	//     "https://www.googleapis.com/auth/logging.admin",
5059	//     "https://www.googleapis.com/auth/logging.read"
5060	//   ]
5061	// }
5062
5063}
5064
5065// Pages invokes f for each page of results.
5066// A non-nil error returned from f will halt the iteration.
5067// The provided context supersedes any context provided to the Context method.
5068func (c *BillingAccountsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
5069	c.ctx_ = ctx
5070	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
5071	for {
5072		x, err := c.Do()
5073		if err != nil {
5074			return err
5075		}
5076		if err := f(x); err != nil {
5077			return err
5078		}
5079		if x.NextPageToken == "" {
5080			return nil
5081		}
5082		c.PageToken(x.NextPageToken)
5083	}
5084}
5085
5086// method id "logging.billingAccounts.locations.buckets.create":
5087
5088type BillingAccountsLocationsBucketsCreateCall struct {
5089	s          *Service
5090	parent     string
5091	logbucket  *LogBucket
5092	urlParams_ gensupport.URLParams
5093	ctx_       context.Context
5094	header_    http.Header
5095}
5096
5097// Create: Creates a log bucket that can be used to store log entries.
5098// After a bucket has been created, the bucket's location cannot be
5099// changed.
5100//
5101// - parent: The resource in which to create the log bucket:
5102//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For
5103//   example:"projects/my-project/locations/global".
5104func (r *BillingAccountsLocationsBucketsService) Create(parent string, logbucket *LogBucket) *BillingAccountsLocationsBucketsCreateCall {
5105	c := &BillingAccountsLocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5106	c.parent = parent
5107	c.logbucket = logbucket
5108	return c
5109}
5110
5111// BucketId sets the optional parameter "bucketId": Required. A
5112// client-assigned identifier such as "my-bucket". Identifiers are
5113// limited to 100 characters and can include only letters, digits,
5114// underscores, hyphens, and periods.
5115func (c *BillingAccountsLocationsBucketsCreateCall) BucketId(bucketId string) *BillingAccountsLocationsBucketsCreateCall {
5116	c.urlParams_.Set("bucketId", bucketId)
5117	return c
5118}
5119
5120// Fields allows partial responses to be retrieved. See
5121// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5122// for more information.
5123func (c *BillingAccountsLocationsBucketsCreateCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsCreateCall {
5124	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5125	return c
5126}
5127
5128// Context sets the context to be used in this call's Do method. Any
5129// pending HTTP request will be aborted if the provided context is
5130// canceled.
5131func (c *BillingAccountsLocationsBucketsCreateCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsCreateCall {
5132	c.ctx_ = ctx
5133	return c
5134}
5135
5136// Header returns an http.Header that can be modified by the caller to
5137// add HTTP headers to the request.
5138func (c *BillingAccountsLocationsBucketsCreateCall) Header() http.Header {
5139	if c.header_ == nil {
5140		c.header_ = make(http.Header)
5141	}
5142	return c.header_
5143}
5144
5145func (c *BillingAccountsLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) {
5146	reqHeaders := make(http.Header)
5147	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
5148	for k, v := range c.header_ {
5149		reqHeaders[k] = v
5150	}
5151	reqHeaders.Set("User-Agent", c.s.userAgent())
5152	var body io.Reader = nil
5153	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
5154	if err != nil {
5155		return nil, err
5156	}
5157	reqHeaders.Set("Content-Type", "application/json")
5158	c.urlParams_.Set("alt", alt)
5159	c.urlParams_.Set("prettyPrint", "false")
5160	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
5161	urls += "?" + c.urlParams_.Encode()
5162	req, err := http.NewRequest("POST", urls, body)
5163	if err != nil {
5164		return nil, err
5165	}
5166	req.Header = reqHeaders
5167	googleapi.Expand(req.URL, map[string]string{
5168		"parent": c.parent,
5169	})
5170	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5171}
5172
5173// Do executes the "logging.billingAccounts.locations.buckets.create" call.
5174// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
5175// status code is an error. Response headers are in either
5176// *LogBucket.ServerResponse.Header or (if a response was returned at
5177// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
5178// to check whether the returned error was because
5179// http.StatusNotModified was returned.
5180func (c *BillingAccountsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
5181	gensupport.SetOptions(c.urlParams_, opts...)
5182	res, err := c.doRequest("json")
5183	if res != nil && res.StatusCode == http.StatusNotModified {
5184		if res.Body != nil {
5185			res.Body.Close()
5186		}
5187		return nil, &googleapi.Error{
5188			Code:   res.StatusCode,
5189			Header: res.Header,
5190		}
5191	}
5192	if err != nil {
5193		return nil, err
5194	}
5195	defer googleapi.CloseBody(res)
5196	if err := googleapi.CheckResponse(res); err != nil {
5197		return nil, err
5198	}
5199	ret := &LogBucket{
5200		ServerResponse: googleapi.ServerResponse{
5201			Header:         res.Header,
5202			HTTPStatusCode: res.StatusCode,
5203		},
5204	}
5205	target := &ret
5206	if err := gensupport.DecodeResponse(target, res); err != nil {
5207		return nil, err
5208	}
5209	return ret, nil
5210	// {
5211	//   "description": "Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.",
5212	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets",
5213	//   "httpMethod": "POST",
5214	//   "id": "logging.billingAccounts.locations.buckets.create",
5215	//   "parameterOrder": [
5216	//     "parent"
5217	//   ],
5218	//   "parameters": {
5219	//     "bucketId": {
5220	//       "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.",
5221	//       "location": "query",
5222	//       "type": "string"
5223	//     },
5224	//     "parent": {
5225	//       "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"",
5226	//       "location": "path",
5227	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+$",
5228	//       "required": true,
5229	//       "type": "string"
5230	//     }
5231	//   },
5232	//   "path": "v2/{+parent}/buckets",
5233	//   "request": {
5234	//     "$ref": "LogBucket"
5235	//   },
5236	//   "response": {
5237	//     "$ref": "LogBucket"
5238	//   },
5239	//   "scopes": [
5240	//     "https://www.googleapis.com/auth/cloud-platform",
5241	//     "https://www.googleapis.com/auth/logging.admin"
5242	//   ]
5243	// }
5244
5245}
5246
5247// method id "logging.billingAccounts.locations.buckets.delete":
5248
5249type BillingAccountsLocationsBucketsDeleteCall struct {
5250	s          *Service
5251	name       string
5252	urlParams_ gensupport.URLParams
5253	ctx_       context.Context
5254	header_    http.Header
5255}
5256
5257// Delete: Deletes a log bucket.Changes the bucket's lifecycle_state to
5258// the DELETE_REQUESTED state. After 7 days, the bucket will be purged
5259// and all log entries in the bucket will be permanently deleted.
5260//
5261// - name: The full resource name of the bucket to delete.
5262//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
5263//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
5264//   CKET_ID]"
5265//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
5266//   s/[BUCKET_ID]"
5267//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
5268//   For
5269//   example:"projects/my-project/locations/global/buckets/my-bucket".
5270func (r *BillingAccountsLocationsBucketsService) Delete(name string) *BillingAccountsLocationsBucketsDeleteCall {
5271	c := &BillingAccountsLocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5272	c.name = name
5273	return c
5274}
5275
5276// Fields allows partial responses to be retrieved. See
5277// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5278// for more information.
5279func (c *BillingAccountsLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsDeleteCall {
5280	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5281	return c
5282}
5283
5284// Context sets the context to be used in this call's Do method. Any
5285// pending HTTP request will be aborted if the provided context is
5286// canceled.
5287func (c *BillingAccountsLocationsBucketsDeleteCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsDeleteCall {
5288	c.ctx_ = ctx
5289	return c
5290}
5291
5292// Header returns an http.Header that can be modified by the caller to
5293// add HTTP headers to the request.
5294func (c *BillingAccountsLocationsBucketsDeleteCall) Header() http.Header {
5295	if c.header_ == nil {
5296		c.header_ = make(http.Header)
5297	}
5298	return c.header_
5299}
5300
5301func (c *BillingAccountsLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
5302	reqHeaders := make(http.Header)
5303	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
5304	for k, v := range c.header_ {
5305		reqHeaders[k] = v
5306	}
5307	reqHeaders.Set("User-Agent", c.s.userAgent())
5308	var body io.Reader = nil
5309	c.urlParams_.Set("alt", alt)
5310	c.urlParams_.Set("prettyPrint", "false")
5311	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
5312	urls += "?" + c.urlParams_.Encode()
5313	req, err := http.NewRequest("DELETE", urls, body)
5314	if err != nil {
5315		return nil, err
5316	}
5317	req.Header = reqHeaders
5318	googleapi.Expand(req.URL, map[string]string{
5319		"name": c.name,
5320	})
5321	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5322}
5323
5324// Do executes the "logging.billingAccounts.locations.buckets.delete" call.
5325// Exactly one of *Empty or error will be non-nil. Any non-2xx status
5326// code is an error. Response headers are in either
5327// *Empty.ServerResponse.Header or (if a response was returned at all)
5328// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5329// check whether the returned error was because http.StatusNotModified
5330// was returned.
5331func (c *BillingAccountsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
5332	gensupport.SetOptions(c.urlParams_, opts...)
5333	res, err := c.doRequest("json")
5334	if res != nil && res.StatusCode == http.StatusNotModified {
5335		if res.Body != nil {
5336			res.Body.Close()
5337		}
5338		return nil, &googleapi.Error{
5339			Code:   res.StatusCode,
5340			Header: res.Header,
5341		}
5342	}
5343	if err != nil {
5344		return nil, err
5345	}
5346	defer googleapi.CloseBody(res)
5347	if err := googleapi.CheckResponse(res); err != nil {
5348		return nil, err
5349	}
5350	ret := &Empty{
5351		ServerResponse: googleapi.ServerResponse{
5352			Header:         res.Header,
5353			HTTPStatusCode: res.StatusCode,
5354		},
5355	}
5356	target := &ret
5357	if err := gensupport.DecodeResponse(target, res); err != nil {
5358		return nil, err
5359	}
5360	return ret, nil
5361	// {
5362	//   "description": "Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.",
5363	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}",
5364	//   "httpMethod": "DELETE",
5365	//   "id": "logging.billingAccounts.locations.buckets.delete",
5366	//   "parameterOrder": [
5367	//     "name"
5368	//   ],
5369	//   "parameters": {
5370	//     "name": {
5371	//       "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]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"",
5372	//       "location": "path",
5373	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+$",
5374	//       "required": true,
5375	//       "type": "string"
5376	//     }
5377	//   },
5378	//   "path": "v2/{+name}",
5379	//   "response": {
5380	//     "$ref": "Empty"
5381	//   },
5382	//   "scopes": [
5383	//     "https://www.googleapis.com/auth/cloud-platform",
5384	//     "https://www.googleapis.com/auth/logging.admin"
5385	//   ]
5386	// }
5387
5388}
5389
5390// method id "logging.billingAccounts.locations.buckets.list":
5391
5392type BillingAccountsLocationsBucketsListCall struct {
5393	s            *Service
5394	parent       string
5395	urlParams_   gensupport.URLParams
5396	ifNoneMatch_ string
5397	ctx_         context.Context
5398	header_      http.Header
5399}
5400
5401// List: Lists log buckets.
5402//
5403// - parent: The parent resource whose buckets are to be listed:
5404//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
5405//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
5406//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
5407//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations
5408//   portion of the resource must be specified, but supplying the
5409//   character - in place of LOCATION_ID will return all buckets.
5410func (r *BillingAccountsLocationsBucketsService) List(parent string) *BillingAccountsLocationsBucketsListCall {
5411	c := &BillingAccountsLocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5412	c.parent = parent
5413	return c
5414}
5415
5416// PageSize sets the optional parameter "pageSize": The maximum number
5417// of results to return from this request. Non-positive values are
5418// ignored. The presence of nextPageToken in the response indicates that
5419// more results might be available.
5420func (c *BillingAccountsLocationsBucketsListCall) PageSize(pageSize int64) *BillingAccountsLocationsBucketsListCall {
5421	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5422	return c
5423}
5424
5425// PageToken sets the optional parameter "pageToken": If present, then
5426// retrieve the next batch of results from the preceding call to this
5427// method. pageToken must be the value of nextPageToken from the
5428// previous response. The values of other method parameters should be
5429// identical to those in the previous call.
5430func (c *BillingAccountsLocationsBucketsListCall) PageToken(pageToken string) *BillingAccountsLocationsBucketsListCall {
5431	c.urlParams_.Set("pageToken", pageToken)
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 *BillingAccountsLocationsBucketsListCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsListCall {
5439	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5440	return c
5441}
5442
5443// IfNoneMatch sets the optional parameter which makes the operation
5444// fail if the object's ETag matches the given value. This is useful for
5445// getting updates only after the object has changed since the last
5446// request. Use googleapi.IsNotModified to check whether the response
5447// error from Do is the result of In-None-Match.
5448func (c *BillingAccountsLocationsBucketsListCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsBucketsListCall {
5449	c.ifNoneMatch_ = entityTag
5450	return c
5451}
5452
5453// Context sets the context to be used in this call's Do method. Any
5454// pending HTTP request will be aborted if the provided context is
5455// canceled.
5456func (c *BillingAccountsLocationsBucketsListCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsListCall {
5457	c.ctx_ = ctx
5458	return c
5459}
5460
5461// Header returns an http.Header that can be modified by the caller to
5462// add HTTP headers to the request.
5463func (c *BillingAccountsLocationsBucketsListCall) Header() http.Header {
5464	if c.header_ == nil {
5465		c.header_ = make(http.Header)
5466	}
5467	return c.header_
5468}
5469
5470func (c *BillingAccountsLocationsBucketsListCall) doRequest(alt string) (*http.Response, error) {
5471	reqHeaders := make(http.Header)
5472	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
5473	for k, v := range c.header_ {
5474		reqHeaders[k] = v
5475	}
5476	reqHeaders.Set("User-Agent", c.s.userAgent())
5477	if c.ifNoneMatch_ != "" {
5478		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
5479	}
5480	var body io.Reader = nil
5481	c.urlParams_.Set("alt", alt)
5482	c.urlParams_.Set("prettyPrint", "false")
5483	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
5484	urls += "?" + c.urlParams_.Encode()
5485	req, err := http.NewRequest("GET", urls, body)
5486	if err != nil {
5487		return nil, err
5488	}
5489	req.Header = reqHeaders
5490	googleapi.Expand(req.URL, map[string]string{
5491		"parent": c.parent,
5492	})
5493	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5494}
5495
5496// Do executes the "logging.billingAccounts.locations.buckets.list" call.
5497// Exactly one of *ListBucketsResponse or error will be non-nil. Any
5498// non-2xx status code is an error. Response headers are in either
5499// *ListBucketsResponse.ServerResponse.Header or (if a response was
5500// returned at all) in error.(*googleapi.Error).Header. Use
5501// googleapi.IsNotModified to check whether the returned error was
5502// because http.StatusNotModified was returned.
5503func (c *BillingAccountsLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) {
5504	gensupport.SetOptions(c.urlParams_, opts...)
5505	res, err := c.doRequest("json")
5506	if res != nil && res.StatusCode == http.StatusNotModified {
5507		if res.Body != nil {
5508			res.Body.Close()
5509		}
5510		return nil, &googleapi.Error{
5511			Code:   res.StatusCode,
5512			Header: res.Header,
5513		}
5514	}
5515	if err != nil {
5516		return nil, err
5517	}
5518	defer googleapi.CloseBody(res)
5519	if err := googleapi.CheckResponse(res); err != nil {
5520		return nil, err
5521	}
5522	ret := &ListBucketsResponse{
5523		ServerResponse: googleapi.ServerResponse{
5524			Header:         res.Header,
5525			HTTPStatusCode: res.StatusCode,
5526		},
5527	}
5528	target := &ret
5529	if err := gensupport.DecodeResponse(target, res); err != nil {
5530		return nil, err
5531	}
5532	return ret, nil
5533	// {
5534	//   "description": "Lists log buckets.",
5535	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets",
5536	//   "httpMethod": "GET",
5537	//   "id": "logging.billingAccounts.locations.buckets.list",
5538	//   "parameterOrder": [
5539	//     "parent"
5540	//   ],
5541	//   "parameters": {
5542	//     "pageSize": {
5543	//       "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.",
5544	//       "format": "int32",
5545	//       "location": "query",
5546	//       "type": "integer"
5547	//     },
5548	//     "pageToken": {
5549	//       "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.",
5550	//       "location": "query",
5551	//       "type": "string"
5552	//     },
5553	//     "parent": {
5554	//       "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.",
5555	//       "location": "path",
5556	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+$",
5557	//       "required": true,
5558	//       "type": "string"
5559	//     }
5560	//   },
5561	//   "path": "v2/{+parent}/buckets",
5562	//   "response": {
5563	//     "$ref": "ListBucketsResponse"
5564	//   },
5565	//   "scopes": [
5566	//     "https://www.googleapis.com/auth/cloud-platform",
5567	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
5568	//     "https://www.googleapis.com/auth/logging.admin",
5569	//     "https://www.googleapis.com/auth/logging.read"
5570	//   ]
5571	// }
5572
5573}
5574
5575// Pages invokes f for each page of results.
5576// A non-nil error returned from f will halt the iteration.
5577// The provided context supersedes any context provided to the Context method.
5578func (c *BillingAccountsLocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error {
5579	c.ctx_ = ctx
5580	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
5581	for {
5582		x, err := c.Do()
5583		if err != nil {
5584			return err
5585		}
5586		if err := f(x); err != nil {
5587			return err
5588		}
5589		if x.NextPageToken == "" {
5590			return nil
5591		}
5592		c.PageToken(x.NextPageToken)
5593	}
5594}
5595
5596// method id "logging.billingAccounts.locations.buckets.patch":
5597
5598type BillingAccountsLocationsBucketsPatchCall struct {
5599	s          *Service
5600	name       string
5601	logbucket  *LogBucket
5602	urlParams_ gensupport.URLParams
5603	ctx_       context.Context
5604	header_    http.Header
5605}
5606
5607// Patch: Updates a log bucket. This method replaces the following
5608// fields in the existing bucket with values from the new bucket:
5609// retention_periodIf the retention period is decreased and the bucket
5610// is locked, FAILED_PRECONDITION will be returned.If the bucket has a
5611// lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be
5612// returned.After a bucket has been created, the bucket's location
5613// cannot be changed.
5614//
5615// - name: The full resource name of the bucket to update.
5616//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
5617//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
5618//   CKET_ID]"
5619//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
5620//   s/[BUCKET_ID]"
5621//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
5622//   For
5623//   example:"projects/my-project/locations/global/buckets/my-bucket".
5624func (r *BillingAccountsLocationsBucketsService) Patch(name string, logbucket *LogBucket) *BillingAccountsLocationsBucketsPatchCall {
5625	c := &BillingAccountsLocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5626	c.name = name
5627	c.logbucket = logbucket
5628	return c
5629}
5630
5631// UpdateMask sets the optional parameter "updateMask": Required. Field
5632// mask that specifies the fields in bucket that need an update. A
5633// bucket field will be overwritten if, and only if, it is in the update
5634// mask. name and output only fields cannot be updated.For a detailed
5635// FieldMask definition, see:
5636// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor
5637// example: updateMask=retention_days
5638func (c *BillingAccountsLocationsBucketsPatchCall) UpdateMask(updateMask string) *BillingAccountsLocationsBucketsPatchCall {
5639	c.urlParams_.Set("updateMask", updateMask)
5640	return c
5641}
5642
5643// Fields allows partial responses to be retrieved. See
5644// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5645// for more information.
5646func (c *BillingAccountsLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsPatchCall {
5647	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5648	return c
5649}
5650
5651// Context sets the context to be used in this call's Do method. Any
5652// pending HTTP request will be aborted if the provided context is
5653// canceled.
5654func (c *BillingAccountsLocationsBucketsPatchCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsPatchCall {
5655	c.ctx_ = ctx
5656	return c
5657}
5658
5659// Header returns an http.Header that can be modified by the caller to
5660// add HTTP headers to the request.
5661func (c *BillingAccountsLocationsBucketsPatchCall) Header() http.Header {
5662	if c.header_ == nil {
5663		c.header_ = make(http.Header)
5664	}
5665	return c.header_
5666}
5667
5668func (c *BillingAccountsLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
5669	reqHeaders := make(http.Header)
5670	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
5671	for k, v := range c.header_ {
5672		reqHeaders[k] = v
5673	}
5674	reqHeaders.Set("User-Agent", c.s.userAgent())
5675	var body io.Reader = nil
5676	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
5677	if err != nil {
5678		return nil, err
5679	}
5680	reqHeaders.Set("Content-Type", "application/json")
5681	c.urlParams_.Set("alt", alt)
5682	c.urlParams_.Set("prettyPrint", "false")
5683	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
5684	urls += "?" + c.urlParams_.Encode()
5685	req, err := http.NewRequest("PATCH", urls, body)
5686	if err != nil {
5687		return nil, err
5688	}
5689	req.Header = reqHeaders
5690	googleapi.Expand(req.URL, map[string]string{
5691		"name": c.name,
5692	})
5693	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5694}
5695
5696// Do executes the "logging.billingAccounts.locations.buckets.patch" call.
5697// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
5698// status code is an error. Response headers are in either
5699// *LogBucket.ServerResponse.Header or (if a response was returned at
5700// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
5701// to check whether the returned error was because
5702// http.StatusNotModified was returned.
5703func (c *BillingAccountsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
5704	gensupport.SetOptions(c.urlParams_, opts...)
5705	res, err := c.doRequest("json")
5706	if res != nil && res.StatusCode == http.StatusNotModified {
5707		if res.Body != nil {
5708			res.Body.Close()
5709		}
5710		return nil, &googleapi.Error{
5711			Code:   res.StatusCode,
5712			Header: res.Header,
5713		}
5714	}
5715	if err != nil {
5716		return nil, err
5717	}
5718	defer googleapi.CloseBody(res)
5719	if err := googleapi.CheckResponse(res); err != nil {
5720		return nil, err
5721	}
5722	ret := &LogBucket{
5723		ServerResponse: googleapi.ServerResponse{
5724			Header:         res.Header,
5725			HTTPStatusCode: res.StatusCode,
5726		},
5727	}
5728	target := &ret
5729	if err := gensupport.DecodeResponse(target, res); err != nil {
5730		return nil, err
5731	}
5732	return ret, nil
5733	// {
5734	//   "description": "Updates a log 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 lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.",
5735	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}",
5736	//   "httpMethod": "PATCH",
5737	//   "id": "logging.billingAccounts.locations.buckets.patch",
5738	//   "parameterOrder": [
5739	//     "name"
5740	//   ],
5741	//   "parameters": {
5742	//     "name": {
5743	//       "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]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"",
5744	//       "location": "path",
5745	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+$",
5746	//       "required": true,
5747	//       "type": "string"
5748	//     },
5749	//     "updateMask": {
5750	//       "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.FieldMaskFor example: updateMask=retention_days",
5751	//       "format": "google-fieldmask",
5752	//       "location": "query",
5753	//       "type": "string"
5754	//     }
5755	//   },
5756	//   "path": "v2/{+name}",
5757	//   "request": {
5758	//     "$ref": "LogBucket"
5759	//   },
5760	//   "response": {
5761	//     "$ref": "LogBucket"
5762	//   },
5763	//   "scopes": [
5764	//     "https://www.googleapis.com/auth/cloud-platform",
5765	//     "https://www.googleapis.com/auth/logging.admin"
5766	//   ]
5767	// }
5768
5769}
5770
5771// method id "logging.billingAccounts.locations.buckets.undelete":
5772
5773type BillingAccountsLocationsBucketsUndeleteCall struct {
5774	s                     *Service
5775	name                  string
5776	undeletebucketrequest *UndeleteBucketRequest
5777	urlParams_            gensupport.URLParams
5778	ctx_                  context.Context
5779	header_               http.Header
5780}
5781
5782// Undelete: Undeletes a log bucket. A bucket that has been deleted can
5783// be undeleted within the grace period of 7 days.
5784//
5785// - name: The full resource name of the bucket to undelete.
5786//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
5787//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
5788//   CKET_ID]"
5789//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
5790//   s/[BUCKET_ID]"
5791//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
5792//   For
5793//   example:"projects/my-project/locations/global/buckets/my-bucket".
5794func (r *BillingAccountsLocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *BillingAccountsLocationsBucketsUndeleteCall {
5795	c := &BillingAccountsLocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5796	c.name = name
5797	c.undeletebucketrequest = undeletebucketrequest
5798	return c
5799}
5800
5801// Fields allows partial responses to be retrieved. See
5802// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5803// for more information.
5804func (c *BillingAccountsLocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsUndeleteCall {
5805	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5806	return c
5807}
5808
5809// Context sets the context to be used in this call's Do method. Any
5810// pending HTTP request will be aborted if the provided context is
5811// canceled.
5812func (c *BillingAccountsLocationsBucketsUndeleteCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsUndeleteCall {
5813	c.ctx_ = ctx
5814	return c
5815}
5816
5817// Header returns an http.Header that can be modified by the caller to
5818// add HTTP headers to the request.
5819func (c *BillingAccountsLocationsBucketsUndeleteCall) Header() http.Header {
5820	if c.header_ == nil {
5821		c.header_ = make(http.Header)
5822	}
5823	return c.header_
5824}
5825
5826func (c *BillingAccountsLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) {
5827	reqHeaders := make(http.Header)
5828	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
5829	for k, v := range c.header_ {
5830		reqHeaders[k] = v
5831	}
5832	reqHeaders.Set("User-Agent", c.s.userAgent())
5833	var body io.Reader = nil
5834	body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest)
5835	if err != nil {
5836		return nil, err
5837	}
5838	reqHeaders.Set("Content-Type", "application/json")
5839	c.urlParams_.Set("alt", alt)
5840	c.urlParams_.Set("prettyPrint", "false")
5841	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete")
5842	urls += "?" + c.urlParams_.Encode()
5843	req, err := http.NewRequest("POST", urls, body)
5844	if err != nil {
5845		return nil, err
5846	}
5847	req.Header = reqHeaders
5848	googleapi.Expand(req.URL, map[string]string{
5849		"name": c.name,
5850	})
5851	return gensupport.SendRequest(c.ctx_, c.s.client, req)
5852}
5853
5854// Do executes the "logging.billingAccounts.locations.buckets.undelete" call.
5855// Exactly one of *Empty or error will be non-nil. Any non-2xx status
5856// code is an error. Response headers are in either
5857// *Empty.ServerResponse.Header or (if a response was returned at all)
5858// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
5859// check whether the returned error was because http.StatusNotModified
5860// was returned.
5861func (c *BillingAccountsLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
5862	gensupport.SetOptions(c.urlParams_, opts...)
5863	res, err := c.doRequest("json")
5864	if res != nil && res.StatusCode == http.StatusNotModified {
5865		if res.Body != nil {
5866			res.Body.Close()
5867		}
5868		return nil, &googleapi.Error{
5869			Code:   res.StatusCode,
5870			Header: res.Header,
5871		}
5872	}
5873	if err != nil {
5874		return nil, err
5875	}
5876	defer googleapi.CloseBody(res)
5877	if err := googleapi.CheckResponse(res); err != nil {
5878		return nil, err
5879	}
5880	ret := &Empty{
5881		ServerResponse: googleapi.ServerResponse{
5882			Header:         res.Header,
5883			HTTPStatusCode: res.StatusCode,
5884		},
5885	}
5886	target := &ret
5887	if err := gensupport.DecodeResponse(target, res); err != nil {
5888		return nil, err
5889	}
5890	return ret, nil
5891	// {
5892	//   "description": "Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.",
5893	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}:undelete",
5894	//   "httpMethod": "POST",
5895	//   "id": "logging.billingAccounts.locations.buckets.undelete",
5896	//   "parameterOrder": [
5897	//     "name"
5898	//   ],
5899	//   "parameters": {
5900	//     "name": {
5901	//       "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]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"",
5902	//       "location": "path",
5903	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+$",
5904	//       "required": true,
5905	//       "type": "string"
5906	//     }
5907	//   },
5908	//   "path": "v2/{+name}:undelete",
5909	//   "request": {
5910	//     "$ref": "UndeleteBucketRequest"
5911	//   },
5912	//   "response": {
5913	//     "$ref": "Empty"
5914	//   },
5915	//   "scopes": [
5916	//     "https://www.googleapis.com/auth/cloud-platform",
5917	//     "https://www.googleapis.com/auth/logging.admin"
5918	//   ]
5919	// }
5920
5921}
5922
5923// method id "logging.billingAccounts.locations.buckets.views.create":
5924
5925type BillingAccountsLocationsBucketsViewsCreateCall struct {
5926	s          *Service
5927	parent     string
5928	logview    *LogView
5929	urlParams_ gensupport.URLParams
5930	ctx_       context.Context
5931	header_    http.Header
5932}
5933
5934// Create: Creates a view over log entries in a log bucket. A bucket may
5935// contain a maximum of 30 views.
5936//
5937// - parent: The bucket in which to create the view
5938//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
5939//   ` For
5940//   example:"projects/my-project/locations/global/buckets/my-bucket".
5941func (r *BillingAccountsLocationsBucketsViewsService) Create(parent string, logview *LogView) *BillingAccountsLocationsBucketsViewsCreateCall {
5942	c := &BillingAccountsLocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
5943	c.parent = parent
5944	c.logview = logview
5945	return c
5946}
5947
5948// ViewId sets the optional parameter "viewId": Required. The id to use
5949// for this view.
5950func (c *BillingAccountsLocationsBucketsViewsCreateCall) ViewId(viewId string) *BillingAccountsLocationsBucketsViewsCreateCall {
5951	c.urlParams_.Set("viewId", viewId)
5952	return c
5953}
5954
5955// Fields allows partial responses to be retrieved. See
5956// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
5957// for more information.
5958func (c *BillingAccountsLocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsCreateCall {
5959	c.urlParams_.Set("fields", googleapi.CombineFields(s))
5960	return c
5961}
5962
5963// Context sets the context to be used in this call's Do method. Any
5964// pending HTTP request will be aborted if the provided context is
5965// canceled.
5966func (c *BillingAccountsLocationsBucketsViewsCreateCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsCreateCall {
5967	c.ctx_ = ctx
5968	return c
5969}
5970
5971// Header returns an http.Header that can be modified by the caller to
5972// add HTTP headers to the request.
5973func (c *BillingAccountsLocationsBucketsViewsCreateCall) Header() http.Header {
5974	if c.header_ == nil {
5975		c.header_ = make(http.Header)
5976	}
5977	return c.header_
5978}
5979
5980func (c *BillingAccountsLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) {
5981	reqHeaders := make(http.Header)
5982	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
5983	for k, v := range c.header_ {
5984		reqHeaders[k] = v
5985	}
5986	reqHeaders.Set("User-Agent", c.s.userAgent())
5987	var body io.Reader = nil
5988	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
5989	if err != nil {
5990		return nil, err
5991	}
5992	reqHeaders.Set("Content-Type", "application/json")
5993	c.urlParams_.Set("alt", alt)
5994	c.urlParams_.Set("prettyPrint", "false")
5995	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
5996	urls += "?" + c.urlParams_.Encode()
5997	req, err := http.NewRequest("POST", urls, body)
5998	if err != nil {
5999		return nil, err
6000	}
6001	req.Header = reqHeaders
6002	googleapi.Expand(req.URL, map[string]string{
6003		"parent": c.parent,
6004	})
6005	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6006}
6007
6008// Do executes the "logging.billingAccounts.locations.buckets.views.create" call.
6009// Exactly one of *LogView or error will be non-nil. Any non-2xx status
6010// code is an error. Response headers are in either
6011// *LogView.ServerResponse.Header or (if a response was returned at all)
6012// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
6013// check whether the returned error was because http.StatusNotModified
6014// was returned.
6015func (c *BillingAccountsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
6016	gensupport.SetOptions(c.urlParams_, opts...)
6017	res, err := c.doRequest("json")
6018	if res != nil && res.StatusCode == http.StatusNotModified {
6019		if res.Body != nil {
6020			res.Body.Close()
6021		}
6022		return nil, &googleapi.Error{
6023			Code:   res.StatusCode,
6024			Header: res.Header,
6025		}
6026	}
6027	if err != nil {
6028		return nil, err
6029	}
6030	defer googleapi.CloseBody(res)
6031	if err := googleapi.CheckResponse(res); err != nil {
6032		return nil, err
6033	}
6034	ret := &LogView{
6035		ServerResponse: googleapi.ServerResponse{
6036			Header:         res.Header,
6037			HTTPStatusCode: res.StatusCode,
6038		},
6039	}
6040	target := &ret
6041	if err := gensupport.DecodeResponse(target, res); err != nil {
6042		return nil, err
6043	}
6044	return ret, nil
6045	// {
6046	//   "description": "Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.",
6047	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views",
6048	//   "httpMethod": "POST",
6049	//   "id": "logging.billingAccounts.locations.buckets.views.create",
6050	//   "parameterOrder": [
6051	//     "parent"
6052	//   ],
6053	//   "parameters": {
6054	//     "parent": {
6055	//       "description": "Required. The bucket in which to create the view `\"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\"` For example:\"projects/my-project/locations/global/buckets/my-bucket\"",
6056	//       "location": "path",
6057	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+$",
6058	//       "required": true,
6059	//       "type": "string"
6060	//     },
6061	//     "viewId": {
6062	//       "description": "Required. The id to use for this view.",
6063	//       "location": "query",
6064	//       "type": "string"
6065	//     }
6066	//   },
6067	//   "path": "v2/{+parent}/views",
6068	//   "request": {
6069	//     "$ref": "LogView"
6070	//   },
6071	//   "response": {
6072	//     "$ref": "LogView"
6073	//   },
6074	//   "scopes": [
6075	//     "https://www.googleapis.com/auth/cloud-platform",
6076	//     "https://www.googleapis.com/auth/logging.admin"
6077	//   ]
6078	// }
6079
6080}
6081
6082// method id "logging.billingAccounts.locations.buckets.views.delete":
6083
6084type BillingAccountsLocationsBucketsViewsDeleteCall struct {
6085	s          *Service
6086	name       string
6087	urlParams_ gensupport.URLParams
6088	ctx_       context.Context
6089	header_    http.Header
6090}
6091
6092// Delete: Deletes a view on a log bucket. If an UNAVAILABLE error is
6093// returned, this indicates that system is not in a state where it can
6094// delete the view. If this occurs, please try again in a few minutes.
6095//
6096// - name: The full resource name of the view to delete:
6097//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
6098//   iews/[VIEW_ID]" For
6099//   example:"projects/my-project/locations/global/buckets/my-bucket/view
6100//   s/my-view".
6101func (r *BillingAccountsLocationsBucketsViewsService) Delete(name string) *BillingAccountsLocationsBucketsViewsDeleteCall {
6102	c := &BillingAccountsLocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6103	c.name = name
6104	return c
6105}
6106
6107// Fields allows partial responses to be retrieved. See
6108// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6109// for more information.
6110func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsDeleteCall {
6111	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6112	return c
6113}
6114
6115// Context sets the context to be used in this call's Do method. Any
6116// pending HTTP request will be aborted if the provided context is
6117// canceled.
6118func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsDeleteCall {
6119	c.ctx_ = ctx
6120	return c
6121}
6122
6123// Header returns an http.Header that can be modified by the caller to
6124// add HTTP headers to the request.
6125func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Header() http.Header {
6126	if c.header_ == nil {
6127		c.header_ = make(http.Header)
6128	}
6129	return c.header_
6130}
6131
6132func (c *BillingAccountsLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) {
6133	reqHeaders := make(http.Header)
6134	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
6135	for k, v := range c.header_ {
6136		reqHeaders[k] = v
6137	}
6138	reqHeaders.Set("User-Agent", c.s.userAgent())
6139	var body io.Reader = nil
6140	c.urlParams_.Set("alt", alt)
6141	c.urlParams_.Set("prettyPrint", "false")
6142	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
6143	urls += "?" + c.urlParams_.Encode()
6144	req, err := http.NewRequest("DELETE", urls, body)
6145	if err != nil {
6146		return nil, err
6147	}
6148	req.Header = reqHeaders
6149	googleapi.Expand(req.URL, map[string]string{
6150		"name": c.name,
6151	})
6152	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6153}
6154
6155// Do executes the "logging.billingAccounts.locations.buckets.views.delete" call.
6156// Exactly one of *Empty or error will be non-nil. Any non-2xx status
6157// code is an error. Response headers are in either
6158// *Empty.ServerResponse.Header or (if a response was returned at all)
6159// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
6160// check whether the returned error was because http.StatusNotModified
6161// was returned.
6162func (c *BillingAccountsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
6163	gensupport.SetOptions(c.urlParams_, opts...)
6164	res, err := c.doRequest("json")
6165	if res != nil && res.StatusCode == http.StatusNotModified {
6166		if res.Body != nil {
6167			res.Body.Close()
6168		}
6169		return nil, &googleapi.Error{
6170			Code:   res.StatusCode,
6171			Header: res.Header,
6172		}
6173	}
6174	if err != nil {
6175		return nil, err
6176	}
6177	defer googleapi.CloseBody(res)
6178	if err := googleapi.CheckResponse(res); err != nil {
6179		return nil, err
6180	}
6181	ret := &Empty{
6182		ServerResponse: googleapi.ServerResponse{
6183			Header:         res.Header,
6184			HTTPStatusCode: res.StatusCode,
6185		},
6186	}
6187	target := &ret
6188	if err := gensupport.DecodeResponse(target, res); err != nil {
6189		return nil, err
6190	}
6191	return ret, nil
6192	// {
6193	//   "description": "Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.",
6194	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
6195	//   "httpMethod": "DELETE",
6196	//   "id": "logging.billingAccounts.locations.buckets.views.delete",
6197	//   "parameterOrder": [
6198	//     "name"
6199	//   ],
6200	//   "parameters": {
6201	//     "name": {
6202	//       "description": "Required. The full resource name of the view to delete: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"",
6203	//       "location": "path",
6204	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
6205	//       "required": true,
6206	//       "type": "string"
6207	//     }
6208	//   },
6209	//   "path": "v2/{+name}",
6210	//   "response": {
6211	//     "$ref": "Empty"
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.locations.buckets.views.list":
6222
6223type BillingAccountsLocationsBucketsViewsListCall struct {
6224	s            *Service
6225	parent       string
6226	urlParams_   gensupport.URLParams
6227	ifNoneMatch_ string
6228	ctx_         context.Context
6229	header_      http.Header
6230}
6231
6232// List: Lists views on a log bucket.
6233//
6234// - parent: The bucket whose views are to be listed:
6235//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]".
6236func (r *BillingAccountsLocationsBucketsViewsService) List(parent string) *BillingAccountsLocationsBucketsViewsListCall {
6237	c := &BillingAccountsLocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6238	c.parent = parent
6239	return c
6240}
6241
6242// PageSize sets the optional parameter "pageSize": The maximum number
6243// of results to return from this request.Non-positive values are
6244// ignored. The presence of nextPageToken in the response indicates that
6245// more results might be available.
6246func (c *BillingAccountsLocationsBucketsViewsListCall) PageSize(pageSize int64) *BillingAccountsLocationsBucketsViewsListCall {
6247	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
6248	return c
6249}
6250
6251// PageToken sets the optional parameter "pageToken": If present, then
6252// retrieve the next batch of results from the preceding call to this
6253// method. pageToken must be the value of nextPageToken from the
6254// previous response. The values of other method parameters should be
6255// identical to those in the previous call.
6256func (c *BillingAccountsLocationsBucketsViewsListCall) PageToken(pageToken string) *BillingAccountsLocationsBucketsViewsListCall {
6257	c.urlParams_.Set("pageToken", pageToken)
6258	return c
6259}
6260
6261// Fields allows partial responses to be retrieved. See
6262// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6263// for more information.
6264func (c *BillingAccountsLocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsListCall {
6265	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6266	return c
6267}
6268
6269// IfNoneMatch sets the optional parameter which makes the operation
6270// fail if the object's ETag matches the given value. This is useful for
6271// getting updates only after the object has changed since the last
6272// request. Use googleapi.IsNotModified to check whether the response
6273// error from Do is the result of In-None-Match.
6274func (c *BillingAccountsLocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsBucketsViewsListCall {
6275	c.ifNoneMatch_ = entityTag
6276	return c
6277}
6278
6279// Context sets the context to be used in this call's Do method. Any
6280// pending HTTP request will be aborted if the provided context is
6281// canceled.
6282func (c *BillingAccountsLocationsBucketsViewsListCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsListCall {
6283	c.ctx_ = ctx
6284	return c
6285}
6286
6287// Header returns an http.Header that can be modified by the caller to
6288// add HTTP headers to the request.
6289func (c *BillingAccountsLocationsBucketsViewsListCall) Header() http.Header {
6290	if c.header_ == nil {
6291		c.header_ = make(http.Header)
6292	}
6293	return c.header_
6294}
6295
6296func (c *BillingAccountsLocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) {
6297	reqHeaders := make(http.Header)
6298	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
6299	for k, v := range c.header_ {
6300		reqHeaders[k] = v
6301	}
6302	reqHeaders.Set("User-Agent", c.s.userAgent())
6303	if c.ifNoneMatch_ != "" {
6304		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6305	}
6306	var body io.Reader = nil
6307	c.urlParams_.Set("alt", alt)
6308	c.urlParams_.Set("prettyPrint", "false")
6309	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
6310	urls += "?" + c.urlParams_.Encode()
6311	req, err := http.NewRequest("GET", urls, body)
6312	if err != nil {
6313		return nil, err
6314	}
6315	req.Header = reqHeaders
6316	googleapi.Expand(req.URL, map[string]string{
6317		"parent": c.parent,
6318	})
6319	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6320}
6321
6322// Do executes the "logging.billingAccounts.locations.buckets.views.list" call.
6323// Exactly one of *ListViewsResponse or error will be non-nil. Any
6324// non-2xx status code is an error. Response headers are in either
6325// *ListViewsResponse.ServerResponse.Header or (if a response was
6326// returned at all) in error.(*googleapi.Error).Header. Use
6327// googleapi.IsNotModified to check whether the returned error was
6328// because http.StatusNotModified was returned.
6329func (c *BillingAccountsLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) {
6330	gensupport.SetOptions(c.urlParams_, opts...)
6331	res, err := c.doRequest("json")
6332	if res != nil && res.StatusCode == http.StatusNotModified {
6333		if res.Body != nil {
6334			res.Body.Close()
6335		}
6336		return nil, &googleapi.Error{
6337			Code:   res.StatusCode,
6338			Header: res.Header,
6339		}
6340	}
6341	if err != nil {
6342		return nil, err
6343	}
6344	defer googleapi.CloseBody(res)
6345	if err := googleapi.CheckResponse(res); err != nil {
6346		return nil, err
6347	}
6348	ret := &ListViewsResponse{
6349		ServerResponse: googleapi.ServerResponse{
6350			Header:         res.Header,
6351			HTTPStatusCode: res.StatusCode,
6352		},
6353	}
6354	target := &ret
6355	if err := gensupport.DecodeResponse(target, res); err != nil {
6356		return nil, err
6357	}
6358	return ret, nil
6359	// {
6360	//   "description": "Lists views on a log bucket.",
6361	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views",
6362	//   "httpMethod": "GET",
6363	//   "id": "logging.billingAccounts.locations.buckets.views.list",
6364	//   "parameterOrder": [
6365	//     "parent"
6366	//   ],
6367	//   "parameters": {
6368	//     "pageSize": {
6369	//       "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.",
6370	//       "format": "int32",
6371	//       "location": "query",
6372	//       "type": "integer"
6373	//     },
6374	//     "pageToken": {
6375	//       "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.",
6376	//       "location": "query",
6377	//       "type": "string"
6378	//     },
6379	//     "parent": {
6380	//       "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ",
6381	//       "location": "path",
6382	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+$",
6383	//       "required": true,
6384	//       "type": "string"
6385	//     }
6386	//   },
6387	//   "path": "v2/{+parent}/views",
6388	//   "response": {
6389	//     "$ref": "ListViewsResponse"
6390	//   },
6391	//   "scopes": [
6392	//     "https://www.googleapis.com/auth/cloud-platform",
6393	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
6394	//     "https://www.googleapis.com/auth/logging.admin",
6395	//     "https://www.googleapis.com/auth/logging.read"
6396	//   ]
6397	// }
6398
6399}
6400
6401// Pages invokes f for each page of results.
6402// A non-nil error returned from f will halt the iteration.
6403// The provided context supersedes any context provided to the Context method.
6404func (c *BillingAccountsLocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error {
6405	c.ctx_ = ctx
6406	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
6407	for {
6408		x, err := c.Do()
6409		if err != nil {
6410			return err
6411		}
6412		if err := f(x); err != nil {
6413			return err
6414		}
6415		if x.NextPageToken == "" {
6416			return nil
6417		}
6418		c.PageToken(x.NextPageToken)
6419	}
6420}
6421
6422// method id "logging.billingAccounts.locations.buckets.views.patch":
6423
6424type BillingAccountsLocationsBucketsViewsPatchCall struct {
6425	s          *Service
6426	name       string
6427	logview    *LogView
6428	urlParams_ gensupport.URLParams
6429	ctx_       context.Context
6430	header_    http.Header
6431}
6432
6433// Patch: Updates a view on a log bucket. This method replaces the
6434// following fields in the existing view with values from the new view:
6435// filter. If an UNAVAILABLE error is returned, this indicates that
6436// system is not in a state where it can update the view. If this
6437// occurs, please try again in a few minutes.
6438//
6439// - name: The full resource name of the view to update
6440//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
6441//   iews/[VIEW_ID]" For
6442//   example:"projects/my-project/locations/global/buckets/my-bucket/view
6443//   s/my-view".
6444func (r *BillingAccountsLocationsBucketsViewsService) Patch(name string, logview *LogView) *BillingAccountsLocationsBucketsViewsPatchCall {
6445	c := &BillingAccountsLocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6446	c.name = name
6447	c.logview = logview
6448	return c
6449}
6450
6451// UpdateMask sets the optional parameter "updateMask": Field mask that
6452// specifies the fields in view that need an update. A field will be
6453// overwritten if, and only if, it is in the update mask. name and
6454// output only fields cannot be updated.For a detailed FieldMask
6455// definition, see
6456// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor
6457// example: updateMask=filter
6458func (c *BillingAccountsLocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *BillingAccountsLocationsBucketsViewsPatchCall {
6459	c.urlParams_.Set("updateMask", updateMask)
6460	return c
6461}
6462
6463// Fields allows partial responses to be retrieved. See
6464// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6465// for more information.
6466func (c *BillingAccountsLocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsBucketsViewsPatchCall {
6467	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6468	return c
6469}
6470
6471// Context sets the context to be used in this call's Do method. Any
6472// pending HTTP request will be aborted if the provided context is
6473// canceled.
6474func (c *BillingAccountsLocationsBucketsViewsPatchCall) Context(ctx context.Context) *BillingAccountsLocationsBucketsViewsPatchCall {
6475	c.ctx_ = ctx
6476	return c
6477}
6478
6479// Header returns an http.Header that can be modified by the caller to
6480// add HTTP headers to the request.
6481func (c *BillingAccountsLocationsBucketsViewsPatchCall) Header() http.Header {
6482	if c.header_ == nil {
6483		c.header_ = make(http.Header)
6484	}
6485	return c.header_
6486}
6487
6488func (c *BillingAccountsLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) {
6489	reqHeaders := make(http.Header)
6490	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
6491	for k, v := range c.header_ {
6492		reqHeaders[k] = v
6493	}
6494	reqHeaders.Set("User-Agent", c.s.userAgent())
6495	var body io.Reader = nil
6496	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
6497	if err != nil {
6498		return nil, err
6499	}
6500	reqHeaders.Set("Content-Type", "application/json")
6501	c.urlParams_.Set("alt", alt)
6502	c.urlParams_.Set("prettyPrint", "false")
6503	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
6504	urls += "?" + c.urlParams_.Encode()
6505	req, err := http.NewRequest("PATCH", urls, body)
6506	if err != nil {
6507		return nil, err
6508	}
6509	req.Header = reqHeaders
6510	googleapi.Expand(req.URL, map[string]string{
6511		"name": c.name,
6512	})
6513	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6514}
6515
6516// Do executes the "logging.billingAccounts.locations.buckets.views.patch" call.
6517// Exactly one of *LogView or error will be non-nil. Any non-2xx status
6518// code is an error. Response headers are in either
6519// *LogView.ServerResponse.Header or (if a response was returned at all)
6520// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
6521// check whether the returned error was because http.StatusNotModified
6522// was returned.
6523func (c *BillingAccountsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
6524	gensupport.SetOptions(c.urlParams_, opts...)
6525	res, err := c.doRequest("json")
6526	if res != nil && res.StatusCode == http.StatusNotModified {
6527		if res.Body != nil {
6528			res.Body.Close()
6529		}
6530		return nil, &googleapi.Error{
6531			Code:   res.StatusCode,
6532			Header: res.Header,
6533		}
6534	}
6535	if err != nil {
6536		return nil, err
6537	}
6538	defer googleapi.CloseBody(res)
6539	if err := googleapi.CheckResponse(res); err != nil {
6540		return nil, err
6541	}
6542	ret := &LogView{
6543		ServerResponse: googleapi.ServerResponse{
6544			Header:         res.Header,
6545			HTTPStatusCode: res.StatusCode,
6546		},
6547	}
6548	target := &ret
6549	if err := gensupport.DecodeResponse(target, res); err != nil {
6550		return nil, err
6551	}
6552	return ret, nil
6553	// {
6554	//   "description": "Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: filter. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.",
6555	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
6556	//   "httpMethod": "PATCH",
6557	//   "id": "logging.billingAccounts.locations.buckets.views.patch",
6558	//   "parameterOrder": [
6559	//     "name"
6560	//   ],
6561	//   "parameters": {
6562	//     "name": {
6563	//       "description": "Required. The full resource name of the view to update \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"",
6564	//       "location": "path",
6565	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
6566	//       "required": true,
6567	//       "type": "string"
6568	//     },
6569	//     "updateMask": {
6570	//       "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.FieldMaskFor example: updateMask=filter",
6571	//       "format": "google-fieldmask",
6572	//       "location": "query",
6573	//       "type": "string"
6574	//     }
6575	//   },
6576	//   "path": "v2/{+name}",
6577	//   "request": {
6578	//     "$ref": "LogView"
6579	//   },
6580	//   "response": {
6581	//     "$ref": "LogView"
6582	//   },
6583	//   "scopes": [
6584	//     "https://www.googleapis.com/auth/cloud-platform",
6585	//     "https://www.googleapis.com/auth/logging.admin"
6586	//   ]
6587	// }
6588
6589}
6590
6591// method id "logging.billingAccounts.locations.operations.cancel":
6592
6593type BillingAccountsLocationsOperationsCancelCall struct {
6594	s                      *Service
6595	name                   string
6596	canceloperationrequest *CancelOperationRequest
6597	urlParams_             gensupport.URLParams
6598	ctx_                   context.Context
6599	header_                http.Header
6600}
6601
6602// Cancel: Starts asynchronous cancellation on a long-running operation.
6603// The server makes a best effort to cancel the operation, but success
6604// is not guaranteed. If the server doesn't support this method, it
6605// returns google.rpc.Code.UNIMPLEMENTED. Clients can use
6606// Operations.GetOperation or other methods to check whether the
6607// cancellation succeeded or whether the operation completed despite
6608// cancellation. On successful cancellation, the operation is not
6609// deleted; instead, it becomes an operation with an Operation.error
6610// value with a google.rpc.Status.code of 1, corresponding to
6611// Code.CANCELLED.
6612//
6613// - name: The name of the operation resource to be cancelled.
6614func (r *BillingAccountsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *BillingAccountsLocationsOperationsCancelCall {
6615	c := &BillingAccountsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6616	c.name = name
6617	c.canceloperationrequest = canceloperationrequest
6618	return c
6619}
6620
6621// Fields allows partial responses to be retrieved. See
6622// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6623// for more information.
6624func (c *BillingAccountsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsOperationsCancelCall {
6625	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6626	return c
6627}
6628
6629// Context sets the context to be used in this call's Do method. Any
6630// pending HTTP request will be aborted if the provided context is
6631// canceled.
6632func (c *BillingAccountsLocationsOperationsCancelCall) Context(ctx context.Context) *BillingAccountsLocationsOperationsCancelCall {
6633	c.ctx_ = ctx
6634	return c
6635}
6636
6637// Header returns an http.Header that can be modified by the caller to
6638// add HTTP headers to the request.
6639func (c *BillingAccountsLocationsOperationsCancelCall) Header() http.Header {
6640	if c.header_ == nil {
6641		c.header_ = make(http.Header)
6642	}
6643	return c.header_
6644}
6645
6646func (c *BillingAccountsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
6647	reqHeaders := make(http.Header)
6648	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
6649	for k, v := range c.header_ {
6650		reqHeaders[k] = v
6651	}
6652	reqHeaders.Set("User-Agent", c.s.userAgent())
6653	var body io.Reader = nil
6654	body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
6655	if err != nil {
6656		return nil, err
6657	}
6658	reqHeaders.Set("Content-Type", "application/json")
6659	c.urlParams_.Set("alt", alt)
6660	c.urlParams_.Set("prettyPrint", "false")
6661	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel")
6662	urls += "?" + c.urlParams_.Encode()
6663	req, err := http.NewRequest("POST", urls, body)
6664	if err != nil {
6665		return nil, err
6666	}
6667	req.Header = reqHeaders
6668	googleapi.Expand(req.URL, map[string]string{
6669		"name": c.name,
6670	})
6671	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6672}
6673
6674// Do executes the "logging.billingAccounts.locations.operations.cancel" call.
6675// Exactly one of *Empty or error will be non-nil. Any non-2xx status
6676// code is an error. Response headers are in either
6677// *Empty.ServerResponse.Header or (if a response was returned at all)
6678// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
6679// check whether the returned error was because http.StatusNotModified
6680// was returned.
6681func (c *BillingAccountsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
6682	gensupport.SetOptions(c.urlParams_, opts...)
6683	res, err := c.doRequest("json")
6684	if res != nil && res.StatusCode == http.StatusNotModified {
6685		if res.Body != nil {
6686			res.Body.Close()
6687		}
6688		return nil, &googleapi.Error{
6689			Code:   res.StatusCode,
6690			Header: res.Header,
6691		}
6692	}
6693	if err != nil {
6694		return nil, err
6695	}
6696	defer googleapi.CloseBody(res)
6697	if err := googleapi.CheckResponse(res); err != nil {
6698		return nil, err
6699	}
6700	ret := &Empty{
6701		ServerResponse: googleapi.ServerResponse{
6702			Header:         res.Header,
6703			HTTPStatusCode: res.StatusCode,
6704		},
6705	}
6706	target := &ret
6707	if err := gensupport.DecodeResponse(target, res); err != nil {
6708		return nil, err
6709	}
6710	return ret, nil
6711	// {
6712	//   "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.",
6713	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/operations/{operationsId}:cancel",
6714	//   "httpMethod": "POST",
6715	//   "id": "logging.billingAccounts.locations.operations.cancel",
6716	//   "parameterOrder": [
6717	//     "name"
6718	//   ],
6719	//   "parameters": {
6720	//     "name": {
6721	//       "description": "The name of the operation resource to be cancelled.",
6722	//       "location": "path",
6723	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+/operations/[^/]+$",
6724	//       "required": true,
6725	//       "type": "string"
6726	//     }
6727	//   },
6728	//   "path": "v2/{+name}:cancel",
6729	//   "request": {
6730	//     "$ref": "CancelOperationRequest"
6731	//   },
6732	//   "response": {
6733	//     "$ref": "Empty"
6734	//   },
6735	//   "scopes": [
6736	//     "https://www.googleapis.com/auth/cloud-platform",
6737	//     "https://www.googleapis.com/auth/logging.admin"
6738	//   ]
6739	// }
6740
6741}
6742
6743// method id "logging.billingAccounts.locations.operations.list":
6744
6745type BillingAccountsLocationsOperationsListCall struct {
6746	s            *Service
6747	name         string
6748	urlParams_   gensupport.URLParams
6749	ifNoneMatch_ string
6750	ctx_         context.Context
6751	header_      http.Header
6752}
6753
6754// List: Lists operations that match the specified filter in the
6755// request. If the server doesn't support this method, it returns
6756// UNIMPLEMENTED.NOTE: the name binding allows API services to override
6757// the binding to use different resource name schemes, such as
6758// users/*/operations. To override the binding, API services can add a
6759// binding such as "/v1/{name=users/*}/operations" to their service
6760// configuration. For backwards compatibility, the default name includes
6761// the operations collection id, however overriding users must ensure
6762// the name binding is the parent resource, without the operations
6763// collection id.
6764//
6765// - name: The name of the operation's parent resource.
6766func (r *BillingAccountsLocationsOperationsService) List(name string) *BillingAccountsLocationsOperationsListCall {
6767	c := &BillingAccountsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6768	c.name = name
6769	return c
6770}
6771
6772// Filter sets the optional parameter "filter": The standard list
6773// filter.
6774func (c *BillingAccountsLocationsOperationsListCall) Filter(filter string) *BillingAccountsLocationsOperationsListCall {
6775	c.urlParams_.Set("filter", filter)
6776	return c
6777}
6778
6779// PageSize sets the optional parameter "pageSize": The standard list
6780// page size.
6781func (c *BillingAccountsLocationsOperationsListCall) PageSize(pageSize int64) *BillingAccountsLocationsOperationsListCall {
6782	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
6783	return c
6784}
6785
6786// PageToken sets the optional parameter "pageToken": The standard list
6787// page token.
6788func (c *BillingAccountsLocationsOperationsListCall) PageToken(pageToken string) *BillingAccountsLocationsOperationsListCall {
6789	c.urlParams_.Set("pageToken", pageToken)
6790	return c
6791}
6792
6793// Fields allows partial responses to be retrieved. See
6794// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6795// for more information.
6796func (c *BillingAccountsLocationsOperationsListCall) Fields(s ...googleapi.Field) *BillingAccountsLocationsOperationsListCall {
6797	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6798	return c
6799}
6800
6801// IfNoneMatch sets the optional parameter which makes the operation
6802// fail if the object's ETag matches the given value. This is useful for
6803// getting updates only after the object has changed since the last
6804// request. Use googleapi.IsNotModified to check whether the response
6805// error from Do is the result of In-None-Match.
6806func (c *BillingAccountsLocationsOperationsListCall) IfNoneMatch(entityTag string) *BillingAccountsLocationsOperationsListCall {
6807	c.ifNoneMatch_ = entityTag
6808	return c
6809}
6810
6811// Context sets the context to be used in this call's Do method. Any
6812// pending HTTP request will be aborted if the provided context is
6813// canceled.
6814func (c *BillingAccountsLocationsOperationsListCall) Context(ctx context.Context) *BillingAccountsLocationsOperationsListCall {
6815	c.ctx_ = ctx
6816	return c
6817}
6818
6819// Header returns an http.Header that can be modified by the caller to
6820// add HTTP headers to the request.
6821func (c *BillingAccountsLocationsOperationsListCall) Header() http.Header {
6822	if c.header_ == nil {
6823		c.header_ = make(http.Header)
6824	}
6825	return c.header_
6826}
6827
6828func (c *BillingAccountsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
6829	reqHeaders := make(http.Header)
6830	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
6831	for k, v := range c.header_ {
6832		reqHeaders[k] = v
6833	}
6834	reqHeaders.Set("User-Agent", c.s.userAgent())
6835	if c.ifNoneMatch_ != "" {
6836		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
6837	}
6838	var body io.Reader = nil
6839	c.urlParams_.Set("alt", alt)
6840	c.urlParams_.Set("prettyPrint", "false")
6841	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations")
6842	urls += "?" + c.urlParams_.Encode()
6843	req, err := http.NewRequest("GET", urls, body)
6844	if err != nil {
6845		return nil, err
6846	}
6847	req.Header = reqHeaders
6848	googleapi.Expand(req.URL, map[string]string{
6849		"name": c.name,
6850	})
6851	return gensupport.SendRequest(c.ctx_, c.s.client, req)
6852}
6853
6854// Do executes the "logging.billingAccounts.locations.operations.list" call.
6855// Exactly one of *ListOperationsResponse or error will be non-nil. Any
6856// non-2xx status code is an error. Response headers are in either
6857// *ListOperationsResponse.ServerResponse.Header or (if a response was
6858// returned at all) in error.(*googleapi.Error).Header. Use
6859// googleapi.IsNotModified to check whether the returned error was
6860// because http.StatusNotModified was returned.
6861func (c *BillingAccountsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
6862	gensupport.SetOptions(c.urlParams_, opts...)
6863	res, err := c.doRequest("json")
6864	if res != nil && res.StatusCode == http.StatusNotModified {
6865		if res.Body != nil {
6866			res.Body.Close()
6867		}
6868		return nil, &googleapi.Error{
6869			Code:   res.StatusCode,
6870			Header: res.Header,
6871		}
6872	}
6873	if err != nil {
6874		return nil, err
6875	}
6876	defer googleapi.CloseBody(res)
6877	if err := googleapi.CheckResponse(res); err != nil {
6878		return nil, err
6879	}
6880	ret := &ListOperationsResponse{
6881		ServerResponse: googleapi.ServerResponse{
6882			Header:         res.Header,
6883			HTTPStatusCode: res.StatusCode,
6884		},
6885	}
6886	target := &ret
6887	if err := gensupport.DecodeResponse(target, res); err != nil {
6888		return nil, err
6889	}
6890	return ret, nil
6891	// {
6892	//   "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as \"/v1/{name=users/*}/operations\" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.",
6893	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/locations/{locationsId}/operations",
6894	//   "httpMethod": "GET",
6895	//   "id": "logging.billingAccounts.locations.operations.list",
6896	//   "parameterOrder": [
6897	//     "name"
6898	//   ],
6899	//   "parameters": {
6900	//     "filter": {
6901	//       "description": "The standard list filter.",
6902	//       "location": "query",
6903	//       "type": "string"
6904	//     },
6905	//     "name": {
6906	//       "description": "The name of the operation's parent resource.",
6907	//       "location": "path",
6908	//       "pattern": "^billingAccounts/[^/]+/locations/[^/]+$",
6909	//       "required": true,
6910	//       "type": "string"
6911	//     },
6912	//     "pageSize": {
6913	//       "description": "The standard list page size.",
6914	//       "format": "int32",
6915	//       "location": "query",
6916	//       "type": "integer"
6917	//     },
6918	//     "pageToken": {
6919	//       "description": "The standard list page token.",
6920	//       "location": "query",
6921	//       "type": "string"
6922	//     }
6923	//   },
6924	//   "path": "v2/{+name}/operations",
6925	//   "response": {
6926	//     "$ref": "ListOperationsResponse"
6927	//   },
6928	//   "scopes": [
6929	//     "https://www.googleapis.com/auth/cloud-platform",
6930	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
6931	//     "https://www.googleapis.com/auth/logging.admin",
6932	//     "https://www.googleapis.com/auth/logging.read"
6933	//   ]
6934	// }
6935
6936}
6937
6938// Pages invokes f for each page of results.
6939// A non-nil error returned from f will halt the iteration.
6940// The provided context supersedes any context provided to the Context method.
6941func (c *BillingAccountsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
6942	c.ctx_ = ctx
6943	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
6944	for {
6945		x, err := c.Do()
6946		if err != nil {
6947			return err
6948		}
6949		if err := f(x); err != nil {
6950			return err
6951		}
6952		if x.NextPageToken == "" {
6953			return nil
6954		}
6955		c.PageToken(x.NextPageToken)
6956	}
6957}
6958
6959// method id "logging.billingAccounts.logs.delete":
6960
6961type BillingAccountsLogsDeleteCall struct {
6962	s          *Service
6963	logName    string
6964	urlParams_ gensupport.URLParams
6965	ctx_       context.Context
6966	header_    http.Header
6967}
6968
6969// Delete: Deletes all the log entries in a log for the _Default Log
6970// Bucket. The log reappears if it receives new entries. Log entries
6971// written shortly before the delete operation might not be deleted.
6972// Entries received after the delete operation with a timestamp before
6973// the operation will be deleted.
6974//
6975// - logName: The resource name of the log to delete:
6976//   projects/[PROJECT_ID]/logs/[LOG_ID]
6977//   organizations/[ORGANIZATION_ID]/logs/[LOG_ID]
6978//   billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]
6979//   folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For
6980//   example, "projects/my-project-id/logs/syslog",
6981//   "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For
6982//   more information about log names, see LogEntry.
6983func (r *BillingAccountsLogsService) Delete(logName string) *BillingAccountsLogsDeleteCall {
6984	c := &BillingAccountsLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
6985	c.logName = logName
6986	return c
6987}
6988
6989// Fields allows partial responses to be retrieved. See
6990// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
6991// for more information.
6992func (c *BillingAccountsLogsDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsLogsDeleteCall {
6993	c.urlParams_.Set("fields", googleapi.CombineFields(s))
6994	return c
6995}
6996
6997// Context sets the context to be used in this call's Do method. Any
6998// pending HTTP request will be aborted if the provided context is
6999// canceled.
7000func (c *BillingAccountsLogsDeleteCall) Context(ctx context.Context) *BillingAccountsLogsDeleteCall {
7001	c.ctx_ = ctx
7002	return c
7003}
7004
7005// Header returns an http.Header that can be modified by the caller to
7006// add HTTP headers to the request.
7007func (c *BillingAccountsLogsDeleteCall) Header() http.Header {
7008	if c.header_ == nil {
7009		c.header_ = make(http.Header)
7010	}
7011	return c.header_
7012}
7013
7014func (c *BillingAccountsLogsDeleteCall) doRequest(alt string) (*http.Response, error) {
7015	reqHeaders := make(http.Header)
7016	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
7017	for k, v := range c.header_ {
7018		reqHeaders[k] = v
7019	}
7020	reqHeaders.Set("User-Agent", c.s.userAgent())
7021	var body io.Reader = nil
7022	c.urlParams_.Set("alt", alt)
7023	c.urlParams_.Set("prettyPrint", "false")
7024	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}")
7025	urls += "?" + c.urlParams_.Encode()
7026	req, err := http.NewRequest("DELETE", urls, body)
7027	if err != nil {
7028		return nil, err
7029	}
7030	req.Header = reqHeaders
7031	googleapi.Expand(req.URL, map[string]string{
7032		"logName": c.logName,
7033	})
7034	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7035}
7036
7037// Do executes the "logging.billingAccounts.logs.delete" call.
7038// Exactly one of *Empty or error will be non-nil. Any non-2xx status
7039// code is an error. Response headers are in either
7040// *Empty.ServerResponse.Header or (if a response was returned at all)
7041// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
7042// check whether the returned error was because http.StatusNotModified
7043// was returned.
7044func (c *BillingAccountsLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
7045	gensupport.SetOptions(c.urlParams_, opts...)
7046	res, err := c.doRequest("json")
7047	if res != nil && res.StatusCode == http.StatusNotModified {
7048		if res.Body != nil {
7049			res.Body.Close()
7050		}
7051		return nil, &googleapi.Error{
7052			Code:   res.StatusCode,
7053			Header: res.Header,
7054		}
7055	}
7056	if err != nil {
7057		return nil, err
7058	}
7059	defer googleapi.CloseBody(res)
7060	if err := googleapi.CheckResponse(res); err != nil {
7061		return nil, err
7062	}
7063	ret := &Empty{
7064		ServerResponse: googleapi.ServerResponse{
7065			Header:         res.Header,
7066			HTTPStatusCode: res.StatusCode,
7067		},
7068	}
7069	target := &ret
7070	if err := gensupport.DecodeResponse(target, res); err != nil {
7071		return nil, err
7072	}
7073	return ret, nil
7074	// {
7075	//   "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.",
7076	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/logs/{logsId}",
7077	//   "httpMethod": "DELETE",
7078	//   "id": "logging.billingAccounts.logs.delete",
7079	//   "parameterOrder": [
7080	//     "logName"
7081	//   ],
7082	//   "parameters": {
7083	//     "logName": {
7084	//       "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.",
7085	//       "location": "path",
7086	//       "pattern": "^billingAccounts/[^/]+/logs/[^/]+$",
7087	//       "required": true,
7088	//       "type": "string"
7089	//     }
7090	//   },
7091	//   "path": "v2/{+logName}",
7092	//   "response": {
7093	//     "$ref": "Empty"
7094	//   },
7095	//   "scopes": [
7096	//     "https://www.googleapis.com/auth/cloud-platform",
7097	//     "https://www.googleapis.com/auth/logging.admin"
7098	//   ]
7099	// }
7100
7101}
7102
7103// method id "logging.billingAccounts.logs.list":
7104
7105type BillingAccountsLogsListCall struct {
7106	s            *Service
7107	parent       string
7108	urlParams_   gensupport.URLParams
7109	ifNoneMatch_ string
7110	ctx_         context.Context
7111	header_      http.Header
7112}
7113
7114// List: Lists the logs in projects, organizations, folders, or billing
7115// accounts. Only logs that have entries are listed.
7116//
7117// - parent: The resource name that owns the logs: projects/[PROJECT_ID]
7118//   organizations/[ORGANIZATION_ID]
7119//   billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID].
7120func (r *BillingAccountsLogsService) List(parent string) *BillingAccountsLogsListCall {
7121	c := &BillingAccountsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7122	c.parent = parent
7123	return c
7124}
7125
7126// PageSize sets the optional parameter "pageSize": The maximum number
7127// of results to return from this request. Non-positive values are
7128// ignored. The presence of nextPageToken in the response indicates that
7129// more results might be available.
7130func (c *BillingAccountsLogsListCall) PageSize(pageSize int64) *BillingAccountsLogsListCall {
7131	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
7132	return c
7133}
7134
7135// PageToken sets the optional parameter "pageToken": If present, then
7136// retrieve the next batch of results from the preceding call to this
7137// method. pageToken must be the value of nextPageToken from the
7138// previous response. The values of other method parameters should be
7139// identical to those in the previous call.
7140func (c *BillingAccountsLogsListCall) PageToken(pageToken string) *BillingAccountsLogsListCall {
7141	c.urlParams_.Set("pageToken", pageToken)
7142	return c
7143}
7144
7145// ResourceNames sets the optional parameter "resourceNames": The
7146// resource name that owns the logs:
7147// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view
7148// s/[VIEW_ID]
7149// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE
7150// T_ID]/views/[VIEW_ID]
7151// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[
7152// BUCKET_ID]/views/[VIEW_ID]
7153// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/
7154// [VIEW_ID]To support legacy queries, it could also be:
7155// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID]
7156// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]
7157func (c *BillingAccountsLogsListCall) ResourceNames(resourceNames ...string) *BillingAccountsLogsListCall {
7158	c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...))
7159	return c
7160}
7161
7162// Fields allows partial responses to be retrieved. See
7163// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7164// for more information.
7165func (c *BillingAccountsLogsListCall) Fields(s ...googleapi.Field) *BillingAccountsLogsListCall {
7166	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7167	return c
7168}
7169
7170// IfNoneMatch sets the optional parameter which makes the operation
7171// fail if the object's ETag matches the given value. This is useful for
7172// getting updates only after the object has changed since the last
7173// request. Use googleapi.IsNotModified to check whether the response
7174// error from Do is the result of In-None-Match.
7175func (c *BillingAccountsLogsListCall) IfNoneMatch(entityTag string) *BillingAccountsLogsListCall {
7176	c.ifNoneMatch_ = entityTag
7177	return c
7178}
7179
7180// Context sets the context to be used in this call's Do method. Any
7181// pending HTTP request will be aborted if the provided context is
7182// canceled.
7183func (c *BillingAccountsLogsListCall) Context(ctx context.Context) *BillingAccountsLogsListCall {
7184	c.ctx_ = ctx
7185	return c
7186}
7187
7188// Header returns an http.Header that can be modified by the caller to
7189// add HTTP headers to the request.
7190func (c *BillingAccountsLogsListCall) Header() http.Header {
7191	if c.header_ == nil {
7192		c.header_ = make(http.Header)
7193	}
7194	return c.header_
7195}
7196
7197func (c *BillingAccountsLogsListCall) doRequest(alt string) (*http.Response, error) {
7198	reqHeaders := make(http.Header)
7199	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
7200	for k, v := range c.header_ {
7201		reqHeaders[k] = v
7202	}
7203	reqHeaders.Set("User-Agent", c.s.userAgent())
7204	if c.ifNoneMatch_ != "" {
7205		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7206	}
7207	var body io.Reader = nil
7208	c.urlParams_.Set("alt", alt)
7209	c.urlParams_.Set("prettyPrint", "false")
7210	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs")
7211	urls += "?" + c.urlParams_.Encode()
7212	req, err := http.NewRequest("GET", urls, body)
7213	if err != nil {
7214		return nil, err
7215	}
7216	req.Header = reqHeaders
7217	googleapi.Expand(req.URL, map[string]string{
7218		"parent": c.parent,
7219	})
7220	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7221}
7222
7223// Do executes the "logging.billingAccounts.logs.list" call.
7224// Exactly one of *ListLogsResponse or error will be non-nil. Any
7225// non-2xx status code is an error. Response headers are in either
7226// *ListLogsResponse.ServerResponse.Header or (if a response was
7227// returned at all) in error.(*googleapi.Error).Header. Use
7228// googleapi.IsNotModified to check whether the returned error was
7229// because http.StatusNotModified was returned.
7230func (c *BillingAccountsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) {
7231	gensupport.SetOptions(c.urlParams_, opts...)
7232	res, err := c.doRequest("json")
7233	if res != nil && res.StatusCode == http.StatusNotModified {
7234		if res.Body != nil {
7235			res.Body.Close()
7236		}
7237		return nil, &googleapi.Error{
7238			Code:   res.StatusCode,
7239			Header: res.Header,
7240		}
7241	}
7242	if err != nil {
7243		return nil, err
7244	}
7245	defer googleapi.CloseBody(res)
7246	if err := googleapi.CheckResponse(res); err != nil {
7247		return nil, err
7248	}
7249	ret := &ListLogsResponse{
7250		ServerResponse: googleapi.ServerResponse{
7251			Header:         res.Header,
7252			HTTPStatusCode: res.StatusCode,
7253		},
7254	}
7255	target := &ret
7256	if err := gensupport.DecodeResponse(target, res); err != nil {
7257		return nil, err
7258	}
7259	return ret, nil
7260	// {
7261	//   "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.",
7262	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/logs",
7263	//   "httpMethod": "GET",
7264	//   "id": "logging.billingAccounts.logs.list",
7265	//   "parameterOrder": [
7266	//     "parent"
7267	//   ],
7268	//   "parameters": {
7269	//     "pageSize": {
7270	//       "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.",
7271	//       "format": "int32",
7272	//       "location": "query",
7273	//       "type": "integer"
7274	//     },
7275	//     "pageToken": {
7276	//       "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.",
7277	//       "location": "query",
7278	//       "type": "string"
7279	//     },
7280	//     "parent": {
7281	//       "description": "Required. The resource name that owns the logs: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]",
7282	//       "location": "path",
7283	//       "pattern": "^billingAccounts/[^/]+$",
7284	//       "required": true,
7285	//       "type": "string"
7286	//     },
7287	//     "resourceNames": {
7288	//       "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]",
7289	//       "location": "query",
7290	//       "repeated": true,
7291	//       "type": "string"
7292	//     }
7293	//   },
7294	//   "path": "v2/{+parent}/logs",
7295	//   "response": {
7296	//     "$ref": "ListLogsResponse"
7297	//   },
7298	//   "scopes": [
7299	//     "https://www.googleapis.com/auth/cloud-platform",
7300	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
7301	//     "https://www.googleapis.com/auth/logging.admin",
7302	//     "https://www.googleapis.com/auth/logging.read"
7303	//   ]
7304	// }
7305
7306}
7307
7308// Pages invokes f for each page of results.
7309// A non-nil error returned from f will halt the iteration.
7310// The provided context supersedes any context provided to the Context method.
7311func (c *BillingAccountsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error {
7312	c.ctx_ = ctx
7313	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
7314	for {
7315		x, err := c.Do()
7316		if err != nil {
7317			return err
7318		}
7319		if err := f(x); err != nil {
7320			return err
7321		}
7322		if x.NextPageToken == "" {
7323			return nil
7324		}
7325		c.PageToken(x.NextPageToken)
7326	}
7327}
7328
7329// method id "logging.billingAccounts.operations.get":
7330
7331type BillingAccountsOperationsGetCall struct {
7332	s            *Service
7333	name         string
7334	urlParams_   gensupport.URLParams
7335	ifNoneMatch_ string
7336	ctx_         context.Context
7337	header_      http.Header
7338}
7339
7340// Get: Gets the latest state of a long-running operation. Clients can
7341// use this method to poll the operation result at intervals as
7342// recommended by the API service.
7343//
7344// - name: The name of the operation resource.
7345func (r *BillingAccountsOperationsService) Get(name string) *BillingAccountsOperationsGetCall {
7346	c := &BillingAccountsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7347	c.name = name
7348	return c
7349}
7350
7351// Fields allows partial responses to be retrieved. See
7352// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7353// for more information.
7354func (c *BillingAccountsOperationsGetCall) Fields(s ...googleapi.Field) *BillingAccountsOperationsGetCall {
7355	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7356	return c
7357}
7358
7359// IfNoneMatch sets the optional parameter which makes the operation
7360// fail if the object's ETag matches the given value. This is useful for
7361// getting updates only after the object has changed since the last
7362// request. Use googleapi.IsNotModified to check whether the response
7363// error from Do is the result of In-None-Match.
7364func (c *BillingAccountsOperationsGetCall) IfNoneMatch(entityTag string) *BillingAccountsOperationsGetCall {
7365	c.ifNoneMatch_ = entityTag
7366	return c
7367}
7368
7369// Context sets the context to be used in this call's Do method. Any
7370// pending HTTP request will be aborted if the provided context is
7371// canceled.
7372func (c *BillingAccountsOperationsGetCall) Context(ctx context.Context) *BillingAccountsOperationsGetCall {
7373	c.ctx_ = ctx
7374	return c
7375}
7376
7377// Header returns an http.Header that can be modified by the caller to
7378// add HTTP headers to the request.
7379func (c *BillingAccountsOperationsGetCall) Header() http.Header {
7380	if c.header_ == nil {
7381		c.header_ = make(http.Header)
7382	}
7383	return c.header_
7384}
7385
7386func (c *BillingAccountsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
7387	reqHeaders := make(http.Header)
7388	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
7389	for k, v := range c.header_ {
7390		reqHeaders[k] = v
7391	}
7392	reqHeaders.Set("User-Agent", c.s.userAgent())
7393	if c.ifNoneMatch_ != "" {
7394		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7395	}
7396	var body io.Reader = nil
7397	c.urlParams_.Set("alt", alt)
7398	c.urlParams_.Set("prettyPrint", "false")
7399	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
7400	urls += "?" + c.urlParams_.Encode()
7401	req, err := http.NewRequest("GET", urls, body)
7402	if err != nil {
7403		return nil, err
7404	}
7405	req.Header = reqHeaders
7406	googleapi.Expand(req.URL, map[string]string{
7407		"name": c.name,
7408	})
7409	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7410}
7411
7412// Do executes the "logging.billingAccounts.operations.get" call.
7413// Exactly one of *Operation or error will be non-nil. Any non-2xx
7414// status code is an error. Response headers are in either
7415// *Operation.ServerResponse.Header or (if a response was returned at
7416// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
7417// to check whether the returned error was because
7418// http.StatusNotModified was returned.
7419func (c *BillingAccountsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
7420	gensupport.SetOptions(c.urlParams_, opts...)
7421	res, err := c.doRequest("json")
7422	if res != nil && res.StatusCode == http.StatusNotModified {
7423		if res.Body != nil {
7424			res.Body.Close()
7425		}
7426		return nil, &googleapi.Error{
7427			Code:   res.StatusCode,
7428			Header: res.Header,
7429		}
7430	}
7431	if err != nil {
7432		return nil, err
7433	}
7434	defer googleapi.CloseBody(res)
7435	if err := googleapi.CheckResponse(res); err != nil {
7436		return nil, err
7437	}
7438	ret := &Operation{
7439		ServerResponse: googleapi.ServerResponse{
7440			Header:         res.Header,
7441			HTTPStatusCode: res.StatusCode,
7442		},
7443	}
7444	target := &ret
7445	if err := gensupport.DecodeResponse(target, res); err != nil {
7446		return nil, err
7447	}
7448	return ret, nil
7449	// {
7450	//   "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.",
7451	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/operations/{operationsId}",
7452	//   "httpMethod": "GET",
7453	//   "id": "logging.billingAccounts.operations.get",
7454	//   "parameterOrder": [
7455	//     "name"
7456	//   ],
7457	//   "parameters": {
7458	//     "name": {
7459	//       "description": "The name of the operation resource.",
7460	//       "location": "path",
7461	//       "pattern": "^billingAccounts/[^/]+/operations/[^/]+$",
7462	//       "required": true,
7463	//       "type": "string"
7464	//     }
7465	//   },
7466	//   "path": "v2/{+name}",
7467	//   "response": {
7468	//     "$ref": "Operation"
7469	//   },
7470	//   "scopes": [
7471	//     "https://www.googleapis.com/auth/cloud-platform",
7472	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
7473	//     "https://www.googleapis.com/auth/logging.admin",
7474	//     "https://www.googleapis.com/auth/logging.read"
7475	//   ]
7476	// }
7477
7478}
7479
7480// method id "logging.billingAccounts.sinks.create":
7481
7482type BillingAccountsSinksCreateCall struct {
7483	s          *Service
7484	parent     string
7485	logsink    *LogSink
7486	urlParams_ gensupport.URLParams
7487	ctx_       context.Context
7488	header_    http.Header
7489}
7490
7491// Create: Creates a sink that exports specified log entries to a
7492// destination. The export of newly-ingested log entries begins
7493// immediately, unless the sink's writer_identity is not permitted to
7494// write to the destination. A sink can export log entries only from the
7495// resource owning the sink.
7496//
7497// - parent: The resource in which to create the sink:
7498//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
7499//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For
7500//   examples:"projects/my-project" "organizations/123456789".
7501func (r *BillingAccountsSinksService) Create(parent string, logsink *LogSink) *BillingAccountsSinksCreateCall {
7502	c := &BillingAccountsSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7503	c.parent = parent
7504	c.logsink = logsink
7505	return c
7506}
7507
7508// UniqueWriterIdentity sets the optional parameter
7509// "uniqueWriterIdentity": Determines the kind of IAM identity returned
7510// as writer_identity in the new sink. If this value is omitted or set
7511// to false, and if the sink's parent is a project, then the value
7512// returned as writer_identity is the same group or service account used
7513// by Cloud Logging before the addition of writer identities to this
7514// API. The sink's destination must be in the same project as the sink
7515// itself.If this field is set to true, or if the sink is owned by a
7516// non-project resource such as an organization, then the value of
7517// writer_identity will be a unique service account used only for
7518// exports from the new sink. For more information, see writer_identity
7519// in LogSink.
7520func (c *BillingAccountsSinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *BillingAccountsSinksCreateCall {
7521	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
7522	return c
7523}
7524
7525// Fields allows partial responses to be retrieved. See
7526// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7527// for more information.
7528func (c *BillingAccountsSinksCreateCall) Fields(s ...googleapi.Field) *BillingAccountsSinksCreateCall {
7529	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7530	return c
7531}
7532
7533// Context sets the context to be used in this call's Do method. Any
7534// pending HTTP request will be aborted if the provided context is
7535// canceled.
7536func (c *BillingAccountsSinksCreateCall) Context(ctx context.Context) *BillingAccountsSinksCreateCall {
7537	c.ctx_ = ctx
7538	return c
7539}
7540
7541// Header returns an http.Header that can be modified by the caller to
7542// add HTTP headers to the request.
7543func (c *BillingAccountsSinksCreateCall) Header() http.Header {
7544	if c.header_ == nil {
7545		c.header_ = make(http.Header)
7546	}
7547	return c.header_
7548}
7549
7550func (c *BillingAccountsSinksCreateCall) doRequest(alt string) (*http.Response, error) {
7551	reqHeaders := make(http.Header)
7552	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
7553	for k, v := range c.header_ {
7554		reqHeaders[k] = v
7555	}
7556	reqHeaders.Set("User-Agent", c.s.userAgent())
7557	var body io.Reader = nil
7558	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
7559	if err != nil {
7560		return nil, err
7561	}
7562	reqHeaders.Set("Content-Type", "application/json")
7563	c.urlParams_.Set("alt", alt)
7564	c.urlParams_.Set("prettyPrint", "false")
7565	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
7566	urls += "?" + c.urlParams_.Encode()
7567	req, err := http.NewRequest("POST", urls, body)
7568	if err != nil {
7569		return nil, err
7570	}
7571	req.Header = reqHeaders
7572	googleapi.Expand(req.URL, map[string]string{
7573		"parent": c.parent,
7574	})
7575	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7576}
7577
7578// Do executes the "logging.billingAccounts.sinks.create" call.
7579// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
7580// code is an error. Response headers are in either
7581// *LogSink.ServerResponse.Header or (if a response was returned at all)
7582// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
7583// check whether the returned error was because http.StatusNotModified
7584// was returned.
7585func (c *BillingAccountsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
7586	gensupport.SetOptions(c.urlParams_, opts...)
7587	res, err := c.doRequest("json")
7588	if res != nil && res.StatusCode == http.StatusNotModified {
7589		if res.Body != nil {
7590			res.Body.Close()
7591		}
7592		return nil, &googleapi.Error{
7593			Code:   res.StatusCode,
7594			Header: res.Header,
7595		}
7596	}
7597	if err != nil {
7598		return nil, err
7599	}
7600	defer googleapi.CloseBody(res)
7601	if err := googleapi.CheckResponse(res); err != nil {
7602		return nil, err
7603	}
7604	ret := &LogSink{
7605		ServerResponse: googleapi.ServerResponse{
7606			Header:         res.Header,
7607			HTTPStatusCode: res.StatusCode,
7608		},
7609	}
7610	target := &ret
7611	if err := gensupport.DecodeResponse(target, res); err != nil {
7612		return nil, err
7613	}
7614	return ret, nil
7615	// {
7616	//   "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.",
7617	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks",
7618	//   "httpMethod": "POST",
7619	//   "id": "logging.billingAccounts.sinks.create",
7620	//   "parameterOrder": [
7621	//     "parent"
7622	//   ],
7623	//   "parameters": {
7624	//     "parent": {
7625	//       "description": "Required. The resource in which to create the sink: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-project\" \"organizations/123456789\"",
7626	//       "location": "path",
7627	//       "pattern": "^billingAccounts/[^/]+$",
7628	//       "required": true,
7629	//       "type": "string"
7630	//     },
7631	//     "uniqueWriterIdentity": {
7632	//       "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 Cloud 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.",
7633	//       "location": "query",
7634	//       "type": "boolean"
7635	//     }
7636	//   },
7637	//   "path": "v2/{+parent}/sinks",
7638	//   "request": {
7639	//     "$ref": "LogSink"
7640	//   },
7641	//   "response": {
7642	//     "$ref": "LogSink"
7643	//   },
7644	//   "scopes": [
7645	//     "https://www.googleapis.com/auth/cloud-platform",
7646	//     "https://www.googleapis.com/auth/logging.admin"
7647	//   ]
7648	// }
7649
7650}
7651
7652// method id "logging.billingAccounts.sinks.delete":
7653
7654type BillingAccountsSinksDeleteCall struct {
7655	s          *Service
7656	sinkNameid string
7657	urlParams_ gensupport.URLParams
7658	ctx_       context.Context
7659	header_    http.Header
7660}
7661
7662// Delete: Deletes a sink. If the sink has a unique writer_identity,
7663// then that service account is also deleted.
7664//
7665// - sinkName: The full resource name of the sink to delete, including
7666//   the parent resource and the sink identifier:
7667//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
7668//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
7669//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
7670//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" For
7671//   example:"projects/my-project/sinks/my-sink".
7672func (r *BillingAccountsSinksService) Delete(sinkNameid string) *BillingAccountsSinksDeleteCall {
7673	c := &BillingAccountsSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7674	c.sinkNameid = sinkNameid
7675	return c
7676}
7677
7678// Fields allows partial responses to be retrieved. See
7679// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7680// for more information.
7681func (c *BillingAccountsSinksDeleteCall) Fields(s ...googleapi.Field) *BillingAccountsSinksDeleteCall {
7682	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7683	return c
7684}
7685
7686// Context sets the context to be used in this call's Do method. Any
7687// pending HTTP request will be aborted if the provided context is
7688// canceled.
7689func (c *BillingAccountsSinksDeleteCall) Context(ctx context.Context) *BillingAccountsSinksDeleteCall {
7690	c.ctx_ = ctx
7691	return c
7692}
7693
7694// Header returns an http.Header that can be modified by the caller to
7695// add HTTP headers to the request.
7696func (c *BillingAccountsSinksDeleteCall) Header() http.Header {
7697	if c.header_ == nil {
7698		c.header_ = make(http.Header)
7699	}
7700	return c.header_
7701}
7702
7703func (c *BillingAccountsSinksDeleteCall) doRequest(alt string) (*http.Response, error) {
7704	reqHeaders := make(http.Header)
7705	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
7706	for k, v := range c.header_ {
7707		reqHeaders[k] = v
7708	}
7709	reqHeaders.Set("User-Agent", c.s.userAgent())
7710	var body io.Reader = nil
7711	c.urlParams_.Set("alt", alt)
7712	c.urlParams_.Set("prettyPrint", "false")
7713	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
7714	urls += "?" + c.urlParams_.Encode()
7715	req, err := http.NewRequest("DELETE", urls, body)
7716	if err != nil {
7717		return nil, err
7718	}
7719	req.Header = reqHeaders
7720	googleapi.Expand(req.URL, map[string]string{
7721		"sinkName": c.sinkNameid,
7722	})
7723	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7724}
7725
7726// Do executes the "logging.billingAccounts.sinks.delete" call.
7727// Exactly one of *Empty or error will be non-nil. Any non-2xx status
7728// code is an error. Response headers are in either
7729// *Empty.ServerResponse.Header or (if a response was returned at all)
7730// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
7731// check whether the returned error was because http.StatusNotModified
7732// was returned.
7733func (c *BillingAccountsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
7734	gensupport.SetOptions(c.urlParams_, opts...)
7735	res, err := c.doRequest("json")
7736	if res != nil && res.StatusCode == http.StatusNotModified {
7737		if res.Body != nil {
7738			res.Body.Close()
7739		}
7740		return nil, &googleapi.Error{
7741			Code:   res.StatusCode,
7742			Header: res.Header,
7743		}
7744	}
7745	if err != nil {
7746		return nil, err
7747	}
7748	defer googleapi.CloseBody(res)
7749	if err := googleapi.CheckResponse(res); err != nil {
7750		return nil, err
7751	}
7752	ret := &Empty{
7753		ServerResponse: googleapi.ServerResponse{
7754			Header:         res.Header,
7755			HTTPStatusCode: res.StatusCode,
7756		},
7757	}
7758	target := &ret
7759	if err := gensupport.DecodeResponse(target, res); err != nil {
7760		return nil, err
7761	}
7762	return ret, nil
7763	// {
7764	//   "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.",
7765	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}",
7766	//   "httpMethod": "DELETE",
7767	//   "id": "logging.billingAccounts.sinks.delete",
7768	//   "parameterOrder": [
7769	//     "sinkName"
7770	//   ],
7771	//   "parameters": {
7772	//     "sinkName": {
7773	//       "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]\" For example:\"projects/my-project/sinks/my-sink\"",
7774	//       "location": "path",
7775	//       "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$",
7776	//       "required": true,
7777	//       "type": "string"
7778	//     }
7779	//   },
7780	//   "path": "v2/{+sinkName}",
7781	//   "response": {
7782	//     "$ref": "Empty"
7783	//   },
7784	//   "scopes": [
7785	//     "https://www.googleapis.com/auth/cloud-platform",
7786	//     "https://www.googleapis.com/auth/logging.admin"
7787	//   ]
7788	// }
7789
7790}
7791
7792// method id "logging.billingAccounts.sinks.get":
7793
7794type BillingAccountsSinksGetCall struct {
7795	s            *Service
7796	sinkName     string
7797	urlParams_   gensupport.URLParams
7798	ifNoneMatch_ string
7799	ctx_         context.Context
7800	header_      http.Header
7801}
7802
7803// Get: Gets a sink.
7804//
7805// - sinkName: The resource name of the sink:
7806//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
7807//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
7808//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
7809//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" For
7810//   example:"projects/my-project/sinks/my-sink".
7811func (r *BillingAccountsSinksService) Get(sinkName string) *BillingAccountsSinksGetCall {
7812	c := &BillingAccountsSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7813	c.sinkName = sinkName
7814	return c
7815}
7816
7817// Fields allows partial responses to be retrieved. See
7818// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7819// for more information.
7820func (c *BillingAccountsSinksGetCall) Fields(s ...googleapi.Field) *BillingAccountsSinksGetCall {
7821	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7822	return c
7823}
7824
7825// IfNoneMatch sets the optional parameter which makes the operation
7826// fail if the object's ETag matches the given value. This is useful for
7827// getting updates only after the object has changed since the last
7828// request. Use googleapi.IsNotModified to check whether the response
7829// error from Do is the result of In-None-Match.
7830func (c *BillingAccountsSinksGetCall) IfNoneMatch(entityTag string) *BillingAccountsSinksGetCall {
7831	c.ifNoneMatch_ = entityTag
7832	return c
7833}
7834
7835// Context sets the context to be used in this call's Do method. Any
7836// pending HTTP request will be aborted if the provided context is
7837// canceled.
7838func (c *BillingAccountsSinksGetCall) Context(ctx context.Context) *BillingAccountsSinksGetCall {
7839	c.ctx_ = ctx
7840	return c
7841}
7842
7843// Header returns an http.Header that can be modified by the caller to
7844// add HTTP headers to the request.
7845func (c *BillingAccountsSinksGetCall) Header() http.Header {
7846	if c.header_ == nil {
7847		c.header_ = make(http.Header)
7848	}
7849	return c.header_
7850}
7851
7852func (c *BillingAccountsSinksGetCall) doRequest(alt string) (*http.Response, error) {
7853	reqHeaders := make(http.Header)
7854	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
7855	for k, v := range c.header_ {
7856		reqHeaders[k] = v
7857	}
7858	reqHeaders.Set("User-Agent", c.s.userAgent())
7859	if c.ifNoneMatch_ != "" {
7860		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
7861	}
7862	var body io.Reader = nil
7863	c.urlParams_.Set("alt", alt)
7864	c.urlParams_.Set("prettyPrint", "false")
7865	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
7866	urls += "?" + c.urlParams_.Encode()
7867	req, err := http.NewRequest("GET", urls, body)
7868	if err != nil {
7869		return nil, err
7870	}
7871	req.Header = reqHeaders
7872	googleapi.Expand(req.URL, map[string]string{
7873		"sinkName": c.sinkName,
7874	})
7875	return gensupport.SendRequest(c.ctx_, c.s.client, req)
7876}
7877
7878// Do executes the "logging.billingAccounts.sinks.get" call.
7879// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
7880// code is an error. Response headers are in either
7881// *LogSink.ServerResponse.Header or (if a response was returned at all)
7882// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
7883// check whether the returned error was because http.StatusNotModified
7884// was returned.
7885func (c *BillingAccountsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
7886	gensupport.SetOptions(c.urlParams_, opts...)
7887	res, err := c.doRequest("json")
7888	if res != nil && res.StatusCode == http.StatusNotModified {
7889		if res.Body != nil {
7890			res.Body.Close()
7891		}
7892		return nil, &googleapi.Error{
7893			Code:   res.StatusCode,
7894			Header: res.Header,
7895		}
7896	}
7897	if err != nil {
7898		return nil, err
7899	}
7900	defer googleapi.CloseBody(res)
7901	if err := googleapi.CheckResponse(res); err != nil {
7902		return nil, err
7903	}
7904	ret := &LogSink{
7905		ServerResponse: googleapi.ServerResponse{
7906			Header:         res.Header,
7907			HTTPStatusCode: res.StatusCode,
7908		},
7909	}
7910	target := &ret
7911	if err := gensupport.DecodeResponse(target, res); err != nil {
7912		return nil, err
7913	}
7914	return ret, nil
7915	// {
7916	//   "description": "Gets a sink.",
7917	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}",
7918	//   "httpMethod": "GET",
7919	//   "id": "logging.billingAccounts.sinks.get",
7920	//   "parameterOrder": [
7921	//     "sinkName"
7922	//   ],
7923	//   "parameters": {
7924	//     "sinkName": {
7925	//       "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]\" For example:\"projects/my-project/sinks/my-sink\"",
7926	//       "location": "path",
7927	//       "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$",
7928	//       "required": true,
7929	//       "type": "string"
7930	//     }
7931	//   },
7932	//   "path": "v2/{+sinkName}",
7933	//   "response": {
7934	//     "$ref": "LogSink"
7935	//   },
7936	//   "scopes": [
7937	//     "https://www.googleapis.com/auth/cloud-platform",
7938	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
7939	//     "https://www.googleapis.com/auth/logging.admin",
7940	//     "https://www.googleapis.com/auth/logging.read"
7941	//   ]
7942	// }
7943
7944}
7945
7946// method id "logging.billingAccounts.sinks.list":
7947
7948type BillingAccountsSinksListCall struct {
7949	s            *Service
7950	parent       string
7951	urlParams_   gensupport.URLParams
7952	ifNoneMatch_ string
7953	ctx_         context.Context
7954	header_      http.Header
7955}
7956
7957// List: Lists sinks.
7958//
7959// - parent: The parent resource whose sinks are to be listed:
7960//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
7961//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]".
7962func (r *BillingAccountsSinksService) List(parent string) *BillingAccountsSinksListCall {
7963	c := &BillingAccountsSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
7964	c.parent = parent
7965	return c
7966}
7967
7968// PageSize sets the optional parameter "pageSize": The maximum number
7969// of results to return from this request. Non-positive values are
7970// ignored. The presence of nextPageToken in the response indicates that
7971// more results might be available.
7972func (c *BillingAccountsSinksListCall) PageSize(pageSize int64) *BillingAccountsSinksListCall {
7973	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
7974	return c
7975}
7976
7977// PageToken sets the optional parameter "pageToken": If present, then
7978// retrieve the next batch of results from the preceding call to this
7979// method. pageToken must be the value of nextPageToken from the
7980// previous response. The values of other method parameters should be
7981// identical to those in the previous call.
7982func (c *BillingAccountsSinksListCall) PageToken(pageToken string) *BillingAccountsSinksListCall {
7983	c.urlParams_.Set("pageToken", pageToken)
7984	return c
7985}
7986
7987// Fields allows partial responses to be retrieved. See
7988// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
7989// for more information.
7990func (c *BillingAccountsSinksListCall) Fields(s ...googleapi.Field) *BillingAccountsSinksListCall {
7991	c.urlParams_.Set("fields", googleapi.CombineFields(s))
7992	return c
7993}
7994
7995// IfNoneMatch sets the optional parameter which makes the operation
7996// fail if the object's ETag matches the given value. This is useful for
7997// getting updates only after the object has changed since the last
7998// request. Use googleapi.IsNotModified to check whether the response
7999// error from Do is the result of In-None-Match.
8000func (c *BillingAccountsSinksListCall) IfNoneMatch(entityTag string) *BillingAccountsSinksListCall {
8001	c.ifNoneMatch_ = entityTag
8002	return c
8003}
8004
8005// Context sets the context to be used in this call's Do method. Any
8006// pending HTTP request will be aborted if the provided context is
8007// canceled.
8008func (c *BillingAccountsSinksListCall) Context(ctx context.Context) *BillingAccountsSinksListCall {
8009	c.ctx_ = ctx
8010	return c
8011}
8012
8013// Header returns an http.Header that can be modified by the caller to
8014// add HTTP headers to the request.
8015func (c *BillingAccountsSinksListCall) Header() http.Header {
8016	if c.header_ == nil {
8017		c.header_ = make(http.Header)
8018	}
8019	return c.header_
8020}
8021
8022func (c *BillingAccountsSinksListCall) doRequest(alt string) (*http.Response, error) {
8023	reqHeaders := make(http.Header)
8024	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
8025	for k, v := range c.header_ {
8026		reqHeaders[k] = v
8027	}
8028	reqHeaders.Set("User-Agent", c.s.userAgent())
8029	if c.ifNoneMatch_ != "" {
8030		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
8031	}
8032	var body io.Reader = nil
8033	c.urlParams_.Set("alt", alt)
8034	c.urlParams_.Set("prettyPrint", "false")
8035	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
8036	urls += "?" + c.urlParams_.Encode()
8037	req, err := http.NewRequest("GET", urls, body)
8038	if err != nil {
8039		return nil, err
8040	}
8041	req.Header = reqHeaders
8042	googleapi.Expand(req.URL, map[string]string{
8043		"parent": c.parent,
8044	})
8045	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8046}
8047
8048// Do executes the "logging.billingAccounts.sinks.list" call.
8049// Exactly one of *ListSinksResponse or error will be non-nil. Any
8050// non-2xx status code is an error. Response headers are in either
8051// *ListSinksResponse.ServerResponse.Header or (if a response was
8052// returned at all) in error.(*googleapi.Error).Header. Use
8053// googleapi.IsNotModified to check whether the returned error was
8054// because http.StatusNotModified was returned.
8055func (c *BillingAccountsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) {
8056	gensupport.SetOptions(c.urlParams_, opts...)
8057	res, err := c.doRequest("json")
8058	if res != nil && res.StatusCode == http.StatusNotModified {
8059		if res.Body != nil {
8060			res.Body.Close()
8061		}
8062		return nil, &googleapi.Error{
8063			Code:   res.StatusCode,
8064			Header: res.Header,
8065		}
8066	}
8067	if err != nil {
8068		return nil, err
8069	}
8070	defer googleapi.CloseBody(res)
8071	if err := googleapi.CheckResponse(res); err != nil {
8072		return nil, err
8073	}
8074	ret := &ListSinksResponse{
8075		ServerResponse: googleapi.ServerResponse{
8076			Header:         res.Header,
8077			HTTPStatusCode: res.StatusCode,
8078		},
8079	}
8080	target := &ret
8081	if err := gensupport.DecodeResponse(target, res); err != nil {
8082		return nil, err
8083	}
8084	return ret, nil
8085	// {
8086	//   "description": "Lists sinks.",
8087	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks",
8088	//   "httpMethod": "GET",
8089	//   "id": "logging.billingAccounts.sinks.list",
8090	//   "parameterOrder": [
8091	//     "parent"
8092	//   ],
8093	//   "parameters": {
8094	//     "pageSize": {
8095	//       "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.",
8096	//       "format": "int32",
8097	//       "location": "query",
8098	//       "type": "integer"
8099	//     },
8100	//     "pageToken": {
8101	//       "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.",
8102	//       "location": "query",
8103	//       "type": "string"
8104	//     },
8105	//     "parent": {
8106	//       "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
8107	//       "location": "path",
8108	//       "pattern": "^billingAccounts/[^/]+$",
8109	//       "required": true,
8110	//       "type": "string"
8111	//     }
8112	//   },
8113	//   "path": "v2/{+parent}/sinks",
8114	//   "response": {
8115	//     "$ref": "ListSinksResponse"
8116	//   },
8117	//   "scopes": [
8118	//     "https://www.googleapis.com/auth/cloud-platform",
8119	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
8120	//     "https://www.googleapis.com/auth/logging.admin",
8121	//     "https://www.googleapis.com/auth/logging.read"
8122	//   ]
8123	// }
8124
8125}
8126
8127// Pages invokes f for each page of results.
8128// A non-nil error returned from f will halt the iteration.
8129// The provided context supersedes any context provided to the Context method.
8130func (c *BillingAccountsSinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error {
8131	c.ctx_ = ctx
8132	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
8133	for {
8134		x, err := c.Do()
8135		if err != nil {
8136			return err
8137		}
8138		if err := f(x); err != nil {
8139			return err
8140		}
8141		if x.NextPageToken == "" {
8142			return nil
8143		}
8144		c.PageToken(x.NextPageToken)
8145	}
8146}
8147
8148// method id "logging.billingAccounts.sinks.patch":
8149
8150type BillingAccountsSinksPatchCall struct {
8151	s          *Service
8152	sinkNameid string
8153	logsink    *LogSink
8154	urlParams_ gensupport.URLParams
8155	ctx_       context.Context
8156	header_    http.Header
8157}
8158
8159// Patch: Updates a sink. This method replaces the following fields in
8160// the existing sink with values from the new sink: destination, and
8161// filter.The updated sink might also have a new writer_identity; see
8162// the unique_writer_identity field.
8163//
8164// - sinkName: The full resource name of the sink to update, including
8165//   the parent resource and the sink identifier:
8166//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
8167//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
8168//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
8169//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" For
8170//   example:"projects/my-project/sinks/my-sink".
8171func (r *BillingAccountsSinksService) Patch(sinkNameid string, logsink *LogSink) *BillingAccountsSinksPatchCall {
8172	c := &BillingAccountsSinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8173	c.sinkNameid = sinkNameid
8174	c.logsink = logsink
8175	return c
8176}
8177
8178// UniqueWriterIdentity sets the optional parameter
8179// "uniqueWriterIdentity": See sinks.create for a description of this
8180// field. When updating a sink, the effect of this field on the value of
8181// writer_identity in the updated sink depends on both the old and new
8182// values of this field: If the old and new values of this field are
8183// both false or both true, then there is no change to the sink's
8184// writer_identity. If the old value is false and the new value is true,
8185// then writer_identity is changed to a unique service account. It is an
8186// error if the old value is true and the new value is set to false or
8187// defaulted to false.
8188func (c *BillingAccountsSinksPatchCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *BillingAccountsSinksPatchCall {
8189	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
8190	return c
8191}
8192
8193// UpdateMask sets the optional parameter "updateMask": Field mask that
8194// specifies the fields in sink that need an update. A sink field will
8195// be overwritten if, and only if, it is in the update mask. name and
8196// output only fields cannot be updated.An empty updateMask is
8197// temporarily treated as using the following mask for backwards
8198// compatibility purposes:destination,filter,includeChildrenAt some
8199// point in the future, behavior will be removed and specifying an empty
8200// updateMask will be an error.For a detailed FieldMask definition, see
8201// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor
8202// example: updateMask=filter
8203func (c *BillingAccountsSinksPatchCall) UpdateMask(updateMask string) *BillingAccountsSinksPatchCall {
8204	c.urlParams_.Set("updateMask", updateMask)
8205	return c
8206}
8207
8208// Fields allows partial responses to be retrieved. See
8209// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8210// for more information.
8211func (c *BillingAccountsSinksPatchCall) Fields(s ...googleapi.Field) *BillingAccountsSinksPatchCall {
8212	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8213	return c
8214}
8215
8216// Context sets the context to be used in this call's Do method. Any
8217// pending HTTP request will be aborted if the provided context is
8218// canceled.
8219func (c *BillingAccountsSinksPatchCall) Context(ctx context.Context) *BillingAccountsSinksPatchCall {
8220	c.ctx_ = ctx
8221	return c
8222}
8223
8224// Header returns an http.Header that can be modified by the caller to
8225// add HTTP headers to the request.
8226func (c *BillingAccountsSinksPatchCall) Header() http.Header {
8227	if c.header_ == nil {
8228		c.header_ = make(http.Header)
8229	}
8230	return c.header_
8231}
8232
8233func (c *BillingAccountsSinksPatchCall) doRequest(alt string) (*http.Response, error) {
8234	reqHeaders := make(http.Header)
8235	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
8236	for k, v := range c.header_ {
8237		reqHeaders[k] = v
8238	}
8239	reqHeaders.Set("User-Agent", c.s.userAgent())
8240	var body io.Reader = nil
8241	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
8242	if err != nil {
8243		return nil, err
8244	}
8245	reqHeaders.Set("Content-Type", "application/json")
8246	c.urlParams_.Set("alt", alt)
8247	c.urlParams_.Set("prettyPrint", "false")
8248	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
8249	urls += "?" + c.urlParams_.Encode()
8250	req, err := http.NewRequest("PATCH", urls, body)
8251	if err != nil {
8252		return nil, err
8253	}
8254	req.Header = reqHeaders
8255	googleapi.Expand(req.URL, map[string]string{
8256		"sinkName": c.sinkNameid,
8257	})
8258	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8259}
8260
8261// Do executes the "logging.billingAccounts.sinks.patch" call.
8262// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
8263// code is an error. Response headers are in either
8264// *LogSink.ServerResponse.Header or (if a response was returned at all)
8265// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8266// check whether the returned error was because http.StatusNotModified
8267// was returned.
8268func (c *BillingAccountsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
8269	gensupport.SetOptions(c.urlParams_, opts...)
8270	res, err := c.doRequest("json")
8271	if res != nil && res.StatusCode == http.StatusNotModified {
8272		if res.Body != nil {
8273			res.Body.Close()
8274		}
8275		return nil, &googleapi.Error{
8276			Code:   res.StatusCode,
8277			Header: res.Header,
8278		}
8279	}
8280	if err != nil {
8281		return nil, err
8282	}
8283	defer googleapi.CloseBody(res)
8284	if err := googleapi.CheckResponse(res); err != nil {
8285		return nil, err
8286	}
8287	ret := &LogSink{
8288		ServerResponse: googleapi.ServerResponse{
8289			Header:         res.Header,
8290			HTTPStatusCode: res.StatusCode,
8291		},
8292	}
8293	target := &ret
8294	if err := gensupport.DecodeResponse(target, res); err != nil {
8295		return nil, err
8296	}
8297	return ret, nil
8298	// {
8299	//   "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.",
8300	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}",
8301	//   "httpMethod": "PATCH",
8302	//   "id": "logging.billingAccounts.sinks.patch",
8303	//   "parameterOrder": [
8304	//     "sinkName"
8305	//   ],
8306	//   "parameters": {
8307	//     "sinkName": {
8308	//       "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]\" For example:\"projects/my-project/sinks/my-sink\"",
8309	//       "location": "path",
8310	//       "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$",
8311	//       "required": true,
8312	//       "type": "string"
8313	//     },
8314	//     "uniqueWriterIdentity": {
8315	//       "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.",
8316	//       "location": "query",
8317	//       "type": "boolean"
8318	//     },
8319	//     "updateMask": {
8320	//       "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,includeChildrenAt 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.FieldMaskFor example: updateMask=filter",
8321	//       "format": "google-fieldmask",
8322	//       "location": "query",
8323	//       "type": "string"
8324	//     }
8325	//   },
8326	//   "path": "v2/{+sinkName}",
8327	//   "request": {
8328	//     "$ref": "LogSink"
8329	//   },
8330	//   "response": {
8331	//     "$ref": "LogSink"
8332	//   },
8333	//   "scopes": [
8334	//     "https://www.googleapis.com/auth/cloud-platform",
8335	//     "https://www.googleapis.com/auth/logging.admin"
8336	//   ]
8337	// }
8338
8339}
8340
8341// method id "logging.billingAccounts.sinks.update":
8342
8343type BillingAccountsSinksUpdateCall struct {
8344	s          *Service
8345	sinkNameid string
8346	logsink    *LogSink
8347	urlParams_ gensupport.URLParams
8348	ctx_       context.Context
8349	header_    http.Header
8350}
8351
8352// Update: Updates a sink. This method replaces the following fields in
8353// the existing sink with values from the new sink: destination, and
8354// filter.The updated sink might also have a new writer_identity; see
8355// the unique_writer_identity field.
8356//
8357// - sinkName: The full resource name of the sink to update, including
8358//   the parent resource and the sink identifier:
8359//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
8360//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
8361//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
8362//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" For
8363//   example:"projects/my-project/sinks/my-sink".
8364func (r *BillingAccountsSinksService) Update(sinkNameid string, logsink *LogSink) *BillingAccountsSinksUpdateCall {
8365	c := &BillingAccountsSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8366	c.sinkNameid = sinkNameid
8367	c.logsink = logsink
8368	return c
8369}
8370
8371// UniqueWriterIdentity sets the optional parameter
8372// "uniqueWriterIdentity": See sinks.create for a description of this
8373// field. When updating a sink, the effect of this field on the value of
8374// writer_identity in the updated sink depends on both the old and new
8375// values of this field: If the old and new values of this field are
8376// both false or both true, then there is no change to the sink's
8377// writer_identity. If the old value is false and the new value is true,
8378// then writer_identity is changed to a unique service account. It is an
8379// error if the old value is true and the new value is set to false or
8380// defaulted to false.
8381func (c *BillingAccountsSinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *BillingAccountsSinksUpdateCall {
8382	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
8383	return c
8384}
8385
8386// UpdateMask sets the optional parameter "updateMask": Field mask that
8387// specifies the fields in sink that need an update. A sink field will
8388// be overwritten if, and only if, it is in the update mask. name and
8389// output only fields cannot be updated.An empty updateMask is
8390// temporarily treated as using the following mask for backwards
8391// compatibility purposes:destination,filter,includeChildrenAt some
8392// point in the future, behavior will be removed and specifying an empty
8393// updateMask will be an error.For a detailed FieldMask definition, see
8394// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor
8395// example: updateMask=filter
8396func (c *BillingAccountsSinksUpdateCall) UpdateMask(updateMask string) *BillingAccountsSinksUpdateCall {
8397	c.urlParams_.Set("updateMask", updateMask)
8398	return c
8399}
8400
8401// Fields allows partial responses to be retrieved. See
8402// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8403// for more information.
8404func (c *BillingAccountsSinksUpdateCall) Fields(s ...googleapi.Field) *BillingAccountsSinksUpdateCall {
8405	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8406	return c
8407}
8408
8409// Context sets the context to be used in this call's Do method. Any
8410// pending HTTP request will be aborted if the provided context is
8411// canceled.
8412func (c *BillingAccountsSinksUpdateCall) Context(ctx context.Context) *BillingAccountsSinksUpdateCall {
8413	c.ctx_ = ctx
8414	return c
8415}
8416
8417// Header returns an http.Header that can be modified by the caller to
8418// add HTTP headers to the request.
8419func (c *BillingAccountsSinksUpdateCall) Header() http.Header {
8420	if c.header_ == nil {
8421		c.header_ = make(http.Header)
8422	}
8423	return c.header_
8424}
8425
8426func (c *BillingAccountsSinksUpdateCall) doRequest(alt string) (*http.Response, error) {
8427	reqHeaders := make(http.Header)
8428	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
8429	for k, v := range c.header_ {
8430		reqHeaders[k] = v
8431	}
8432	reqHeaders.Set("User-Agent", c.s.userAgent())
8433	var body io.Reader = nil
8434	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
8435	if err != nil {
8436		return nil, err
8437	}
8438	reqHeaders.Set("Content-Type", "application/json")
8439	c.urlParams_.Set("alt", alt)
8440	c.urlParams_.Set("prettyPrint", "false")
8441	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
8442	urls += "?" + c.urlParams_.Encode()
8443	req, err := http.NewRequest("PUT", urls, body)
8444	if err != nil {
8445		return nil, err
8446	}
8447	req.Header = reqHeaders
8448	googleapi.Expand(req.URL, map[string]string{
8449		"sinkName": c.sinkNameid,
8450	})
8451	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8452}
8453
8454// Do executes the "logging.billingAccounts.sinks.update" call.
8455// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
8456// code is an error. Response headers are in either
8457// *LogSink.ServerResponse.Header or (if a response was returned at all)
8458// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
8459// check whether the returned error was because http.StatusNotModified
8460// was returned.
8461func (c *BillingAccountsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
8462	gensupport.SetOptions(c.urlParams_, opts...)
8463	res, err := c.doRequest("json")
8464	if res != nil && res.StatusCode == http.StatusNotModified {
8465		if res.Body != nil {
8466			res.Body.Close()
8467		}
8468		return nil, &googleapi.Error{
8469			Code:   res.StatusCode,
8470			Header: res.Header,
8471		}
8472	}
8473	if err != nil {
8474		return nil, err
8475	}
8476	defer googleapi.CloseBody(res)
8477	if err := googleapi.CheckResponse(res); err != nil {
8478		return nil, err
8479	}
8480	ret := &LogSink{
8481		ServerResponse: googleapi.ServerResponse{
8482			Header:         res.Header,
8483			HTTPStatusCode: res.StatusCode,
8484		},
8485	}
8486	target := &ret
8487	if err := gensupport.DecodeResponse(target, res); err != nil {
8488		return nil, err
8489	}
8490	return ret, nil
8491	// {
8492	//   "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.",
8493	//   "flatPath": "v2/billingAccounts/{billingAccountsId}/sinks/{sinksId}",
8494	//   "httpMethod": "PUT",
8495	//   "id": "logging.billingAccounts.sinks.update",
8496	//   "parameterOrder": [
8497	//     "sinkName"
8498	//   ],
8499	//   "parameters": {
8500	//     "sinkName": {
8501	//       "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]\" For example:\"projects/my-project/sinks/my-sink\"",
8502	//       "location": "path",
8503	//       "pattern": "^billingAccounts/[^/]+/sinks/[^/]+$",
8504	//       "required": true,
8505	//       "type": "string"
8506	//     },
8507	//     "uniqueWriterIdentity": {
8508	//       "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.",
8509	//       "location": "query",
8510	//       "type": "boolean"
8511	//     },
8512	//     "updateMask": {
8513	//       "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,includeChildrenAt 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.FieldMaskFor example: updateMask=filter",
8514	//       "format": "google-fieldmask",
8515	//       "location": "query",
8516	//       "type": "string"
8517	//     }
8518	//   },
8519	//   "path": "v2/{+sinkName}",
8520	//   "request": {
8521	//     "$ref": "LogSink"
8522	//   },
8523	//   "response": {
8524	//     "$ref": "LogSink"
8525	//   },
8526	//   "scopes": [
8527	//     "https://www.googleapis.com/auth/cloud-platform",
8528	//     "https://www.googleapis.com/auth/logging.admin"
8529	//   ]
8530	// }
8531
8532}
8533
8534// method id "logging.entries.copy":
8535
8536type EntriesCopyCall struct {
8537	s                     *Service
8538	copylogentriesrequest *CopyLogEntriesRequest
8539	urlParams_            gensupport.URLParams
8540	ctx_                  context.Context
8541	header_               http.Header
8542}
8543
8544// Copy: Copies a set of log entries from a log bucket to a Cloud
8545// Storage bucket.
8546func (r *EntriesService) Copy(copylogentriesrequest *CopyLogEntriesRequest) *EntriesCopyCall {
8547	c := &EntriesCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8548	c.copylogentriesrequest = copylogentriesrequest
8549	return c
8550}
8551
8552// Fields allows partial responses to be retrieved. See
8553// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8554// for more information.
8555func (c *EntriesCopyCall) Fields(s ...googleapi.Field) *EntriesCopyCall {
8556	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8557	return c
8558}
8559
8560// Context sets the context to be used in this call's Do method. Any
8561// pending HTTP request will be aborted if the provided context is
8562// canceled.
8563func (c *EntriesCopyCall) Context(ctx context.Context) *EntriesCopyCall {
8564	c.ctx_ = ctx
8565	return c
8566}
8567
8568// Header returns an http.Header that can be modified by the caller to
8569// add HTTP headers to the request.
8570func (c *EntriesCopyCall) Header() http.Header {
8571	if c.header_ == nil {
8572		c.header_ = make(http.Header)
8573	}
8574	return c.header_
8575}
8576
8577func (c *EntriesCopyCall) doRequest(alt string) (*http.Response, error) {
8578	reqHeaders := make(http.Header)
8579	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
8580	for k, v := range c.header_ {
8581		reqHeaders[k] = v
8582	}
8583	reqHeaders.Set("User-Agent", c.s.userAgent())
8584	var body io.Reader = nil
8585	body, err := googleapi.WithoutDataWrapper.JSONReader(c.copylogentriesrequest)
8586	if err != nil {
8587		return nil, err
8588	}
8589	reqHeaders.Set("Content-Type", "application/json")
8590	c.urlParams_.Set("alt", alt)
8591	c.urlParams_.Set("prettyPrint", "false")
8592	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/entries:copy")
8593	urls += "?" + c.urlParams_.Encode()
8594	req, err := http.NewRequest("POST", urls, body)
8595	if err != nil {
8596		return nil, err
8597	}
8598	req.Header = reqHeaders
8599	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8600}
8601
8602// Do executes the "logging.entries.copy" call.
8603// Exactly one of *Operation or error will be non-nil. Any non-2xx
8604// status code is an error. Response headers are in either
8605// *Operation.ServerResponse.Header or (if a response was returned at
8606// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
8607// to check whether the returned error was because
8608// http.StatusNotModified was returned.
8609func (c *EntriesCopyCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
8610	gensupport.SetOptions(c.urlParams_, opts...)
8611	res, err := c.doRequest("json")
8612	if res != nil && res.StatusCode == http.StatusNotModified {
8613		if res.Body != nil {
8614			res.Body.Close()
8615		}
8616		return nil, &googleapi.Error{
8617			Code:   res.StatusCode,
8618			Header: res.Header,
8619		}
8620	}
8621	if err != nil {
8622		return nil, err
8623	}
8624	defer googleapi.CloseBody(res)
8625	if err := googleapi.CheckResponse(res); err != nil {
8626		return nil, err
8627	}
8628	ret := &Operation{
8629		ServerResponse: googleapi.ServerResponse{
8630			Header:         res.Header,
8631			HTTPStatusCode: res.StatusCode,
8632		},
8633	}
8634	target := &ret
8635	if err := gensupport.DecodeResponse(target, res); err != nil {
8636		return nil, err
8637	}
8638	return ret, nil
8639	// {
8640	//   "description": "Copies a set of log entries from a log bucket to a Cloud Storage bucket.",
8641	//   "flatPath": "v2/entries:copy",
8642	//   "httpMethod": "POST",
8643	//   "id": "logging.entries.copy",
8644	//   "parameterOrder": [],
8645	//   "parameters": {},
8646	//   "path": "v2/entries:copy",
8647	//   "request": {
8648	//     "$ref": "CopyLogEntriesRequest"
8649	//   },
8650	//   "response": {
8651	//     "$ref": "Operation"
8652	//   },
8653	//   "scopes": [
8654	//     "https://www.googleapis.com/auth/cloud-platform",
8655	//     "https://www.googleapis.com/auth/logging.admin"
8656	//   ]
8657	// }
8658
8659}
8660
8661// method id "logging.entries.list":
8662
8663type EntriesListCall struct {
8664	s                     *Service
8665	listlogentriesrequest *ListLogEntriesRequest
8666	urlParams_            gensupport.URLParams
8667	ctx_                  context.Context
8668	header_               http.Header
8669}
8670
8671// List: Lists log entries. Use this method to retrieve log entries that
8672// originated from a project/folder/organization/billing account. For
8673// ways to export log entries, see Exporting Logs
8674// (https://cloud.google.com/logging/docs/export).
8675func (r *EntriesService) List(listlogentriesrequest *ListLogEntriesRequest) *EntriesListCall {
8676	c := &EntriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8677	c.listlogentriesrequest = listlogentriesrequest
8678	return c
8679}
8680
8681// Fields allows partial responses to be retrieved. See
8682// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8683// for more information.
8684func (c *EntriesListCall) Fields(s ...googleapi.Field) *EntriesListCall {
8685	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8686	return c
8687}
8688
8689// Context sets the context to be used in this call's Do method. Any
8690// pending HTTP request will be aborted if the provided context is
8691// canceled.
8692func (c *EntriesListCall) Context(ctx context.Context) *EntriesListCall {
8693	c.ctx_ = ctx
8694	return c
8695}
8696
8697// Header returns an http.Header that can be modified by the caller to
8698// add HTTP headers to the request.
8699func (c *EntriesListCall) Header() http.Header {
8700	if c.header_ == nil {
8701		c.header_ = make(http.Header)
8702	}
8703	return c.header_
8704}
8705
8706func (c *EntriesListCall) doRequest(alt string) (*http.Response, error) {
8707	reqHeaders := make(http.Header)
8708	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
8709	for k, v := range c.header_ {
8710		reqHeaders[k] = v
8711	}
8712	reqHeaders.Set("User-Agent", c.s.userAgent())
8713	var body io.Reader = nil
8714	body, err := googleapi.WithoutDataWrapper.JSONReader(c.listlogentriesrequest)
8715	if err != nil {
8716		return nil, err
8717	}
8718	reqHeaders.Set("Content-Type", "application/json")
8719	c.urlParams_.Set("alt", alt)
8720	c.urlParams_.Set("prettyPrint", "false")
8721	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/entries:list")
8722	urls += "?" + c.urlParams_.Encode()
8723	req, err := http.NewRequest("POST", urls, body)
8724	if err != nil {
8725		return nil, err
8726	}
8727	req.Header = reqHeaders
8728	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8729}
8730
8731// Do executes the "logging.entries.list" call.
8732// Exactly one of *ListLogEntriesResponse or error will be non-nil. Any
8733// non-2xx status code is an error. Response headers are in either
8734// *ListLogEntriesResponse.ServerResponse.Header or (if a response was
8735// returned at all) in error.(*googleapi.Error).Header. Use
8736// googleapi.IsNotModified to check whether the returned error was
8737// because http.StatusNotModified was returned.
8738func (c *EntriesListCall) Do(opts ...googleapi.CallOption) (*ListLogEntriesResponse, error) {
8739	gensupport.SetOptions(c.urlParams_, opts...)
8740	res, err := c.doRequest("json")
8741	if res != nil && res.StatusCode == http.StatusNotModified {
8742		if res.Body != nil {
8743			res.Body.Close()
8744		}
8745		return nil, &googleapi.Error{
8746			Code:   res.StatusCode,
8747			Header: res.Header,
8748		}
8749	}
8750	if err != nil {
8751		return nil, err
8752	}
8753	defer googleapi.CloseBody(res)
8754	if err := googleapi.CheckResponse(res); err != nil {
8755		return nil, err
8756	}
8757	ret := &ListLogEntriesResponse{
8758		ServerResponse: googleapi.ServerResponse{
8759			Header:         res.Header,
8760			HTTPStatusCode: res.StatusCode,
8761		},
8762	}
8763	target := &ret
8764	if err := gensupport.DecodeResponse(target, res); err != nil {
8765		return nil, err
8766	}
8767	return ret, nil
8768	// {
8769	//   "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).",
8770	//   "flatPath": "v2/entries:list",
8771	//   "httpMethod": "POST",
8772	//   "id": "logging.entries.list",
8773	//   "parameterOrder": [],
8774	//   "parameters": {},
8775	//   "path": "v2/entries:list",
8776	//   "request": {
8777	//     "$ref": "ListLogEntriesRequest"
8778	//   },
8779	//   "response": {
8780	//     "$ref": "ListLogEntriesResponse"
8781	//   },
8782	//   "scopes": [
8783	//     "https://www.googleapis.com/auth/cloud-platform",
8784	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
8785	//     "https://www.googleapis.com/auth/logging.admin",
8786	//     "https://www.googleapis.com/auth/logging.read"
8787	//   ]
8788	// }
8789
8790}
8791
8792// Pages invokes f for each page of results.
8793// A non-nil error returned from f will halt the iteration.
8794// The provided context supersedes any context provided to the Context method.
8795func (c *EntriesListCall) Pages(ctx context.Context, f func(*ListLogEntriesResponse) error) error {
8796	c.ctx_ = ctx
8797	defer func(pt string) { c.listlogentriesrequest.PageToken = pt }(c.listlogentriesrequest.PageToken) // reset paging to original point
8798	for {
8799		x, err := c.Do()
8800		if err != nil {
8801			return err
8802		}
8803		if err := f(x); err != nil {
8804			return err
8805		}
8806		if x.NextPageToken == "" {
8807			return nil
8808		}
8809		c.listlogentriesrequest.PageToken = x.NextPageToken
8810	}
8811}
8812
8813// method id "logging.entries.tail":
8814
8815type EntriesTailCall struct {
8816	s                     *Service
8817	taillogentriesrequest *TailLogEntriesRequest
8818	urlParams_            gensupport.URLParams
8819	ctx_                  context.Context
8820	header_               http.Header
8821}
8822
8823// Tail: Streaming read of log entries as they are ingested. Until the
8824// stream is terminated, it will continue reading logs.
8825func (r *EntriesService) Tail(taillogentriesrequest *TailLogEntriesRequest) *EntriesTailCall {
8826	c := &EntriesTailCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8827	c.taillogentriesrequest = taillogentriesrequest
8828	return c
8829}
8830
8831// Fields allows partial responses to be retrieved. See
8832// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8833// for more information.
8834func (c *EntriesTailCall) Fields(s ...googleapi.Field) *EntriesTailCall {
8835	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8836	return c
8837}
8838
8839// Context sets the context to be used in this call's Do method. Any
8840// pending HTTP request will be aborted if the provided context is
8841// canceled.
8842func (c *EntriesTailCall) Context(ctx context.Context) *EntriesTailCall {
8843	c.ctx_ = ctx
8844	return c
8845}
8846
8847// Header returns an http.Header that can be modified by the caller to
8848// add HTTP headers to the request.
8849func (c *EntriesTailCall) Header() http.Header {
8850	if c.header_ == nil {
8851		c.header_ = make(http.Header)
8852	}
8853	return c.header_
8854}
8855
8856func (c *EntriesTailCall) doRequest(alt string) (*http.Response, error) {
8857	reqHeaders := make(http.Header)
8858	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
8859	for k, v := range c.header_ {
8860		reqHeaders[k] = v
8861	}
8862	reqHeaders.Set("User-Agent", c.s.userAgent())
8863	var body io.Reader = nil
8864	body, err := googleapi.WithoutDataWrapper.JSONReader(c.taillogentriesrequest)
8865	if err != nil {
8866		return nil, err
8867	}
8868	reqHeaders.Set("Content-Type", "application/json")
8869	c.urlParams_.Set("alt", alt)
8870	c.urlParams_.Set("prettyPrint", "false")
8871	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/entries:tail")
8872	urls += "?" + c.urlParams_.Encode()
8873	req, err := http.NewRequest("POST", urls, body)
8874	if err != nil {
8875		return nil, err
8876	}
8877	req.Header = reqHeaders
8878	return gensupport.SendRequest(c.ctx_, c.s.client, req)
8879}
8880
8881// Do executes the "logging.entries.tail" call.
8882// Exactly one of *TailLogEntriesResponse or error will be non-nil. Any
8883// non-2xx status code is an error. Response headers are in either
8884// *TailLogEntriesResponse.ServerResponse.Header or (if a response was
8885// returned at all) in error.(*googleapi.Error).Header. Use
8886// googleapi.IsNotModified to check whether the returned error was
8887// because http.StatusNotModified was returned.
8888func (c *EntriesTailCall) Do(opts ...googleapi.CallOption) (*TailLogEntriesResponse, error) {
8889	gensupport.SetOptions(c.urlParams_, opts...)
8890	res, err := c.doRequest("json")
8891	if res != nil && res.StatusCode == http.StatusNotModified {
8892		if res.Body != nil {
8893			res.Body.Close()
8894		}
8895		return nil, &googleapi.Error{
8896			Code:   res.StatusCode,
8897			Header: res.Header,
8898		}
8899	}
8900	if err != nil {
8901		return nil, err
8902	}
8903	defer googleapi.CloseBody(res)
8904	if err := googleapi.CheckResponse(res); err != nil {
8905		return nil, err
8906	}
8907	ret := &TailLogEntriesResponse{
8908		ServerResponse: googleapi.ServerResponse{
8909			Header:         res.Header,
8910			HTTPStatusCode: res.StatusCode,
8911		},
8912	}
8913	target := &ret
8914	if err := gensupport.DecodeResponse(target, res); err != nil {
8915		return nil, err
8916	}
8917	return ret, nil
8918	// {
8919	//   "description": "Streaming read of log entries as they are ingested. Until the stream is terminated, it will continue reading logs.",
8920	//   "flatPath": "v2/entries:tail",
8921	//   "httpMethod": "POST",
8922	//   "id": "logging.entries.tail",
8923	//   "parameterOrder": [],
8924	//   "parameters": {},
8925	//   "path": "v2/entries:tail",
8926	//   "request": {
8927	//     "$ref": "TailLogEntriesRequest"
8928	//   },
8929	//   "response": {
8930	//     "$ref": "TailLogEntriesResponse"
8931	//   },
8932	//   "scopes": [
8933	//     "https://www.googleapis.com/auth/cloud-platform",
8934	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
8935	//     "https://www.googleapis.com/auth/logging.admin",
8936	//     "https://www.googleapis.com/auth/logging.read"
8937	//   ]
8938	// }
8939
8940}
8941
8942// method id "logging.entries.write":
8943
8944type EntriesWriteCall struct {
8945	s                      *Service
8946	writelogentriesrequest *WriteLogEntriesRequest
8947	urlParams_             gensupport.URLParams
8948	ctx_                   context.Context
8949	header_                http.Header
8950}
8951
8952// Write: Writes log entries to Logging. This API method is the only way
8953// to send log entries to Logging. This method is used, directly or
8954// indirectly, by the Logging agent (fluentd) and all logging libraries
8955// configured to use Logging. A single request may contain log entries
8956// for a maximum of 1000 different resources (projects, organizations,
8957// billing accounts or folders)
8958func (r *EntriesService) Write(writelogentriesrequest *WriteLogEntriesRequest) *EntriesWriteCall {
8959	c := &EntriesWriteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8960	c.writelogentriesrequest = writelogentriesrequest
8961	return c
8962}
8963
8964// Fields allows partial responses to be retrieved. See
8965// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
8966// for more information.
8967func (c *EntriesWriteCall) Fields(s ...googleapi.Field) *EntriesWriteCall {
8968	c.urlParams_.Set("fields", googleapi.CombineFields(s))
8969	return c
8970}
8971
8972// Context sets the context to be used in this call's Do method. Any
8973// pending HTTP request will be aborted if the provided context is
8974// canceled.
8975func (c *EntriesWriteCall) Context(ctx context.Context) *EntriesWriteCall {
8976	c.ctx_ = ctx
8977	return c
8978}
8979
8980// Header returns an http.Header that can be modified by the caller to
8981// add HTTP headers to the request.
8982func (c *EntriesWriteCall) Header() http.Header {
8983	if c.header_ == nil {
8984		c.header_ = make(http.Header)
8985	}
8986	return c.header_
8987}
8988
8989func (c *EntriesWriteCall) doRequest(alt string) (*http.Response, error) {
8990	reqHeaders := make(http.Header)
8991	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
8992	for k, v := range c.header_ {
8993		reqHeaders[k] = v
8994	}
8995	reqHeaders.Set("User-Agent", c.s.userAgent())
8996	var body io.Reader = nil
8997	body, err := googleapi.WithoutDataWrapper.JSONReader(c.writelogentriesrequest)
8998	if err != nil {
8999		return nil, err
9000	}
9001	reqHeaders.Set("Content-Type", "application/json")
9002	c.urlParams_.Set("alt", alt)
9003	c.urlParams_.Set("prettyPrint", "false")
9004	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/entries:write")
9005	urls += "?" + c.urlParams_.Encode()
9006	req, err := http.NewRequest("POST", urls, body)
9007	if err != nil {
9008		return nil, err
9009	}
9010	req.Header = reqHeaders
9011	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9012}
9013
9014// Do executes the "logging.entries.write" call.
9015// Exactly one of *WriteLogEntriesResponse or error will be non-nil. Any
9016// non-2xx status code is an error. Response headers are in either
9017// *WriteLogEntriesResponse.ServerResponse.Header or (if a response was
9018// returned at all) in error.(*googleapi.Error).Header. Use
9019// googleapi.IsNotModified to check whether the returned error was
9020// because http.StatusNotModified was returned.
9021func (c *EntriesWriteCall) Do(opts ...googleapi.CallOption) (*WriteLogEntriesResponse, error) {
9022	gensupport.SetOptions(c.urlParams_, opts...)
9023	res, err := c.doRequest("json")
9024	if res != nil && res.StatusCode == http.StatusNotModified {
9025		if res.Body != nil {
9026			res.Body.Close()
9027		}
9028		return nil, &googleapi.Error{
9029			Code:   res.StatusCode,
9030			Header: res.Header,
9031		}
9032	}
9033	if err != nil {
9034		return nil, err
9035	}
9036	defer googleapi.CloseBody(res)
9037	if err := googleapi.CheckResponse(res); err != nil {
9038		return nil, err
9039	}
9040	ret := &WriteLogEntriesResponse{
9041		ServerResponse: googleapi.ServerResponse{
9042			Header:         res.Header,
9043			HTTPStatusCode: res.StatusCode,
9044		},
9045	}
9046	target := &ret
9047	if err := gensupport.DecodeResponse(target, res); err != nil {
9048		return nil, err
9049	}
9050	return ret, nil
9051	// {
9052	//   "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)",
9053	//   "flatPath": "v2/entries:write",
9054	//   "httpMethod": "POST",
9055	//   "id": "logging.entries.write",
9056	//   "parameterOrder": [],
9057	//   "parameters": {},
9058	//   "path": "v2/entries:write",
9059	//   "request": {
9060	//     "$ref": "WriteLogEntriesRequest"
9061	//   },
9062	//   "response": {
9063	//     "$ref": "WriteLogEntriesResponse"
9064	//   },
9065	//   "scopes": [
9066	//     "https://www.googleapis.com/auth/cloud-platform",
9067	//     "https://www.googleapis.com/auth/logging.admin",
9068	//     "https://www.googleapis.com/auth/logging.write"
9069	//   ]
9070	// }
9071
9072}
9073
9074// method id "logging.exclusions.create":
9075
9076type ExclusionsCreateCall struct {
9077	s            *Service
9078	parent       string
9079	logexclusion *LogExclusion
9080	urlParams_   gensupport.URLParams
9081	ctx_         context.Context
9082	header_      http.Header
9083}
9084
9085// Create: Creates a new exclusion in the _Default sink in a specified
9086// parent resource. Only log entries belonging to that resource can be
9087// excluded. You can have up to 10 exclusions in a resource.
9088//
9089// - parent: The parent resource in which to create the exclusion:
9090//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
9091//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For
9092//   examples:"projects/my-logging-project" "organizations/123456789".
9093func (r *ExclusionsService) Create(parent string, logexclusion *LogExclusion) *ExclusionsCreateCall {
9094	c := &ExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9095	c.parent = parent
9096	c.logexclusion = logexclusion
9097	return c
9098}
9099
9100// Fields allows partial responses to be retrieved. See
9101// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9102// for more information.
9103func (c *ExclusionsCreateCall) Fields(s ...googleapi.Field) *ExclusionsCreateCall {
9104	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9105	return c
9106}
9107
9108// Context sets the context to be used in this call's Do method. Any
9109// pending HTTP request will be aborted if the provided context is
9110// canceled.
9111func (c *ExclusionsCreateCall) Context(ctx context.Context) *ExclusionsCreateCall {
9112	c.ctx_ = ctx
9113	return c
9114}
9115
9116// Header returns an http.Header that can be modified by the caller to
9117// add HTTP headers to the request.
9118func (c *ExclusionsCreateCall) Header() http.Header {
9119	if c.header_ == nil {
9120		c.header_ = make(http.Header)
9121	}
9122	return c.header_
9123}
9124
9125func (c *ExclusionsCreateCall) doRequest(alt string) (*http.Response, error) {
9126	reqHeaders := make(http.Header)
9127	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
9128	for k, v := range c.header_ {
9129		reqHeaders[k] = v
9130	}
9131	reqHeaders.Set("User-Agent", c.s.userAgent())
9132	var body io.Reader = nil
9133	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
9134	if err != nil {
9135		return nil, err
9136	}
9137	reqHeaders.Set("Content-Type", "application/json")
9138	c.urlParams_.Set("alt", alt)
9139	c.urlParams_.Set("prettyPrint", "false")
9140	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
9141	urls += "?" + c.urlParams_.Encode()
9142	req, err := http.NewRequest("POST", urls, body)
9143	if err != nil {
9144		return nil, err
9145	}
9146	req.Header = reqHeaders
9147	googleapi.Expand(req.URL, map[string]string{
9148		"parent": c.parent,
9149	})
9150	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9151}
9152
9153// Do executes the "logging.exclusions.create" call.
9154// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
9155// status code is an error. Response headers are in either
9156// *LogExclusion.ServerResponse.Header or (if a response was returned at
9157// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
9158// to check whether the returned error was because
9159// http.StatusNotModified was returned.
9160func (c *ExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
9161	gensupport.SetOptions(c.urlParams_, opts...)
9162	res, err := c.doRequest("json")
9163	if res != nil && res.StatusCode == http.StatusNotModified {
9164		if res.Body != nil {
9165			res.Body.Close()
9166		}
9167		return nil, &googleapi.Error{
9168			Code:   res.StatusCode,
9169			Header: res.Header,
9170		}
9171	}
9172	if err != nil {
9173		return nil, err
9174	}
9175	defer googleapi.CloseBody(res)
9176	if err := googleapi.CheckResponse(res); err != nil {
9177		return nil, err
9178	}
9179	ret := &LogExclusion{
9180		ServerResponse: googleapi.ServerResponse{
9181			Header:         res.Header,
9182			HTTPStatusCode: res.StatusCode,
9183		},
9184	}
9185	target := &ret
9186	if err := gensupport.DecodeResponse(target, res); err != nil {
9187		return nil, err
9188	}
9189	return ret, nil
9190	// {
9191	//   "description": "Creates a new exclusion in the _Default sink 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.",
9192	//   "flatPath": "v2/{v2Id}/{v2Id1}/exclusions",
9193	//   "httpMethod": "POST",
9194	//   "id": "logging.exclusions.create",
9195	//   "parameterOrder": [
9196	//     "parent"
9197	//   ],
9198	//   "parameters": {
9199	//     "parent": {
9200	//       "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-logging-project\" \"organizations/123456789\"",
9201	//       "location": "path",
9202	//       "pattern": "^[^/]+/[^/]+$",
9203	//       "required": true,
9204	//       "type": "string"
9205	//     }
9206	//   },
9207	//   "path": "v2/{+parent}/exclusions",
9208	//   "request": {
9209	//     "$ref": "LogExclusion"
9210	//   },
9211	//   "response": {
9212	//     "$ref": "LogExclusion"
9213	//   },
9214	//   "scopes": [
9215	//     "https://www.googleapis.com/auth/cloud-platform",
9216	//     "https://www.googleapis.com/auth/logging.admin"
9217	//   ]
9218	// }
9219
9220}
9221
9222// method id "logging.exclusions.delete":
9223
9224type ExclusionsDeleteCall struct {
9225	s          *Service
9226	name       string
9227	urlParams_ gensupport.URLParams
9228	ctx_       context.Context
9229	header_    http.Header
9230}
9231
9232// Delete: Deletes an exclusion in the _Default sink.
9233//
9234// - name: The resource name of an existing exclusion to delete:
9235//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
9236//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
9237//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
9238//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For
9239//   example:"projects/my-project/exclusions/my-exclusion".
9240func (r *ExclusionsService) Delete(name string) *ExclusionsDeleteCall {
9241	c := &ExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9242	c.name = name
9243	return c
9244}
9245
9246// Fields allows partial responses to be retrieved. See
9247// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9248// for more information.
9249func (c *ExclusionsDeleteCall) Fields(s ...googleapi.Field) *ExclusionsDeleteCall {
9250	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9251	return c
9252}
9253
9254// Context sets the context to be used in this call's Do method. Any
9255// pending HTTP request will be aborted if the provided context is
9256// canceled.
9257func (c *ExclusionsDeleteCall) Context(ctx context.Context) *ExclusionsDeleteCall {
9258	c.ctx_ = ctx
9259	return c
9260}
9261
9262// Header returns an http.Header that can be modified by the caller to
9263// add HTTP headers to the request.
9264func (c *ExclusionsDeleteCall) Header() http.Header {
9265	if c.header_ == nil {
9266		c.header_ = make(http.Header)
9267	}
9268	return c.header_
9269}
9270
9271func (c *ExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) {
9272	reqHeaders := make(http.Header)
9273	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
9274	for k, v := range c.header_ {
9275		reqHeaders[k] = v
9276	}
9277	reqHeaders.Set("User-Agent", c.s.userAgent())
9278	var body io.Reader = nil
9279	c.urlParams_.Set("alt", alt)
9280	c.urlParams_.Set("prettyPrint", "false")
9281	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
9282	urls += "?" + c.urlParams_.Encode()
9283	req, err := http.NewRequest("DELETE", urls, body)
9284	if err != nil {
9285		return nil, err
9286	}
9287	req.Header = reqHeaders
9288	googleapi.Expand(req.URL, map[string]string{
9289		"name": c.name,
9290	})
9291	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9292}
9293
9294// Do executes the "logging.exclusions.delete" call.
9295// Exactly one of *Empty or error will be non-nil. Any non-2xx status
9296// code is an error. Response headers are in either
9297// *Empty.ServerResponse.Header or (if a response was returned at all)
9298// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
9299// check whether the returned error was because http.StatusNotModified
9300// was returned.
9301func (c *ExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
9302	gensupport.SetOptions(c.urlParams_, opts...)
9303	res, err := c.doRequest("json")
9304	if res != nil && res.StatusCode == http.StatusNotModified {
9305		if res.Body != nil {
9306			res.Body.Close()
9307		}
9308		return nil, &googleapi.Error{
9309			Code:   res.StatusCode,
9310			Header: res.Header,
9311		}
9312	}
9313	if err != nil {
9314		return nil, err
9315	}
9316	defer googleapi.CloseBody(res)
9317	if err := googleapi.CheckResponse(res); err != nil {
9318		return nil, err
9319	}
9320	ret := &Empty{
9321		ServerResponse: googleapi.ServerResponse{
9322			Header:         res.Header,
9323			HTTPStatusCode: res.StatusCode,
9324		},
9325	}
9326	target := &ret
9327	if err := gensupport.DecodeResponse(target, res); err != nil {
9328		return nil, err
9329	}
9330	return ret, nil
9331	// {
9332	//   "description": "Deletes an exclusion in the _Default sink.",
9333	//   "flatPath": "v2/{v2Id}/{v2Id1}/exclusions/{exclusionsId}",
9334	//   "httpMethod": "DELETE",
9335	//   "id": "logging.exclusions.delete",
9336	//   "parameterOrder": [
9337	//     "name"
9338	//   ],
9339	//   "parameters": {
9340	//     "name": {
9341	//       "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]\" For example:\"projects/my-project/exclusions/my-exclusion\"",
9342	//       "location": "path",
9343	//       "pattern": "^[^/]+/[^/]+/exclusions/[^/]+$",
9344	//       "required": true,
9345	//       "type": "string"
9346	//     }
9347	//   },
9348	//   "path": "v2/{+name}",
9349	//   "response": {
9350	//     "$ref": "Empty"
9351	//   },
9352	//   "scopes": [
9353	//     "https://www.googleapis.com/auth/cloud-platform",
9354	//     "https://www.googleapis.com/auth/logging.admin"
9355	//   ]
9356	// }
9357
9358}
9359
9360// method id "logging.exclusions.get":
9361
9362type ExclusionsGetCall struct {
9363	s            *Service
9364	name         string
9365	urlParams_   gensupport.URLParams
9366	ifNoneMatch_ string
9367	ctx_         context.Context
9368	header_      http.Header
9369}
9370
9371// Get: Gets the description of an exclusion in the _Default sink.
9372//
9373// - name: The resource name of an existing exclusion:
9374//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
9375//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
9376//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
9377//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For
9378//   example:"projects/my-project/exclusions/my-exclusion".
9379func (r *ExclusionsService) Get(name string) *ExclusionsGetCall {
9380	c := &ExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9381	c.name = name
9382	return c
9383}
9384
9385// Fields allows partial responses to be retrieved. See
9386// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9387// for more information.
9388func (c *ExclusionsGetCall) Fields(s ...googleapi.Field) *ExclusionsGetCall {
9389	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9390	return c
9391}
9392
9393// IfNoneMatch sets the optional parameter which makes the operation
9394// fail if the object's ETag matches the given value. This is useful for
9395// getting updates only after the object has changed since the last
9396// request. Use googleapi.IsNotModified to check whether the response
9397// error from Do is the result of In-None-Match.
9398func (c *ExclusionsGetCall) IfNoneMatch(entityTag string) *ExclusionsGetCall {
9399	c.ifNoneMatch_ = entityTag
9400	return c
9401}
9402
9403// Context sets the context to be used in this call's Do method. Any
9404// pending HTTP request will be aborted if the provided context is
9405// canceled.
9406func (c *ExclusionsGetCall) Context(ctx context.Context) *ExclusionsGetCall {
9407	c.ctx_ = ctx
9408	return c
9409}
9410
9411// Header returns an http.Header that can be modified by the caller to
9412// add HTTP headers to the request.
9413func (c *ExclusionsGetCall) Header() http.Header {
9414	if c.header_ == nil {
9415		c.header_ = make(http.Header)
9416	}
9417	return c.header_
9418}
9419
9420func (c *ExclusionsGetCall) doRequest(alt string) (*http.Response, error) {
9421	reqHeaders := make(http.Header)
9422	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
9423	for k, v := range c.header_ {
9424		reqHeaders[k] = v
9425	}
9426	reqHeaders.Set("User-Agent", c.s.userAgent())
9427	if c.ifNoneMatch_ != "" {
9428		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9429	}
9430	var body io.Reader = nil
9431	c.urlParams_.Set("alt", alt)
9432	c.urlParams_.Set("prettyPrint", "false")
9433	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
9434	urls += "?" + c.urlParams_.Encode()
9435	req, err := http.NewRequest("GET", urls, body)
9436	if err != nil {
9437		return nil, err
9438	}
9439	req.Header = reqHeaders
9440	googleapi.Expand(req.URL, map[string]string{
9441		"name": c.name,
9442	})
9443	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9444}
9445
9446// Do executes the "logging.exclusions.get" call.
9447// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
9448// status code is an error. Response headers are in either
9449// *LogExclusion.ServerResponse.Header or (if a response was returned at
9450// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
9451// to check whether the returned error was because
9452// http.StatusNotModified was returned.
9453func (c *ExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
9454	gensupport.SetOptions(c.urlParams_, opts...)
9455	res, err := c.doRequest("json")
9456	if res != nil && res.StatusCode == http.StatusNotModified {
9457		if res.Body != nil {
9458			res.Body.Close()
9459		}
9460		return nil, &googleapi.Error{
9461			Code:   res.StatusCode,
9462			Header: res.Header,
9463		}
9464	}
9465	if err != nil {
9466		return nil, err
9467	}
9468	defer googleapi.CloseBody(res)
9469	if err := googleapi.CheckResponse(res); err != nil {
9470		return nil, err
9471	}
9472	ret := &LogExclusion{
9473		ServerResponse: googleapi.ServerResponse{
9474			Header:         res.Header,
9475			HTTPStatusCode: res.StatusCode,
9476		},
9477	}
9478	target := &ret
9479	if err := gensupport.DecodeResponse(target, res); err != nil {
9480		return nil, err
9481	}
9482	return ret, nil
9483	// {
9484	//   "description": "Gets the description of an exclusion in the _Default sink.",
9485	//   "flatPath": "v2/{v2Id}/{v2Id1}/exclusions/{exclusionsId}",
9486	//   "httpMethod": "GET",
9487	//   "id": "logging.exclusions.get",
9488	//   "parameterOrder": [
9489	//     "name"
9490	//   ],
9491	//   "parameters": {
9492	//     "name": {
9493	//       "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]\" For example:\"projects/my-project/exclusions/my-exclusion\"",
9494	//       "location": "path",
9495	//       "pattern": "^[^/]+/[^/]+/exclusions/[^/]+$",
9496	//       "required": true,
9497	//       "type": "string"
9498	//     }
9499	//   },
9500	//   "path": "v2/{+name}",
9501	//   "response": {
9502	//     "$ref": "LogExclusion"
9503	//   },
9504	//   "scopes": [
9505	//     "https://www.googleapis.com/auth/cloud-platform",
9506	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
9507	//     "https://www.googleapis.com/auth/logging.admin",
9508	//     "https://www.googleapis.com/auth/logging.read"
9509	//   ]
9510	// }
9511
9512}
9513
9514// method id "logging.exclusions.list":
9515
9516type ExclusionsListCall struct {
9517	s            *Service
9518	parent       string
9519	urlParams_   gensupport.URLParams
9520	ifNoneMatch_ string
9521	ctx_         context.Context
9522	header_      http.Header
9523}
9524
9525// List: Lists all the exclusions on the _Default sink in a parent
9526// resource.
9527//
9528// - parent: The parent resource whose exclusions are to be listed.
9529//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
9530//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]".
9531func (r *ExclusionsService) List(parent string) *ExclusionsListCall {
9532	c := &ExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9533	c.parent = parent
9534	return c
9535}
9536
9537// PageSize sets the optional parameter "pageSize": The maximum number
9538// of results to return from this request. Non-positive values are
9539// ignored. The presence of nextPageToken in the response indicates that
9540// more results might be available.
9541func (c *ExclusionsListCall) PageSize(pageSize int64) *ExclusionsListCall {
9542	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
9543	return c
9544}
9545
9546// PageToken sets the optional parameter "pageToken": If present, then
9547// retrieve the next batch of results from the preceding call to this
9548// method. pageToken must be the value of nextPageToken from the
9549// previous response. The values of other method parameters should be
9550// identical to those in the previous call.
9551func (c *ExclusionsListCall) PageToken(pageToken string) *ExclusionsListCall {
9552	c.urlParams_.Set("pageToken", pageToken)
9553	return c
9554}
9555
9556// Fields allows partial responses to be retrieved. See
9557// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9558// for more information.
9559func (c *ExclusionsListCall) Fields(s ...googleapi.Field) *ExclusionsListCall {
9560	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9561	return c
9562}
9563
9564// IfNoneMatch sets the optional parameter which makes the operation
9565// fail if the object's ETag matches the given value. This is useful for
9566// getting updates only after the object has changed since the last
9567// request. Use googleapi.IsNotModified to check whether the response
9568// error from Do is the result of In-None-Match.
9569func (c *ExclusionsListCall) IfNoneMatch(entityTag string) *ExclusionsListCall {
9570	c.ifNoneMatch_ = entityTag
9571	return c
9572}
9573
9574// Context sets the context to be used in this call's Do method. Any
9575// pending HTTP request will be aborted if the provided context is
9576// canceled.
9577func (c *ExclusionsListCall) Context(ctx context.Context) *ExclusionsListCall {
9578	c.ctx_ = ctx
9579	return c
9580}
9581
9582// Header returns an http.Header that can be modified by the caller to
9583// add HTTP headers to the request.
9584func (c *ExclusionsListCall) Header() http.Header {
9585	if c.header_ == nil {
9586		c.header_ = make(http.Header)
9587	}
9588	return c.header_
9589}
9590
9591func (c *ExclusionsListCall) doRequest(alt string) (*http.Response, error) {
9592	reqHeaders := make(http.Header)
9593	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
9594	for k, v := range c.header_ {
9595		reqHeaders[k] = v
9596	}
9597	reqHeaders.Set("User-Agent", c.s.userAgent())
9598	if c.ifNoneMatch_ != "" {
9599		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
9600	}
9601	var body io.Reader = nil
9602	c.urlParams_.Set("alt", alt)
9603	c.urlParams_.Set("prettyPrint", "false")
9604	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
9605	urls += "?" + c.urlParams_.Encode()
9606	req, err := http.NewRequest("GET", urls, body)
9607	if err != nil {
9608		return nil, err
9609	}
9610	req.Header = reqHeaders
9611	googleapi.Expand(req.URL, map[string]string{
9612		"parent": c.parent,
9613	})
9614	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9615}
9616
9617// Do executes the "logging.exclusions.list" call.
9618// Exactly one of *ListExclusionsResponse or error will be non-nil. Any
9619// non-2xx status code is an error. Response headers are in either
9620// *ListExclusionsResponse.ServerResponse.Header or (if a response was
9621// returned at all) in error.(*googleapi.Error).Header. Use
9622// googleapi.IsNotModified to check whether the returned error was
9623// because http.StatusNotModified was returned.
9624func (c *ExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) {
9625	gensupport.SetOptions(c.urlParams_, opts...)
9626	res, err := c.doRequest("json")
9627	if res != nil && res.StatusCode == http.StatusNotModified {
9628		if res.Body != nil {
9629			res.Body.Close()
9630		}
9631		return nil, &googleapi.Error{
9632			Code:   res.StatusCode,
9633			Header: res.Header,
9634		}
9635	}
9636	if err != nil {
9637		return nil, err
9638	}
9639	defer googleapi.CloseBody(res)
9640	if err := googleapi.CheckResponse(res); err != nil {
9641		return nil, err
9642	}
9643	ret := &ListExclusionsResponse{
9644		ServerResponse: googleapi.ServerResponse{
9645			Header:         res.Header,
9646			HTTPStatusCode: res.StatusCode,
9647		},
9648	}
9649	target := &ret
9650	if err := gensupport.DecodeResponse(target, res); err != nil {
9651		return nil, err
9652	}
9653	return ret, nil
9654	// {
9655	//   "description": "Lists all the exclusions on the _Default sink in a parent resource.",
9656	//   "flatPath": "v2/{v2Id}/{v2Id1}/exclusions",
9657	//   "httpMethod": "GET",
9658	//   "id": "logging.exclusions.list",
9659	//   "parameterOrder": [
9660	//     "parent"
9661	//   ],
9662	//   "parameters": {
9663	//     "pageSize": {
9664	//       "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.",
9665	//       "format": "int32",
9666	//       "location": "query",
9667	//       "type": "integer"
9668	//     },
9669	//     "pageToken": {
9670	//       "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.",
9671	//       "location": "query",
9672	//       "type": "string"
9673	//     },
9674	//     "parent": {
9675	//       "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
9676	//       "location": "path",
9677	//       "pattern": "^[^/]+/[^/]+$",
9678	//       "required": true,
9679	//       "type": "string"
9680	//     }
9681	//   },
9682	//   "path": "v2/{+parent}/exclusions",
9683	//   "response": {
9684	//     "$ref": "ListExclusionsResponse"
9685	//   },
9686	//   "scopes": [
9687	//     "https://www.googleapis.com/auth/cloud-platform",
9688	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
9689	//     "https://www.googleapis.com/auth/logging.admin",
9690	//     "https://www.googleapis.com/auth/logging.read"
9691	//   ]
9692	// }
9693
9694}
9695
9696// Pages invokes f for each page of results.
9697// A non-nil error returned from f will halt the iteration.
9698// The provided context supersedes any context provided to the Context method.
9699func (c *ExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error {
9700	c.ctx_ = ctx
9701	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
9702	for {
9703		x, err := c.Do()
9704		if err != nil {
9705			return err
9706		}
9707		if err := f(x); err != nil {
9708			return err
9709		}
9710		if x.NextPageToken == "" {
9711			return nil
9712		}
9713		c.PageToken(x.NextPageToken)
9714	}
9715}
9716
9717// method id "logging.exclusions.patch":
9718
9719type ExclusionsPatchCall struct {
9720	s            *Service
9721	name         string
9722	logexclusion *LogExclusion
9723	urlParams_   gensupport.URLParams
9724	ctx_         context.Context
9725	header_      http.Header
9726}
9727
9728// Patch: Changes one or more properties of an existing exclusion in the
9729// _Default sink.
9730//
9731// - name: The resource name of the exclusion to update:
9732//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
9733//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
9734//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
9735//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For
9736//   example:"projects/my-project/exclusions/my-exclusion".
9737func (r *ExclusionsService) Patch(name string, logexclusion *LogExclusion) *ExclusionsPatchCall {
9738	c := &ExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9739	c.name = name
9740	c.logexclusion = logexclusion
9741	return c
9742}
9743
9744// UpdateMask sets the optional parameter "updateMask": Required. A
9745// non-empty list of fields to change in the existing exclusion. New
9746// values for the fields are taken from the corresponding fields in the
9747// LogExclusion included in this request. Fields not mentioned in
9748// update_mask are not changed and are ignored in the request.For
9749// example, to change the filter and description of an exclusion,
9750// specify an update_mask of "filter,description".
9751func (c *ExclusionsPatchCall) UpdateMask(updateMask string) *ExclusionsPatchCall {
9752	c.urlParams_.Set("updateMask", updateMask)
9753	return c
9754}
9755
9756// Fields allows partial responses to be retrieved. See
9757// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9758// for more information.
9759func (c *ExclusionsPatchCall) Fields(s ...googleapi.Field) *ExclusionsPatchCall {
9760	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9761	return c
9762}
9763
9764// Context sets the context to be used in this call's Do method. Any
9765// pending HTTP request will be aborted if the provided context is
9766// canceled.
9767func (c *ExclusionsPatchCall) Context(ctx context.Context) *ExclusionsPatchCall {
9768	c.ctx_ = ctx
9769	return c
9770}
9771
9772// Header returns an http.Header that can be modified by the caller to
9773// add HTTP headers to the request.
9774func (c *ExclusionsPatchCall) Header() http.Header {
9775	if c.header_ == nil {
9776		c.header_ = make(http.Header)
9777	}
9778	return c.header_
9779}
9780
9781func (c *ExclusionsPatchCall) doRequest(alt string) (*http.Response, error) {
9782	reqHeaders := make(http.Header)
9783	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
9784	for k, v := range c.header_ {
9785		reqHeaders[k] = v
9786	}
9787	reqHeaders.Set("User-Agent", c.s.userAgent())
9788	var body io.Reader = nil
9789	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
9790	if err != nil {
9791		return nil, err
9792	}
9793	reqHeaders.Set("Content-Type", "application/json")
9794	c.urlParams_.Set("alt", alt)
9795	c.urlParams_.Set("prettyPrint", "false")
9796	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
9797	urls += "?" + c.urlParams_.Encode()
9798	req, err := http.NewRequest("PATCH", urls, body)
9799	if err != nil {
9800		return nil, err
9801	}
9802	req.Header = reqHeaders
9803	googleapi.Expand(req.URL, map[string]string{
9804		"name": c.name,
9805	})
9806	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9807}
9808
9809// Do executes the "logging.exclusions.patch" call.
9810// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
9811// status code is an error. Response headers are in either
9812// *LogExclusion.ServerResponse.Header or (if a response was returned at
9813// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
9814// to check whether the returned error was because
9815// http.StatusNotModified was returned.
9816func (c *ExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
9817	gensupport.SetOptions(c.urlParams_, opts...)
9818	res, err := c.doRequest("json")
9819	if res != nil && res.StatusCode == http.StatusNotModified {
9820		if res.Body != nil {
9821			res.Body.Close()
9822		}
9823		return nil, &googleapi.Error{
9824			Code:   res.StatusCode,
9825			Header: res.Header,
9826		}
9827	}
9828	if err != nil {
9829		return nil, err
9830	}
9831	defer googleapi.CloseBody(res)
9832	if err := googleapi.CheckResponse(res); err != nil {
9833		return nil, err
9834	}
9835	ret := &LogExclusion{
9836		ServerResponse: googleapi.ServerResponse{
9837			Header:         res.Header,
9838			HTTPStatusCode: res.StatusCode,
9839		},
9840	}
9841	target := &ret
9842	if err := gensupport.DecodeResponse(target, res); err != nil {
9843		return nil, err
9844	}
9845	return ret, nil
9846	// {
9847	//   "description": "Changes one or more properties of an existing exclusion in the _Default sink.",
9848	//   "flatPath": "v2/{v2Id}/{v2Id1}/exclusions/{exclusionsId}",
9849	//   "httpMethod": "PATCH",
9850	//   "id": "logging.exclusions.patch",
9851	//   "parameterOrder": [
9852	//     "name"
9853	//   ],
9854	//   "parameters": {
9855	//     "name": {
9856	//       "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]\" For example:\"projects/my-project/exclusions/my-exclusion\"",
9857	//       "location": "path",
9858	//       "pattern": "^[^/]+/[^/]+/exclusions/[^/]+$",
9859	//       "required": true,
9860	//       "type": "string"
9861	//     },
9862	//     "updateMask": {
9863	//       "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\".",
9864	//       "format": "google-fieldmask",
9865	//       "location": "query",
9866	//       "type": "string"
9867	//     }
9868	//   },
9869	//   "path": "v2/{+name}",
9870	//   "request": {
9871	//     "$ref": "LogExclusion"
9872	//   },
9873	//   "response": {
9874	//     "$ref": "LogExclusion"
9875	//   },
9876	//   "scopes": [
9877	//     "https://www.googleapis.com/auth/cloud-platform",
9878	//     "https://www.googleapis.com/auth/logging.admin"
9879	//   ]
9880	// }
9881
9882}
9883
9884// method id "logging.folders.exclusions.create":
9885
9886type FoldersExclusionsCreateCall struct {
9887	s            *Service
9888	parent       string
9889	logexclusion *LogExclusion
9890	urlParams_   gensupport.URLParams
9891	ctx_         context.Context
9892	header_      http.Header
9893}
9894
9895// Create: Creates a new exclusion in the _Default sink in a specified
9896// parent resource. Only log entries belonging to that resource can be
9897// excluded. You can have up to 10 exclusions in a resource.
9898//
9899// - parent: The parent resource in which to create the exclusion:
9900//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
9901//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For
9902//   examples:"projects/my-logging-project" "organizations/123456789".
9903func (r *FoldersExclusionsService) Create(parent string, logexclusion *LogExclusion) *FoldersExclusionsCreateCall {
9904	c := &FoldersExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
9905	c.parent = parent
9906	c.logexclusion = logexclusion
9907	return c
9908}
9909
9910// Fields allows partial responses to be retrieved. See
9911// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
9912// for more information.
9913func (c *FoldersExclusionsCreateCall) Fields(s ...googleapi.Field) *FoldersExclusionsCreateCall {
9914	c.urlParams_.Set("fields", googleapi.CombineFields(s))
9915	return c
9916}
9917
9918// Context sets the context to be used in this call's Do method. Any
9919// pending HTTP request will be aborted if the provided context is
9920// canceled.
9921func (c *FoldersExclusionsCreateCall) Context(ctx context.Context) *FoldersExclusionsCreateCall {
9922	c.ctx_ = ctx
9923	return c
9924}
9925
9926// Header returns an http.Header that can be modified by the caller to
9927// add HTTP headers to the request.
9928func (c *FoldersExclusionsCreateCall) Header() http.Header {
9929	if c.header_ == nil {
9930		c.header_ = make(http.Header)
9931	}
9932	return c.header_
9933}
9934
9935func (c *FoldersExclusionsCreateCall) doRequest(alt string) (*http.Response, error) {
9936	reqHeaders := make(http.Header)
9937	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
9938	for k, v := range c.header_ {
9939		reqHeaders[k] = v
9940	}
9941	reqHeaders.Set("User-Agent", c.s.userAgent())
9942	var body io.Reader = nil
9943	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
9944	if err != nil {
9945		return nil, err
9946	}
9947	reqHeaders.Set("Content-Type", "application/json")
9948	c.urlParams_.Set("alt", alt)
9949	c.urlParams_.Set("prettyPrint", "false")
9950	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
9951	urls += "?" + c.urlParams_.Encode()
9952	req, err := http.NewRequest("POST", urls, body)
9953	if err != nil {
9954		return nil, err
9955	}
9956	req.Header = reqHeaders
9957	googleapi.Expand(req.URL, map[string]string{
9958		"parent": c.parent,
9959	})
9960	return gensupport.SendRequest(c.ctx_, c.s.client, req)
9961}
9962
9963// Do executes the "logging.folders.exclusions.create" call.
9964// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
9965// status code is an error. Response headers are in either
9966// *LogExclusion.ServerResponse.Header or (if a response was returned at
9967// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
9968// to check whether the returned error was because
9969// http.StatusNotModified was returned.
9970func (c *FoldersExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
9971	gensupport.SetOptions(c.urlParams_, opts...)
9972	res, err := c.doRequest("json")
9973	if res != nil && res.StatusCode == http.StatusNotModified {
9974		if res.Body != nil {
9975			res.Body.Close()
9976		}
9977		return nil, &googleapi.Error{
9978			Code:   res.StatusCode,
9979			Header: res.Header,
9980		}
9981	}
9982	if err != nil {
9983		return nil, err
9984	}
9985	defer googleapi.CloseBody(res)
9986	if err := googleapi.CheckResponse(res); err != nil {
9987		return nil, err
9988	}
9989	ret := &LogExclusion{
9990		ServerResponse: googleapi.ServerResponse{
9991			Header:         res.Header,
9992			HTTPStatusCode: res.StatusCode,
9993		},
9994	}
9995	target := &ret
9996	if err := gensupport.DecodeResponse(target, res); err != nil {
9997		return nil, err
9998	}
9999	return ret, nil
10000	// {
10001	//   "description": "Creates a new exclusion in the _Default sink 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.",
10002	//   "flatPath": "v2/folders/{foldersId}/exclusions",
10003	//   "httpMethod": "POST",
10004	//   "id": "logging.folders.exclusions.create",
10005	//   "parameterOrder": [
10006	//     "parent"
10007	//   ],
10008	//   "parameters": {
10009	//     "parent": {
10010	//       "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-logging-project\" \"organizations/123456789\"",
10011	//       "location": "path",
10012	//       "pattern": "^folders/[^/]+$",
10013	//       "required": true,
10014	//       "type": "string"
10015	//     }
10016	//   },
10017	//   "path": "v2/{+parent}/exclusions",
10018	//   "request": {
10019	//     "$ref": "LogExclusion"
10020	//   },
10021	//   "response": {
10022	//     "$ref": "LogExclusion"
10023	//   },
10024	//   "scopes": [
10025	//     "https://www.googleapis.com/auth/cloud-platform",
10026	//     "https://www.googleapis.com/auth/logging.admin"
10027	//   ]
10028	// }
10029
10030}
10031
10032// method id "logging.folders.exclusions.delete":
10033
10034type FoldersExclusionsDeleteCall struct {
10035	s          *Service
10036	name       string
10037	urlParams_ gensupport.URLParams
10038	ctx_       context.Context
10039	header_    http.Header
10040}
10041
10042// Delete: Deletes an exclusion in the _Default sink.
10043//
10044// - name: The resource name of an existing exclusion to delete:
10045//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
10046//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
10047//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
10048//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For
10049//   example:"projects/my-project/exclusions/my-exclusion".
10050func (r *FoldersExclusionsService) Delete(name string) *FoldersExclusionsDeleteCall {
10051	c := &FoldersExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10052	c.name = name
10053	return c
10054}
10055
10056// Fields allows partial responses to be retrieved. See
10057// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10058// for more information.
10059func (c *FoldersExclusionsDeleteCall) Fields(s ...googleapi.Field) *FoldersExclusionsDeleteCall {
10060	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10061	return c
10062}
10063
10064// Context sets the context to be used in this call's Do method. Any
10065// pending HTTP request will be aborted if the provided context is
10066// canceled.
10067func (c *FoldersExclusionsDeleteCall) Context(ctx context.Context) *FoldersExclusionsDeleteCall {
10068	c.ctx_ = ctx
10069	return c
10070}
10071
10072// Header returns an http.Header that can be modified by the caller to
10073// add HTTP headers to the request.
10074func (c *FoldersExclusionsDeleteCall) Header() http.Header {
10075	if c.header_ == nil {
10076		c.header_ = make(http.Header)
10077	}
10078	return c.header_
10079}
10080
10081func (c *FoldersExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) {
10082	reqHeaders := make(http.Header)
10083	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
10084	for k, v := range c.header_ {
10085		reqHeaders[k] = v
10086	}
10087	reqHeaders.Set("User-Agent", c.s.userAgent())
10088	var body io.Reader = nil
10089	c.urlParams_.Set("alt", alt)
10090	c.urlParams_.Set("prettyPrint", "false")
10091	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
10092	urls += "?" + c.urlParams_.Encode()
10093	req, err := http.NewRequest("DELETE", urls, body)
10094	if err != nil {
10095		return nil, err
10096	}
10097	req.Header = reqHeaders
10098	googleapi.Expand(req.URL, map[string]string{
10099		"name": c.name,
10100	})
10101	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10102}
10103
10104// Do executes the "logging.folders.exclusions.delete" call.
10105// Exactly one of *Empty or error will be non-nil. Any non-2xx status
10106// code is an error. Response headers are in either
10107// *Empty.ServerResponse.Header or (if a response was returned at all)
10108// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
10109// check whether the returned error was because http.StatusNotModified
10110// was returned.
10111func (c *FoldersExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
10112	gensupport.SetOptions(c.urlParams_, opts...)
10113	res, err := c.doRequest("json")
10114	if res != nil && res.StatusCode == http.StatusNotModified {
10115		if res.Body != nil {
10116			res.Body.Close()
10117		}
10118		return nil, &googleapi.Error{
10119			Code:   res.StatusCode,
10120			Header: res.Header,
10121		}
10122	}
10123	if err != nil {
10124		return nil, err
10125	}
10126	defer googleapi.CloseBody(res)
10127	if err := googleapi.CheckResponse(res); err != nil {
10128		return nil, err
10129	}
10130	ret := &Empty{
10131		ServerResponse: googleapi.ServerResponse{
10132			Header:         res.Header,
10133			HTTPStatusCode: res.StatusCode,
10134		},
10135	}
10136	target := &ret
10137	if err := gensupport.DecodeResponse(target, res); err != nil {
10138		return nil, err
10139	}
10140	return ret, nil
10141	// {
10142	//   "description": "Deletes an exclusion in the _Default sink.",
10143	//   "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}",
10144	//   "httpMethod": "DELETE",
10145	//   "id": "logging.folders.exclusions.delete",
10146	//   "parameterOrder": [
10147	//     "name"
10148	//   ],
10149	//   "parameters": {
10150	//     "name": {
10151	//       "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]\" For example:\"projects/my-project/exclusions/my-exclusion\"",
10152	//       "location": "path",
10153	//       "pattern": "^folders/[^/]+/exclusions/[^/]+$",
10154	//       "required": true,
10155	//       "type": "string"
10156	//     }
10157	//   },
10158	//   "path": "v2/{+name}",
10159	//   "response": {
10160	//     "$ref": "Empty"
10161	//   },
10162	//   "scopes": [
10163	//     "https://www.googleapis.com/auth/cloud-platform",
10164	//     "https://www.googleapis.com/auth/logging.admin"
10165	//   ]
10166	// }
10167
10168}
10169
10170// method id "logging.folders.exclusions.get":
10171
10172type FoldersExclusionsGetCall struct {
10173	s            *Service
10174	name         string
10175	urlParams_   gensupport.URLParams
10176	ifNoneMatch_ string
10177	ctx_         context.Context
10178	header_      http.Header
10179}
10180
10181// Get: Gets the description of an exclusion in the _Default sink.
10182//
10183// - name: The resource name of an existing exclusion:
10184//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
10185//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
10186//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
10187//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For
10188//   example:"projects/my-project/exclusions/my-exclusion".
10189func (r *FoldersExclusionsService) Get(name string) *FoldersExclusionsGetCall {
10190	c := &FoldersExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10191	c.name = name
10192	return c
10193}
10194
10195// Fields allows partial responses to be retrieved. See
10196// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10197// for more information.
10198func (c *FoldersExclusionsGetCall) Fields(s ...googleapi.Field) *FoldersExclusionsGetCall {
10199	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10200	return c
10201}
10202
10203// IfNoneMatch sets the optional parameter which makes the operation
10204// fail if the object's ETag matches the given value. This is useful for
10205// getting updates only after the object has changed since the last
10206// request. Use googleapi.IsNotModified to check whether the response
10207// error from Do is the result of In-None-Match.
10208func (c *FoldersExclusionsGetCall) IfNoneMatch(entityTag string) *FoldersExclusionsGetCall {
10209	c.ifNoneMatch_ = entityTag
10210	return c
10211}
10212
10213// Context sets the context to be used in this call's Do method. Any
10214// pending HTTP request will be aborted if the provided context is
10215// canceled.
10216func (c *FoldersExclusionsGetCall) Context(ctx context.Context) *FoldersExclusionsGetCall {
10217	c.ctx_ = ctx
10218	return c
10219}
10220
10221// Header returns an http.Header that can be modified by the caller to
10222// add HTTP headers to the request.
10223func (c *FoldersExclusionsGetCall) Header() http.Header {
10224	if c.header_ == nil {
10225		c.header_ = make(http.Header)
10226	}
10227	return c.header_
10228}
10229
10230func (c *FoldersExclusionsGetCall) doRequest(alt string) (*http.Response, error) {
10231	reqHeaders := make(http.Header)
10232	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
10233	for k, v := range c.header_ {
10234		reqHeaders[k] = v
10235	}
10236	reqHeaders.Set("User-Agent", c.s.userAgent())
10237	if c.ifNoneMatch_ != "" {
10238		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10239	}
10240	var body io.Reader = nil
10241	c.urlParams_.Set("alt", alt)
10242	c.urlParams_.Set("prettyPrint", "false")
10243	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
10244	urls += "?" + c.urlParams_.Encode()
10245	req, err := http.NewRequest("GET", urls, body)
10246	if err != nil {
10247		return nil, err
10248	}
10249	req.Header = reqHeaders
10250	googleapi.Expand(req.URL, map[string]string{
10251		"name": c.name,
10252	})
10253	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10254}
10255
10256// Do executes the "logging.folders.exclusions.get" call.
10257// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
10258// status code is an error. Response headers are in either
10259// *LogExclusion.ServerResponse.Header or (if a response was returned at
10260// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
10261// to check whether the returned error was because
10262// http.StatusNotModified was returned.
10263func (c *FoldersExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
10264	gensupport.SetOptions(c.urlParams_, opts...)
10265	res, err := c.doRequest("json")
10266	if res != nil && res.StatusCode == http.StatusNotModified {
10267		if res.Body != nil {
10268			res.Body.Close()
10269		}
10270		return nil, &googleapi.Error{
10271			Code:   res.StatusCode,
10272			Header: res.Header,
10273		}
10274	}
10275	if err != nil {
10276		return nil, err
10277	}
10278	defer googleapi.CloseBody(res)
10279	if err := googleapi.CheckResponse(res); err != nil {
10280		return nil, err
10281	}
10282	ret := &LogExclusion{
10283		ServerResponse: googleapi.ServerResponse{
10284			Header:         res.Header,
10285			HTTPStatusCode: res.StatusCode,
10286		},
10287	}
10288	target := &ret
10289	if err := gensupport.DecodeResponse(target, res); err != nil {
10290		return nil, err
10291	}
10292	return ret, nil
10293	// {
10294	//   "description": "Gets the description of an exclusion in the _Default sink.",
10295	//   "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}",
10296	//   "httpMethod": "GET",
10297	//   "id": "logging.folders.exclusions.get",
10298	//   "parameterOrder": [
10299	//     "name"
10300	//   ],
10301	//   "parameters": {
10302	//     "name": {
10303	//       "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]\" For example:\"projects/my-project/exclusions/my-exclusion\"",
10304	//       "location": "path",
10305	//       "pattern": "^folders/[^/]+/exclusions/[^/]+$",
10306	//       "required": true,
10307	//       "type": "string"
10308	//     }
10309	//   },
10310	//   "path": "v2/{+name}",
10311	//   "response": {
10312	//     "$ref": "LogExclusion"
10313	//   },
10314	//   "scopes": [
10315	//     "https://www.googleapis.com/auth/cloud-platform",
10316	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
10317	//     "https://www.googleapis.com/auth/logging.admin",
10318	//     "https://www.googleapis.com/auth/logging.read"
10319	//   ]
10320	// }
10321
10322}
10323
10324// method id "logging.folders.exclusions.list":
10325
10326type FoldersExclusionsListCall struct {
10327	s            *Service
10328	parent       string
10329	urlParams_   gensupport.URLParams
10330	ifNoneMatch_ string
10331	ctx_         context.Context
10332	header_      http.Header
10333}
10334
10335// List: Lists all the exclusions on the _Default sink in a parent
10336// resource.
10337//
10338// - parent: The parent resource whose exclusions are to be listed.
10339//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
10340//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]".
10341func (r *FoldersExclusionsService) List(parent string) *FoldersExclusionsListCall {
10342	c := &FoldersExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10343	c.parent = parent
10344	return c
10345}
10346
10347// PageSize sets the optional parameter "pageSize": The maximum number
10348// of results to return from this request. Non-positive values are
10349// ignored. The presence of nextPageToken in the response indicates that
10350// more results might be available.
10351func (c *FoldersExclusionsListCall) PageSize(pageSize int64) *FoldersExclusionsListCall {
10352	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
10353	return c
10354}
10355
10356// PageToken sets the optional parameter "pageToken": If present, then
10357// retrieve the next batch of results from the preceding call to this
10358// method. pageToken must be the value of nextPageToken from the
10359// previous response. The values of other method parameters should be
10360// identical to those in the previous call.
10361func (c *FoldersExclusionsListCall) PageToken(pageToken string) *FoldersExclusionsListCall {
10362	c.urlParams_.Set("pageToken", pageToken)
10363	return c
10364}
10365
10366// Fields allows partial responses to be retrieved. See
10367// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10368// for more information.
10369func (c *FoldersExclusionsListCall) Fields(s ...googleapi.Field) *FoldersExclusionsListCall {
10370	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10371	return c
10372}
10373
10374// IfNoneMatch sets the optional parameter which makes the operation
10375// fail if the object's ETag matches the given value. This is useful for
10376// getting updates only after the object has changed since the last
10377// request. Use googleapi.IsNotModified to check whether the response
10378// error from Do is the result of In-None-Match.
10379func (c *FoldersExclusionsListCall) IfNoneMatch(entityTag string) *FoldersExclusionsListCall {
10380	c.ifNoneMatch_ = entityTag
10381	return c
10382}
10383
10384// Context sets the context to be used in this call's Do method. Any
10385// pending HTTP request will be aborted if the provided context is
10386// canceled.
10387func (c *FoldersExclusionsListCall) Context(ctx context.Context) *FoldersExclusionsListCall {
10388	c.ctx_ = ctx
10389	return c
10390}
10391
10392// Header returns an http.Header that can be modified by the caller to
10393// add HTTP headers to the request.
10394func (c *FoldersExclusionsListCall) Header() http.Header {
10395	if c.header_ == nil {
10396		c.header_ = make(http.Header)
10397	}
10398	return c.header_
10399}
10400
10401func (c *FoldersExclusionsListCall) doRequest(alt string) (*http.Response, error) {
10402	reqHeaders := make(http.Header)
10403	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
10404	for k, v := range c.header_ {
10405		reqHeaders[k] = v
10406	}
10407	reqHeaders.Set("User-Agent", c.s.userAgent())
10408	if c.ifNoneMatch_ != "" {
10409		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10410	}
10411	var body io.Reader = nil
10412	c.urlParams_.Set("alt", alt)
10413	c.urlParams_.Set("prettyPrint", "false")
10414	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
10415	urls += "?" + c.urlParams_.Encode()
10416	req, err := http.NewRequest("GET", urls, body)
10417	if err != nil {
10418		return nil, err
10419	}
10420	req.Header = reqHeaders
10421	googleapi.Expand(req.URL, map[string]string{
10422		"parent": c.parent,
10423	})
10424	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10425}
10426
10427// Do executes the "logging.folders.exclusions.list" call.
10428// Exactly one of *ListExclusionsResponse or error will be non-nil. Any
10429// non-2xx status code is an error. Response headers are in either
10430// *ListExclusionsResponse.ServerResponse.Header or (if a response was
10431// returned at all) in error.(*googleapi.Error).Header. Use
10432// googleapi.IsNotModified to check whether the returned error was
10433// because http.StatusNotModified was returned.
10434func (c *FoldersExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) {
10435	gensupport.SetOptions(c.urlParams_, opts...)
10436	res, err := c.doRequest("json")
10437	if res != nil && res.StatusCode == http.StatusNotModified {
10438		if res.Body != nil {
10439			res.Body.Close()
10440		}
10441		return nil, &googleapi.Error{
10442			Code:   res.StatusCode,
10443			Header: res.Header,
10444		}
10445	}
10446	if err != nil {
10447		return nil, err
10448	}
10449	defer googleapi.CloseBody(res)
10450	if err := googleapi.CheckResponse(res); err != nil {
10451		return nil, err
10452	}
10453	ret := &ListExclusionsResponse{
10454		ServerResponse: googleapi.ServerResponse{
10455			Header:         res.Header,
10456			HTTPStatusCode: res.StatusCode,
10457		},
10458	}
10459	target := &ret
10460	if err := gensupport.DecodeResponse(target, res); err != nil {
10461		return nil, err
10462	}
10463	return ret, nil
10464	// {
10465	//   "description": "Lists all the exclusions on the _Default sink in a parent resource.",
10466	//   "flatPath": "v2/folders/{foldersId}/exclusions",
10467	//   "httpMethod": "GET",
10468	//   "id": "logging.folders.exclusions.list",
10469	//   "parameterOrder": [
10470	//     "parent"
10471	//   ],
10472	//   "parameters": {
10473	//     "pageSize": {
10474	//       "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.",
10475	//       "format": "int32",
10476	//       "location": "query",
10477	//       "type": "integer"
10478	//     },
10479	//     "pageToken": {
10480	//       "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.",
10481	//       "location": "query",
10482	//       "type": "string"
10483	//     },
10484	//     "parent": {
10485	//       "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
10486	//       "location": "path",
10487	//       "pattern": "^folders/[^/]+$",
10488	//       "required": true,
10489	//       "type": "string"
10490	//     }
10491	//   },
10492	//   "path": "v2/{+parent}/exclusions",
10493	//   "response": {
10494	//     "$ref": "ListExclusionsResponse"
10495	//   },
10496	//   "scopes": [
10497	//     "https://www.googleapis.com/auth/cloud-platform",
10498	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
10499	//     "https://www.googleapis.com/auth/logging.admin",
10500	//     "https://www.googleapis.com/auth/logging.read"
10501	//   ]
10502	// }
10503
10504}
10505
10506// Pages invokes f for each page of results.
10507// A non-nil error returned from f will halt the iteration.
10508// The provided context supersedes any context provided to the Context method.
10509func (c *FoldersExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error {
10510	c.ctx_ = ctx
10511	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
10512	for {
10513		x, err := c.Do()
10514		if err != nil {
10515			return err
10516		}
10517		if err := f(x); err != nil {
10518			return err
10519		}
10520		if x.NextPageToken == "" {
10521			return nil
10522		}
10523		c.PageToken(x.NextPageToken)
10524	}
10525}
10526
10527// method id "logging.folders.exclusions.patch":
10528
10529type FoldersExclusionsPatchCall struct {
10530	s            *Service
10531	name         string
10532	logexclusion *LogExclusion
10533	urlParams_   gensupport.URLParams
10534	ctx_         context.Context
10535	header_      http.Header
10536}
10537
10538// Patch: Changes one or more properties of an existing exclusion in the
10539// _Default sink.
10540//
10541// - name: The resource name of the exclusion to update:
10542//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
10543//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
10544//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
10545//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For
10546//   example:"projects/my-project/exclusions/my-exclusion".
10547func (r *FoldersExclusionsService) Patch(name string, logexclusion *LogExclusion) *FoldersExclusionsPatchCall {
10548	c := &FoldersExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10549	c.name = name
10550	c.logexclusion = logexclusion
10551	return c
10552}
10553
10554// UpdateMask sets the optional parameter "updateMask": Required. A
10555// non-empty list of fields to change in the existing exclusion. New
10556// values for the fields are taken from the corresponding fields in the
10557// LogExclusion included in this request. Fields not mentioned in
10558// update_mask are not changed and are ignored in the request.For
10559// example, to change the filter and description of an exclusion,
10560// specify an update_mask of "filter,description".
10561func (c *FoldersExclusionsPatchCall) UpdateMask(updateMask string) *FoldersExclusionsPatchCall {
10562	c.urlParams_.Set("updateMask", updateMask)
10563	return c
10564}
10565
10566// Fields allows partial responses to be retrieved. See
10567// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10568// for more information.
10569func (c *FoldersExclusionsPatchCall) Fields(s ...googleapi.Field) *FoldersExclusionsPatchCall {
10570	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10571	return c
10572}
10573
10574// Context sets the context to be used in this call's Do method. Any
10575// pending HTTP request will be aborted if the provided context is
10576// canceled.
10577func (c *FoldersExclusionsPatchCall) Context(ctx context.Context) *FoldersExclusionsPatchCall {
10578	c.ctx_ = ctx
10579	return c
10580}
10581
10582// Header returns an http.Header that can be modified by the caller to
10583// add HTTP headers to the request.
10584func (c *FoldersExclusionsPatchCall) Header() http.Header {
10585	if c.header_ == nil {
10586		c.header_ = make(http.Header)
10587	}
10588	return c.header_
10589}
10590
10591func (c *FoldersExclusionsPatchCall) doRequest(alt string) (*http.Response, error) {
10592	reqHeaders := make(http.Header)
10593	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
10594	for k, v := range c.header_ {
10595		reqHeaders[k] = v
10596	}
10597	reqHeaders.Set("User-Agent", c.s.userAgent())
10598	var body io.Reader = nil
10599	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
10600	if err != nil {
10601		return nil, err
10602	}
10603	reqHeaders.Set("Content-Type", "application/json")
10604	c.urlParams_.Set("alt", alt)
10605	c.urlParams_.Set("prettyPrint", "false")
10606	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
10607	urls += "?" + c.urlParams_.Encode()
10608	req, err := http.NewRequest("PATCH", urls, body)
10609	if err != nil {
10610		return nil, err
10611	}
10612	req.Header = reqHeaders
10613	googleapi.Expand(req.URL, map[string]string{
10614		"name": c.name,
10615	})
10616	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10617}
10618
10619// Do executes the "logging.folders.exclusions.patch" call.
10620// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
10621// status code is an error. Response headers are in either
10622// *LogExclusion.ServerResponse.Header or (if a response was returned at
10623// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
10624// to check whether the returned error was because
10625// http.StatusNotModified was returned.
10626func (c *FoldersExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
10627	gensupport.SetOptions(c.urlParams_, opts...)
10628	res, err := c.doRequest("json")
10629	if res != nil && res.StatusCode == http.StatusNotModified {
10630		if res.Body != nil {
10631			res.Body.Close()
10632		}
10633		return nil, &googleapi.Error{
10634			Code:   res.StatusCode,
10635			Header: res.Header,
10636		}
10637	}
10638	if err != nil {
10639		return nil, err
10640	}
10641	defer googleapi.CloseBody(res)
10642	if err := googleapi.CheckResponse(res); err != nil {
10643		return nil, err
10644	}
10645	ret := &LogExclusion{
10646		ServerResponse: googleapi.ServerResponse{
10647			Header:         res.Header,
10648			HTTPStatusCode: res.StatusCode,
10649		},
10650	}
10651	target := &ret
10652	if err := gensupport.DecodeResponse(target, res); err != nil {
10653		return nil, err
10654	}
10655	return ret, nil
10656	// {
10657	//   "description": "Changes one or more properties of an existing exclusion in the _Default sink.",
10658	//   "flatPath": "v2/folders/{foldersId}/exclusions/{exclusionsId}",
10659	//   "httpMethod": "PATCH",
10660	//   "id": "logging.folders.exclusions.patch",
10661	//   "parameterOrder": [
10662	//     "name"
10663	//   ],
10664	//   "parameters": {
10665	//     "name": {
10666	//       "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]\" For example:\"projects/my-project/exclusions/my-exclusion\"",
10667	//       "location": "path",
10668	//       "pattern": "^folders/[^/]+/exclusions/[^/]+$",
10669	//       "required": true,
10670	//       "type": "string"
10671	//     },
10672	//     "updateMask": {
10673	//       "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\".",
10674	//       "format": "google-fieldmask",
10675	//       "location": "query",
10676	//       "type": "string"
10677	//     }
10678	//   },
10679	//   "path": "v2/{+name}",
10680	//   "request": {
10681	//     "$ref": "LogExclusion"
10682	//   },
10683	//   "response": {
10684	//     "$ref": "LogExclusion"
10685	//   },
10686	//   "scopes": [
10687	//     "https://www.googleapis.com/auth/cloud-platform",
10688	//     "https://www.googleapis.com/auth/logging.admin"
10689	//   ]
10690	// }
10691
10692}
10693
10694// method id "logging.folders.locations.get":
10695
10696type FoldersLocationsGetCall struct {
10697	s            *Service
10698	name         string
10699	urlParams_   gensupport.URLParams
10700	ifNoneMatch_ string
10701	ctx_         context.Context
10702	header_      http.Header
10703}
10704
10705// Get: Gets information about a location.
10706//
10707// - name: Resource name for the location.
10708func (r *FoldersLocationsService) Get(name string) *FoldersLocationsGetCall {
10709	c := &FoldersLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10710	c.name = name
10711	return c
10712}
10713
10714// Fields allows partial responses to be retrieved. See
10715// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10716// for more information.
10717func (c *FoldersLocationsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsGetCall {
10718	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10719	return c
10720}
10721
10722// IfNoneMatch sets the optional parameter which makes the operation
10723// fail if the object's ETag matches the given value. This is useful for
10724// getting updates only after the object has changed since the last
10725// request. Use googleapi.IsNotModified to check whether the response
10726// error from Do is the result of In-None-Match.
10727func (c *FoldersLocationsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsGetCall {
10728	c.ifNoneMatch_ = entityTag
10729	return c
10730}
10731
10732// Context sets the context to be used in this call's Do method. Any
10733// pending HTTP request will be aborted if the provided context is
10734// canceled.
10735func (c *FoldersLocationsGetCall) Context(ctx context.Context) *FoldersLocationsGetCall {
10736	c.ctx_ = ctx
10737	return c
10738}
10739
10740// Header returns an http.Header that can be modified by the caller to
10741// add HTTP headers to the request.
10742func (c *FoldersLocationsGetCall) Header() http.Header {
10743	if c.header_ == nil {
10744		c.header_ = make(http.Header)
10745	}
10746	return c.header_
10747}
10748
10749func (c *FoldersLocationsGetCall) doRequest(alt string) (*http.Response, error) {
10750	reqHeaders := make(http.Header)
10751	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
10752	for k, v := range c.header_ {
10753		reqHeaders[k] = v
10754	}
10755	reqHeaders.Set("User-Agent", c.s.userAgent())
10756	if c.ifNoneMatch_ != "" {
10757		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10758	}
10759	var body io.Reader = nil
10760	c.urlParams_.Set("alt", alt)
10761	c.urlParams_.Set("prettyPrint", "false")
10762	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
10763	urls += "?" + c.urlParams_.Encode()
10764	req, err := http.NewRequest("GET", urls, body)
10765	if err != nil {
10766		return nil, err
10767	}
10768	req.Header = reqHeaders
10769	googleapi.Expand(req.URL, map[string]string{
10770		"name": c.name,
10771	})
10772	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10773}
10774
10775// Do executes the "logging.folders.locations.get" call.
10776// Exactly one of *Location or error will be non-nil. Any non-2xx status
10777// code is an error. Response headers are in either
10778// *Location.ServerResponse.Header or (if a response was returned at
10779// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
10780// to check whether the returned error was because
10781// http.StatusNotModified was returned.
10782func (c *FoldersLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
10783	gensupport.SetOptions(c.urlParams_, opts...)
10784	res, err := c.doRequest("json")
10785	if res != nil && res.StatusCode == http.StatusNotModified {
10786		if res.Body != nil {
10787			res.Body.Close()
10788		}
10789		return nil, &googleapi.Error{
10790			Code:   res.StatusCode,
10791			Header: res.Header,
10792		}
10793	}
10794	if err != nil {
10795		return nil, err
10796	}
10797	defer googleapi.CloseBody(res)
10798	if err := googleapi.CheckResponse(res); err != nil {
10799		return nil, err
10800	}
10801	ret := &Location{
10802		ServerResponse: googleapi.ServerResponse{
10803			Header:         res.Header,
10804			HTTPStatusCode: res.StatusCode,
10805		},
10806	}
10807	target := &ret
10808	if err := gensupport.DecodeResponse(target, res); err != nil {
10809		return nil, err
10810	}
10811	return ret, nil
10812	// {
10813	//   "description": "Gets information about a location.",
10814	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}",
10815	//   "httpMethod": "GET",
10816	//   "id": "logging.folders.locations.get",
10817	//   "parameterOrder": [
10818	//     "name"
10819	//   ],
10820	//   "parameters": {
10821	//     "name": {
10822	//       "description": "Resource name for the location.",
10823	//       "location": "path",
10824	//       "pattern": "^folders/[^/]+/locations/[^/]+$",
10825	//       "required": true,
10826	//       "type": "string"
10827	//     }
10828	//   },
10829	//   "path": "v2/{+name}",
10830	//   "response": {
10831	//     "$ref": "Location"
10832	//   },
10833	//   "scopes": [
10834	//     "https://www.googleapis.com/auth/cloud-platform",
10835	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
10836	//     "https://www.googleapis.com/auth/logging.admin",
10837	//     "https://www.googleapis.com/auth/logging.read"
10838	//   ]
10839	// }
10840
10841}
10842
10843// method id "logging.folders.locations.list":
10844
10845type FoldersLocationsListCall struct {
10846	s            *Service
10847	name         string
10848	urlParams_   gensupport.URLParams
10849	ifNoneMatch_ string
10850	ctx_         context.Context
10851	header_      http.Header
10852}
10853
10854// List: Lists information about the supported locations for this
10855// service.
10856//
10857// - name: The resource that owns the locations collection, if
10858//   applicable.
10859func (r *FoldersLocationsService) List(name string) *FoldersLocationsListCall {
10860	c := &FoldersLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
10861	c.name = name
10862	return c
10863}
10864
10865// Filter sets the optional parameter "filter": A filter to narrow down
10866// results to a preferred subset. The filtering language accepts strings
10867// like "displayName=tokyo", and is documented in more detail in AIP-160
10868// (https://google.aip.dev/160).
10869func (c *FoldersLocationsListCall) Filter(filter string) *FoldersLocationsListCall {
10870	c.urlParams_.Set("filter", filter)
10871	return c
10872}
10873
10874// PageSize sets the optional parameter "pageSize": The maximum number
10875// of results to return. If not set, the service selects a default.
10876func (c *FoldersLocationsListCall) PageSize(pageSize int64) *FoldersLocationsListCall {
10877	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
10878	return c
10879}
10880
10881// PageToken sets the optional parameter "pageToken": A page token
10882// received from the next_page_token field in the response. Send that
10883// page token to receive the subsequent page.
10884func (c *FoldersLocationsListCall) PageToken(pageToken string) *FoldersLocationsListCall {
10885	c.urlParams_.Set("pageToken", pageToken)
10886	return c
10887}
10888
10889// Fields allows partial responses to be retrieved. See
10890// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
10891// for more information.
10892func (c *FoldersLocationsListCall) Fields(s ...googleapi.Field) *FoldersLocationsListCall {
10893	c.urlParams_.Set("fields", googleapi.CombineFields(s))
10894	return c
10895}
10896
10897// IfNoneMatch sets the optional parameter which makes the operation
10898// fail if the object's ETag matches the given value. This is useful for
10899// getting updates only after the object has changed since the last
10900// request. Use googleapi.IsNotModified to check whether the response
10901// error from Do is the result of In-None-Match.
10902func (c *FoldersLocationsListCall) IfNoneMatch(entityTag string) *FoldersLocationsListCall {
10903	c.ifNoneMatch_ = entityTag
10904	return c
10905}
10906
10907// Context sets the context to be used in this call's Do method. Any
10908// pending HTTP request will be aborted if the provided context is
10909// canceled.
10910func (c *FoldersLocationsListCall) Context(ctx context.Context) *FoldersLocationsListCall {
10911	c.ctx_ = ctx
10912	return c
10913}
10914
10915// Header returns an http.Header that can be modified by the caller to
10916// add HTTP headers to the request.
10917func (c *FoldersLocationsListCall) Header() http.Header {
10918	if c.header_ == nil {
10919		c.header_ = make(http.Header)
10920	}
10921	return c.header_
10922}
10923
10924func (c *FoldersLocationsListCall) doRequest(alt string) (*http.Response, error) {
10925	reqHeaders := make(http.Header)
10926	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
10927	for k, v := range c.header_ {
10928		reqHeaders[k] = v
10929	}
10930	reqHeaders.Set("User-Agent", c.s.userAgent())
10931	if c.ifNoneMatch_ != "" {
10932		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
10933	}
10934	var body io.Reader = nil
10935	c.urlParams_.Set("alt", alt)
10936	c.urlParams_.Set("prettyPrint", "false")
10937	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations")
10938	urls += "?" + c.urlParams_.Encode()
10939	req, err := http.NewRequest("GET", urls, body)
10940	if err != nil {
10941		return nil, err
10942	}
10943	req.Header = reqHeaders
10944	googleapi.Expand(req.URL, map[string]string{
10945		"name": c.name,
10946	})
10947	return gensupport.SendRequest(c.ctx_, c.s.client, req)
10948}
10949
10950// Do executes the "logging.folders.locations.list" call.
10951// Exactly one of *ListLocationsResponse or error will be non-nil. Any
10952// non-2xx status code is an error. Response headers are in either
10953// *ListLocationsResponse.ServerResponse.Header or (if a response was
10954// returned at all) in error.(*googleapi.Error).Header. Use
10955// googleapi.IsNotModified to check whether the returned error was
10956// because http.StatusNotModified was returned.
10957func (c *FoldersLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
10958	gensupport.SetOptions(c.urlParams_, opts...)
10959	res, err := c.doRequest("json")
10960	if res != nil && res.StatusCode == http.StatusNotModified {
10961		if res.Body != nil {
10962			res.Body.Close()
10963		}
10964		return nil, &googleapi.Error{
10965			Code:   res.StatusCode,
10966			Header: res.Header,
10967		}
10968	}
10969	if err != nil {
10970		return nil, err
10971	}
10972	defer googleapi.CloseBody(res)
10973	if err := googleapi.CheckResponse(res); err != nil {
10974		return nil, err
10975	}
10976	ret := &ListLocationsResponse{
10977		ServerResponse: googleapi.ServerResponse{
10978			Header:         res.Header,
10979			HTTPStatusCode: res.StatusCode,
10980		},
10981	}
10982	target := &ret
10983	if err := gensupport.DecodeResponse(target, res); err != nil {
10984		return nil, err
10985	}
10986	return ret, nil
10987	// {
10988	//   "description": "Lists information about the supported locations for this service.",
10989	//   "flatPath": "v2/folders/{foldersId}/locations",
10990	//   "httpMethod": "GET",
10991	//   "id": "logging.folders.locations.list",
10992	//   "parameterOrder": [
10993	//     "name"
10994	//   ],
10995	//   "parameters": {
10996	//     "filter": {
10997	//       "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).",
10998	//       "location": "query",
10999	//       "type": "string"
11000	//     },
11001	//     "name": {
11002	//       "description": "The resource that owns the locations collection, if applicable.",
11003	//       "location": "path",
11004	//       "pattern": "^folders/[^/]+$",
11005	//       "required": true,
11006	//       "type": "string"
11007	//     },
11008	//     "pageSize": {
11009	//       "description": "The maximum number of results to return. If not set, the service selects a default.",
11010	//       "format": "int32",
11011	//       "location": "query",
11012	//       "type": "integer"
11013	//     },
11014	//     "pageToken": {
11015	//       "description": "A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.",
11016	//       "location": "query",
11017	//       "type": "string"
11018	//     }
11019	//   },
11020	//   "path": "v2/{+name}/locations",
11021	//   "response": {
11022	//     "$ref": "ListLocationsResponse"
11023	//   },
11024	//   "scopes": [
11025	//     "https://www.googleapis.com/auth/cloud-platform",
11026	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
11027	//     "https://www.googleapis.com/auth/logging.admin",
11028	//     "https://www.googleapis.com/auth/logging.read"
11029	//   ]
11030	// }
11031
11032}
11033
11034// Pages invokes f for each page of results.
11035// A non-nil error returned from f will halt the iteration.
11036// The provided context supersedes any context provided to the Context method.
11037func (c *FoldersLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
11038	c.ctx_ = ctx
11039	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
11040	for {
11041		x, err := c.Do()
11042		if err != nil {
11043			return err
11044		}
11045		if err := f(x); err != nil {
11046			return err
11047		}
11048		if x.NextPageToken == "" {
11049			return nil
11050		}
11051		c.PageToken(x.NextPageToken)
11052	}
11053}
11054
11055// method id "logging.folders.locations.buckets.create":
11056
11057type FoldersLocationsBucketsCreateCall struct {
11058	s          *Service
11059	parent     string
11060	logbucket  *LogBucket
11061	urlParams_ gensupport.URLParams
11062	ctx_       context.Context
11063	header_    http.Header
11064}
11065
11066// Create: Creates a log bucket that can be used to store log entries.
11067// After a bucket has been created, the bucket's location cannot be
11068// changed.
11069//
11070// - parent: The resource in which to create the log bucket:
11071//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For
11072//   example:"projects/my-project/locations/global".
11073func (r *FoldersLocationsBucketsService) Create(parent string, logbucket *LogBucket) *FoldersLocationsBucketsCreateCall {
11074	c := &FoldersLocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11075	c.parent = parent
11076	c.logbucket = logbucket
11077	return c
11078}
11079
11080// BucketId sets the optional parameter "bucketId": Required. A
11081// client-assigned identifier such as "my-bucket". Identifiers are
11082// limited to 100 characters and can include only letters, digits,
11083// underscores, hyphens, and periods.
11084func (c *FoldersLocationsBucketsCreateCall) BucketId(bucketId string) *FoldersLocationsBucketsCreateCall {
11085	c.urlParams_.Set("bucketId", bucketId)
11086	return c
11087}
11088
11089// Fields allows partial responses to be retrieved. See
11090// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11091// for more information.
11092func (c *FoldersLocationsBucketsCreateCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsCreateCall {
11093	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11094	return c
11095}
11096
11097// Context sets the context to be used in this call's Do method. Any
11098// pending HTTP request will be aborted if the provided context is
11099// canceled.
11100func (c *FoldersLocationsBucketsCreateCall) Context(ctx context.Context) *FoldersLocationsBucketsCreateCall {
11101	c.ctx_ = ctx
11102	return c
11103}
11104
11105// Header returns an http.Header that can be modified by the caller to
11106// add HTTP headers to the request.
11107func (c *FoldersLocationsBucketsCreateCall) Header() http.Header {
11108	if c.header_ == nil {
11109		c.header_ = make(http.Header)
11110	}
11111	return c.header_
11112}
11113
11114func (c *FoldersLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) {
11115	reqHeaders := make(http.Header)
11116	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
11117	for k, v := range c.header_ {
11118		reqHeaders[k] = v
11119	}
11120	reqHeaders.Set("User-Agent", c.s.userAgent())
11121	var body io.Reader = nil
11122	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
11123	if err != nil {
11124		return nil, err
11125	}
11126	reqHeaders.Set("Content-Type", "application/json")
11127	c.urlParams_.Set("alt", alt)
11128	c.urlParams_.Set("prettyPrint", "false")
11129	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
11130	urls += "?" + c.urlParams_.Encode()
11131	req, err := http.NewRequest("POST", urls, body)
11132	if err != nil {
11133		return nil, err
11134	}
11135	req.Header = reqHeaders
11136	googleapi.Expand(req.URL, map[string]string{
11137		"parent": c.parent,
11138	})
11139	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11140}
11141
11142// Do executes the "logging.folders.locations.buckets.create" call.
11143// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
11144// status code is an error. Response headers are in either
11145// *LogBucket.ServerResponse.Header or (if a response was returned at
11146// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
11147// to check whether the returned error was because
11148// http.StatusNotModified was returned.
11149func (c *FoldersLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
11150	gensupport.SetOptions(c.urlParams_, opts...)
11151	res, err := c.doRequest("json")
11152	if res != nil && res.StatusCode == http.StatusNotModified {
11153		if res.Body != nil {
11154			res.Body.Close()
11155		}
11156		return nil, &googleapi.Error{
11157			Code:   res.StatusCode,
11158			Header: res.Header,
11159		}
11160	}
11161	if err != nil {
11162		return nil, err
11163	}
11164	defer googleapi.CloseBody(res)
11165	if err := googleapi.CheckResponse(res); err != nil {
11166		return nil, err
11167	}
11168	ret := &LogBucket{
11169		ServerResponse: googleapi.ServerResponse{
11170			Header:         res.Header,
11171			HTTPStatusCode: res.StatusCode,
11172		},
11173	}
11174	target := &ret
11175	if err := gensupport.DecodeResponse(target, res); err != nil {
11176		return nil, err
11177	}
11178	return ret, nil
11179	// {
11180	//   "description": "Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.",
11181	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets",
11182	//   "httpMethod": "POST",
11183	//   "id": "logging.folders.locations.buckets.create",
11184	//   "parameterOrder": [
11185	//     "parent"
11186	//   ],
11187	//   "parameters": {
11188	//     "bucketId": {
11189	//       "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.",
11190	//       "location": "query",
11191	//       "type": "string"
11192	//     },
11193	//     "parent": {
11194	//       "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"",
11195	//       "location": "path",
11196	//       "pattern": "^folders/[^/]+/locations/[^/]+$",
11197	//       "required": true,
11198	//       "type": "string"
11199	//     }
11200	//   },
11201	//   "path": "v2/{+parent}/buckets",
11202	//   "request": {
11203	//     "$ref": "LogBucket"
11204	//   },
11205	//   "response": {
11206	//     "$ref": "LogBucket"
11207	//   },
11208	//   "scopes": [
11209	//     "https://www.googleapis.com/auth/cloud-platform",
11210	//     "https://www.googleapis.com/auth/logging.admin"
11211	//   ]
11212	// }
11213
11214}
11215
11216// method id "logging.folders.locations.buckets.delete":
11217
11218type FoldersLocationsBucketsDeleteCall struct {
11219	s          *Service
11220	name       string
11221	urlParams_ gensupport.URLParams
11222	ctx_       context.Context
11223	header_    http.Header
11224}
11225
11226// Delete: Deletes a log bucket.Changes the bucket's lifecycle_state to
11227// the DELETE_REQUESTED state. After 7 days, the bucket will be purged
11228// and all log entries in the bucket will be permanently deleted.
11229//
11230// - name: The full resource name of the bucket to delete.
11231//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
11232//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
11233//   CKET_ID]"
11234//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
11235//   s/[BUCKET_ID]"
11236//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
11237//   For
11238//   example:"projects/my-project/locations/global/buckets/my-bucket".
11239func (r *FoldersLocationsBucketsService) Delete(name string) *FoldersLocationsBucketsDeleteCall {
11240	c := &FoldersLocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11241	c.name = name
11242	return c
11243}
11244
11245// Fields allows partial responses to be retrieved. See
11246// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11247// for more information.
11248func (c *FoldersLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsDeleteCall {
11249	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11250	return c
11251}
11252
11253// Context sets the context to be used in this call's Do method. Any
11254// pending HTTP request will be aborted if the provided context is
11255// canceled.
11256func (c *FoldersLocationsBucketsDeleteCall) Context(ctx context.Context) *FoldersLocationsBucketsDeleteCall {
11257	c.ctx_ = ctx
11258	return c
11259}
11260
11261// Header returns an http.Header that can be modified by the caller to
11262// add HTTP headers to the request.
11263func (c *FoldersLocationsBucketsDeleteCall) Header() http.Header {
11264	if c.header_ == nil {
11265		c.header_ = make(http.Header)
11266	}
11267	return c.header_
11268}
11269
11270func (c *FoldersLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
11271	reqHeaders := make(http.Header)
11272	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
11273	for k, v := range c.header_ {
11274		reqHeaders[k] = v
11275	}
11276	reqHeaders.Set("User-Agent", c.s.userAgent())
11277	var body io.Reader = nil
11278	c.urlParams_.Set("alt", alt)
11279	c.urlParams_.Set("prettyPrint", "false")
11280	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
11281	urls += "?" + c.urlParams_.Encode()
11282	req, err := http.NewRequest("DELETE", urls, body)
11283	if err != nil {
11284		return nil, err
11285	}
11286	req.Header = reqHeaders
11287	googleapi.Expand(req.URL, map[string]string{
11288		"name": c.name,
11289	})
11290	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11291}
11292
11293// Do executes the "logging.folders.locations.buckets.delete" call.
11294// Exactly one of *Empty or error will be non-nil. Any non-2xx status
11295// code is an error. Response headers are in either
11296// *Empty.ServerResponse.Header or (if a response was returned at all)
11297// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11298// check whether the returned error was because http.StatusNotModified
11299// was returned.
11300func (c *FoldersLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
11301	gensupport.SetOptions(c.urlParams_, opts...)
11302	res, err := c.doRequest("json")
11303	if res != nil && res.StatusCode == http.StatusNotModified {
11304		if res.Body != nil {
11305			res.Body.Close()
11306		}
11307		return nil, &googleapi.Error{
11308			Code:   res.StatusCode,
11309			Header: res.Header,
11310		}
11311	}
11312	if err != nil {
11313		return nil, err
11314	}
11315	defer googleapi.CloseBody(res)
11316	if err := googleapi.CheckResponse(res); err != nil {
11317		return nil, err
11318	}
11319	ret := &Empty{
11320		ServerResponse: googleapi.ServerResponse{
11321			Header:         res.Header,
11322			HTTPStatusCode: res.StatusCode,
11323		},
11324	}
11325	target := &ret
11326	if err := gensupport.DecodeResponse(target, res); err != nil {
11327		return nil, err
11328	}
11329	return ret, nil
11330	// {
11331	//   "description": "Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.",
11332	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}",
11333	//   "httpMethod": "DELETE",
11334	//   "id": "logging.folders.locations.buckets.delete",
11335	//   "parameterOrder": [
11336	//     "name"
11337	//   ],
11338	//   "parameters": {
11339	//     "name": {
11340	//       "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]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"",
11341	//       "location": "path",
11342	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$",
11343	//       "required": true,
11344	//       "type": "string"
11345	//     }
11346	//   },
11347	//   "path": "v2/{+name}",
11348	//   "response": {
11349	//     "$ref": "Empty"
11350	//   },
11351	//   "scopes": [
11352	//     "https://www.googleapis.com/auth/cloud-platform",
11353	//     "https://www.googleapis.com/auth/logging.admin"
11354	//   ]
11355	// }
11356
11357}
11358
11359// method id "logging.folders.locations.buckets.get":
11360
11361type FoldersLocationsBucketsGetCall struct {
11362	s            *Service
11363	name         string
11364	urlParams_   gensupport.URLParams
11365	ifNoneMatch_ string
11366	ctx_         context.Context
11367	header_      http.Header
11368}
11369
11370// Get: Gets a log bucket.
11371//
11372// - name: The resource name of the bucket:
11373//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
11374//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
11375//   CKET_ID]"
11376//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
11377//   s/[BUCKET_ID]"
11378//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
11379//   For
11380//   example:"projects/my-project/locations/global/buckets/my-bucket".
11381func (r *FoldersLocationsBucketsService) Get(name string) *FoldersLocationsBucketsGetCall {
11382	c := &FoldersLocationsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11383	c.name = name
11384	return c
11385}
11386
11387// Fields allows partial responses to be retrieved. See
11388// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11389// for more information.
11390func (c *FoldersLocationsBucketsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsGetCall {
11391	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11392	return c
11393}
11394
11395// IfNoneMatch sets the optional parameter which makes the operation
11396// fail if the object's ETag matches the given value. This is useful for
11397// getting updates only after the object has changed since the last
11398// request. Use googleapi.IsNotModified to check whether the response
11399// error from Do is the result of In-None-Match.
11400func (c *FoldersLocationsBucketsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsGetCall {
11401	c.ifNoneMatch_ = entityTag
11402	return c
11403}
11404
11405// Context sets the context to be used in this call's Do method. Any
11406// pending HTTP request will be aborted if the provided context is
11407// canceled.
11408func (c *FoldersLocationsBucketsGetCall) Context(ctx context.Context) *FoldersLocationsBucketsGetCall {
11409	c.ctx_ = ctx
11410	return c
11411}
11412
11413// Header returns an http.Header that can be modified by the caller to
11414// add HTTP headers to the request.
11415func (c *FoldersLocationsBucketsGetCall) Header() http.Header {
11416	if c.header_ == nil {
11417		c.header_ = make(http.Header)
11418	}
11419	return c.header_
11420}
11421
11422func (c *FoldersLocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) {
11423	reqHeaders := make(http.Header)
11424	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
11425	for k, v := range c.header_ {
11426		reqHeaders[k] = v
11427	}
11428	reqHeaders.Set("User-Agent", c.s.userAgent())
11429	if c.ifNoneMatch_ != "" {
11430		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11431	}
11432	var body io.Reader = nil
11433	c.urlParams_.Set("alt", alt)
11434	c.urlParams_.Set("prettyPrint", "false")
11435	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
11436	urls += "?" + c.urlParams_.Encode()
11437	req, err := http.NewRequest("GET", urls, body)
11438	if err != nil {
11439		return nil, err
11440	}
11441	req.Header = reqHeaders
11442	googleapi.Expand(req.URL, map[string]string{
11443		"name": c.name,
11444	})
11445	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11446}
11447
11448// Do executes the "logging.folders.locations.buckets.get" call.
11449// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
11450// status code is an error. Response headers are in either
11451// *LogBucket.ServerResponse.Header or (if a response was returned at
11452// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
11453// to check whether the returned error was because
11454// http.StatusNotModified was returned.
11455func (c *FoldersLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
11456	gensupport.SetOptions(c.urlParams_, opts...)
11457	res, err := c.doRequest("json")
11458	if res != nil && res.StatusCode == http.StatusNotModified {
11459		if res.Body != nil {
11460			res.Body.Close()
11461		}
11462		return nil, &googleapi.Error{
11463			Code:   res.StatusCode,
11464			Header: res.Header,
11465		}
11466	}
11467	if err != nil {
11468		return nil, err
11469	}
11470	defer googleapi.CloseBody(res)
11471	if err := googleapi.CheckResponse(res); err != nil {
11472		return nil, err
11473	}
11474	ret := &LogBucket{
11475		ServerResponse: googleapi.ServerResponse{
11476			Header:         res.Header,
11477			HTTPStatusCode: res.StatusCode,
11478		},
11479	}
11480	target := &ret
11481	if err := gensupport.DecodeResponse(target, res); err != nil {
11482		return nil, err
11483	}
11484	return ret, nil
11485	// {
11486	//   "description": "Gets a log bucket.",
11487	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}",
11488	//   "httpMethod": "GET",
11489	//   "id": "logging.folders.locations.buckets.get",
11490	//   "parameterOrder": [
11491	//     "name"
11492	//   ],
11493	//   "parameters": {
11494	//     "name": {
11495	//       "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]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"",
11496	//       "location": "path",
11497	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$",
11498	//       "required": true,
11499	//       "type": "string"
11500	//     }
11501	//   },
11502	//   "path": "v2/{+name}",
11503	//   "response": {
11504	//     "$ref": "LogBucket"
11505	//   },
11506	//   "scopes": [
11507	//     "https://www.googleapis.com/auth/cloud-platform",
11508	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
11509	//     "https://www.googleapis.com/auth/logging.admin",
11510	//     "https://www.googleapis.com/auth/logging.read"
11511	//   ]
11512	// }
11513
11514}
11515
11516// method id "logging.folders.locations.buckets.list":
11517
11518type FoldersLocationsBucketsListCall struct {
11519	s            *Service
11520	parent       string
11521	urlParams_   gensupport.URLParams
11522	ifNoneMatch_ string
11523	ctx_         context.Context
11524	header_      http.Header
11525}
11526
11527// List: Lists log buckets.
11528//
11529// - parent: The parent resource whose buckets are to be listed:
11530//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
11531//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
11532//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
11533//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations
11534//   portion of the resource must be specified, but supplying the
11535//   character - in place of LOCATION_ID will return all buckets.
11536func (r *FoldersLocationsBucketsService) List(parent string) *FoldersLocationsBucketsListCall {
11537	c := &FoldersLocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11538	c.parent = parent
11539	return c
11540}
11541
11542// PageSize sets the optional parameter "pageSize": The maximum number
11543// of results to return from this request. Non-positive values are
11544// ignored. The presence of nextPageToken in the response indicates that
11545// more results might be available.
11546func (c *FoldersLocationsBucketsListCall) PageSize(pageSize int64) *FoldersLocationsBucketsListCall {
11547	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
11548	return c
11549}
11550
11551// PageToken sets the optional parameter "pageToken": If present, then
11552// retrieve the next batch of results from the preceding call to this
11553// method. pageToken must be the value of nextPageToken from the
11554// previous response. The values of other method parameters should be
11555// identical to those in the previous call.
11556func (c *FoldersLocationsBucketsListCall) PageToken(pageToken string) *FoldersLocationsBucketsListCall {
11557	c.urlParams_.Set("pageToken", pageToken)
11558	return c
11559}
11560
11561// Fields allows partial responses to be retrieved. See
11562// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11563// for more information.
11564func (c *FoldersLocationsBucketsListCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsListCall {
11565	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11566	return c
11567}
11568
11569// IfNoneMatch sets the optional parameter which makes the operation
11570// fail if the object's ETag matches the given value. This is useful for
11571// getting updates only after the object has changed since the last
11572// request. Use googleapi.IsNotModified to check whether the response
11573// error from Do is the result of In-None-Match.
11574func (c *FoldersLocationsBucketsListCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsListCall {
11575	c.ifNoneMatch_ = entityTag
11576	return c
11577}
11578
11579// Context sets the context to be used in this call's Do method. Any
11580// pending HTTP request will be aborted if the provided context is
11581// canceled.
11582func (c *FoldersLocationsBucketsListCall) Context(ctx context.Context) *FoldersLocationsBucketsListCall {
11583	c.ctx_ = ctx
11584	return c
11585}
11586
11587// Header returns an http.Header that can be modified by the caller to
11588// add HTTP headers to the request.
11589func (c *FoldersLocationsBucketsListCall) Header() http.Header {
11590	if c.header_ == nil {
11591		c.header_ = make(http.Header)
11592	}
11593	return c.header_
11594}
11595
11596func (c *FoldersLocationsBucketsListCall) doRequest(alt string) (*http.Response, error) {
11597	reqHeaders := make(http.Header)
11598	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
11599	for k, v := range c.header_ {
11600		reqHeaders[k] = v
11601	}
11602	reqHeaders.Set("User-Agent", c.s.userAgent())
11603	if c.ifNoneMatch_ != "" {
11604		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
11605	}
11606	var body io.Reader = nil
11607	c.urlParams_.Set("alt", alt)
11608	c.urlParams_.Set("prettyPrint", "false")
11609	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
11610	urls += "?" + c.urlParams_.Encode()
11611	req, err := http.NewRequest("GET", urls, body)
11612	if err != nil {
11613		return nil, err
11614	}
11615	req.Header = reqHeaders
11616	googleapi.Expand(req.URL, map[string]string{
11617		"parent": c.parent,
11618	})
11619	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11620}
11621
11622// Do executes the "logging.folders.locations.buckets.list" call.
11623// Exactly one of *ListBucketsResponse or error will be non-nil. Any
11624// non-2xx status code is an error. Response headers are in either
11625// *ListBucketsResponse.ServerResponse.Header or (if a response was
11626// returned at all) in error.(*googleapi.Error).Header. Use
11627// googleapi.IsNotModified to check whether the returned error was
11628// because http.StatusNotModified was returned.
11629func (c *FoldersLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) {
11630	gensupport.SetOptions(c.urlParams_, opts...)
11631	res, err := c.doRequest("json")
11632	if res != nil && res.StatusCode == http.StatusNotModified {
11633		if res.Body != nil {
11634			res.Body.Close()
11635		}
11636		return nil, &googleapi.Error{
11637			Code:   res.StatusCode,
11638			Header: res.Header,
11639		}
11640	}
11641	if err != nil {
11642		return nil, err
11643	}
11644	defer googleapi.CloseBody(res)
11645	if err := googleapi.CheckResponse(res); err != nil {
11646		return nil, err
11647	}
11648	ret := &ListBucketsResponse{
11649		ServerResponse: googleapi.ServerResponse{
11650			Header:         res.Header,
11651			HTTPStatusCode: res.StatusCode,
11652		},
11653	}
11654	target := &ret
11655	if err := gensupport.DecodeResponse(target, res); err != nil {
11656		return nil, err
11657	}
11658	return ret, nil
11659	// {
11660	//   "description": "Lists log buckets.",
11661	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets",
11662	//   "httpMethod": "GET",
11663	//   "id": "logging.folders.locations.buckets.list",
11664	//   "parameterOrder": [
11665	//     "parent"
11666	//   ],
11667	//   "parameters": {
11668	//     "pageSize": {
11669	//       "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.",
11670	//       "format": "int32",
11671	//       "location": "query",
11672	//       "type": "integer"
11673	//     },
11674	//     "pageToken": {
11675	//       "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.",
11676	//       "location": "query",
11677	//       "type": "string"
11678	//     },
11679	//     "parent": {
11680	//       "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.",
11681	//       "location": "path",
11682	//       "pattern": "^folders/[^/]+/locations/[^/]+$",
11683	//       "required": true,
11684	//       "type": "string"
11685	//     }
11686	//   },
11687	//   "path": "v2/{+parent}/buckets",
11688	//   "response": {
11689	//     "$ref": "ListBucketsResponse"
11690	//   },
11691	//   "scopes": [
11692	//     "https://www.googleapis.com/auth/cloud-platform",
11693	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
11694	//     "https://www.googleapis.com/auth/logging.admin",
11695	//     "https://www.googleapis.com/auth/logging.read"
11696	//   ]
11697	// }
11698
11699}
11700
11701// Pages invokes f for each page of results.
11702// A non-nil error returned from f will halt the iteration.
11703// The provided context supersedes any context provided to the Context method.
11704func (c *FoldersLocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error {
11705	c.ctx_ = ctx
11706	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
11707	for {
11708		x, err := c.Do()
11709		if err != nil {
11710			return err
11711		}
11712		if err := f(x); err != nil {
11713			return err
11714		}
11715		if x.NextPageToken == "" {
11716			return nil
11717		}
11718		c.PageToken(x.NextPageToken)
11719	}
11720}
11721
11722// method id "logging.folders.locations.buckets.patch":
11723
11724type FoldersLocationsBucketsPatchCall struct {
11725	s          *Service
11726	name       string
11727	logbucket  *LogBucket
11728	urlParams_ gensupport.URLParams
11729	ctx_       context.Context
11730	header_    http.Header
11731}
11732
11733// Patch: Updates a log bucket. This method replaces the following
11734// fields in the existing bucket with values from the new bucket:
11735// retention_periodIf the retention period is decreased and the bucket
11736// is locked, FAILED_PRECONDITION will be returned.If the bucket has a
11737// lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be
11738// returned.After a bucket has been created, the bucket's location
11739// cannot be changed.
11740//
11741// - name: The full resource name of the bucket to update.
11742//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
11743//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
11744//   CKET_ID]"
11745//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
11746//   s/[BUCKET_ID]"
11747//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
11748//   For
11749//   example:"projects/my-project/locations/global/buckets/my-bucket".
11750func (r *FoldersLocationsBucketsService) Patch(name string, logbucket *LogBucket) *FoldersLocationsBucketsPatchCall {
11751	c := &FoldersLocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11752	c.name = name
11753	c.logbucket = logbucket
11754	return c
11755}
11756
11757// UpdateMask sets the optional parameter "updateMask": Required. Field
11758// mask that specifies the fields in bucket that need an update. A
11759// bucket field will be overwritten if, and only if, it is in the update
11760// mask. name and output only fields cannot be updated.For a detailed
11761// FieldMask definition, see:
11762// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor
11763// example: updateMask=retention_days
11764func (c *FoldersLocationsBucketsPatchCall) UpdateMask(updateMask string) *FoldersLocationsBucketsPatchCall {
11765	c.urlParams_.Set("updateMask", updateMask)
11766	return c
11767}
11768
11769// Fields allows partial responses to be retrieved. See
11770// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11771// for more information.
11772func (c *FoldersLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsPatchCall {
11773	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11774	return c
11775}
11776
11777// Context sets the context to be used in this call's Do method. Any
11778// pending HTTP request will be aborted if the provided context is
11779// canceled.
11780func (c *FoldersLocationsBucketsPatchCall) Context(ctx context.Context) *FoldersLocationsBucketsPatchCall {
11781	c.ctx_ = ctx
11782	return c
11783}
11784
11785// Header returns an http.Header that can be modified by the caller to
11786// add HTTP headers to the request.
11787func (c *FoldersLocationsBucketsPatchCall) Header() http.Header {
11788	if c.header_ == nil {
11789		c.header_ = make(http.Header)
11790	}
11791	return c.header_
11792}
11793
11794func (c *FoldersLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
11795	reqHeaders := make(http.Header)
11796	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
11797	for k, v := range c.header_ {
11798		reqHeaders[k] = v
11799	}
11800	reqHeaders.Set("User-Agent", c.s.userAgent())
11801	var body io.Reader = nil
11802	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
11803	if err != nil {
11804		return nil, err
11805	}
11806	reqHeaders.Set("Content-Type", "application/json")
11807	c.urlParams_.Set("alt", alt)
11808	c.urlParams_.Set("prettyPrint", "false")
11809	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
11810	urls += "?" + c.urlParams_.Encode()
11811	req, err := http.NewRequest("PATCH", urls, body)
11812	if err != nil {
11813		return nil, err
11814	}
11815	req.Header = reqHeaders
11816	googleapi.Expand(req.URL, map[string]string{
11817		"name": c.name,
11818	})
11819	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11820}
11821
11822// Do executes the "logging.folders.locations.buckets.patch" call.
11823// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
11824// status code is an error. Response headers are in either
11825// *LogBucket.ServerResponse.Header or (if a response was returned at
11826// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
11827// to check whether the returned error was because
11828// http.StatusNotModified was returned.
11829func (c *FoldersLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
11830	gensupport.SetOptions(c.urlParams_, opts...)
11831	res, err := c.doRequest("json")
11832	if res != nil && res.StatusCode == http.StatusNotModified {
11833		if res.Body != nil {
11834			res.Body.Close()
11835		}
11836		return nil, &googleapi.Error{
11837			Code:   res.StatusCode,
11838			Header: res.Header,
11839		}
11840	}
11841	if err != nil {
11842		return nil, err
11843	}
11844	defer googleapi.CloseBody(res)
11845	if err := googleapi.CheckResponse(res); err != nil {
11846		return nil, err
11847	}
11848	ret := &LogBucket{
11849		ServerResponse: googleapi.ServerResponse{
11850			Header:         res.Header,
11851			HTTPStatusCode: res.StatusCode,
11852		},
11853	}
11854	target := &ret
11855	if err := gensupport.DecodeResponse(target, res); err != nil {
11856		return nil, err
11857	}
11858	return ret, nil
11859	// {
11860	//   "description": "Updates a log 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 lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.",
11861	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}",
11862	//   "httpMethod": "PATCH",
11863	//   "id": "logging.folders.locations.buckets.patch",
11864	//   "parameterOrder": [
11865	//     "name"
11866	//   ],
11867	//   "parameters": {
11868	//     "name": {
11869	//       "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]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"",
11870	//       "location": "path",
11871	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$",
11872	//       "required": true,
11873	//       "type": "string"
11874	//     },
11875	//     "updateMask": {
11876	//       "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.FieldMaskFor example: updateMask=retention_days",
11877	//       "format": "google-fieldmask",
11878	//       "location": "query",
11879	//       "type": "string"
11880	//     }
11881	//   },
11882	//   "path": "v2/{+name}",
11883	//   "request": {
11884	//     "$ref": "LogBucket"
11885	//   },
11886	//   "response": {
11887	//     "$ref": "LogBucket"
11888	//   },
11889	//   "scopes": [
11890	//     "https://www.googleapis.com/auth/cloud-platform",
11891	//     "https://www.googleapis.com/auth/logging.admin"
11892	//   ]
11893	// }
11894
11895}
11896
11897// method id "logging.folders.locations.buckets.undelete":
11898
11899type FoldersLocationsBucketsUndeleteCall struct {
11900	s                     *Service
11901	name                  string
11902	undeletebucketrequest *UndeleteBucketRequest
11903	urlParams_            gensupport.URLParams
11904	ctx_                  context.Context
11905	header_               http.Header
11906}
11907
11908// Undelete: Undeletes a log bucket. A bucket that has been deleted can
11909// be undeleted within the grace period of 7 days.
11910//
11911// - name: The full resource name of the bucket to undelete.
11912//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
11913//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
11914//   CKET_ID]"
11915//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
11916//   s/[BUCKET_ID]"
11917//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
11918//   For
11919//   example:"projects/my-project/locations/global/buckets/my-bucket".
11920func (r *FoldersLocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *FoldersLocationsBucketsUndeleteCall {
11921	c := &FoldersLocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
11922	c.name = name
11923	c.undeletebucketrequest = undeletebucketrequest
11924	return c
11925}
11926
11927// Fields allows partial responses to be retrieved. See
11928// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
11929// for more information.
11930func (c *FoldersLocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsUndeleteCall {
11931	c.urlParams_.Set("fields", googleapi.CombineFields(s))
11932	return c
11933}
11934
11935// Context sets the context to be used in this call's Do method. Any
11936// pending HTTP request will be aborted if the provided context is
11937// canceled.
11938func (c *FoldersLocationsBucketsUndeleteCall) Context(ctx context.Context) *FoldersLocationsBucketsUndeleteCall {
11939	c.ctx_ = ctx
11940	return c
11941}
11942
11943// Header returns an http.Header that can be modified by the caller to
11944// add HTTP headers to the request.
11945func (c *FoldersLocationsBucketsUndeleteCall) Header() http.Header {
11946	if c.header_ == nil {
11947		c.header_ = make(http.Header)
11948	}
11949	return c.header_
11950}
11951
11952func (c *FoldersLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) {
11953	reqHeaders := make(http.Header)
11954	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
11955	for k, v := range c.header_ {
11956		reqHeaders[k] = v
11957	}
11958	reqHeaders.Set("User-Agent", c.s.userAgent())
11959	var body io.Reader = nil
11960	body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest)
11961	if err != nil {
11962		return nil, err
11963	}
11964	reqHeaders.Set("Content-Type", "application/json")
11965	c.urlParams_.Set("alt", alt)
11966	c.urlParams_.Set("prettyPrint", "false")
11967	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete")
11968	urls += "?" + c.urlParams_.Encode()
11969	req, err := http.NewRequest("POST", urls, body)
11970	if err != nil {
11971		return nil, err
11972	}
11973	req.Header = reqHeaders
11974	googleapi.Expand(req.URL, map[string]string{
11975		"name": c.name,
11976	})
11977	return gensupport.SendRequest(c.ctx_, c.s.client, req)
11978}
11979
11980// Do executes the "logging.folders.locations.buckets.undelete" call.
11981// Exactly one of *Empty or error will be non-nil. Any non-2xx status
11982// code is an error. Response headers are in either
11983// *Empty.ServerResponse.Header or (if a response was returned at all)
11984// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
11985// check whether the returned error was because http.StatusNotModified
11986// was returned.
11987func (c *FoldersLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
11988	gensupport.SetOptions(c.urlParams_, opts...)
11989	res, err := c.doRequest("json")
11990	if res != nil && res.StatusCode == http.StatusNotModified {
11991		if res.Body != nil {
11992			res.Body.Close()
11993		}
11994		return nil, &googleapi.Error{
11995			Code:   res.StatusCode,
11996			Header: res.Header,
11997		}
11998	}
11999	if err != nil {
12000		return nil, err
12001	}
12002	defer googleapi.CloseBody(res)
12003	if err := googleapi.CheckResponse(res); err != nil {
12004		return nil, err
12005	}
12006	ret := &Empty{
12007		ServerResponse: googleapi.ServerResponse{
12008			Header:         res.Header,
12009			HTTPStatusCode: res.StatusCode,
12010		},
12011	}
12012	target := &ret
12013	if err := gensupport.DecodeResponse(target, res); err != nil {
12014		return nil, err
12015	}
12016	return ret, nil
12017	// {
12018	//   "description": "Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.",
12019	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}:undelete",
12020	//   "httpMethod": "POST",
12021	//   "id": "logging.folders.locations.buckets.undelete",
12022	//   "parameterOrder": [
12023	//     "name"
12024	//   ],
12025	//   "parameters": {
12026	//     "name": {
12027	//       "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]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"",
12028	//       "location": "path",
12029	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$",
12030	//       "required": true,
12031	//       "type": "string"
12032	//     }
12033	//   },
12034	//   "path": "v2/{+name}:undelete",
12035	//   "request": {
12036	//     "$ref": "UndeleteBucketRequest"
12037	//   },
12038	//   "response": {
12039	//     "$ref": "Empty"
12040	//   },
12041	//   "scopes": [
12042	//     "https://www.googleapis.com/auth/cloud-platform",
12043	//     "https://www.googleapis.com/auth/logging.admin"
12044	//   ]
12045	// }
12046
12047}
12048
12049// method id "logging.folders.locations.buckets.views.create":
12050
12051type FoldersLocationsBucketsViewsCreateCall struct {
12052	s          *Service
12053	parent     string
12054	logview    *LogView
12055	urlParams_ gensupport.URLParams
12056	ctx_       context.Context
12057	header_    http.Header
12058}
12059
12060// Create: Creates a view over log entries in a log bucket. A bucket may
12061// contain a maximum of 30 views.
12062//
12063// - parent: The bucket in which to create the view
12064//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
12065//   ` For
12066//   example:"projects/my-project/locations/global/buckets/my-bucket".
12067func (r *FoldersLocationsBucketsViewsService) Create(parent string, logview *LogView) *FoldersLocationsBucketsViewsCreateCall {
12068	c := &FoldersLocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12069	c.parent = parent
12070	c.logview = logview
12071	return c
12072}
12073
12074// ViewId sets the optional parameter "viewId": Required. The id to use
12075// for this view.
12076func (c *FoldersLocationsBucketsViewsCreateCall) ViewId(viewId string) *FoldersLocationsBucketsViewsCreateCall {
12077	c.urlParams_.Set("viewId", viewId)
12078	return c
12079}
12080
12081// Fields allows partial responses to be retrieved. See
12082// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12083// for more information.
12084func (c *FoldersLocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsCreateCall {
12085	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12086	return c
12087}
12088
12089// Context sets the context to be used in this call's Do method. Any
12090// pending HTTP request will be aborted if the provided context is
12091// canceled.
12092func (c *FoldersLocationsBucketsViewsCreateCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsCreateCall {
12093	c.ctx_ = ctx
12094	return c
12095}
12096
12097// Header returns an http.Header that can be modified by the caller to
12098// add HTTP headers to the request.
12099func (c *FoldersLocationsBucketsViewsCreateCall) Header() http.Header {
12100	if c.header_ == nil {
12101		c.header_ = make(http.Header)
12102	}
12103	return c.header_
12104}
12105
12106func (c *FoldersLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) {
12107	reqHeaders := make(http.Header)
12108	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
12109	for k, v := range c.header_ {
12110		reqHeaders[k] = v
12111	}
12112	reqHeaders.Set("User-Agent", c.s.userAgent())
12113	var body io.Reader = nil
12114	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
12115	if err != nil {
12116		return nil, err
12117	}
12118	reqHeaders.Set("Content-Type", "application/json")
12119	c.urlParams_.Set("alt", alt)
12120	c.urlParams_.Set("prettyPrint", "false")
12121	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
12122	urls += "?" + c.urlParams_.Encode()
12123	req, err := http.NewRequest("POST", urls, body)
12124	if err != nil {
12125		return nil, err
12126	}
12127	req.Header = reqHeaders
12128	googleapi.Expand(req.URL, map[string]string{
12129		"parent": c.parent,
12130	})
12131	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12132}
12133
12134// Do executes the "logging.folders.locations.buckets.views.create" call.
12135// Exactly one of *LogView or error will be non-nil. Any non-2xx status
12136// code is an error. Response headers are in either
12137// *LogView.ServerResponse.Header or (if a response was returned at all)
12138// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
12139// check whether the returned error was because http.StatusNotModified
12140// was returned.
12141func (c *FoldersLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
12142	gensupport.SetOptions(c.urlParams_, opts...)
12143	res, err := c.doRequest("json")
12144	if res != nil && res.StatusCode == http.StatusNotModified {
12145		if res.Body != nil {
12146			res.Body.Close()
12147		}
12148		return nil, &googleapi.Error{
12149			Code:   res.StatusCode,
12150			Header: res.Header,
12151		}
12152	}
12153	if err != nil {
12154		return nil, err
12155	}
12156	defer googleapi.CloseBody(res)
12157	if err := googleapi.CheckResponse(res); err != nil {
12158		return nil, err
12159	}
12160	ret := &LogView{
12161		ServerResponse: googleapi.ServerResponse{
12162			Header:         res.Header,
12163			HTTPStatusCode: res.StatusCode,
12164		},
12165	}
12166	target := &ret
12167	if err := gensupport.DecodeResponse(target, res); err != nil {
12168		return nil, err
12169	}
12170	return ret, nil
12171	// {
12172	//   "description": "Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.",
12173	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views",
12174	//   "httpMethod": "POST",
12175	//   "id": "logging.folders.locations.buckets.views.create",
12176	//   "parameterOrder": [
12177	//     "parent"
12178	//   ],
12179	//   "parameters": {
12180	//     "parent": {
12181	//       "description": "Required. The bucket in which to create the view `\"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\"` For example:\"projects/my-project/locations/global/buckets/my-bucket\"",
12182	//       "location": "path",
12183	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$",
12184	//       "required": true,
12185	//       "type": "string"
12186	//     },
12187	//     "viewId": {
12188	//       "description": "Required. The id to use for this view.",
12189	//       "location": "query",
12190	//       "type": "string"
12191	//     }
12192	//   },
12193	//   "path": "v2/{+parent}/views",
12194	//   "request": {
12195	//     "$ref": "LogView"
12196	//   },
12197	//   "response": {
12198	//     "$ref": "LogView"
12199	//   },
12200	//   "scopes": [
12201	//     "https://www.googleapis.com/auth/cloud-platform",
12202	//     "https://www.googleapis.com/auth/logging.admin"
12203	//   ]
12204	// }
12205
12206}
12207
12208// method id "logging.folders.locations.buckets.views.delete":
12209
12210type FoldersLocationsBucketsViewsDeleteCall struct {
12211	s          *Service
12212	name       string
12213	urlParams_ gensupport.URLParams
12214	ctx_       context.Context
12215	header_    http.Header
12216}
12217
12218// Delete: Deletes a view on a log bucket. If an UNAVAILABLE error is
12219// returned, this indicates that system is not in a state where it can
12220// delete the view. If this occurs, please try again in a few minutes.
12221//
12222// - name: The full resource name of the view to delete:
12223//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
12224//   iews/[VIEW_ID]" For
12225//   example:"projects/my-project/locations/global/buckets/my-bucket/view
12226//   s/my-view".
12227func (r *FoldersLocationsBucketsViewsService) Delete(name string) *FoldersLocationsBucketsViewsDeleteCall {
12228	c := &FoldersLocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12229	c.name = name
12230	return c
12231}
12232
12233// Fields allows partial responses to be retrieved. See
12234// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12235// for more information.
12236func (c *FoldersLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsDeleteCall {
12237	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12238	return c
12239}
12240
12241// Context sets the context to be used in this call's Do method. Any
12242// pending HTTP request will be aborted if the provided context is
12243// canceled.
12244func (c *FoldersLocationsBucketsViewsDeleteCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsDeleteCall {
12245	c.ctx_ = ctx
12246	return c
12247}
12248
12249// Header returns an http.Header that can be modified by the caller to
12250// add HTTP headers to the request.
12251func (c *FoldersLocationsBucketsViewsDeleteCall) Header() http.Header {
12252	if c.header_ == nil {
12253		c.header_ = make(http.Header)
12254	}
12255	return c.header_
12256}
12257
12258func (c *FoldersLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) {
12259	reqHeaders := make(http.Header)
12260	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
12261	for k, v := range c.header_ {
12262		reqHeaders[k] = v
12263	}
12264	reqHeaders.Set("User-Agent", c.s.userAgent())
12265	var body io.Reader = nil
12266	c.urlParams_.Set("alt", alt)
12267	c.urlParams_.Set("prettyPrint", "false")
12268	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
12269	urls += "?" + c.urlParams_.Encode()
12270	req, err := http.NewRequest("DELETE", urls, body)
12271	if err != nil {
12272		return nil, err
12273	}
12274	req.Header = reqHeaders
12275	googleapi.Expand(req.URL, map[string]string{
12276		"name": c.name,
12277	})
12278	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12279}
12280
12281// Do executes the "logging.folders.locations.buckets.views.delete" call.
12282// Exactly one of *Empty or error will be non-nil. Any non-2xx status
12283// code is an error. Response headers are in either
12284// *Empty.ServerResponse.Header or (if a response was returned at all)
12285// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
12286// check whether the returned error was because http.StatusNotModified
12287// was returned.
12288func (c *FoldersLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
12289	gensupport.SetOptions(c.urlParams_, opts...)
12290	res, err := c.doRequest("json")
12291	if res != nil && res.StatusCode == http.StatusNotModified {
12292		if res.Body != nil {
12293			res.Body.Close()
12294		}
12295		return nil, &googleapi.Error{
12296			Code:   res.StatusCode,
12297			Header: res.Header,
12298		}
12299	}
12300	if err != nil {
12301		return nil, err
12302	}
12303	defer googleapi.CloseBody(res)
12304	if err := googleapi.CheckResponse(res); err != nil {
12305		return nil, err
12306	}
12307	ret := &Empty{
12308		ServerResponse: googleapi.ServerResponse{
12309			Header:         res.Header,
12310			HTTPStatusCode: res.StatusCode,
12311		},
12312	}
12313	target := &ret
12314	if err := gensupport.DecodeResponse(target, res); err != nil {
12315		return nil, err
12316	}
12317	return ret, nil
12318	// {
12319	//   "description": "Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.",
12320	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
12321	//   "httpMethod": "DELETE",
12322	//   "id": "logging.folders.locations.buckets.views.delete",
12323	//   "parameterOrder": [
12324	//     "name"
12325	//   ],
12326	//   "parameters": {
12327	//     "name": {
12328	//       "description": "Required. The full resource name of the view to delete: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"",
12329	//       "location": "path",
12330	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
12331	//       "required": true,
12332	//       "type": "string"
12333	//     }
12334	//   },
12335	//   "path": "v2/{+name}",
12336	//   "response": {
12337	//     "$ref": "Empty"
12338	//   },
12339	//   "scopes": [
12340	//     "https://www.googleapis.com/auth/cloud-platform",
12341	//     "https://www.googleapis.com/auth/logging.admin"
12342	//   ]
12343	// }
12344
12345}
12346
12347// method id "logging.folders.locations.buckets.views.get":
12348
12349type FoldersLocationsBucketsViewsGetCall struct {
12350	s            *Service
12351	name         string
12352	urlParams_   gensupport.URLParams
12353	ifNoneMatch_ string
12354	ctx_         context.Context
12355	header_      http.Header
12356}
12357
12358// Get: Gets a view on a log bucket..
12359//
12360// - name: The resource name of the policy:
12361//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
12362//   iews/[VIEW_ID]" For
12363//   example:"projects/my-project/locations/global/buckets/my-bucket/view
12364//   s/my-view".
12365func (r *FoldersLocationsBucketsViewsService) Get(name string) *FoldersLocationsBucketsViewsGetCall {
12366	c := &FoldersLocationsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12367	c.name = name
12368	return c
12369}
12370
12371// Fields allows partial responses to be retrieved. See
12372// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12373// for more information.
12374func (c *FoldersLocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsGetCall {
12375	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12376	return c
12377}
12378
12379// IfNoneMatch sets the optional parameter which makes the operation
12380// fail if the object's ETag matches the given value. This is useful for
12381// getting updates only after the object has changed since the last
12382// request. Use googleapi.IsNotModified to check whether the response
12383// error from Do is the result of In-None-Match.
12384func (c *FoldersLocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsViewsGetCall {
12385	c.ifNoneMatch_ = entityTag
12386	return c
12387}
12388
12389// Context sets the context to be used in this call's Do method. Any
12390// pending HTTP request will be aborted if the provided context is
12391// canceled.
12392func (c *FoldersLocationsBucketsViewsGetCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsGetCall {
12393	c.ctx_ = ctx
12394	return c
12395}
12396
12397// Header returns an http.Header that can be modified by the caller to
12398// add HTTP headers to the request.
12399func (c *FoldersLocationsBucketsViewsGetCall) Header() http.Header {
12400	if c.header_ == nil {
12401		c.header_ = make(http.Header)
12402	}
12403	return c.header_
12404}
12405
12406func (c *FoldersLocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) {
12407	reqHeaders := make(http.Header)
12408	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
12409	for k, v := range c.header_ {
12410		reqHeaders[k] = v
12411	}
12412	reqHeaders.Set("User-Agent", c.s.userAgent())
12413	if c.ifNoneMatch_ != "" {
12414		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12415	}
12416	var body io.Reader = nil
12417	c.urlParams_.Set("alt", alt)
12418	c.urlParams_.Set("prettyPrint", "false")
12419	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
12420	urls += "?" + c.urlParams_.Encode()
12421	req, err := http.NewRequest("GET", urls, body)
12422	if err != nil {
12423		return nil, err
12424	}
12425	req.Header = reqHeaders
12426	googleapi.Expand(req.URL, map[string]string{
12427		"name": c.name,
12428	})
12429	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12430}
12431
12432// Do executes the "logging.folders.locations.buckets.views.get" call.
12433// Exactly one of *LogView or error will be non-nil. Any non-2xx status
12434// code is an error. Response headers are in either
12435// *LogView.ServerResponse.Header or (if a response was returned at all)
12436// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
12437// check whether the returned error was because http.StatusNotModified
12438// was returned.
12439func (c *FoldersLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
12440	gensupport.SetOptions(c.urlParams_, opts...)
12441	res, err := c.doRequest("json")
12442	if res != nil && res.StatusCode == http.StatusNotModified {
12443		if res.Body != nil {
12444			res.Body.Close()
12445		}
12446		return nil, &googleapi.Error{
12447			Code:   res.StatusCode,
12448			Header: res.Header,
12449		}
12450	}
12451	if err != nil {
12452		return nil, err
12453	}
12454	defer googleapi.CloseBody(res)
12455	if err := googleapi.CheckResponse(res); err != nil {
12456		return nil, err
12457	}
12458	ret := &LogView{
12459		ServerResponse: googleapi.ServerResponse{
12460			Header:         res.Header,
12461			HTTPStatusCode: res.StatusCode,
12462		},
12463	}
12464	target := &ret
12465	if err := gensupport.DecodeResponse(target, res); err != nil {
12466		return nil, err
12467	}
12468	return ret, nil
12469	// {
12470	//   "description": "Gets a view on a log bucket..",
12471	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
12472	//   "httpMethod": "GET",
12473	//   "id": "logging.folders.locations.buckets.views.get",
12474	//   "parameterOrder": [
12475	//     "name"
12476	//   ],
12477	//   "parameters": {
12478	//     "name": {
12479	//       "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"",
12480	//       "location": "path",
12481	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
12482	//       "required": true,
12483	//       "type": "string"
12484	//     }
12485	//   },
12486	//   "path": "v2/{+name}",
12487	//   "response": {
12488	//     "$ref": "LogView"
12489	//   },
12490	//   "scopes": [
12491	//     "https://www.googleapis.com/auth/cloud-platform",
12492	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
12493	//     "https://www.googleapis.com/auth/logging.admin",
12494	//     "https://www.googleapis.com/auth/logging.read"
12495	//   ]
12496	// }
12497
12498}
12499
12500// method id "logging.folders.locations.buckets.views.list":
12501
12502type FoldersLocationsBucketsViewsListCall struct {
12503	s            *Service
12504	parent       string
12505	urlParams_   gensupport.URLParams
12506	ifNoneMatch_ string
12507	ctx_         context.Context
12508	header_      http.Header
12509}
12510
12511// List: Lists views on a log bucket.
12512//
12513// - parent: The bucket whose views are to be listed:
12514//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]".
12515func (r *FoldersLocationsBucketsViewsService) List(parent string) *FoldersLocationsBucketsViewsListCall {
12516	c := &FoldersLocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12517	c.parent = parent
12518	return c
12519}
12520
12521// PageSize sets the optional parameter "pageSize": The maximum number
12522// of results to return from this request.Non-positive values are
12523// ignored. The presence of nextPageToken in the response indicates that
12524// more results might be available.
12525func (c *FoldersLocationsBucketsViewsListCall) PageSize(pageSize int64) *FoldersLocationsBucketsViewsListCall {
12526	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
12527	return c
12528}
12529
12530// PageToken sets the optional parameter "pageToken": If present, then
12531// retrieve the next batch of results from the preceding call to this
12532// method. pageToken must be the value of nextPageToken from the
12533// previous response. The values of other method parameters should be
12534// identical to those in the previous call.
12535func (c *FoldersLocationsBucketsViewsListCall) PageToken(pageToken string) *FoldersLocationsBucketsViewsListCall {
12536	c.urlParams_.Set("pageToken", pageToken)
12537	return c
12538}
12539
12540// Fields allows partial responses to be retrieved. See
12541// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12542// for more information.
12543func (c *FoldersLocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsListCall {
12544	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12545	return c
12546}
12547
12548// IfNoneMatch sets the optional parameter which makes the operation
12549// fail if the object's ETag matches the given value. This is useful for
12550// getting updates only after the object has changed since the last
12551// request. Use googleapi.IsNotModified to check whether the response
12552// error from Do is the result of In-None-Match.
12553func (c *FoldersLocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *FoldersLocationsBucketsViewsListCall {
12554	c.ifNoneMatch_ = entityTag
12555	return c
12556}
12557
12558// Context sets the context to be used in this call's Do method. Any
12559// pending HTTP request will be aborted if the provided context is
12560// canceled.
12561func (c *FoldersLocationsBucketsViewsListCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsListCall {
12562	c.ctx_ = ctx
12563	return c
12564}
12565
12566// Header returns an http.Header that can be modified by the caller to
12567// add HTTP headers to the request.
12568func (c *FoldersLocationsBucketsViewsListCall) Header() http.Header {
12569	if c.header_ == nil {
12570		c.header_ = make(http.Header)
12571	}
12572	return c.header_
12573}
12574
12575func (c *FoldersLocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) {
12576	reqHeaders := make(http.Header)
12577	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
12578	for k, v := range c.header_ {
12579		reqHeaders[k] = v
12580	}
12581	reqHeaders.Set("User-Agent", c.s.userAgent())
12582	if c.ifNoneMatch_ != "" {
12583		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
12584	}
12585	var body io.Reader = nil
12586	c.urlParams_.Set("alt", alt)
12587	c.urlParams_.Set("prettyPrint", "false")
12588	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
12589	urls += "?" + c.urlParams_.Encode()
12590	req, err := http.NewRequest("GET", urls, body)
12591	if err != nil {
12592		return nil, err
12593	}
12594	req.Header = reqHeaders
12595	googleapi.Expand(req.URL, map[string]string{
12596		"parent": c.parent,
12597	})
12598	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12599}
12600
12601// Do executes the "logging.folders.locations.buckets.views.list" call.
12602// Exactly one of *ListViewsResponse or error will be non-nil. Any
12603// non-2xx status code is an error. Response headers are in either
12604// *ListViewsResponse.ServerResponse.Header or (if a response was
12605// returned at all) in error.(*googleapi.Error).Header. Use
12606// googleapi.IsNotModified to check whether the returned error was
12607// because http.StatusNotModified was returned.
12608func (c *FoldersLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) {
12609	gensupport.SetOptions(c.urlParams_, opts...)
12610	res, err := c.doRequest("json")
12611	if res != nil && res.StatusCode == http.StatusNotModified {
12612		if res.Body != nil {
12613			res.Body.Close()
12614		}
12615		return nil, &googleapi.Error{
12616			Code:   res.StatusCode,
12617			Header: res.Header,
12618		}
12619	}
12620	if err != nil {
12621		return nil, err
12622	}
12623	defer googleapi.CloseBody(res)
12624	if err := googleapi.CheckResponse(res); err != nil {
12625		return nil, err
12626	}
12627	ret := &ListViewsResponse{
12628		ServerResponse: googleapi.ServerResponse{
12629			Header:         res.Header,
12630			HTTPStatusCode: res.StatusCode,
12631		},
12632	}
12633	target := &ret
12634	if err := gensupport.DecodeResponse(target, res); err != nil {
12635		return nil, err
12636	}
12637	return ret, nil
12638	// {
12639	//   "description": "Lists views on a log bucket.",
12640	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views",
12641	//   "httpMethod": "GET",
12642	//   "id": "logging.folders.locations.buckets.views.list",
12643	//   "parameterOrder": [
12644	//     "parent"
12645	//   ],
12646	//   "parameters": {
12647	//     "pageSize": {
12648	//       "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.",
12649	//       "format": "int32",
12650	//       "location": "query",
12651	//       "type": "integer"
12652	//     },
12653	//     "pageToken": {
12654	//       "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.",
12655	//       "location": "query",
12656	//       "type": "string"
12657	//     },
12658	//     "parent": {
12659	//       "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ",
12660	//       "location": "path",
12661	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+$",
12662	//       "required": true,
12663	//       "type": "string"
12664	//     }
12665	//   },
12666	//   "path": "v2/{+parent}/views",
12667	//   "response": {
12668	//     "$ref": "ListViewsResponse"
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// Pages invokes f for each page of results.
12681// A non-nil error returned from f will halt the iteration.
12682// The provided context supersedes any context provided to the Context method.
12683func (c *FoldersLocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error {
12684	c.ctx_ = ctx
12685	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
12686	for {
12687		x, err := c.Do()
12688		if err != nil {
12689			return err
12690		}
12691		if err := f(x); err != nil {
12692			return err
12693		}
12694		if x.NextPageToken == "" {
12695			return nil
12696		}
12697		c.PageToken(x.NextPageToken)
12698	}
12699}
12700
12701// method id "logging.folders.locations.buckets.views.patch":
12702
12703type FoldersLocationsBucketsViewsPatchCall struct {
12704	s          *Service
12705	name       string
12706	logview    *LogView
12707	urlParams_ gensupport.URLParams
12708	ctx_       context.Context
12709	header_    http.Header
12710}
12711
12712// Patch: Updates a view on a log bucket. This method replaces the
12713// following fields in the existing view with values from the new view:
12714// filter. If an UNAVAILABLE error is returned, this indicates that
12715// system is not in a state where it can update the view. If this
12716// occurs, please try again in a few minutes.
12717//
12718// - name: The full resource name of the view to update
12719//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
12720//   iews/[VIEW_ID]" For
12721//   example:"projects/my-project/locations/global/buckets/my-bucket/view
12722//   s/my-view".
12723func (r *FoldersLocationsBucketsViewsService) Patch(name string, logview *LogView) *FoldersLocationsBucketsViewsPatchCall {
12724	c := &FoldersLocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12725	c.name = name
12726	c.logview = logview
12727	return c
12728}
12729
12730// UpdateMask sets the optional parameter "updateMask": Field mask that
12731// specifies the fields in view that need an update. A field will be
12732// overwritten if, and only if, it is in the update mask. name and
12733// output only fields cannot be updated.For a detailed FieldMask
12734// definition, see
12735// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor
12736// example: updateMask=filter
12737func (c *FoldersLocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *FoldersLocationsBucketsViewsPatchCall {
12738	c.urlParams_.Set("updateMask", updateMask)
12739	return c
12740}
12741
12742// Fields allows partial responses to be retrieved. See
12743// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12744// for more information.
12745func (c *FoldersLocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *FoldersLocationsBucketsViewsPatchCall {
12746	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12747	return c
12748}
12749
12750// Context sets the context to be used in this call's Do method. Any
12751// pending HTTP request will be aborted if the provided context is
12752// canceled.
12753func (c *FoldersLocationsBucketsViewsPatchCall) Context(ctx context.Context) *FoldersLocationsBucketsViewsPatchCall {
12754	c.ctx_ = ctx
12755	return c
12756}
12757
12758// Header returns an http.Header that can be modified by the caller to
12759// add HTTP headers to the request.
12760func (c *FoldersLocationsBucketsViewsPatchCall) Header() http.Header {
12761	if c.header_ == nil {
12762		c.header_ = make(http.Header)
12763	}
12764	return c.header_
12765}
12766
12767func (c *FoldersLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) {
12768	reqHeaders := make(http.Header)
12769	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
12770	for k, v := range c.header_ {
12771		reqHeaders[k] = v
12772	}
12773	reqHeaders.Set("User-Agent", c.s.userAgent())
12774	var body io.Reader = nil
12775	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
12776	if err != nil {
12777		return nil, err
12778	}
12779	reqHeaders.Set("Content-Type", "application/json")
12780	c.urlParams_.Set("alt", alt)
12781	c.urlParams_.Set("prettyPrint", "false")
12782	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
12783	urls += "?" + c.urlParams_.Encode()
12784	req, err := http.NewRequest("PATCH", urls, body)
12785	if err != nil {
12786		return nil, err
12787	}
12788	req.Header = reqHeaders
12789	googleapi.Expand(req.URL, map[string]string{
12790		"name": c.name,
12791	})
12792	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12793}
12794
12795// Do executes the "logging.folders.locations.buckets.views.patch" call.
12796// Exactly one of *LogView or error will be non-nil. Any non-2xx status
12797// code is an error. Response headers are in either
12798// *LogView.ServerResponse.Header or (if a response was returned at all)
12799// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
12800// check whether the returned error was because http.StatusNotModified
12801// was returned.
12802func (c *FoldersLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
12803	gensupport.SetOptions(c.urlParams_, opts...)
12804	res, err := c.doRequest("json")
12805	if res != nil && res.StatusCode == http.StatusNotModified {
12806		if res.Body != nil {
12807			res.Body.Close()
12808		}
12809		return nil, &googleapi.Error{
12810			Code:   res.StatusCode,
12811			Header: res.Header,
12812		}
12813	}
12814	if err != nil {
12815		return nil, err
12816	}
12817	defer googleapi.CloseBody(res)
12818	if err := googleapi.CheckResponse(res); err != nil {
12819		return nil, err
12820	}
12821	ret := &LogView{
12822		ServerResponse: googleapi.ServerResponse{
12823			Header:         res.Header,
12824			HTTPStatusCode: res.StatusCode,
12825		},
12826	}
12827	target := &ret
12828	if err := gensupport.DecodeResponse(target, res); err != nil {
12829		return nil, err
12830	}
12831	return ret, nil
12832	// {
12833	//   "description": "Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: filter. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.",
12834	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
12835	//   "httpMethod": "PATCH",
12836	//   "id": "logging.folders.locations.buckets.views.patch",
12837	//   "parameterOrder": [
12838	//     "name"
12839	//   ],
12840	//   "parameters": {
12841	//     "name": {
12842	//       "description": "Required. The full resource name of the view to update \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"",
12843	//       "location": "path",
12844	//       "pattern": "^folders/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
12845	//       "required": true,
12846	//       "type": "string"
12847	//     },
12848	//     "updateMask": {
12849	//       "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.FieldMaskFor example: updateMask=filter",
12850	//       "format": "google-fieldmask",
12851	//       "location": "query",
12852	//       "type": "string"
12853	//     }
12854	//   },
12855	//   "path": "v2/{+name}",
12856	//   "request": {
12857	//     "$ref": "LogView"
12858	//   },
12859	//   "response": {
12860	//     "$ref": "LogView"
12861	//   },
12862	//   "scopes": [
12863	//     "https://www.googleapis.com/auth/cloud-platform",
12864	//     "https://www.googleapis.com/auth/logging.admin"
12865	//   ]
12866	// }
12867
12868}
12869
12870// method id "logging.folders.locations.operations.cancel":
12871
12872type FoldersLocationsOperationsCancelCall struct {
12873	s                      *Service
12874	name                   string
12875	canceloperationrequest *CancelOperationRequest
12876	urlParams_             gensupport.URLParams
12877	ctx_                   context.Context
12878	header_                http.Header
12879}
12880
12881// Cancel: Starts asynchronous cancellation on a long-running operation.
12882// The server makes a best effort to cancel the operation, but success
12883// is not guaranteed. If the server doesn't support this method, it
12884// returns google.rpc.Code.UNIMPLEMENTED. Clients can use
12885// Operations.GetOperation or other methods to check whether the
12886// cancellation succeeded or whether the operation completed despite
12887// cancellation. On successful cancellation, the operation is not
12888// deleted; instead, it becomes an operation with an Operation.error
12889// value with a google.rpc.Status.code of 1, corresponding to
12890// Code.CANCELLED.
12891//
12892// - name: The name of the operation resource to be cancelled.
12893func (r *FoldersLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *FoldersLocationsOperationsCancelCall {
12894	c := &FoldersLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
12895	c.name = name
12896	c.canceloperationrequest = canceloperationrequest
12897	return c
12898}
12899
12900// Fields allows partial responses to be retrieved. See
12901// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
12902// for more information.
12903func (c *FoldersLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *FoldersLocationsOperationsCancelCall {
12904	c.urlParams_.Set("fields", googleapi.CombineFields(s))
12905	return c
12906}
12907
12908// Context sets the context to be used in this call's Do method. Any
12909// pending HTTP request will be aborted if the provided context is
12910// canceled.
12911func (c *FoldersLocationsOperationsCancelCall) Context(ctx context.Context) *FoldersLocationsOperationsCancelCall {
12912	c.ctx_ = ctx
12913	return c
12914}
12915
12916// Header returns an http.Header that can be modified by the caller to
12917// add HTTP headers to the request.
12918func (c *FoldersLocationsOperationsCancelCall) Header() http.Header {
12919	if c.header_ == nil {
12920		c.header_ = make(http.Header)
12921	}
12922	return c.header_
12923}
12924
12925func (c *FoldersLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
12926	reqHeaders := make(http.Header)
12927	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
12928	for k, v := range c.header_ {
12929		reqHeaders[k] = v
12930	}
12931	reqHeaders.Set("User-Agent", c.s.userAgent())
12932	var body io.Reader = nil
12933	body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
12934	if err != nil {
12935		return nil, err
12936	}
12937	reqHeaders.Set("Content-Type", "application/json")
12938	c.urlParams_.Set("alt", alt)
12939	c.urlParams_.Set("prettyPrint", "false")
12940	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel")
12941	urls += "?" + c.urlParams_.Encode()
12942	req, err := http.NewRequest("POST", urls, body)
12943	if err != nil {
12944		return nil, err
12945	}
12946	req.Header = reqHeaders
12947	googleapi.Expand(req.URL, map[string]string{
12948		"name": c.name,
12949	})
12950	return gensupport.SendRequest(c.ctx_, c.s.client, req)
12951}
12952
12953// Do executes the "logging.folders.locations.operations.cancel" call.
12954// Exactly one of *Empty or error will be non-nil. Any non-2xx status
12955// code is an error. Response headers are in either
12956// *Empty.ServerResponse.Header or (if a response was returned at all)
12957// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
12958// check whether the returned error was because http.StatusNotModified
12959// was returned.
12960func (c *FoldersLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
12961	gensupport.SetOptions(c.urlParams_, opts...)
12962	res, err := c.doRequest("json")
12963	if res != nil && res.StatusCode == http.StatusNotModified {
12964		if res.Body != nil {
12965			res.Body.Close()
12966		}
12967		return nil, &googleapi.Error{
12968			Code:   res.StatusCode,
12969			Header: res.Header,
12970		}
12971	}
12972	if err != nil {
12973		return nil, err
12974	}
12975	defer googleapi.CloseBody(res)
12976	if err := googleapi.CheckResponse(res); err != nil {
12977		return nil, err
12978	}
12979	ret := &Empty{
12980		ServerResponse: googleapi.ServerResponse{
12981			Header:         res.Header,
12982			HTTPStatusCode: res.StatusCode,
12983		},
12984	}
12985	target := &ret
12986	if err := gensupport.DecodeResponse(target, res); err != nil {
12987		return nil, err
12988	}
12989	return ret, nil
12990	// {
12991	//   "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.",
12992	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/operations/{operationsId}:cancel",
12993	//   "httpMethod": "POST",
12994	//   "id": "logging.folders.locations.operations.cancel",
12995	//   "parameterOrder": [
12996	//     "name"
12997	//   ],
12998	//   "parameters": {
12999	//     "name": {
13000	//       "description": "The name of the operation resource to be cancelled.",
13001	//       "location": "path",
13002	//       "pattern": "^folders/[^/]+/locations/[^/]+/operations/[^/]+$",
13003	//       "required": true,
13004	//       "type": "string"
13005	//     }
13006	//   },
13007	//   "path": "v2/{+name}:cancel",
13008	//   "request": {
13009	//     "$ref": "CancelOperationRequest"
13010	//   },
13011	//   "response": {
13012	//     "$ref": "Empty"
13013	//   },
13014	//   "scopes": [
13015	//     "https://www.googleapis.com/auth/cloud-platform",
13016	//     "https://www.googleapis.com/auth/logging.admin"
13017	//   ]
13018	// }
13019
13020}
13021
13022// method id "logging.folders.locations.operations.get":
13023
13024type FoldersLocationsOperationsGetCall struct {
13025	s            *Service
13026	name         string
13027	urlParams_   gensupport.URLParams
13028	ifNoneMatch_ string
13029	ctx_         context.Context
13030	header_      http.Header
13031}
13032
13033// Get: Gets the latest state of a long-running operation. Clients can
13034// use this method to poll the operation result at intervals as
13035// recommended by the API service.
13036//
13037// - name: The name of the operation resource.
13038func (r *FoldersLocationsOperationsService) Get(name string) *FoldersLocationsOperationsGetCall {
13039	c := &FoldersLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13040	c.name = name
13041	return c
13042}
13043
13044// Fields allows partial responses to be retrieved. See
13045// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
13046// for more information.
13047func (c *FoldersLocationsOperationsGetCall) Fields(s ...googleapi.Field) *FoldersLocationsOperationsGetCall {
13048	c.urlParams_.Set("fields", googleapi.CombineFields(s))
13049	return c
13050}
13051
13052// IfNoneMatch sets the optional parameter which makes the operation
13053// fail if the object's ETag matches the given value. This is useful for
13054// getting updates only after the object has changed since the last
13055// request. Use googleapi.IsNotModified to check whether the response
13056// error from Do is the result of In-None-Match.
13057func (c *FoldersLocationsOperationsGetCall) IfNoneMatch(entityTag string) *FoldersLocationsOperationsGetCall {
13058	c.ifNoneMatch_ = entityTag
13059	return c
13060}
13061
13062// Context sets the context to be used in this call's Do method. Any
13063// pending HTTP request will be aborted if the provided context is
13064// canceled.
13065func (c *FoldersLocationsOperationsGetCall) Context(ctx context.Context) *FoldersLocationsOperationsGetCall {
13066	c.ctx_ = ctx
13067	return c
13068}
13069
13070// Header returns an http.Header that can be modified by the caller to
13071// add HTTP headers to the request.
13072func (c *FoldersLocationsOperationsGetCall) Header() http.Header {
13073	if c.header_ == nil {
13074		c.header_ = make(http.Header)
13075	}
13076	return c.header_
13077}
13078
13079func (c *FoldersLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
13080	reqHeaders := make(http.Header)
13081	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
13082	for k, v := range c.header_ {
13083		reqHeaders[k] = v
13084	}
13085	reqHeaders.Set("User-Agent", c.s.userAgent())
13086	if c.ifNoneMatch_ != "" {
13087		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
13088	}
13089	var body io.Reader = nil
13090	c.urlParams_.Set("alt", alt)
13091	c.urlParams_.Set("prettyPrint", "false")
13092	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
13093	urls += "?" + c.urlParams_.Encode()
13094	req, err := http.NewRequest("GET", urls, body)
13095	if err != nil {
13096		return nil, err
13097	}
13098	req.Header = reqHeaders
13099	googleapi.Expand(req.URL, map[string]string{
13100		"name": c.name,
13101	})
13102	return gensupport.SendRequest(c.ctx_, c.s.client, req)
13103}
13104
13105// Do executes the "logging.folders.locations.operations.get" call.
13106// Exactly one of *Operation or error will be non-nil. Any non-2xx
13107// status code is an error. Response headers are in either
13108// *Operation.ServerResponse.Header or (if a response was returned at
13109// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
13110// to check whether the returned error was because
13111// http.StatusNotModified was returned.
13112func (c *FoldersLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
13113	gensupport.SetOptions(c.urlParams_, opts...)
13114	res, err := c.doRequest("json")
13115	if res != nil && res.StatusCode == http.StatusNotModified {
13116		if res.Body != nil {
13117			res.Body.Close()
13118		}
13119		return nil, &googleapi.Error{
13120			Code:   res.StatusCode,
13121			Header: res.Header,
13122		}
13123	}
13124	if err != nil {
13125		return nil, err
13126	}
13127	defer googleapi.CloseBody(res)
13128	if err := googleapi.CheckResponse(res); err != nil {
13129		return nil, err
13130	}
13131	ret := &Operation{
13132		ServerResponse: googleapi.ServerResponse{
13133			Header:         res.Header,
13134			HTTPStatusCode: res.StatusCode,
13135		},
13136	}
13137	target := &ret
13138	if err := gensupport.DecodeResponse(target, res); err != nil {
13139		return nil, err
13140	}
13141	return ret, nil
13142	// {
13143	//   "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.",
13144	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/operations/{operationsId}",
13145	//   "httpMethod": "GET",
13146	//   "id": "logging.folders.locations.operations.get",
13147	//   "parameterOrder": [
13148	//     "name"
13149	//   ],
13150	//   "parameters": {
13151	//     "name": {
13152	//       "description": "The name of the operation resource.",
13153	//       "location": "path",
13154	//       "pattern": "^folders/[^/]+/locations/[^/]+/operations/[^/]+$",
13155	//       "required": true,
13156	//       "type": "string"
13157	//     }
13158	//   },
13159	//   "path": "v2/{+name}",
13160	//   "response": {
13161	//     "$ref": "Operation"
13162	//   },
13163	//   "scopes": [
13164	//     "https://www.googleapis.com/auth/cloud-platform",
13165	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
13166	//     "https://www.googleapis.com/auth/logging.admin",
13167	//     "https://www.googleapis.com/auth/logging.read"
13168	//   ]
13169	// }
13170
13171}
13172
13173// method id "logging.folders.locations.operations.list":
13174
13175type FoldersLocationsOperationsListCall struct {
13176	s            *Service
13177	name         string
13178	urlParams_   gensupport.URLParams
13179	ifNoneMatch_ string
13180	ctx_         context.Context
13181	header_      http.Header
13182}
13183
13184// List: Lists operations that match the specified filter in the
13185// request. If the server doesn't support this method, it returns
13186// UNIMPLEMENTED.NOTE: the name binding allows API services to override
13187// the binding to use different resource name schemes, such as
13188// users/*/operations. To override the binding, API services can add a
13189// binding such as "/v1/{name=users/*}/operations" to their service
13190// configuration. For backwards compatibility, the default name includes
13191// the operations collection id, however overriding users must ensure
13192// the name binding is the parent resource, without the operations
13193// collection id.
13194//
13195// - name: The name of the operation's parent resource.
13196func (r *FoldersLocationsOperationsService) List(name string) *FoldersLocationsOperationsListCall {
13197	c := &FoldersLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13198	c.name = name
13199	return c
13200}
13201
13202// Filter sets the optional parameter "filter": The standard list
13203// filter.
13204func (c *FoldersLocationsOperationsListCall) Filter(filter string) *FoldersLocationsOperationsListCall {
13205	c.urlParams_.Set("filter", filter)
13206	return c
13207}
13208
13209// PageSize sets the optional parameter "pageSize": The standard list
13210// page size.
13211func (c *FoldersLocationsOperationsListCall) PageSize(pageSize int64) *FoldersLocationsOperationsListCall {
13212	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
13213	return c
13214}
13215
13216// PageToken sets the optional parameter "pageToken": The standard list
13217// page token.
13218func (c *FoldersLocationsOperationsListCall) PageToken(pageToken string) *FoldersLocationsOperationsListCall {
13219	c.urlParams_.Set("pageToken", pageToken)
13220	return c
13221}
13222
13223// Fields allows partial responses to be retrieved. See
13224// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
13225// for more information.
13226func (c *FoldersLocationsOperationsListCall) Fields(s ...googleapi.Field) *FoldersLocationsOperationsListCall {
13227	c.urlParams_.Set("fields", googleapi.CombineFields(s))
13228	return c
13229}
13230
13231// IfNoneMatch sets the optional parameter which makes the operation
13232// fail if the object's ETag matches the given value. This is useful for
13233// getting updates only after the object has changed since the last
13234// request. Use googleapi.IsNotModified to check whether the response
13235// error from Do is the result of In-None-Match.
13236func (c *FoldersLocationsOperationsListCall) IfNoneMatch(entityTag string) *FoldersLocationsOperationsListCall {
13237	c.ifNoneMatch_ = entityTag
13238	return c
13239}
13240
13241// Context sets the context to be used in this call's Do method. Any
13242// pending HTTP request will be aborted if the provided context is
13243// canceled.
13244func (c *FoldersLocationsOperationsListCall) Context(ctx context.Context) *FoldersLocationsOperationsListCall {
13245	c.ctx_ = ctx
13246	return c
13247}
13248
13249// Header returns an http.Header that can be modified by the caller to
13250// add HTTP headers to the request.
13251func (c *FoldersLocationsOperationsListCall) Header() http.Header {
13252	if c.header_ == nil {
13253		c.header_ = make(http.Header)
13254	}
13255	return c.header_
13256}
13257
13258func (c *FoldersLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
13259	reqHeaders := make(http.Header)
13260	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
13261	for k, v := range c.header_ {
13262		reqHeaders[k] = v
13263	}
13264	reqHeaders.Set("User-Agent", c.s.userAgent())
13265	if c.ifNoneMatch_ != "" {
13266		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
13267	}
13268	var body io.Reader = nil
13269	c.urlParams_.Set("alt", alt)
13270	c.urlParams_.Set("prettyPrint", "false")
13271	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations")
13272	urls += "?" + c.urlParams_.Encode()
13273	req, err := http.NewRequest("GET", urls, body)
13274	if err != nil {
13275		return nil, err
13276	}
13277	req.Header = reqHeaders
13278	googleapi.Expand(req.URL, map[string]string{
13279		"name": c.name,
13280	})
13281	return gensupport.SendRequest(c.ctx_, c.s.client, req)
13282}
13283
13284// Do executes the "logging.folders.locations.operations.list" call.
13285// Exactly one of *ListOperationsResponse or error will be non-nil. Any
13286// non-2xx status code is an error. Response headers are in either
13287// *ListOperationsResponse.ServerResponse.Header or (if a response was
13288// returned at all) in error.(*googleapi.Error).Header. Use
13289// googleapi.IsNotModified to check whether the returned error was
13290// because http.StatusNotModified was returned.
13291func (c *FoldersLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
13292	gensupport.SetOptions(c.urlParams_, opts...)
13293	res, err := c.doRequest("json")
13294	if res != nil && res.StatusCode == http.StatusNotModified {
13295		if res.Body != nil {
13296			res.Body.Close()
13297		}
13298		return nil, &googleapi.Error{
13299			Code:   res.StatusCode,
13300			Header: res.Header,
13301		}
13302	}
13303	if err != nil {
13304		return nil, err
13305	}
13306	defer googleapi.CloseBody(res)
13307	if err := googleapi.CheckResponse(res); err != nil {
13308		return nil, err
13309	}
13310	ret := &ListOperationsResponse{
13311		ServerResponse: googleapi.ServerResponse{
13312			Header:         res.Header,
13313			HTTPStatusCode: res.StatusCode,
13314		},
13315	}
13316	target := &ret
13317	if err := gensupport.DecodeResponse(target, res); err != nil {
13318		return nil, err
13319	}
13320	return ret, nil
13321	// {
13322	//   "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as \"/v1/{name=users/*}/operations\" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.",
13323	//   "flatPath": "v2/folders/{foldersId}/locations/{locationsId}/operations",
13324	//   "httpMethod": "GET",
13325	//   "id": "logging.folders.locations.operations.list",
13326	//   "parameterOrder": [
13327	//     "name"
13328	//   ],
13329	//   "parameters": {
13330	//     "filter": {
13331	//       "description": "The standard list filter.",
13332	//       "location": "query",
13333	//       "type": "string"
13334	//     },
13335	//     "name": {
13336	//       "description": "The name of the operation's parent resource.",
13337	//       "location": "path",
13338	//       "pattern": "^folders/[^/]+/locations/[^/]+$",
13339	//       "required": true,
13340	//       "type": "string"
13341	//     },
13342	//     "pageSize": {
13343	//       "description": "The standard list page size.",
13344	//       "format": "int32",
13345	//       "location": "query",
13346	//       "type": "integer"
13347	//     },
13348	//     "pageToken": {
13349	//       "description": "The standard list page token.",
13350	//       "location": "query",
13351	//       "type": "string"
13352	//     }
13353	//   },
13354	//   "path": "v2/{+name}/operations",
13355	//   "response": {
13356	//     "$ref": "ListOperationsResponse"
13357	//   },
13358	//   "scopes": [
13359	//     "https://www.googleapis.com/auth/cloud-platform",
13360	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
13361	//     "https://www.googleapis.com/auth/logging.admin",
13362	//     "https://www.googleapis.com/auth/logging.read"
13363	//   ]
13364	// }
13365
13366}
13367
13368// Pages invokes f for each page of results.
13369// A non-nil error returned from f will halt the iteration.
13370// The provided context supersedes any context provided to the Context method.
13371func (c *FoldersLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
13372	c.ctx_ = ctx
13373	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
13374	for {
13375		x, err := c.Do()
13376		if err != nil {
13377			return err
13378		}
13379		if err := f(x); err != nil {
13380			return err
13381		}
13382		if x.NextPageToken == "" {
13383			return nil
13384		}
13385		c.PageToken(x.NextPageToken)
13386	}
13387}
13388
13389// method id "logging.folders.logs.delete":
13390
13391type FoldersLogsDeleteCall struct {
13392	s          *Service
13393	logName    string
13394	urlParams_ gensupport.URLParams
13395	ctx_       context.Context
13396	header_    http.Header
13397}
13398
13399// Delete: Deletes all the log entries in a log for the _Default Log
13400// Bucket. The log reappears if it receives new entries. Log entries
13401// written shortly before the delete operation might not be deleted.
13402// Entries received after the delete operation with a timestamp before
13403// the operation will be deleted.
13404//
13405// - logName: The resource name of the log to delete:
13406//   projects/[PROJECT_ID]/logs/[LOG_ID]
13407//   organizations/[ORGANIZATION_ID]/logs/[LOG_ID]
13408//   billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]
13409//   folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For
13410//   example, "projects/my-project-id/logs/syslog",
13411//   "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For
13412//   more information about log names, see LogEntry.
13413func (r *FoldersLogsService) Delete(logName string) *FoldersLogsDeleteCall {
13414	c := &FoldersLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13415	c.logName = logName
13416	return c
13417}
13418
13419// Fields allows partial responses to be retrieved. See
13420// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
13421// for more information.
13422func (c *FoldersLogsDeleteCall) Fields(s ...googleapi.Field) *FoldersLogsDeleteCall {
13423	c.urlParams_.Set("fields", googleapi.CombineFields(s))
13424	return c
13425}
13426
13427// Context sets the context to be used in this call's Do method. Any
13428// pending HTTP request will be aborted if the provided context is
13429// canceled.
13430func (c *FoldersLogsDeleteCall) Context(ctx context.Context) *FoldersLogsDeleteCall {
13431	c.ctx_ = ctx
13432	return c
13433}
13434
13435// Header returns an http.Header that can be modified by the caller to
13436// add HTTP headers to the request.
13437func (c *FoldersLogsDeleteCall) Header() http.Header {
13438	if c.header_ == nil {
13439		c.header_ = make(http.Header)
13440	}
13441	return c.header_
13442}
13443
13444func (c *FoldersLogsDeleteCall) doRequest(alt string) (*http.Response, error) {
13445	reqHeaders := make(http.Header)
13446	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
13447	for k, v := range c.header_ {
13448		reqHeaders[k] = v
13449	}
13450	reqHeaders.Set("User-Agent", c.s.userAgent())
13451	var body io.Reader = nil
13452	c.urlParams_.Set("alt", alt)
13453	c.urlParams_.Set("prettyPrint", "false")
13454	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}")
13455	urls += "?" + c.urlParams_.Encode()
13456	req, err := http.NewRequest("DELETE", urls, body)
13457	if err != nil {
13458		return nil, err
13459	}
13460	req.Header = reqHeaders
13461	googleapi.Expand(req.URL, map[string]string{
13462		"logName": c.logName,
13463	})
13464	return gensupport.SendRequest(c.ctx_, c.s.client, req)
13465}
13466
13467// Do executes the "logging.folders.logs.delete" call.
13468// Exactly one of *Empty or error will be non-nil. Any non-2xx status
13469// code is an error. Response headers are in either
13470// *Empty.ServerResponse.Header or (if a response was returned at all)
13471// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
13472// check whether the returned error was because http.StatusNotModified
13473// was returned.
13474func (c *FoldersLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
13475	gensupport.SetOptions(c.urlParams_, opts...)
13476	res, err := c.doRequest("json")
13477	if res != nil && res.StatusCode == http.StatusNotModified {
13478		if res.Body != nil {
13479			res.Body.Close()
13480		}
13481		return nil, &googleapi.Error{
13482			Code:   res.StatusCode,
13483			Header: res.Header,
13484		}
13485	}
13486	if err != nil {
13487		return nil, err
13488	}
13489	defer googleapi.CloseBody(res)
13490	if err := googleapi.CheckResponse(res); err != nil {
13491		return nil, err
13492	}
13493	ret := &Empty{
13494		ServerResponse: googleapi.ServerResponse{
13495			Header:         res.Header,
13496			HTTPStatusCode: res.StatusCode,
13497		},
13498	}
13499	target := &ret
13500	if err := gensupport.DecodeResponse(target, res); err != nil {
13501		return nil, err
13502	}
13503	return ret, nil
13504	// {
13505	//   "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.",
13506	//   "flatPath": "v2/folders/{foldersId}/logs/{logsId}",
13507	//   "httpMethod": "DELETE",
13508	//   "id": "logging.folders.logs.delete",
13509	//   "parameterOrder": [
13510	//     "logName"
13511	//   ],
13512	//   "parameters": {
13513	//     "logName": {
13514	//       "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.",
13515	//       "location": "path",
13516	//       "pattern": "^folders/[^/]+/logs/[^/]+$",
13517	//       "required": true,
13518	//       "type": "string"
13519	//     }
13520	//   },
13521	//   "path": "v2/{+logName}",
13522	//   "response": {
13523	//     "$ref": "Empty"
13524	//   },
13525	//   "scopes": [
13526	//     "https://www.googleapis.com/auth/cloud-platform",
13527	//     "https://www.googleapis.com/auth/logging.admin"
13528	//   ]
13529	// }
13530
13531}
13532
13533// method id "logging.folders.logs.list":
13534
13535type FoldersLogsListCall struct {
13536	s            *Service
13537	parent       string
13538	urlParams_   gensupport.URLParams
13539	ifNoneMatch_ string
13540	ctx_         context.Context
13541	header_      http.Header
13542}
13543
13544// List: Lists the logs in projects, organizations, folders, or billing
13545// accounts. Only logs that have entries are listed.
13546//
13547// - parent: The resource name that owns the logs: projects/[PROJECT_ID]
13548//   organizations/[ORGANIZATION_ID]
13549//   billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID].
13550func (r *FoldersLogsService) List(parent string) *FoldersLogsListCall {
13551	c := &FoldersLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13552	c.parent = parent
13553	return c
13554}
13555
13556// PageSize sets the optional parameter "pageSize": The maximum number
13557// of results to return from this request. Non-positive values are
13558// ignored. The presence of nextPageToken in the response indicates that
13559// more results might be available.
13560func (c *FoldersLogsListCall) PageSize(pageSize int64) *FoldersLogsListCall {
13561	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
13562	return c
13563}
13564
13565// PageToken sets the optional parameter "pageToken": If present, then
13566// retrieve the next batch of results from the preceding call to this
13567// method. pageToken must be the value of nextPageToken from the
13568// previous response. The values of other method parameters should be
13569// identical to those in the previous call.
13570func (c *FoldersLogsListCall) PageToken(pageToken string) *FoldersLogsListCall {
13571	c.urlParams_.Set("pageToken", pageToken)
13572	return c
13573}
13574
13575// ResourceNames sets the optional parameter "resourceNames": The
13576// resource name that owns the logs:
13577// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view
13578// s/[VIEW_ID]
13579// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE
13580// T_ID]/views/[VIEW_ID]
13581// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[
13582// BUCKET_ID]/views/[VIEW_ID]
13583// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/
13584// [VIEW_ID]To support legacy queries, it could also be:
13585// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID]
13586// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]
13587func (c *FoldersLogsListCall) ResourceNames(resourceNames ...string) *FoldersLogsListCall {
13588	c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...))
13589	return c
13590}
13591
13592// Fields allows partial responses to be retrieved. See
13593// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
13594// for more information.
13595func (c *FoldersLogsListCall) Fields(s ...googleapi.Field) *FoldersLogsListCall {
13596	c.urlParams_.Set("fields", googleapi.CombineFields(s))
13597	return c
13598}
13599
13600// IfNoneMatch sets the optional parameter which makes the operation
13601// fail if the object's ETag matches the given value. This is useful for
13602// getting updates only after the object has changed since the last
13603// request. Use googleapi.IsNotModified to check whether the response
13604// error from Do is the result of In-None-Match.
13605func (c *FoldersLogsListCall) IfNoneMatch(entityTag string) *FoldersLogsListCall {
13606	c.ifNoneMatch_ = entityTag
13607	return c
13608}
13609
13610// Context sets the context to be used in this call's Do method. Any
13611// pending HTTP request will be aborted if the provided context is
13612// canceled.
13613func (c *FoldersLogsListCall) Context(ctx context.Context) *FoldersLogsListCall {
13614	c.ctx_ = ctx
13615	return c
13616}
13617
13618// Header returns an http.Header that can be modified by the caller to
13619// add HTTP headers to the request.
13620func (c *FoldersLogsListCall) Header() http.Header {
13621	if c.header_ == nil {
13622		c.header_ = make(http.Header)
13623	}
13624	return c.header_
13625}
13626
13627func (c *FoldersLogsListCall) doRequest(alt string) (*http.Response, error) {
13628	reqHeaders := make(http.Header)
13629	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
13630	for k, v := range c.header_ {
13631		reqHeaders[k] = v
13632	}
13633	reqHeaders.Set("User-Agent", c.s.userAgent())
13634	if c.ifNoneMatch_ != "" {
13635		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
13636	}
13637	var body io.Reader = nil
13638	c.urlParams_.Set("alt", alt)
13639	c.urlParams_.Set("prettyPrint", "false")
13640	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs")
13641	urls += "?" + c.urlParams_.Encode()
13642	req, err := http.NewRequest("GET", urls, body)
13643	if err != nil {
13644		return nil, err
13645	}
13646	req.Header = reqHeaders
13647	googleapi.Expand(req.URL, map[string]string{
13648		"parent": c.parent,
13649	})
13650	return gensupport.SendRequest(c.ctx_, c.s.client, req)
13651}
13652
13653// Do executes the "logging.folders.logs.list" call.
13654// Exactly one of *ListLogsResponse or error will be non-nil. Any
13655// non-2xx status code is an error. Response headers are in either
13656// *ListLogsResponse.ServerResponse.Header or (if a response was
13657// returned at all) in error.(*googleapi.Error).Header. Use
13658// googleapi.IsNotModified to check whether the returned error was
13659// because http.StatusNotModified was returned.
13660func (c *FoldersLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) {
13661	gensupport.SetOptions(c.urlParams_, opts...)
13662	res, err := c.doRequest("json")
13663	if res != nil && res.StatusCode == http.StatusNotModified {
13664		if res.Body != nil {
13665			res.Body.Close()
13666		}
13667		return nil, &googleapi.Error{
13668			Code:   res.StatusCode,
13669			Header: res.Header,
13670		}
13671	}
13672	if err != nil {
13673		return nil, err
13674	}
13675	defer googleapi.CloseBody(res)
13676	if err := googleapi.CheckResponse(res); err != nil {
13677		return nil, err
13678	}
13679	ret := &ListLogsResponse{
13680		ServerResponse: googleapi.ServerResponse{
13681			Header:         res.Header,
13682			HTTPStatusCode: res.StatusCode,
13683		},
13684	}
13685	target := &ret
13686	if err := gensupport.DecodeResponse(target, res); err != nil {
13687		return nil, err
13688	}
13689	return ret, nil
13690	// {
13691	//   "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.",
13692	//   "flatPath": "v2/folders/{foldersId}/logs",
13693	//   "httpMethod": "GET",
13694	//   "id": "logging.folders.logs.list",
13695	//   "parameterOrder": [
13696	//     "parent"
13697	//   ],
13698	//   "parameters": {
13699	//     "pageSize": {
13700	//       "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.",
13701	//       "format": "int32",
13702	//       "location": "query",
13703	//       "type": "integer"
13704	//     },
13705	//     "pageToken": {
13706	//       "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.",
13707	//       "location": "query",
13708	//       "type": "string"
13709	//     },
13710	//     "parent": {
13711	//       "description": "Required. The resource name that owns the logs: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]",
13712	//       "location": "path",
13713	//       "pattern": "^folders/[^/]+$",
13714	//       "required": true,
13715	//       "type": "string"
13716	//     },
13717	//     "resourceNames": {
13718	//       "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]",
13719	//       "location": "query",
13720	//       "repeated": true,
13721	//       "type": "string"
13722	//     }
13723	//   },
13724	//   "path": "v2/{+parent}/logs",
13725	//   "response": {
13726	//     "$ref": "ListLogsResponse"
13727	//   },
13728	//   "scopes": [
13729	//     "https://www.googleapis.com/auth/cloud-platform",
13730	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
13731	//     "https://www.googleapis.com/auth/logging.admin",
13732	//     "https://www.googleapis.com/auth/logging.read"
13733	//   ]
13734	// }
13735
13736}
13737
13738// Pages invokes f for each page of results.
13739// A non-nil error returned from f will halt the iteration.
13740// The provided context supersedes any context provided to the Context method.
13741func (c *FoldersLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error {
13742	c.ctx_ = ctx
13743	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
13744	for {
13745		x, err := c.Do()
13746		if err != nil {
13747			return err
13748		}
13749		if err := f(x); err != nil {
13750			return err
13751		}
13752		if x.NextPageToken == "" {
13753			return nil
13754		}
13755		c.PageToken(x.NextPageToken)
13756	}
13757}
13758
13759// method id "logging.folders.sinks.create":
13760
13761type FoldersSinksCreateCall struct {
13762	s          *Service
13763	parent     string
13764	logsink    *LogSink
13765	urlParams_ gensupport.URLParams
13766	ctx_       context.Context
13767	header_    http.Header
13768}
13769
13770// Create: Creates a sink that exports specified log entries to a
13771// destination. The export of newly-ingested log entries begins
13772// immediately, unless the sink's writer_identity is not permitted to
13773// write to the destination. A sink can export log entries only from the
13774// resource owning the sink.
13775//
13776// - parent: The resource in which to create the sink:
13777//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
13778//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For
13779//   examples:"projects/my-project" "organizations/123456789".
13780func (r *FoldersSinksService) Create(parent string, logsink *LogSink) *FoldersSinksCreateCall {
13781	c := &FoldersSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13782	c.parent = parent
13783	c.logsink = logsink
13784	return c
13785}
13786
13787// UniqueWriterIdentity sets the optional parameter
13788// "uniqueWriterIdentity": Determines the kind of IAM identity returned
13789// as writer_identity in the new sink. If this value is omitted or set
13790// to false, and if the sink's parent is a project, then the value
13791// returned as writer_identity is the same group or service account used
13792// by Cloud Logging before the addition of writer identities to this
13793// API. The sink's destination must be in the same project as the sink
13794// itself.If this field is set to true, or if the sink is owned by a
13795// non-project resource such as an organization, then the value of
13796// writer_identity will be a unique service account used only for
13797// exports from the new sink. For more information, see writer_identity
13798// in LogSink.
13799func (c *FoldersSinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *FoldersSinksCreateCall {
13800	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
13801	return c
13802}
13803
13804// Fields allows partial responses to be retrieved. See
13805// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
13806// for more information.
13807func (c *FoldersSinksCreateCall) Fields(s ...googleapi.Field) *FoldersSinksCreateCall {
13808	c.urlParams_.Set("fields", googleapi.CombineFields(s))
13809	return c
13810}
13811
13812// Context sets the context to be used in this call's Do method. Any
13813// pending HTTP request will be aborted if the provided context is
13814// canceled.
13815func (c *FoldersSinksCreateCall) Context(ctx context.Context) *FoldersSinksCreateCall {
13816	c.ctx_ = ctx
13817	return c
13818}
13819
13820// Header returns an http.Header that can be modified by the caller to
13821// add HTTP headers to the request.
13822func (c *FoldersSinksCreateCall) Header() http.Header {
13823	if c.header_ == nil {
13824		c.header_ = make(http.Header)
13825	}
13826	return c.header_
13827}
13828
13829func (c *FoldersSinksCreateCall) doRequest(alt string) (*http.Response, error) {
13830	reqHeaders := make(http.Header)
13831	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
13832	for k, v := range c.header_ {
13833		reqHeaders[k] = v
13834	}
13835	reqHeaders.Set("User-Agent", c.s.userAgent())
13836	var body io.Reader = nil
13837	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
13838	if err != nil {
13839		return nil, err
13840	}
13841	reqHeaders.Set("Content-Type", "application/json")
13842	c.urlParams_.Set("alt", alt)
13843	c.urlParams_.Set("prettyPrint", "false")
13844	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
13845	urls += "?" + c.urlParams_.Encode()
13846	req, err := http.NewRequest("POST", urls, body)
13847	if err != nil {
13848		return nil, err
13849	}
13850	req.Header = reqHeaders
13851	googleapi.Expand(req.URL, map[string]string{
13852		"parent": c.parent,
13853	})
13854	return gensupport.SendRequest(c.ctx_, c.s.client, req)
13855}
13856
13857// Do executes the "logging.folders.sinks.create" call.
13858// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
13859// code is an error. Response headers are in either
13860// *LogSink.ServerResponse.Header or (if a response was returned at all)
13861// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
13862// check whether the returned error was because http.StatusNotModified
13863// was returned.
13864func (c *FoldersSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
13865	gensupport.SetOptions(c.urlParams_, opts...)
13866	res, err := c.doRequest("json")
13867	if res != nil && res.StatusCode == http.StatusNotModified {
13868		if res.Body != nil {
13869			res.Body.Close()
13870		}
13871		return nil, &googleapi.Error{
13872			Code:   res.StatusCode,
13873			Header: res.Header,
13874		}
13875	}
13876	if err != nil {
13877		return nil, err
13878	}
13879	defer googleapi.CloseBody(res)
13880	if err := googleapi.CheckResponse(res); err != nil {
13881		return nil, err
13882	}
13883	ret := &LogSink{
13884		ServerResponse: googleapi.ServerResponse{
13885			Header:         res.Header,
13886			HTTPStatusCode: res.StatusCode,
13887		},
13888	}
13889	target := &ret
13890	if err := gensupport.DecodeResponse(target, res); err != nil {
13891		return nil, err
13892	}
13893	return ret, nil
13894	// {
13895	//   "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.",
13896	//   "flatPath": "v2/folders/{foldersId}/sinks",
13897	//   "httpMethod": "POST",
13898	//   "id": "logging.folders.sinks.create",
13899	//   "parameterOrder": [
13900	//     "parent"
13901	//   ],
13902	//   "parameters": {
13903	//     "parent": {
13904	//       "description": "Required. The resource in which to create the sink: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-project\" \"organizations/123456789\"",
13905	//       "location": "path",
13906	//       "pattern": "^folders/[^/]+$",
13907	//       "required": true,
13908	//       "type": "string"
13909	//     },
13910	//     "uniqueWriterIdentity": {
13911	//       "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 Cloud 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.",
13912	//       "location": "query",
13913	//       "type": "boolean"
13914	//     }
13915	//   },
13916	//   "path": "v2/{+parent}/sinks",
13917	//   "request": {
13918	//     "$ref": "LogSink"
13919	//   },
13920	//   "response": {
13921	//     "$ref": "LogSink"
13922	//   },
13923	//   "scopes": [
13924	//     "https://www.googleapis.com/auth/cloud-platform",
13925	//     "https://www.googleapis.com/auth/logging.admin"
13926	//   ]
13927	// }
13928
13929}
13930
13931// method id "logging.folders.sinks.delete":
13932
13933type FoldersSinksDeleteCall struct {
13934	s          *Service
13935	sinkNameid string
13936	urlParams_ gensupport.URLParams
13937	ctx_       context.Context
13938	header_    http.Header
13939}
13940
13941// Delete: Deletes a sink. If the sink has a unique writer_identity,
13942// then that service account is also deleted.
13943//
13944// - sinkName: The full resource name of the sink to delete, including
13945//   the parent resource and the sink identifier:
13946//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
13947//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
13948//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
13949//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" For
13950//   example:"projects/my-project/sinks/my-sink".
13951func (r *FoldersSinksService) Delete(sinkNameid string) *FoldersSinksDeleteCall {
13952	c := &FoldersSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
13953	c.sinkNameid = sinkNameid
13954	return c
13955}
13956
13957// Fields allows partial responses to be retrieved. See
13958// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
13959// for more information.
13960func (c *FoldersSinksDeleteCall) Fields(s ...googleapi.Field) *FoldersSinksDeleteCall {
13961	c.urlParams_.Set("fields", googleapi.CombineFields(s))
13962	return c
13963}
13964
13965// Context sets the context to be used in this call's Do method. Any
13966// pending HTTP request will be aborted if the provided context is
13967// canceled.
13968func (c *FoldersSinksDeleteCall) Context(ctx context.Context) *FoldersSinksDeleteCall {
13969	c.ctx_ = ctx
13970	return c
13971}
13972
13973// Header returns an http.Header that can be modified by the caller to
13974// add HTTP headers to the request.
13975func (c *FoldersSinksDeleteCall) Header() http.Header {
13976	if c.header_ == nil {
13977		c.header_ = make(http.Header)
13978	}
13979	return c.header_
13980}
13981
13982func (c *FoldersSinksDeleteCall) doRequest(alt string) (*http.Response, error) {
13983	reqHeaders := make(http.Header)
13984	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
13985	for k, v := range c.header_ {
13986		reqHeaders[k] = v
13987	}
13988	reqHeaders.Set("User-Agent", c.s.userAgent())
13989	var body io.Reader = nil
13990	c.urlParams_.Set("alt", alt)
13991	c.urlParams_.Set("prettyPrint", "false")
13992	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
13993	urls += "?" + c.urlParams_.Encode()
13994	req, err := http.NewRequest("DELETE", urls, body)
13995	if err != nil {
13996		return nil, err
13997	}
13998	req.Header = reqHeaders
13999	googleapi.Expand(req.URL, map[string]string{
14000		"sinkName": c.sinkNameid,
14001	})
14002	return gensupport.SendRequest(c.ctx_, c.s.client, req)
14003}
14004
14005// Do executes the "logging.folders.sinks.delete" call.
14006// Exactly one of *Empty or error will be non-nil. Any non-2xx status
14007// code is an error. Response headers are in either
14008// *Empty.ServerResponse.Header or (if a response was returned at all)
14009// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
14010// check whether the returned error was because http.StatusNotModified
14011// was returned.
14012func (c *FoldersSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
14013	gensupport.SetOptions(c.urlParams_, opts...)
14014	res, err := c.doRequest("json")
14015	if res != nil && res.StatusCode == http.StatusNotModified {
14016		if res.Body != nil {
14017			res.Body.Close()
14018		}
14019		return nil, &googleapi.Error{
14020			Code:   res.StatusCode,
14021			Header: res.Header,
14022		}
14023	}
14024	if err != nil {
14025		return nil, err
14026	}
14027	defer googleapi.CloseBody(res)
14028	if err := googleapi.CheckResponse(res); err != nil {
14029		return nil, err
14030	}
14031	ret := &Empty{
14032		ServerResponse: googleapi.ServerResponse{
14033			Header:         res.Header,
14034			HTTPStatusCode: res.StatusCode,
14035		},
14036	}
14037	target := &ret
14038	if err := gensupport.DecodeResponse(target, res); err != nil {
14039		return nil, err
14040	}
14041	return ret, nil
14042	// {
14043	//   "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.",
14044	//   "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}",
14045	//   "httpMethod": "DELETE",
14046	//   "id": "logging.folders.sinks.delete",
14047	//   "parameterOrder": [
14048	//     "sinkName"
14049	//   ],
14050	//   "parameters": {
14051	//     "sinkName": {
14052	//       "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]\" For example:\"projects/my-project/sinks/my-sink\"",
14053	//       "location": "path",
14054	//       "pattern": "^folders/[^/]+/sinks/[^/]+$",
14055	//       "required": true,
14056	//       "type": "string"
14057	//     }
14058	//   },
14059	//   "path": "v2/{+sinkName}",
14060	//   "response": {
14061	//     "$ref": "Empty"
14062	//   },
14063	//   "scopes": [
14064	//     "https://www.googleapis.com/auth/cloud-platform",
14065	//     "https://www.googleapis.com/auth/logging.admin"
14066	//   ]
14067	// }
14068
14069}
14070
14071// method id "logging.folders.sinks.get":
14072
14073type FoldersSinksGetCall struct {
14074	s            *Service
14075	sinkName     string
14076	urlParams_   gensupport.URLParams
14077	ifNoneMatch_ string
14078	ctx_         context.Context
14079	header_      http.Header
14080}
14081
14082// Get: Gets a sink.
14083//
14084// - sinkName: The resource name of the sink:
14085//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
14086//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
14087//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
14088//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" For
14089//   example:"projects/my-project/sinks/my-sink".
14090func (r *FoldersSinksService) Get(sinkName string) *FoldersSinksGetCall {
14091	c := &FoldersSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14092	c.sinkName = sinkName
14093	return c
14094}
14095
14096// Fields allows partial responses to be retrieved. See
14097// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
14098// for more information.
14099func (c *FoldersSinksGetCall) Fields(s ...googleapi.Field) *FoldersSinksGetCall {
14100	c.urlParams_.Set("fields", googleapi.CombineFields(s))
14101	return c
14102}
14103
14104// IfNoneMatch sets the optional parameter which makes the operation
14105// fail if the object's ETag matches the given value. This is useful for
14106// getting updates only after the object has changed since the last
14107// request. Use googleapi.IsNotModified to check whether the response
14108// error from Do is the result of In-None-Match.
14109func (c *FoldersSinksGetCall) IfNoneMatch(entityTag string) *FoldersSinksGetCall {
14110	c.ifNoneMatch_ = entityTag
14111	return c
14112}
14113
14114// Context sets the context to be used in this call's Do method. Any
14115// pending HTTP request will be aborted if the provided context is
14116// canceled.
14117func (c *FoldersSinksGetCall) Context(ctx context.Context) *FoldersSinksGetCall {
14118	c.ctx_ = ctx
14119	return c
14120}
14121
14122// Header returns an http.Header that can be modified by the caller to
14123// add HTTP headers to the request.
14124func (c *FoldersSinksGetCall) Header() http.Header {
14125	if c.header_ == nil {
14126		c.header_ = make(http.Header)
14127	}
14128	return c.header_
14129}
14130
14131func (c *FoldersSinksGetCall) doRequest(alt string) (*http.Response, error) {
14132	reqHeaders := make(http.Header)
14133	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
14134	for k, v := range c.header_ {
14135		reqHeaders[k] = v
14136	}
14137	reqHeaders.Set("User-Agent", c.s.userAgent())
14138	if c.ifNoneMatch_ != "" {
14139		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
14140	}
14141	var body io.Reader = nil
14142	c.urlParams_.Set("alt", alt)
14143	c.urlParams_.Set("prettyPrint", "false")
14144	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
14145	urls += "?" + c.urlParams_.Encode()
14146	req, err := http.NewRequest("GET", urls, body)
14147	if err != nil {
14148		return nil, err
14149	}
14150	req.Header = reqHeaders
14151	googleapi.Expand(req.URL, map[string]string{
14152		"sinkName": c.sinkName,
14153	})
14154	return gensupport.SendRequest(c.ctx_, c.s.client, req)
14155}
14156
14157// Do executes the "logging.folders.sinks.get" call.
14158// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
14159// code is an error. Response headers are in either
14160// *LogSink.ServerResponse.Header or (if a response was returned at all)
14161// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
14162// check whether the returned error was because http.StatusNotModified
14163// was returned.
14164func (c *FoldersSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
14165	gensupport.SetOptions(c.urlParams_, opts...)
14166	res, err := c.doRequest("json")
14167	if res != nil && res.StatusCode == http.StatusNotModified {
14168		if res.Body != nil {
14169			res.Body.Close()
14170		}
14171		return nil, &googleapi.Error{
14172			Code:   res.StatusCode,
14173			Header: res.Header,
14174		}
14175	}
14176	if err != nil {
14177		return nil, err
14178	}
14179	defer googleapi.CloseBody(res)
14180	if err := googleapi.CheckResponse(res); err != nil {
14181		return nil, err
14182	}
14183	ret := &LogSink{
14184		ServerResponse: googleapi.ServerResponse{
14185			Header:         res.Header,
14186			HTTPStatusCode: res.StatusCode,
14187		},
14188	}
14189	target := &ret
14190	if err := gensupport.DecodeResponse(target, res); err != nil {
14191		return nil, err
14192	}
14193	return ret, nil
14194	// {
14195	//   "description": "Gets a sink.",
14196	//   "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}",
14197	//   "httpMethod": "GET",
14198	//   "id": "logging.folders.sinks.get",
14199	//   "parameterOrder": [
14200	//     "sinkName"
14201	//   ],
14202	//   "parameters": {
14203	//     "sinkName": {
14204	//       "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]\" For example:\"projects/my-project/sinks/my-sink\"",
14205	//       "location": "path",
14206	//       "pattern": "^folders/[^/]+/sinks/[^/]+$",
14207	//       "required": true,
14208	//       "type": "string"
14209	//     }
14210	//   },
14211	//   "path": "v2/{+sinkName}",
14212	//   "response": {
14213	//     "$ref": "LogSink"
14214	//   },
14215	//   "scopes": [
14216	//     "https://www.googleapis.com/auth/cloud-platform",
14217	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
14218	//     "https://www.googleapis.com/auth/logging.admin",
14219	//     "https://www.googleapis.com/auth/logging.read"
14220	//   ]
14221	// }
14222
14223}
14224
14225// method id "logging.folders.sinks.list":
14226
14227type FoldersSinksListCall struct {
14228	s            *Service
14229	parent       string
14230	urlParams_   gensupport.URLParams
14231	ifNoneMatch_ string
14232	ctx_         context.Context
14233	header_      http.Header
14234}
14235
14236// List: Lists sinks.
14237//
14238// - parent: The parent resource whose sinks are to be listed:
14239//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
14240//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]".
14241func (r *FoldersSinksService) List(parent string) *FoldersSinksListCall {
14242	c := &FoldersSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14243	c.parent = parent
14244	return c
14245}
14246
14247// PageSize sets the optional parameter "pageSize": The maximum number
14248// of results to return from this request. Non-positive values are
14249// ignored. The presence of nextPageToken in the response indicates that
14250// more results might be available.
14251func (c *FoldersSinksListCall) PageSize(pageSize int64) *FoldersSinksListCall {
14252	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
14253	return c
14254}
14255
14256// PageToken sets the optional parameter "pageToken": If present, then
14257// retrieve the next batch of results from the preceding call to this
14258// method. pageToken must be the value of nextPageToken from the
14259// previous response. The values of other method parameters should be
14260// identical to those in the previous call.
14261func (c *FoldersSinksListCall) PageToken(pageToken string) *FoldersSinksListCall {
14262	c.urlParams_.Set("pageToken", pageToken)
14263	return c
14264}
14265
14266// Fields allows partial responses to be retrieved. See
14267// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
14268// for more information.
14269func (c *FoldersSinksListCall) Fields(s ...googleapi.Field) *FoldersSinksListCall {
14270	c.urlParams_.Set("fields", googleapi.CombineFields(s))
14271	return c
14272}
14273
14274// IfNoneMatch sets the optional parameter which makes the operation
14275// fail if the object's ETag matches the given value. This is useful for
14276// getting updates only after the object has changed since the last
14277// request. Use googleapi.IsNotModified to check whether the response
14278// error from Do is the result of In-None-Match.
14279func (c *FoldersSinksListCall) IfNoneMatch(entityTag string) *FoldersSinksListCall {
14280	c.ifNoneMatch_ = entityTag
14281	return c
14282}
14283
14284// Context sets the context to be used in this call's Do method. Any
14285// pending HTTP request will be aborted if the provided context is
14286// canceled.
14287func (c *FoldersSinksListCall) Context(ctx context.Context) *FoldersSinksListCall {
14288	c.ctx_ = ctx
14289	return c
14290}
14291
14292// Header returns an http.Header that can be modified by the caller to
14293// add HTTP headers to the request.
14294func (c *FoldersSinksListCall) Header() http.Header {
14295	if c.header_ == nil {
14296		c.header_ = make(http.Header)
14297	}
14298	return c.header_
14299}
14300
14301func (c *FoldersSinksListCall) doRequest(alt string) (*http.Response, error) {
14302	reqHeaders := make(http.Header)
14303	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
14304	for k, v := range c.header_ {
14305		reqHeaders[k] = v
14306	}
14307	reqHeaders.Set("User-Agent", c.s.userAgent())
14308	if c.ifNoneMatch_ != "" {
14309		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
14310	}
14311	var body io.Reader = nil
14312	c.urlParams_.Set("alt", alt)
14313	c.urlParams_.Set("prettyPrint", "false")
14314	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
14315	urls += "?" + c.urlParams_.Encode()
14316	req, err := http.NewRequest("GET", urls, body)
14317	if err != nil {
14318		return nil, err
14319	}
14320	req.Header = reqHeaders
14321	googleapi.Expand(req.URL, map[string]string{
14322		"parent": c.parent,
14323	})
14324	return gensupport.SendRequest(c.ctx_, c.s.client, req)
14325}
14326
14327// Do executes the "logging.folders.sinks.list" call.
14328// Exactly one of *ListSinksResponse or error will be non-nil. Any
14329// non-2xx status code is an error. Response headers are in either
14330// *ListSinksResponse.ServerResponse.Header or (if a response was
14331// returned at all) in error.(*googleapi.Error).Header. Use
14332// googleapi.IsNotModified to check whether the returned error was
14333// because http.StatusNotModified was returned.
14334func (c *FoldersSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) {
14335	gensupport.SetOptions(c.urlParams_, opts...)
14336	res, err := c.doRequest("json")
14337	if res != nil && res.StatusCode == http.StatusNotModified {
14338		if res.Body != nil {
14339			res.Body.Close()
14340		}
14341		return nil, &googleapi.Error{
14342			Code:   res.StatusCode,
14343			Header: res.Header,
14344		}
14345	}
14346	if err != nil {
14347		return nil, err
14348	}
14349	defer googleapi.CloseBody(res)
14350	if err := googleapi.CheckResponse(res); err != nil {
14351		return nil, err
14352	}
14353	ret := &ListSinksResponse{
14354		ServerResponse: googleapi.ServerResponse{
14355			Header:         res.Header,
14356			HTTPStatusCode: res.StatusCode,
14357		},
14358	}
14359	target := &ret
14360	if err := gensupport.DecodeResponse(target, res); err != nil {
14361		return nil, err
14362	}
14363	return ret, nil
14364	// {
14365	//   "description": "Lists sinks.",
14366	//   "flatPath": "v2/folders/{foldersId}/sinks",
14367	//   "httpMethod": "GET",
14368	//   "id": "logging.folders.sinks.list",
14369	//   "parameterOrder": [
14370	//     "parent"
14371	//   ],
14372	//   "parameters": {
14373	//     "pageSize": {
14374	//       "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.",
14375	//       "format": "int32",
14376	//       "location": "query",
14377	//       "type": "integer"
14378	//     },
14379	//     "pageToken": {
14380	//       "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.",
14381	//       "location": "query",
14382	//       "type": "string"
14383	//     },
14384	//     "parent": {
14385	//       "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
14386	//       "location": "path",
14387	//       "pattern": "^folders/[^/]+$",
14388	//       "required": true,
14389	//       "type": "string"
14390	//     }
14391	//   },
14392	//   "path": "v2/{+parent}/sinks",
14393	//   "response": {
14394	//     "$ref": "ListSinksResponse"
14395	//   },
14396	//   "scopes": [
14397	//     "https://www.googleapis.com/auth/cloud-platform",
14398	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
14399	//     "https://www.googleapis.com/auth/logging.admin",
14400	//     "https://www.googleapis.com/auth/logging.read"
14401	//   ]
14402	// }
14403
14404}
14405
14406// Pages invokes f for each page of results.
14407// A non-nil error returned from f will halt the iteration.
14408// The provided context supersedes any context provided to the Context method.
14409func (c *FoldersSinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error {
14410	c.ctx_ = ctx
14411	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
14412	for {
14413		x, err := c.Do()
14414		if err != nil {
14415			return err
14416		}
14417		if err := f(x); err != nil {
14418			return err
14419		}
14420		if x.NextPageToken == "" {
14421			return nil
14422		}
14423		c.PageToken(x.NextPageToken)
14424	}
14425}
14426
14427// method id "logging.folders.sinks.patch":
14428
14429type FoldersSinksPatchCall struct {
14430	s          *Service
14431	sinkNameid string
14432	logsink    *LogSink
14433	urlParams_ gensupport.URLParams
14434	ctx_       context.Context
14435	header_    http.Header
14436}
14437
14438// Patch: Updates a sink. This method replaces the following fields in
14439// the existing sink with values from the new sink: destination, and
14440// filter.The updated sink might also have a new writer_identity; see
14441// the unique_writer_identity field.
14442//
14443// - sinkName: The full resource name of the sink to update, including
14444//   the parent resource and the sink identifier:
14445//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
14446//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
14447//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
14448//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" For
14449//   example:"projects/my-project/sinks/my-sink".
14450func (r *FoldersSinksService) Patch(sinkNameid string, logsink *LogSink) *FoldersSinksPatchCall {
14451	c := &FoldersSinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14452	c.sinkNameid = sinkNameid
14453	c.logsink = logsink
14454	return c
14455}
14456
14457// UniqueWriterIdentity sets the optional parameter
14458// "uniqueWriterIdentity": See sinks.create for a description of this
14459// field. When updating a sink, the effect of this field on the value of
14460// writer_identity in the updated sink depends on both the old and new
14461// values of this field: If the old and new values of this field are
14462// both false or both true, then there is no change to the sink's
14463// writer_identity. If the old value is false and the new value is true,
14464// then writer_identity is changed to a unique service account. It is an
14465// error if the old value is true and the new value is set to false or
14466// defaulted to false.
14467func (c *FoldersSinksPatchCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *FoldersSinksPatchCall {
14468	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
14469	return c
14470}
14471
14472// UpdateMask sets the optional parameter "updateMask": Field mask that
14473// specifies the fields in sink that need an update. A sink field will
14474// be overwritten if, and only if, it is in the update mask. name and
14475// output only fields cannot be updated.An empty updateMask is
14476// temporarily treated as using the following mask for backwards
14477// compatibility purposes:destination,filter,includeChildrenAt some
14478// point in the future, behavior will be removed and specifying an empty
14479// updateMask will be an error.For a detailed FieldMask definition, see
14480// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor
14481// example: updateMask=filter
14482func (c *FoldersSinksPatchCall) UpdateMask(updateMask string) *FoldersSinksPatchCall {
14483	c.urlParams_.Set("updateMask", updateMask)
14484	return c
14485}
14486
14487// Fields allows partial responses to be retrieved. See
14488// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
14489// for more information.
14490func (c *FoldersSinksPatchCall) Fields(s ...googleapi.Field) *FoldersSinksPatchCall {
14491	c.urlParams_.Set("fields", googleapi.CombineFields(s))
14492	return c
14493}
14494
14495// Context sets the context to be used in this call's Do method. Any
14496// pending HTTP request will be aborted if the provided context is
14497// canceled.
14498func (c *FoldersSinksPatchCall) Context(ctx context.Context) *FoldersSinksPatchCall {
14499	c.ctx_ = ctx
14500	return c
14501}
14502
14503// Header returns an http.Header that can be modified by the caller to
14504// add HTTP headers to the request.
14505func (c *FoldersSinksPatchCall) Header() http.Header {
14506	if c.header_ == nil {
14507		c.header_ = make(http.Header)
14508	}
14509	return c.header_
14510}
14511
14512func (c *FoldersSinksPatchCall) doRequest(alt string) (*http.Response, error) {
14513	reqHeaders := make(http.Header)
14514	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
14515	for k, v := range c.header_ {
14516		reqHeaders[k] = v
14517	}
14518	reqHeaders.Set("User-Agent", c.s.userAgent())
14519	var body io.Reader = nil
14520	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
14521	if err != nil {
14522		return nil, err
14523	}
14524	reqHeaders.Set("Content-Type", "application/json")
14525	c.urlParams_.Set("alt", alt)
14526	c.urlParams_.Set("prettyPrint", "false")
14527	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
14528	urls += "?" + c.urlParams_.Encode()
14529	req, err := http.NewRequest("PATCH", urls, body)
14530	if err != nil {
14531		return nil, err
14532	}
14533	req.Header = reqHeaders
14534	googleapi.Expand(req.URL, map[string]string{
14535		"sinkName": c.sinkNameid,
14536	})
14537	return gensupport.SendRequest(c.ctx_, c.s.client, req)
14538}
14539
14540// Do executes the "logging.folders.sinks.patch" call.
14541// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
14542// code is an error. Response headers are in either
14543// *LogSink.ServerResponse.Header or (if a response was returned at all)
14544// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
14545// check whether the returned error was because http.StatusNotModified
14546// was returned.
14547func (c *FoldersSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
14548	gensupport.SetOptions(c.urlParams_, opts...)
14549	res, err := c.doRequest("json")
14550	if res != nil && res.StatusCode == http.StatusNotModified {
14551		if res.Body != nil {
14552			res.Body.Close()
14553		}
14554		return nil, &googleapi.Error{
14555			Code:   res.StatusCode,
14556			Header: res.Header,
14557		}
14558	}
14559	if err != nil {
14560		return nil, err
14561	}
14562	defer googleapi.CloseBody(res)
14563	if err := googleapi.CheckResponse(res); err != nil {
14564		return nil, err
14565	}
14566	ret := &LogSink{
14567		ServerResponse: googleapi.ServerResponse{
14568			Header:         res.Header,
14569			HTTPStatusCode: res.StatusCode,
14570		},
14571	}
14572	target := &ret
14573	if err := gensupport.DecodeResponse(target, res); err != nil {
14574		return nil, err
14575	}
14576	return ret, nil
14577	// {
14578	//   "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.",
14579	//   "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}",
14580	//   "httpMethod": "PATCH",
14581	//   "id": "logging.folders.sinks.patch",
14582	//   "parameterOrder": [
14583	//     "sinkName"
14584	//   ],
14585	//   "parameters": {
14586	//     "sinkName": {
14587	//       "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]\" For example:\"projects/my-project/sinks/my-sink\"",
14588	//       "location": "path",
14589	//       "pattern": "^folders/[^/]+/sinks/[^/]+$",
14590	//       "required": true,
14591	//       "type": "string"
14592	//     },
14593	//     "uniqueWriterIdentity": {
14594	//       "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.",
14595	//       "location": "query",
14596	//       "type": "boolean"
14597	//     },
14598	//     "updateMask": {
14599	//       "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,includeChildrenAt 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.FieldMaskFor example: updateMask=filter",
14600	//       "format": "google-fieldmask",
14601	//       "location": "query",
14602	//       "type": "string"
14603	//     }
14604	//   },
14605	//   "path": "v2/{+sinkName}",
14606	//   "request": {
14607	//     "$ref": "LogSink"
14608	//   },
14609	//   "response": {
14610	//     "$ref": "LogSink"
14611	//   },
14612	//   "scopes": [
14613	//     "https://www.googleapis.com/auth/cloud-platform",
14614	//     "https://www.googleapis.com/auth/logging.admin"
14615	//   ]
14616	// }
14617
14618}
14619
14620// method id "logging.folders.sinks.update":
14621
14622type FoldersSinksUpdateCall struct {
14623	s          *Service
14624	sinkNameid string
14625	logsink    *LogSink
14626	urlParams_ gensupport.URLParams
14627	ctx_       context.Context
14628	header_    http.Header
14629}
14630
14631// Update: Updates a sink. This method replaces the following fields in
14632// the existing sink with values from the new sink: destination, and
14633// filter.The updated sink might also have a new writer_identity; see
14634// the unique_writer_identity field.
14635//
14636// - sinkName: The full resource name of the sink to update, including
14637//   the parent resource and the sink identifier:
14638//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
14639//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
14640//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
14641//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" For
14642//   example:"projects/my-project/sinks/my-sink".
14643func (r *FoldersSinksService) Update(sinkNameid string, logsink *LogSink) *FoldersSinksUpdateCall {
14644	c := &FoldersSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14645	c.sinkNameid = sinkNameid
14646	c.logsink = logsink
14647	return c
14648}
14649
14650// UniqueWriterIdentity sets the optional parameter
14651// "uniqueWriterIdentity": See sinks.create for a description of this
14652// field. When updating a sink, the effect of this field on the value of
14653// writer_identity in the updated sink depends on both the old and new
14654// values of this field: If the old and new values of this field are
14655// both false or both true, then there is no change to the sink's
14656// writer_identity. If the old value is false and the new value is true,
14657// then writer_identity is changed to a unique service account. It is an
14658// error if the old value is true and the new value is set to false or
14659// defaulted to false.
14660func (c *FoldersSinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *FoldersSinksUpdateCall {
14661	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
14662	return c
14663}
14664
14665// UpdateMask sets the optional parameter "updateMask": Field mask that
14666// specifies the fields in sink that need an update. A sink field will
14667// be overwritten if, and only if, it is in the update mask. name and
14668// output only fields cannot be updated.An empty updateMask is
14669// temporarily treated as using the following mask for backwards
14670// compatibility purposes:destination,filter,includeChildrenAt some
14671// point in the future, behavior will be removed and specifying an empty
14672// updateMask will be an error.For a detailed FieldMask definition, see
14673// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor
14674// example: updateMask=filter
14675func (c *FoldersSinksUpdateCall) UpdateMask(updateMask string) *FoldersSinksUpdateCall {
14676	c.urlParams_.Set("updateMask", updateMask)
14677	return c
14678}
14679
14680// Fields allows partial responses to be retrieved. See
14681// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
14682// for more information.
14683func (c *FoldersSinksUpdateCall) Fields(s ...googleapi.Field) *FoldersSinksUpdateCall {
14684	c.urlParams_.Set("fields", googleapi.CombineFields(s))
14685	return c
14686}
14687
14688// Context sets the context to be used in this call's Do method. Any
14689// pending HTTP request will be aborted if the provided context is
14690// canceled.
14691func (c *FoldersSinksUpdateCall) Context(ctx context.Context) *FoldersSinksUpdateCall {
14692	c.ctx_ = ctx
14693	return c
14694}
14695
14696// Header returns an http.Header that can be modified by the caller to
14697// add HTTP headers to the request.
14698func (c *FoldersSinksUpdateCall) Header() http.Header {
14699	if c.header_ == nil {
14700		c.header_ = make(http.Header)
14701	}
14702	return c.header_
14703}
14704
14705func (c *FoldersSinksUpdateCall) doRequest(alt string) (*http.Response, error) {
14706	reqHeaders := make(http.Header)
14707	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
14708	for k, v := range c.header_ {
14709		reqHeaders[k] = v
14710	}
14711	reqHeaders.Set("User-Agent", c.s.userAgent())
14712	var body io.Reader = nil
14713	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
14714	if err != nil {
14715		return nil, err
14716	}
14717	reqHeaders.Set("Content-Type", "application/json")
14718	c.urlParams_.Set("alt", alt)
14719	c.urlParams_.Set("prettyPrint", "false")
14720	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
14721	urls += "?" + c.urlParams_.Encode()
14722	req, err := http.NewRequest("PUT", urls, body)
14723	if err != nil {
14724		return nil, err
14725	}
14726	req.Header = reqHeaders
14727	googleapi.Expand(req.URL, map[string]string{
14728		"sinkName": c.sinkNameid,
14729	})
14730	return gensupport.SendRequest(c.ctx_, c.s.client, req)
14731}
14732
14733// Do executes the "logging.folders.sinks.update" call.
14734// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
14735// code is an error. Response headers are in either
14736// *LogSink.ServerResponse.Header or (if a response was returned at all)
14737// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
14738// check whether the returned error was because http.StatusNotModified
14739// was returned.
14740func (c *FoldersSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
14741	gensupport.SetOptions(c.urlParams_, opts...)
14742	res, err := c.doRequest("json")
14743	if res != nil && res.StatusCode == http.StatusNotModified {
14744		if res.Body != nil {
14745			res.Body.Close()
14746		}
14747		return nil, &googleapi.Error{
14748			Code:   res.StatusCode,
14749			Header: res.Header,
14750		}
14751	}
14752	if err != nil {
14753		return nil, err
14754	}
14755	defer googleapi.CloseBody(res)
14756	if err := googleapi.CheckResponse(res); err != nil {
14757		return nil, err
14758	}
14759	ret := &LogSink{
14760		ServerResponse: googleapi.ServerResponse{
14761			Header:         res.Header,
14762			HTTPStatusCode: res.StatusCode,
14763		},
14764	}
14765	target := &ret
14766	if err := gensupport.DecodeResponse(target, res); err != nil {
14767		return nil, err
14768	}
14769	return ret, nil
14770	// {
14771	//   "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.",
14772	//   "flatPath": "v2/folders/{foldersId}/sinks/{sinksId}",
14773	//   "httpMethod": "PUT",
14774	//   "id": "logging.folders.sinks.update",
14775	//   "parameterOrder": [
14776	//     "sinkName"
14777	//   ],
14778	//   "parameters": {
14779	//     "sinkName": {
14780	//       "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]\" For example:\"projects/my-project/sinks/my-sink\"",
14781	//       "location": "path",
14782	//       "pattern": "^folders/[^/]+/sinks/[^/]+$",
14783	//       "required": true,
14784	//       "type": "string"
14785	//     },
14786	//     "uniqueWriterIdentity": {
14787	//       "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.",
14788	//       "location": "query",
14789	//       "type": "boolean"
14790	//     },
14791	//     "updateMask": {
14792	//       "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,includeChildrenAt 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.FieldMaskFor example: updateMask=filter",
14793	//       "format": "google-fieldmask",
14794	//       "location": "query",
14795	//       "type": "string"
14796	//     }
14797	//   },
14798	//   "path": "v2/{+sinkName}",
14799	//   "request": {
14800	//     "$ref": "LogSink"
14801	//   },
14802	//   "response": {
14803	//     "$ref": "LogSink"
14804	//   },
14805	//   "scopes": [
14806	//     "https://www.googleapis.com/auth/cloud-platform",
14807	//     "https://www.googleapis.com/auth/logging.admin"
14808	//   ]
14809	// }
14810
14811}
14812
14813// method id "logging.locations.get":
14814
14815type LocationsGetCall struct {
14816	s            *Service
14817	name         string
14818	urlParams_   gensupport.URLParams
14819	ifNoneMatch_ string
14820	ctx_         context.Context
14821	header_      http.Header
14822}
14823
14824// Get: Gets information about a location.
14825//
14826// - name: Resource name for the location.
14827func (r *LocationsService) Get(name string) *LocationsGetCall {
14828	c := &LocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14829	c.name = name
14830	return c
14831}
14832
14833// Fields allows partial responses to be retrieved. See
14834// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
14835// for more information.
14836func (c *LocationsGetCall) Fields(s ...googleapi.Field) *LocationsGetCall {
14837	c.urlParams_.Set("fields", googleapi.CombineFields(s))
14838	return c
14839}
14840
14841// IfNoneMatch sets the optional parameter which makes the operation
14842// fail if the object's ETag matches the given value. This is useful for
14843// getting updates only after the object has changed since the last
14844// request. Use googleapi.IsNotModified to check whether the response
14845// error from Do is the result of In-None-Match.
14846func (c *LocationsGetCall) IfNoneMatch(entityTag string) *LocationsGetCall {
14847	c.ifNoneMatch_ = entityTag
14848	return c
14849}
14850
14851// Context sets the context to be used in this call's Do method. Any
14852// pending HTTP request will be aborted if the provided context is
14853// canceled.
14854func (c *LocationsGetCall) Context(ctx context.Context) *LocationsGetCall {
14855	c.ctx_ = ctx
14856	return c
14857}
14858
14859// Header returns an http.Header that can be modified by the caller to
14860// add HTTP headers to the request.
14861func (c *LocationsGetCall) Header() http.Header {
14862	if c.header_ == nil {
14863		c.header_ = make(http.Header)
14864	}
14865	return c.header_
14866}
14867
14868func (c *LocationsGetCall) doRequest(alt string) (*http.Response, error) {
14869	reqHeaders := make(http.Header)
14870	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
14871	for k, v := range c.header_ {
14872		reqHeaders[k] = v
14873	}
14874	reqHeaders.Set("User-Agent", c.s.userAgent())
14875	if c.ifNoneMatch_ != "" {
14876		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
14877	}
14878	var body io.Reader = nil
14879	c.urlParams_.Set("alt", alt)
14880	c.urlParams_.Set("prettyPrint", "false")
14881	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
14882	urls += "?" + c.urlParams_.Encode()
14883	req, err := http.NewRequest("GET", urls, body)
14884	if err != nil {
14885		return nil, err
14886	}
14887	req.Header = reqHeaders
14888	googleapi.Expand(req.URL, map[string]string{
14889		"name": c.name,
14890	})
14891	return gensupport.SendRequest(c.ctx_, c.s.client, req)
14892}
14893
14894// Do executes the "logging.locations.get" call.
14895// Exactly one of *Location or error will be non-nil. Any non-2xx status
14896// code is an error. Response headers are in either
14897// *Location.ServerResponse.Header or (if a response was returned at
14898// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
14899// to check whether the returned error was because
14900// http.StatusNotModified was returned.
14901func (c *LocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
14902	gensupport.SetOptions(c.urlParams_, opts...)
14903	res, err := c.doRequest("json")
14904	if res != nil && res.StatusCode == http.StatusNotModified {
14905		if res.Body != nil {
14906			res.Body.Close()
14907		}
14908		return nil, &googleapi.Error{
14909			Code:   res.StatusCode,
14910			Header: res.Header,
14911		}
14912	}
14913	if err != nil {
14914		return nil, err
14915	}
14916	defer googleapi.CloseBody(res)
14917	if err := googleapi.CheckResponse(res); err != nil {
14918		return nil, err
14919	}
14920	ret := &Location{
14921		ServerResponse: googleapi.ServerResponse{
14922			Header:         res.Header,
14923			HTTPStatusCode: res.StatusCode,
14924		},
14925	}
14926	target := &ret
14927	if err := gensupport.DecodeResponse(target, res); err != nil {
14928		return nil, err
14929	}
14930	return ret, nil
14931	// {
14932	//   "description": "Gets information about a location.",
14933	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}",
14934	//   "httpMethod": "GET",
14935	//   "id": "logging.locations.get",
14936	//   "parameterOrder": [
14937	//     "name"
14938	//   ],
14939	//   "parameters": {
14940	//     "name": {
14941	//       "description": "Resource name for the location.",
14942	//       "location": "path",
14943	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+$",
14944	//       "required": true,
14945	//       "type": "string"
14946	//     }
14947	//   },
14948	//   "path": "v2/{+name}",
14949	//   "response": {
14950	//     "$ref": "Location"
14951	//   },
14952	//   "scopes": [
14953	//     "https://www.googleapis.com/auth/cloud-platform",
14954	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
14955	//     "https://www.googleapis.com/auth/logging.admin",
14956	//     "https://www.googleapis.com/auth/logging.read"
14957	//   ]
14958	// }
14959
14960}
14961
14962// method id "logging.locations.list":
14963
14964type LocationsListCall struct {
14965	s            *Service
14966	name         string
14967	urlParams_   gensupport.URLParams
14968	ifNoneMatch_ string
14969	ctx_         context.Context
14970	header_      http.Header
14971}
14972
14973// List: Lists information about the supported locations for this
14974// service.
14975//
14976// - name: The resource that owns the locations collection, if
14977//   applicable.
14978func (r *LocationsService) List(name string) *LocationsListCall {
14979	c := &LocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
14980	c.name = name
14981	return c
14982}
14983
14984// Filter sets the optional parameter "filter": A filter to narrow down
14985// results to a preferred subset. The filtering language accepts strings
14986// like "displayName=tokyo", and is documented in more detail in AIP-160
14987// (https://google.aip.dev/160).
14988func (c *LocationsListCall) Filter(filter string) *LocationsListCall {
14989	c.urlParams_.Set("filter", filter)
14990	return c
14991}
14992
14993// PageSize sets the optional parameter "pageSize": The maximum number
14994// of results to return. If not set, the service selects a default.
14995func (c *LocationsListCall) PageSize(pageSize int64) *LocationsListCall {
14996	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
14997	return c
14998}
14999
15000// PageToken sets the optional parameter "pageToken": A page token
15001// received from the next_page_token field in the response. Send that
15002// page token to receive the subsequent page.
15003func (c *LocationsListCall) PageToken(pageToken string) *LocationsListCall {
15004	c.urlParams_.Set("pageToken", pageToken)
15005	return c
15006}
15007
15008// Fields allows partial responses to be retrieved. See
15009// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
15010// for more information.
15011func (c *LocationsListCall) Fields(s ...googleapi.Field) *LocationsListCall {
15012	c.urlParams_.Set("fields", googleapi.CombineFields(s))
15013	return c
15014}
15015
15016// IfNoneMatch sets the optional parameter which makes the operation
15017// fail if the object's ETag matches the given value. This is useful for
15018// getting updates only after the object has changed since the last
15019// request. Use googleapi.IsNotModified to check whether the response
15020// error from Do is the result of In-None-Match.
15021func (c *LocationsListCall) IfNoneMatch(entityTag string) *LocationsListCall {
15022	c.ifNoneMatch_ = entityTag
15023	return c
15024}
15025
15026// Context sets the context to be used in this call's Do method. Any
15027// pending HTTP request will be aborted if the provided context is
15028// canceled.
15029func (c *LocationsListCall) Context(ctx context.Context) *LocationsListCall {
15030	c.ctx_ = ctx
15031	return c
15032}
15033
15034// Header returns an http.Header that can be modified by the caller to
15035// add HTTP headers to the request.
15036func (c *LocationsListCall) Header() http.Header {
15037	if c.header_ == nil {
15038		c.header_ = make(http.Header)
15039	}
15040	return c.header_
15041}
15042
15043func (c *LocationsListCall) doRequest(alt string) (*http.Response, error) {
15044	reqHeaders := make(http.Header)
15045	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
15046	for k, v := range c.header_ {
15047		reqHeaders[k] = v
15048	}
15049	reqHeaders.Set("User-Agent", c.s.userAgent())
15050	if c.ifNoneMatch_ != "" {
15051		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
15052	}
15053	var body io.Reader = nil
15054	c.urlParams_.Set("alt", alt)
15055	c.urlParams_.Set("prettyPrint", "false")
15056	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations")
15057	urls += "?" + c.urlParams_.Encode()
15058	req, err := http.NewRequest("GET", urls, body)
15059	if err != nil {
15060		return nil, err
15061	}
15062	req.Header = reqHeaders
15063	googleapi.Expand(req.URL, map[string]string{
15064		"name": c.name,
15065	})
15066	return gensupport.SendRequest(c.ctx_, c.s.client, req)
15067}
15068
15069// Do executes the "logging.locations.list" call.
15070// Exactly one of *ListLocationsResponse or error will be non-nil. Any
15071// non-2xx status code is an error. Response headers are in either
15072// *ListLocationsResponse.ServerResponse.Header or (if a response was
15073// returned at all) in error.(*googleapi.Error).Header. Use
15074// googleapi.IsNotModified to check whether the returned error was
15075// because http.StatusNotModified was returned.
15076func (c *LocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
15077	gensupport.SetOptions(c.urlParams_, opts...)
15078	res, err := c.doRequest("json")
15079	if res != nil && res.StatusCode == http.StatusNotModified {
15080		if res.Body != nil {
15081			res.Body.Close()
15082		}
15083		return nil, &googleapi.Error{
15084			Code:   res.StatusCode,
15085			Header: res.Header,
15086		}
15087	}
15088	if err != nil {
15089		return nil, err
15090	}
15091	defer googleapi.CloseBody(res)
15092	if err := googleapi.CheckResponse(res); err != nil {
15093		return nil, err
15094	}
15095	ret := &ListLocationsResponse{
15096		ServerResponse: googleapi.ServerResponse{
15097			Header:         res.Header,
15098			HTTPStatusCode: res.StatusCode,
15099		},
15100	}
15101	target := &ret
15102	if err := gensupport.DecodeResponse(target, res); err != nil {
15103		return nil, err
15104	}
15105	return ret, nil
15106	// {
15107	//   "description": "Lists information about the supported locations for this service.",
15108	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations",
15109	//   "httpMethod": "GET",
15110	//   "id": "logging.locations.list",
15111	//   "parameterOrder": [
15112	//     "name"
15113	//   ],
15114	//   "parameters": {
15115	//     "filter": {
15116	//       "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).",
15117	//       "location": "query",
15118	//       "type": "string"
15119	//     },
15120	//     "name": {
15121	//       "description": "The resource that owns the locations collection, if applicable.",
15122	//       "location": "path",
15123	//       "pattern": "^[^/]+/[^/]+$",
15124	//       "required": true,
15125	//       "type": "string"
15126	//     },
15127	//     "pageSize": {
15128	//       "description": "The maximum number of results to return. If not set, the service selects a default.",
15129	//       "format": "int32",
15130	//       "location": "query",
15131	//       "type": "integer"
15132	//     },
15133	//     "pageToken": {
15134	//       "description": "A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.",
15135	//       "location": "query",
15136	//       "type": "string"
15137	//     }
15138	//   },
15139	//   "path": "v2/{+name}/locations",
15140	//   "response": {
15141	//     "$ref": "ListLocationsResponse"
15142	//   },
15143	//   "scopes": [
15144	//     "https://www.googleapis.com/auth/cloud-platform",
15145	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
15146	//     "https://www.googleapis.com/auth/logging.admin",
15147	//     "https://www.googleapis.com/auth/logging.read"
15148	//   ]
15149	// }
15150
15151}
15152
15153// Pages invokes f for each page of results.
15154// A non-nil error returned from f will halt the iteration.
15155// The provided context supersedes any context provided to the Context method.
15156func (c *LocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
15157	c.ctx_ = ctx
15158	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
15159	for {
15160		x, err := c.Do()
15161		if err != nil {
15162			return err
15163		}
15164		if err := f(x); err != nil {
15165			return err
15166		}
15167		if x.NextPageToken == "" {
15168			return nil
15169		}
15170		c.PageToken(x.NextPageToken)
15171	}
15172}
15173
15174// method id "logging.locations.buckets.create":
15175
15176type LocationsBucketsCreateCall struct {
15177	s          *Service
15178	parent     string
15179	logbucket  *LogBucket
15180	urlParams_ gensupport.URLParams
15181	ctx_       context.Context
15182	header_    http.Header
15183}
15184
15185// Create: Creates a log bucket that can be used to store log entries.
15186// After a bucket has been created, the bucket's location cannot be
15187// changed.
15188//
15189// - parent: The resource in which to create the log bucket:
15190//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For
15191//   example:"projects/my-project/locations/global".
15192func (r *LocationsBucketsService) Create(parent string, logbucket *LogBucket) *LocationsBucketsCreateCall {
15193	c := &LocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15194	c.parent = parent
15195	c.logbucket = logbucket
15196	return c
15197}
15198
15199// BucketId sets the optional parameter "bucketId": Required. A
15200// client-assigned identifier such as "my-bucket". Identifiers are
15201// limited to 100 characters and can include only letters, digits,
15202// underscores, hyphens, and periods.
15203func (c *LocationsBucketsCreateCall) BucketId(bucketId string) *LocationsBucketsCreateCall {
15204	c.urlParams_.Set("bucketId", bucketId)
15205	return c
15206}
15207
15208// Fields allows partial responses to be retrieved. See
15209// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
15210// for more information.
15211func (c *LocationsBucketsCreateCall) Fields(s ...googleapi.Field) *LocationsBucketsCreateCall {
15212	c.urlParams_.Set("fields", googleapi.CombineFields(s))
15213	return c
15214}
15215
15216// Context sets the context to be used in this call's Do method. Any
15217// pending HTTP request will be aborted if the provided context is
15218// canceled.
15219func (c *LocationsBucketsCreateCall) Context(ctx context.Context) *LocationsBucketsCreateCall {
15220	c.ctx_ = ctx
15221	return c
15222}
15223
15224// Header returns an http.Header that can be modified by the caller to
15225// add HTTP headers to the request.
15226func (c *LocationsBucketsCreateCall) Header() http.Header {
15227	if c.header_ == nil {
15228		c.header_ = make(http.Header)
15229	}
15230	return c.header_
15231}
15232
15233func (c *LocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) {
15234	reqHeaders := make(http.Header)
15235	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
15236	for k, v := range c.header_ {
15237		reqHeaders[k] = v
15238	}
15239	reqHeaders.Set("User-Agent", c.s.userAgent())
15240	var body io.Reader = nil
15241	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
15242	if err != nil {
15243		return nil, err
15244	}
15245	reqHeaders.Set("Content-Type", "application/json")
15246	c.urlParams_.Set("alt", alt)
15247	c.urlParams_.Set("prettyPrint", "false")
15248	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
15249	urls += "?" + c.urlParams_.Encode()
15250	req, err := http.NewRequest("POST", urls, body)
15251	if err != nil {
15252		return nil, err
15253	}
15254	req.Header = reqHeaders
15255	googleapi.Expand(req.URL, map[string]string{
15256		"parent": c.parent,
15257	})
15258	return gensupport.SendRequest(c.ctx_, c.s.client, req)
15259}
15260
15261// Do executes the "logging.locations.buckets.create" call.
15262// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
15263// status code is an error. Response headers are in either
15264// *LogBucket.ServerResponse.Header or (if a response was returned at
15265// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
15266// to check whether the returned error was because
15267// http.StatusNotModified was returned.
15268func (c *LocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
15269	gensupport.SetOptions(c.urlParams_, opts...)
15270	res, err := c.doRequest("json")
15271	if res != nil && res.StatusCode == http.StatusNotModified {
15272		if res.Body != nil {
15273			res.Body.Close()
15274		}
15275		return nil, &googleapi.Error{
15276			Code:   res.StatusCode,
15277			Header: res.Header,
15278		}
15279	}
15280	if err != nil {
15281		return nil, err
15282	}
15283	defer googleapi.CloseBody(res)
15284	if err := googleapi.CheckResponse(res); err != nil {
15285		return nil, err
15286	}
15287	ret := &LogBucket{
15288		ServerResponse: googleapi.ServerResponse{
15289			Header:         res.Header,
15290			HTTPStatusCode: res.StatusCode,
15291		},
15292	}
15293	target := &ret
15294	if err := gensupport.DecodeResponse(target, res); err != nil {
15295		return nil, err
15296	}
15297	return ret, nil
15298	// {
15299	//   "description": "Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.",
15300	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets",
15301	//   "httpMethod": "POST",
15302	//   "id": "logging.locations.buckets.create",
15303	//   "parameterOrder": [
15304	//     "parent"
15305	//   ],
15306	//   "parameters": {
15307	//     "bucketId": {
15308	//       "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.",
15309	//       "location": "query",
15310	//       "type": "string"
15311	//     },
15312	//     "parent": {
15313	//       "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"",
15314	//       "location": "path",
15315	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+$",
15316	//       "required": true,
15317	//       "type": "string"
15318	//     }
15319	//   },
15320	//   "path": "v2/{+parent}/buckets",
15321	//   "request": {
15322	//     "$ref": "LogBucket"
15323	//   },
15324	//   "response": {
15325	//     "$ref": "LogBucket"
15326	//   },
15327	//   "scopes": [
15328	//     "https://www.googleapis.com/auth/cloud-platform",
15329	//     "https://www.googleapis.com/auth/logging.admin"
15330	//   ]
15331	// }
15332
15333}
15334
15335// method id "logging.locations.buckets.delete":
15336
15337type LocationsBucketsDeleteCall struct {
15338	s          *Service
15339	name       string
15340	urlParams_ gensupport.URLParams
15341	ctx_       context.Context
15342	header_    http.Header
15343}
15344
15345// Delete: Deletes a log bucket.Changes the bucket's lifecycle_state to
15346// the DELETE_REQUESTED state. After 7 days, the bucket will be purged
15347// and all log entries in the bucket will be permanently deleted.
15348//
15349// - name: The full resource name of the bucket to delete.
15350//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
15351//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
15352//   CKET_ID]"
15353//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
15354//   s/[BUCKET_ID]"
15355//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
15356//   For
15357//   example:"projects/my-project/locations/global/buckets/my-bucket".
15358func (r *LocationsBucketsService) Delete(name string) *LocationsBucketsDeleteCall {
15359	c := &LocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15360	c.name = name
15361	return c
15362}
15363
15364// Fields allows partial responses to be retrieved. See
15365// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
15366// for more information.
15367func (c *LocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *LocationsBucketsDeleteCall {
15368	c.urlParams_.Set("fields", googleapi.CombineFields(s))
15369	return c
15370}
15371
15372// Context sets the context to be used in this call's Do method. Any
15373// pending HTTP request will be aborted if the provided context is
15374// canceled.
15375func (c *LocationsBucketsDeleteCall) Context(ctx context.Context) *LocationsBucketsDeleteCall {
15376	c.ctx_ = ctx
15377	return c
15378}
15379
15380// Header returns an http.Header that can be modified by the caller to
15381// add HTTP headers to the request.
15382func (c *LocationsBucketsDeleteCall) Header() http.Header {
15383	if c.header_ == nil {
15384		c.header_ = make(http.Header)
15385	}
15386	return c.header_
15387}
15388
15389func (c *LocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
15390	reqHeaders := make(http.Header)
15391	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
15392	for k, v := range c.header_ {
15393		reqHeaders[k] = v
15394	}
15395	reqHeaders.Set("User-Agent", c.s.userAgent())
15396	var body io.Reader = nil
15397	c.urlParams_.Set("alt", alt)
15398	c.urlParams_.Set("prettyPrint", "false")
15399	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
15400	urls += "?" + c.urlParams_.Encode()
15401	req, err := http.NewRequest("DELETE", urls, body)
15402	if err != nil {
15403		return nil, err
15404	}
15405	req.Header = reqHeaders
15406	googleapi.Expand(req.URL, map[string]string{
15407		"name": c.name,
15408	})
15409	return gensupport.SendRequest(c.ctx_, c.s.client, req)
15410}
15411
15412// Do executes the "logging.locations.buckets.delete" call.
15413// Exactly one of *Empty or error will be non-nil. Any non-2xx status
15414// code is an error. Response headers are in either
15415// *Empty.ServerResponse.Header or (if a response was returned at all)
15416// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
15417// check whether the returned error was because http.StatusNotModified
15418// was returned.
15419func (c *LocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
15420	gensupport.SetOptions(c.urlParams_, opts...)
15421	res, err := c.doRequest("json")
15422	if res != nil && res.StatusCode == http.StatusNotModified {
15423		if res.Body != nil {
15424			res.Body.Close()
15425		}
15426		return nil, &googleapi.Error{
15427			Code:   res.StatusCode,
15428			Header: res.Header,
15429		}
15430	}
15431	if err != nil {
15432		return nil, err
15433	}
15434	defer googleapi.CloseBody(res)
15435	if err := googleapi.CheckResponse(res); err != nil {
15436		return nil, err
15437	}
15438	ret := &Empty{
15439		ServerResponse: googleapi.ServerResponse{
15440			Header:         res.Header,
15441			HTTPStatusCode: res.StatusCode,
15442		},
15443	}
15444	target := &ret
15445	if err := gensupport.DecodeResponse(target, res); err != nil {
15446		return nil, err
15447	}
15448	return ret, nil
15449	// {
15450	//   "description": "Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.",
15451	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}",
15452	//   "httpMethod": "DELETE",
15453	//   "id": "logging.locations.buckets.delete",
15454	//   "parameterOrder": [
15455	//     "name"
15456	//   ],
15457	//   "parameters": {
15458	//     "name": {
15459	//       "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]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"",
15460	//       "location": "path",
15461	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$",
15462	//       "required": true,
15463	//       "type": "string"
15464	//     }
15465	//   },
15466	//   "path": "v2/{+name}",
15467	//   "response": {
15468	//     "$ref": "Empty"
15469	//   },
15470	//   "scopes": [
15471	//     "https://www.googleapis.com/auth/cloud-platform",
15472	//     "https://www.googleapis.com/auth/logging.admin"
15473	//   ]
15474	// }
15475
15476}
15477
15478// method id "logging.locations.buckets.get":
15479
15480type LocationsBucketsGetCall struct {
15481	s            *Service
15482	name         string
15483	urlParams_   gensupport.URLParams
15484	ifNoneMatch_ string
15485	ctx_         context.Context
15486	header_      http.Header
15487}
15488
15489// Get: Gets a log bucket.
15490//
15491// - name: The resource name of the bucket:
15492//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
15493//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
15494//   CKET_ID]"
15495//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
15496//   s/[BUCKET_ID]"
15497//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
15498//   For
15499//   example:"projects/my-project/locations/global/buckets/my-bucket".
15500func (r *LocationsBucketsService) Get(name string) *LocationsBucketsGetCall {
15501	c := &LocationsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15502	c.name = name
15503	return c
15504}
15505
15506// Fields allows partial responses to be retrieved. See
15507// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
15508// for more information.
15509func (c *LocationsBucketsGetCall) Fields(s ...googleapi.Field) *LocationsBucketsGetCall {
15510	c.urlParams_.Set("fields", googleapi.CombineFields(s))
15511	return c
15512}
15513
15514// IfNoneMatch sets the optional parameter which makes the operation
15515// fail if the object's ETag matches the given value. This is useful for
15516// getting updates only after the object has changed since the last
15517// request. Use googleapi.IsNotModified to check whether the response
15518// error from Do is the result of In-None-Match.
15519func (c *LocationsBucketsGetCall) IfNoneMatch(entityTag string) *LocationsBucketsGetCall {
15520	c.ifNoneMatch_ = entityTag
15521	return c
15522}
15523
15524// Context sets the context to be used in this call's Do method. Any
15525// pending HTTP request will be aborted if the provided context is
15526// canceled.
15527func (c *LocationsBucketsGetCall) Context(ctx context.Context) *LocationsBucketsGetCall {
15528	c.ctx_ = ctx
15529	return c
15530}
15531
15532// Header returns an http.Header that can be modified by the caller to
15533// add HTTP headers to the request.
15534func (c *LocationsBucketsGetCall) Header() http.Header {
15535	if c.header_ == nil {
15536		c.header_ = make(http.Header)
15537	}
15538	return c.header_
15539}
15540
15541func (c *LocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) {
15542	reqHeaders := make(http.Header)
15543	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
15544	for k, v := range c.header_ {
15545		reqHeaders[k] = v
15546	}
15547	reqHeaders.Set("User-Agent", c.s.userAgent())
15548	if c.ifNoneMatch_ != "" {
15549		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
15550	}
15551	var body io.Reader = nil
15552	c.urlParams_.Set("alt", alt)
15553	c.urlParams_.Set("prettyPrint", "false")
15554	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
15555	urls += "?" + c.urlParams_.Encode()
15556	req, err := http.NewRequest("GET", urls, body)
15557	if err != nil {
15558		return nil, err
15559	}
15560	req.Header = reqHeaders
15561	googleapi.Expand(req.URL, map[string]string{
15562		"name": c.name,
15563	})
15564	return gensupport.SendRequest(c.ctx_, c.s.client, req)
15565}
15566
15567// Do executes the "logging.locations.buckets.get" call.
15568// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
15569// status code is an error. Response headers are in either
15570// *LogBucket.ServerResponse.Header or (if a response was returned at
15571// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
15572// to check whether the returned error was because
15573// http.StatusNotModified was returned.
15574func (c *LocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
15575	gensupport.SetOptions(c.urlParams_, opts...)
15576	res, err := c.doRequest("json")
15577	if res != nil && res.StatusCode == http.StatusNotModified {
15578		if res.Body != nil {
15579			res.Body.Close()
15580		}
15581		return nil, &googleapi.Error{
15582			Code:   res.StatusCode,
15583			Header: res.Header,
15584		}
15585	}
15586	if err != nil {
15587		return nil, err
15588	}
15589	defer googleapi.CloseBody(res)
15590	if err := googleapi.CheckResponse(res); err != nil {
15591		return nil, err
15592	}
15593	ret := &LogBucket{
15594		ServerResponse: googleapi.ServerResponse{
15595			Header:         res.Header,
15596			HTTPStatusCode: res.StatusCode,
15597		},
15598	}
15599	target := &ret
15600	if err := gensupport.DecodeResponse(target, res); err != nil {
15601		return nil, err
15602	}
15603	return ret, nil
15604	// {
15605	//   "description": "Gets a log bucket.",
15606	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}",
15607	//   "httpMethod": "GET",
15608	//   "id": "logging.locations.buckets.get",
15609	//   "parameterOrder": [
15610	//     "name"
15611	//   ],
15612	//   "parameters": {
15613	//     "name": {
15614	//       "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]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"",
15615	//       "location": "path",
15616	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$",
15617	//       "required": true,
15618	//       "type": "string"
15619	//     }
15620	//   },
15621	//   "path": "v2/{+name}",
15622	//   "response": {
15623	//     "$ref": "LogBucket"
15624	//   },
15625	//   "scopes": [
15626	//     "https://www.googleapis.com/auth/cloud-platform",
15627	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
15628	//     "https://www.googleapis.com/auth/logging.admin",
15629	//     "https://www.googleapis.com/auth/logging.read"
15630	//   ]
15631	// }
15632
15633}
15634
15635// method id "logging.locations.buckets.list":
15636
15637type LocationsBucketsListCall struct {
15638	s            *Service
15639	parent       string
15640	urlParams_   gensupport.URLParams
15641	ifNoneMatch_ string
15642	ctx_         context.Context
15643	header_      http.Header
15644}
15645
15646// List: Lists log buckets.
15647//
15648// - parent: The parent resource whose buckets are to be listed:
15649//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
15650//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
15651//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
15652//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations
15653//   portion of the resource must be specified, but supplying the
15654//   character - in place of LOCATION_ID will return all buckets.
15655func (r *LocationsBucketsService) List(parent string) *LocationsBucketsListCall {
15656	c := &LocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15657	c.parent = parent
15658	return c
15659}
15660
15661// PageSize sets the optional parameter "pageSize": The maximum number
15662// of results to return from this request. Non-positive values are
15663// ignored. The presence of nextPageToken in the response indicates that
15664// more results might be available.
15665func (c *LocationsBucketsListCall) PageSize(pageSize int64) *LocationsBucketsListCall {
15666	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
15667	return c
15668}
15669
15670// PageToken sets the optional parameter "pageToken": If present, then
15671// retrieve the next batch of results from the preceding call to this
15672// method. pageToken must be the value of nextPageToken from the
15673// previous response. The values of other method parameters should be
15674// identical to those in the previous call.
15675func (c *LocationsBucketsListCall) PageToken(pageToken string) *LocationsBucketsListCall {
15676	c.urlParams_.Set("pageToken", pageToken)
15677	return c
15678}
15679
15680// Fields allows partial responses to be retrieved. See
15681// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
15682// for more information.
15683func (c *LocationsBucketsListCall) Fields(s ...googleapi.Field) *LocationsBucketsListCall {
15684	c.urlParams_.Set("fields", googleapi.CombineFields(s))
15685	return c
15686}
15687
15688// IfNoneMatch sets the optional parameter which makes the operation
15689// fail if the object's ETag matches the given value. This is useful for
15690// getting updates only after the object has changed since the last
15691// request. Use googleapi.IsNotModified to check whether the response
15692// error from Do is the result of In-None-Match.
15693func (c *LocationsBucketsListCall) IfNoneMatch(entityTag string) *LocationsBucketsListCall {
15694	c.ifNoneMatch_ = entityTag
15695	return c
15696}
15697
15698// Context sets the context to be used in this call's Do method. Any
15699// pending HTTP request will be aborted if the provided context is
15700// canceled.
15701func (c *LocationsBucketsListCall) Context(ctx context.Context) *LocationsBucketsListCall {
15702	c.ctx_ = ctx
15703	return c
15704}
15705
15706// Header returns an http.Header that can be modified by the caller to
15707// add HTTP headers to the request.
15708func (c *LocationsBucketsListCall) Header() http.Header {
15709	if c.header_ == nil {
15710		c.header_ = make(http.Header)
15711	}
15712	return c.header_
15713}
15714
15715func (c *LocationsBucketsListCall) doRequest(alt string) (*http.Response, error) {
15716	reqHeaders := make(http.Header)
15717	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
15718	for k, v := range c.header_ {
15719		reqHeaders[k] = v
15720	}
15721	reqHeaders.Set("User-Agent", c.s.userAgent())
15722	if c.ifNoneMatch_ != "" {
15723		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
15724	}
15725	var body io.Reader = nil
15726	c.urlParams_.Set("alt", alt)
15727	c.urlParams_.Set("prettyPrint", "false")
15728	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
15729	urls += "?" + c.urlParams_.Encode()
15730	req, err := http.NewRequest("GET", urls, body)
15731	if err != nil {
15732		return nil, err
15733	}
15734	req.Header = reqHeaders
15735	googleapi.Expand(req.URL, map[string]string{
15736		"parent": c.parent,
15737	})
15738	return gensupport.SendRequest(c.ctx_, c.s.client, req)
15739}
15740
15741// Do executes the "logging.locations.buckets.list" call.
15742// Exactly one of *ListBucketsResponse or error will be non-nil. Any
15743// non-2xx status code is an error. Response headers are in either
15744// *ListBucketsResponse.ServerResponse.Header or (if a response was
15745// returned at all) in error.(*googleapi.Error).Header. Use
15746// googleapi.IsNotModified to check whether the returned error was
15747// because http.StatusNotModified was returned.
15748func (c *LocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) {
15749	gensupport.SetOptions(c.urlParams_, opts...)
15750	res, err := c.doRequest("json")
15751	if res != nil && res.StatusCode == http.StatusNotModified {
15752		if res.Body != nil {
15753			res.Body.Close()
15754		}
15755		return nil, &googleapi.Error{
15756			Code:   res.StatusCode,
15757			Header: res.Header,
15758		}
15759	}
15760	if err != nil {
15761		return nil, err
15762	}
15763	defer googleapi.CloseBody(res)
15764	if err := googleapi.CheckResponse(res); err != nil {
15765		return nil, err
15766	}
15767	ret := &ListBucketsResponse{
15768		ServerResponse: googleapi.ServerResponse{
15769			Header:         res.Header,
15770			HTTPStatusCode: res.StatusCode,
15771		},
15772	}
15773	target := &ret
15774	if err := gensupport.DecodeResponse(target, res); err != nil {
15775		return nil, err
15776	}
15777	return ret, nil
15778	// {
15779	//   "description": "Lists log buckets.",
15780	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets",
15781	//   "httpMethod": "GET",
15782	//   "id": "logging.locations.buckets.list",
15783	//   "parameterOrder": [
15784	//     "parent"
15785	//   ],
15786	//   "parameters": {
15787	//     "pageSize": {
15788	//       "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.",
15789	//       "format": "int32",
15790	//       "location": "query",
15791	//       "type": "integer"
15792	//     },
15793	//     "pageToken": {
15794	//       "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.",
15795	//       "location": "query",
15796	//       "type": "string"
15797	//     },
15798	//     "parent": {
15799	//       "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.",
15800	//       "location": "path",
15801	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+$",
15802	//       "required": true,
15803	//       "type": "string"
15804	//     }
15805	//   },
15806	//   "path": "v2/{+parent}/buckets",
15807	//   "response": {
15808	//     "$ref": "ListBucketsResponse"
15809	//   },
15810	//   "scopes": [
15811	//     "https://www.googleapis.com/auth/cloud-platform",
15812	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
15813	//     "https://www.googleapis.com/auth/logging.admin",
15814	//     "https://www.googleapis.com/auth/logging.read"
15815	//   ]
15816	// }
15817
15818}
15819
15820// Pages invokes f for each page of results.
15821// A non-nil error returned from f will halt the iteration.
15822// The provided context supersedes any context provided to the Context method.
15823func (c *LocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error {
15824	c.ctx_ = ctx
15825	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
15826	for {
15827		x, err := c.Do()
15828		if err != nil {
15829			return err
15830		}
15831		if err := f(x); err != nil {
15832			return err
15833		}
15834		if x.NextPageToken == "" {
15835			return nil
15836		}
15837		c.PageToken(x.NextPageToken)
15838	}
15839}
15840
15841// method id "logging.locations.buckets.patch":
15842
15843type LocationsBucketsPatchCall struct {
15844	s          *Service
15845	name       string
15846	logbucket  *LogBucket
15847	urlParams_ gensupport.URLParams
15848	ctx_       context.Context
15849	header_    http.Header
15850}
15851
15852// Patch: Updates a log bucket. This method replaces the following
15853// fields in the existing bucket with values from the new bucket:
15854// retention_periodIf the retention period is decreased and the bucket
15855// is locked, FAILED_PRECONDITION will be returned.If the bucket has a
15856// lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be
15857// returned.After a bucket has been created, the bucket's location
15858// cannot be changed.
15859//
15860// - name: The full resource name of the bucket to update.
15861//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
15862//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
15863//   CKET_ID]"
15864//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
15865//   s/[BUCKET_ID]"
15866//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
15867//   For
15868//   example:"projects/my-project/locations/global/buckets/my-bucket".
15869func (r *LocationsBucketsService) Patch(name string, logbucket *LogBucket) *LocationsBucketsPatchCall {
15870	c := &LocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
15871	c.name = name
15872	c.logbucket = logbucket
15873	return c
15874}
15875
15876// UpdateMask sets the optional parameter "updateMask": Required. Field
15877// mask that specifies the fields in bucket that need an update. A
15878// bucket field will be overwritten if, and only if, it is in the update
15879// mask. name and output only fields cannot be updated.For a detailed
15880// FieldMask definition, see:
15881// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor
15882// example: updateMask=retention_days
15883func (c *LocationsBucketsPatchCall) UpdateMask(updateMask string) *LocationsBucketsPatchCall {
15884	c.urlParams_.Set("updateMask", updateMask)
15885	return c
15886}
15887
15888// Fields allows partial responses to be retrieved. See
15889// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
15890// for more information.
15891func (c *LocationsBucketsPatchCall) Fields(s ...googleapi.Field) *LocationsBucketsPatchCall {
15892	c.urlParams_.Set("fields", googleapi.CombineFields(s))
15893	return c
15894}
15895
15896// Context sets the context to be used in this call's Do method. Any
15897// pending HTTP request will be aborted if the provided context is
15898// canceled.
15899func (c *LocationsBucketsPatchCall) Context(ctx context.Context) *LocationsBucketsPatchCall {
15900	c.ctx_ = ctx
15901	return c
15902}
15903
15904// Header returns an http.Header that can be modified by the caller to
15905// add HTTP headers to the request.
15906func (c *LocationsBucketsPatchCall) Header() http.Header {
15907	if c.header_ == nil {
15908		c.header_ = make(http.Header)
15909	}
15910	return c.header_
15911}
15912
15913func (c *LocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
15914	reqHeaders := make(http.Header)
15915	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
15916	for k, v := range c.header_ {
15917		reqHeaders[k] = v
15918	}
15919	reqHeaders.Set("User-Agent", c.s.userAgent())
15920	var body io.Reader = nil
15921	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
15922	if err != nil {
15923		return nil, err
15924	}
15925	reqHeaders.Set("Content-Type", "application/json")
15926	c.urlParams_.Set("alt", alt)
15927	c.urlParams_.Set("prettyPrint", "false")
15928	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
15929	urls += "?" + c.urlParams_.Encode()
15930	req, err := http.NewRequest("PATCH", urls, body)
15931	if err != nil {
15932		return nil, err
15933	}
15934	req.Header = reqHeaders
15935	googleapi.Expand(req.URL, map[string]string{
15936		"name": c.name,
15937	})
15938	return gensupport.SendRequest(c.ctx_, c.s.client, req)
15939}
15940
15941// Do executes the "logging.locations.buckets.patch" call.
15942// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
15943// status code is an error. Response headers are in either
15944// *LogBucket.ServerResponse.Header or (if a response was returned at
15945// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
15946// to check whether the returned error was because
15947// http.StatusNotModified was returned.
15948func (c *LocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
15949	gensupport.SetOptions(c.urlParams_, opts...)
15950	res, err := c.doRequest("json")
15951	if res != nil && res.StatusCode == http.StatusNotModified {
15952		if res.Body != nil {
15953			res.Body.Close()
15954		}
15955		return nil, &googleapi.Error{
15956			Code:   res.StatusCode,
15957			Header: res.Header,
15958		}
15959	}
15960	if err != nil {
15961		return nil, err
15962	}
15963	defer googleapi.CloseBody(res)
15964	if err := googleapi.CheckResponse(res); err != nil {
15965		return nil, err
15966	}
15967	ret := &LogBucket{
15968		ServerResponse: googleapi.ServerResponse{
15969			Header:         res.Header,
15970			HTTPStatusCode: res.StatusCode,
15971		},
15972	}
15973	target := &ret
15974	if err := gensupport.DecodeResponse(target, res); err != nil {
15975		return nil, err
15976	}
15977	return ret, nil
15978	// {
15979	//   "description": "Updates a log 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 lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.",
15980	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}",
15981	//   "httpMethod": "PATCH",
15982	//   "id": "logging.locations.buckets.patch",
15983	//   "parameterOrder": [
15984	//     "name"
15985	//   ],
15986	//   "parameters": {
15987	//     "name": {
15988	//       "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]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"",
15989	//       "location": "path",
15990	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$",
15991	//       "required": true,
15992	//       "type": "string"
15993	//     },
15994	//     "updateMask": {
15995	//       "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.FieldMaskFor example: updateMask=retention_days",
15996	//       "format": "google-fieldmask",
15997	//       "location": "query",
15998	//       "type": "string"
15999	//     }
16000	//   },
16001	//   "path": "v2/{+name}",
16002	//   "request": {
16003	//     "$ref": "LogBucket"
16004	//   },
16005	//   "response": {
16006	//     "$ref": "LogBucket"
16007	//   },
16008	//   "scopes": [
16009	//     "https://www.googleapis.com/auth/cloud-platform",
16010	//     "https://www.googleapis.com/auth/logging.admin"
16011	//   ]
16012	// }
16013
16014}
16015
16016// method id "logging.locations.buckets.undelete":
16017
16018type LocationsBucketsUndeleteCall struct {
16019	s                     *Service
16020	name                  string
16021	undeletebucketrequest *UndeleteBucketRequest
16022	urlParams_            gensupport.URLParams
16023	ctx_                  context.Context
16024	header_               http.Header
16025}
16026
16027// Undelete: Undeletes a log bucket. A bucket that has been deleted can
16028// be undeleted within the grace period of 7 days.
16029//
16030// - name: The full resource name of the bucket to undelete.
16031//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
16032//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
16033//   CKET_ID]"
16034//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
16035//   s/[BUCKET_ID]"
16036//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
16037//   For
16038//   example:"projects/my-project/locations/global/buckets/my-bucket".
16039func (r *LocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *LocationsBucketsUndeleteCall {
16040	c := &LocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
16041	c.name = name
16042	c.undeletebucketrequest = undeletebucketrequest
16043	return c
16044}
16045
16046// Fields allows partial responses to be retrieved. See
16047// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
16048// for more information.
16049func (c *LocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *LocationsBucketsUndeleteCall {
16050	c.urlParams_.Set("fields", googleapi.CombineFields(s))
16051	return c
16052}
16053
16054// Context sets the context to be used in this call's Do method. Any
16055// pending HTTP request will be aborted if the provided context is
16056// canceled.
16057func (c *LocationsBucketsUndeleteCall) Context(ctx context.Context) *LocationsBucketsUndeleteCall {
16058	c.ctx_ = ctx
16059	return c
16060}
16061
16062// Header returns an http.Header that can be modified by the caller to
16063// add HTTP headers to the request.
16064func (c *LocationsBucketsUndeleteCall) Header() http.Header {
16065	if c.header_ == nil {
16066		c.header_ = make(http.Header)
16067	}
16068	return c.header_
16069}
16070
16071func (c *LocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) {
16072	reqHeaders := make(http.Header)
16073	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
16074	for k, v := range c.header_ {
16075		reqHeaders[k] = v
16076	}
16077	reqHeaders.Set("User-Agent", c.s.userAgent())
16078	var body io.Reader = nil
16079	body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest)
16080	if err != nil {
16081		return nil, err
16082	}
16083	reqHeaders.Set("Content-Type", "application/json")
16084	c.urlParams_.Set("alt", alt)
16085	c.urlParams_.Set("prettyPrint", "false")
16086	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete")
16087	urls += "?" + c.urlParams_.Encode()
16088	req, err := http.NewRequest("POST", urls, body)
16089	if err != nil {
16090		return nil, err
16091	}
16092	req.Header = reqHeaders
16093	googleapi.Expand(req.URL, map[string]string{
16094		"name": c.name,
16095	})
16096	return gensupport.SendRequest(c.ctx_, c.s.client, req)
16097}
16098
16099// Do executes the "logging.locations.buckets.undelete" call.
16100// Exactly one of *Empty or error will be non-nil. Any non-2xx status
16101// code is an error. Response headers are in either
16102// *Empty.ServerResponse.Header or (if a response was returned at all)
16103// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
16104// check whether the returned error was because http.StatusNotModified
16105// was returned.
16106func (c *LocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
16107	gensupport.SetOptions(c.urlParams_, opts...)
16108	res, err := c.doRequest("json")
16109	if res != nil && res.StatusCode == http.StatusNotModified {
16110		if res.Body != nil {
16111			res.Body.Close()
16112		}
16113		return nil, &googleapi.Error{
16114			Code:   res.StatusCode,
16115			Header: res.Header,
16116		}
16117	}
16118	if err != nil {
16119		return nil, err
16120	}
16121	defer googleapi.CloseBody(res)
16122	if err := googleapi.CheckResponse(res); err != nil {
16123		return nil, err
16124	}
16125	ret := &Empty{
16126		ServerResponse: googleapi.ServerResponse{
16127			Header:         res.Header,
16128			HTTPStatusCode: res.StatusCode,
16129		},
16130	}
16131	target := &ret
16132	if err := gensupport.DecodeResponse(target, res); err != nil {
16133		return nil, err
16134	}
16135	return ret, nil
16136	// {
16137	//   "description": "Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.",
16138	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}:undelete",
16139	//   "httpMethod": "POST",
16140	//   "id": "logging.locations.buckets.undelete",
16141	//   "parameterOrder": [
16142	//     "name"
16143	//   ],
16144	//   "parameters": {
16145	//     "name": {
16146	//       "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]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"",
16147	//       "location": "path",
16148	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$",
16149	//       "required": true,
16150	//       "type": "string"
16151	//     }
16152	//   },
16153	//   "path": "v2/{+name}:undelete",
16154	//   "request": {
16155	//     "$ref": "UndeleteBucketRequest"
16156	//   },
16157	//   "response": {
16158	//     "$ref": "Empty"
16159	//   },
16160	//   "scopes": [
16161	//     "https://www.googleapis.com/auth/cloud-platform",
16162	//     "https://www.googleapis.com/auth/logging.admin"
16163	//   ]
16164	// }
16165
16166}
16167
16168// method id "logging.locations.buckets.views.create":
16169
16170type LocationsBucketsViewsCreateCall struct {
16171	s          *Service
16172	parent     string
16173	logview    *LogView
16174	urlParams_ gensupport.URLParams
16175	ctx_       context.Context
16176	header_    http.Header
16177}
16178
16179// Create: Creates a view over log entries in a log bucket. A bucket may
16180// contain a maximum of 30 views.
16181//
16182// - parent: The bucket in which to create the view
16183//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
16184//   ` For
16185//   example:"projects/my-project/locations/global/buckets/my-bucket".
16186func (r *LocationsBucketsViewsService) Create(parent string, logview *LogView) *LocationsBucketsViewsCreateCall {
16187	c := &LocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
16188	c.parent = parent
16189	c.logview = logview
16190	return c
16191}
16192
16193// ViewId sets the optional parameter "viewId": Required. The id to use
16194// for this view.
16195func (c *LocationsBucketsViewsCreateCall) ViewId(viewId string) *LocationsBucketsViewsCreateCall {
16196	c.urlParams_.Set("viewId", viewId)
16197	return c
16198}
16199
16200// Fields allows partial responses to be retrieved. See
16201// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
16202// for more information.
16203func (c *LocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsCreateCall {
16204	c.urlParams_.Set("fields", googleapi.CombineFields(s))
16205	return c
16206}
16207
16208// Context sets the context to be used in this call's Do method. Any
16209// pending HTTP request will be aborted if the provided context is
16210// canceled.
16211func (c *LocationsBucketsViewsCreateCall) Context(ctx context.Context) *LocationsBucketsViewsCreateCall {
16212	c.ctx_ = ctx
16213	return c
16214}
16215
16216// Header returns an http.Header that can be modified by the caller to
16217// add HTTP headers to the request.
16218func (c *LocationsBucketsViewsCreateCall) Header() http.Header {
16219	if c.header_ == nil {
16220		c.header_ = make(http.Header)
16221	}
16222	return c.header_
16223}
16224
16225func (c *LocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) {
16226	reqHeaders := make(http.Header)
16227	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
16228	for k, v := range c.header_ {
16229		reqHeaders[k] = v
16230	}
16231	reqHeaders.Set("User-Agent", c.s.userAgent())
16232	var body io.Reader = nil
16233	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
16234	if err != nil {
16235		return nil, err
16236	}
16237	reqHeaders.Set("Content-Type", "application/json")
16238	c.urlParams_.Set("alt", alt)
16239	c.urlParams_.Set("prettyPrint", "false")
16240	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
16241	urls += "?" + c.urlParams_.Encode()
16242	req, err := http.NewRequest("POST", urls, body)
16243	if err != nil {
16244		return nil, err
16245	}
16246	req.Header = reqHeaders
16247	googleapi.Expand(req.URL, map[string]string{
16248		"parent": c.parent,
16249	})
16250	return gensupport.SendRequest(c.ctx_, c.s.client, req)
16251}
16252
16253// Do executes the "logging.locations.buckets.views.create" call.
16254// Exactly one of *LogView or error will be non-nil. Any non-2xx status
16255// code is an error. Response headers are in either
16256// *LogView.ServerResponse.Header or (if a response was returned at all)
16257// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
16258// check whether the returned error was because http.StatusNotModified
16259// was returned.
16260func (c *LocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
16261	gensupport.SetOptions(c.urlParams_, opts...)
16262	res, err := c.doRequest("json")
16263	if res != nil && res.StatusCode == http.StatusNotModified {
16264		if res.Body != nil {
16265			res.Body.Close()
16266		}
16267		return nil, &googleapi.Error{
16268			Code:   res.StatusCode,
16269			Header: res.Header,
16270		}
16271	}
16272	if err != nil {
16273		return nil, err
16274	}
16275	defer googleapi.CloseBody(res)
16276	if err := googleapi.CheckResponse(res); err != nil {
16277		return nil, err
16278	}
16279	ret := &LogView{
16280		ServerResponse: googleapi.ServerResponse{
16281			Header:         res.Header,
16282			HTTPStatusCode: res.StatusCode,
16283		},
16284	}
16285	target := &ret
16286	if err := gensupport.DecodeResponse(target, res); err != nil {
16287		return nil, err
16288	}
16289	return ret, nil
16290	// {
16291	//   "description": "Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.",
16292	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views",
16293	//   "httpMethod": "POST",
16294	//   "id": "logging.locations.buckets.views.create",
16295	//   "parameterOrder": [
16296	//     "parent"
16297	//   ],
16298	//   "parameters": {
16299	//     "parent": {
16300	//       "description": "Required. The bucket in which to create the view `\"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\"` For example:\"projects/my-project/locations/global/buckets/my-bucket\"",
16301	//       "location": "path",
16302	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$",
16303	//       "required": true,
16304	//       "type": "string"
16305	//     },
16306	//     "viewId": {
16307	//       "description": "Required. The id to use for this view.",
16308	//       "location": "query",
16309	//       "type": "string"
16310	//     }
16311	//   },
16312	//   "path": "v2/{+parent}/views",
16313	//   "request": {
16314	//     "$ref": "LogView"
16315	//   },
16316	//   "response": {
16317	//     "$ref": "LogView"
16318	//   },
16319	//   "scopes": [
16320	//     "https://www.googleapis.com/auth/cloud-platform",
16321	//     "https://www.googleapis.com/auth/logging.admin"
16322	//   ]
16323	// }
16324
16325}
16326
16327// method id "logging.locations.buckets.views.delete":
16328
16329type LocationsBucketsViewsDeleteCall struct {
16330	s          *Service
16331	name       string
16332	urlParams_ gensupport.URLParams
16333	ctx_       context.Context
16334	header_    http.Header
16335}
16336
16337// Delete: Deletes a view on a log bucket. If an UNAVAILABLE error is
16338// returned, this indicates that system is not in a state where it can
16339// delete the view. If this occurs, please try again in a few minutes.
16340//
16341// - name: The full resource name of the view to delete:
16342//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
16343//   iews/[VIEW_ID]" For
16344//   example:"projects/my-project/locations/global/buckets/my-bucket/view
16345//   s/my-view".
16346func (r *LocationsBucketsViewsService) Delete(name string) *LocationsBucketsViewsDeleteCall {
16347	c := &LocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
16348	c.name = name
16349	return c
16350}
16351
16352// Fields allows partial responses to be retrieved. See
16353// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
16354// for more information.
16355func (c *LocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsDeleteCall {
16356	c.urlParams_.Set("fields", googleapi.CombineFields(s))
16357	return c
16358}
16359
16360// Context sets the context to be used in this call's Do method. Any
16361// pending HTTP request will be aborted if the provided context is
16362// canceled.
16363func (c *LocationsBucketsViewsDeleteCall) Context(ctx context.Context) *LocationsBucketsViewsDeleteCall {
16364	c.ctx_ = ctx
16365	return c
16366}
16367
16368// Header returns an http.Header that can be modified by the caller to
16369// add HTTP headers to the request.
16370func (c *LocationsBucketsViewsDeleteCall) Header() http.Header {
16371	if c.header_ == nil {
16372		c.header_ = make(http.Header)
16373	}
16374	return c.header_
16375}
16376
16377func (c *LocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) {
16378	reqHeaders := make(http.Header)
16379	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
16380	for k, v := range c.header_ {
16381		reqHeaders[k] = v
16382	}
16383	reqHeaders.Set("User-Agent", c.s.userAgent())
16384	var body io.Reader = nil
16385	c.urlParams_.Set("alt", alt)
16386	c.urlParams_.Set("prettyPrint", "false")
16387	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
16388	urls += "?" + c.urlParams_.Encode()
16389	req, err := http.NewRequest("DELETE", urls, body)
16390	if err != nil {
16391		return nil, err
16392	}
16393	req.Header = reqHeaders
16394	googleapi.Expand(req.URL, map[string]string{
16395		"name": c.name,
16396	})
16397	return gensupport.SendRequest(c.ctx_, c.s.client, req)
16398}
16399
16400// Do executes the "logging.locations.buckets.views.delete" call.
16401// Exactly one of *Empty or error will be non-nil. Any non-2xx status
16402// code is an error. Response headers are in either
16403// *Empty.ServerResponse.Header or (if a response was returned at all)
16404// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
16405// check whether the returned error was because http.StatusNotModified
16406// was returned.
16407func (c *LocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
16408	gensupport.SetOptions(c.urlParams_, opts...)
16409	res, err := c.doRequest("json")
16410	if res != nil && res.StatusCode == http.StatusNotModified {
16411		if res.Body != nil {
16412			res.Body.Close()
16413		}
16414		return nil, &googleapi.Error{
16415			Code:   res.StatusCode,
16416			Header: res.Header,
16417		}
16418	}
16419	if err != nil {
16420		return nil, err
16421	}
16422	defer googleapi.CloseBody(res)
16423	if err := googleapi.CheckResponse(res); err != nil {
16424		return nil, err
16425	}
16426	ret := &Empty{
16427		ServerResponse: googleapi.ServerResponse{
16428			Header:         res.Header,
16429			HTTPStatusCode: res.StatusCode,
16430		},
16431	}
16432	target := &ret
16433	if err := gensupport.DecodeResponse(target, res); err != nil {
16434		return nil, err
16435	}
16436	return ret, nil
16437	// {
16438	//   "description": "Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.",
16439	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
16440	//   "httpMethod": "DELETE",
16441	//   "id": "logging.locations.buckets.views.delete",
16442	//   "parameterOrder": [
16443	//     "name"
16444	//   ],
16445	//   "parameters": {
16446	//     "name": {
16447	//       "description": "Required. The full resource name of the view to delete: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"",
16448	//       "location": "path",
16449	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
16450	//       "required": true,
16451	//       "type": "string"
16452	//     }
16453	//   },
16454	//   "path": "v2/{+name}",
16455	//   "response": {
16456	//     "$ref": "Empty"
16457	//   },
16458	//   "scopes": [
16459	//     "https://www.googleapis.com/auth/cloud-platform",
16460	//     "https://www.googleapis.com/auth/logging.admin"
16461	//   ]
16462	// }
16463
16464}
16465
16466// method id "logging.locations.buckets.views.get":
16467
16468type LocationsBucketsViewsGetCall struct {
16469	s            *Service
16470	name         string
16471	urlParams_   gensupport.URLParams
16472	ifNoneMatch_ string
16473	ctx_         context.Context
16474	header_      http.Header
16475}
16476
16477// Get: Gets a view on a log bucket..
16478//
16479// - name: The resource name of the policy:
16480//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
16481//   iews/[VIEW_ID]" For
16482//   example:"projects/my-project/locations/global/buckets/my-bucket/view
16483//   s/my-view".
16484func (r *LocationsBucketsViewsService) Get(name string) *LocationsBucketsViewsGetCall {
16485	c := &LocationsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
16486	c.name = name
16487	return c
16488}
16489
16490// Fields allows partial responses to be retrieved. See
16491// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
16492// for more information.
16493func (c *LocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsGetCall {
16494	c.urlParams_.Set("fields", googleapi.CombineFields(s))
16495	return c
16496}
16497
16498// IfNoneMatch sets the optional parameter which makes the operation
16499// fail if the object's ETag matches the given value. This is useful for
16500// getting updates only after the object has changed since the last
16501// request. Use googleapi.IsNotModified to check whether the response
16502// error from Do is the result of In-None-Match.
16503func (c *LocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *LocationsBucketsViewsGetCall {
16504	c.ifNoneMatch_ = entityTag
16505	return c
16506}
16507
16508// Context sets the context to be used in this call's Do method. Any
16509// pending HTTP request will be aborted if the provided context is
16510// canceled.
16511func (c *LocationsBucketsViewsGetCall) Context(ctx context.Context) *LocationsBucketsViewsGetCall {
16512	c.ctx_ = ctx
16513	return c
16514}
16515
16516// Header returns an http.Header that can be modified by the caller to
16517// add HTTP headers to the request.
16518func (c *LocationsBucketsViewsGetCall) Header() http.Header {
16519	if c.header_ == nil {
16520		c.header_ = make(http.Header)
16521	}
16522	return c.header_
16523}
16524
16525func (c *LocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) {
16526	reqHeaders := make(http.Header)
16527	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
16528	for k, v := range c.header_ {
16529		reqHeaders[k] = v
16530	}
16531	reqHeaders.Set("User-Agent", c.s.userAgent())
16532	if c.ifNoneMatch_ != "" {
16533		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
16534	}
16535	var body io.Reader = nil
16536	c.urlParams_.Set("alt", alt)
16537	c.urlParams_.Set("prettyPrint", "false")
16538	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
16539	urls += "?" + c.urlParams_.Encode()
16540	req, err := http.NewRequest("GET", urls, body)
16541	if err != nil {
16542		return nil, err
16543	}
16544	req.Header = reqHeaders
16545	googleapi.Expand(req.URL, map[string]string{
16546		"name": c.name,
16547	})
16548	return gensupport.SendRequest(c.ctx_, c.s.client, req)
16549}
16550
16551// Do executes the "logging.locations.buckets.views.get" call.
16552// Exactly one of *LogView or error will be non-nil. Any non-2xx status
16553// code is an error. Response headers are in either
16554// *LogView.ServerResponse.Header or (if a response was returned at all)
16555// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
16556// check whether the returned error was because http.StatusNotModified
16557// was returned.
16558func (c *LocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
16559	gensupport.SetOptions(c.urlParams_, opts...)
16560	res, err := c.doRequest("json")
16561	if res != nil && res.StatusCode == http.StatusNotModified {
16562		if res.Body != nil {
16563			res.Body.Close()
16564		}
16565		return nil, &googleapi.Error{
16566			Code:   res.StatusCode,
16567			Header: res.Header,
16568		}
16569	}
16570	if err != nil {
16571		return nil, err
16572	}
16573	defer googleapi.CloseBody(res)
16574	if err := googleapi.CheckResponse(res); err != nil {
16575		return nil, err
16576	}
16577	ret := &LogView{
16578		ServerResponse: googleapi.ServerResponse{
16579			Header:         res.Header,
16580			HTTPStatusCode: res.StatusCode,
16581		},
16582	}
16583	target := &ret
16584	if err := gensupport.DecodeResponse(target, res); err != nil {
16585		return nil, err
16586	}
16587	return ret, nil
16588	// {
16589	//   "description": "Gets a view on a log bucket..",
16590	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
16591	//   "httpMethod": "GET",
16592	//   "id": "logging.locations.buckets.views.get",
16593	//   "parameterOrder": [
16594	//     "name"
16595	//   ],
16596	//   "parameters": {
16597	//     "name": {
16598	//       "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"",
16599	//       "location": "path",
16600	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
16601	//       "required": true,
16602	//       "type": "string"
16603	//     }
16604	//   },
16605	//   "path": "v2/{+name}",
16606	//   "response": {
16607	//     "$ref": "LogView"
16608	//   },
16609	//   "scopes": [
16610	//     "https://www.googleapis.com/auth/cloud-platform",
16611	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
16612	//     "https://www.googleapis.com/auth/logging.admin",
16613	//     "https://www.googleapis.com/auth/logging.read"
16614	//   ]
16615	// }
16616
16617}
16618
16619// method id "logging.locations.buckets.views.list":
16620
16621type LocationsBucketsViewsListCall struct {
16622	s            *Service
16623	parent       string
16624	urlParams_   gensupport.URLParams
16625	ifNoneMatch_ string
16626	ctx_         context.Context
16627	header_      http.Header
16628}
16629
16630// List: Lists views on a log bucket.
16631//
16632// - parent: The bucket whose views are to be listed:
16633//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]".
16634func (r *LocationsBucketsViewsService) List(parent string) *LocationsBucketsViewsListCall {
16635	c := &LocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
16636	c.parent = parent
16637	return c
16638}
16639
16640// PageSize sets the optional parameter "pageSize": The maximum number
16641// of results to return from this request.Non-positive values are
16642// ignored. The presence of nextPageToken in the response indicates that
16643// more results might be available.
16644func (c *LocationsBucketsViewsListCall) PageSize(pageSize int64) *LocationsBucketsViewsListCall {
16645	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
16646	return c
16647}
16648
16649// PageToken sets the optional parameter "pageToken": If present, then
16650// retrieve the next batch of results from the preceding call to this
16651// method. pageToken must be the value of nextPageToken from the
16652// previous response. The values of other method parameters should be
16653// identical to those in the previous call.
16654func (c *LocationsBucketsViewsListCall) PageToken(pageToken string) *LocationsBucketsViewsListCall {
16655	c.urlParams_.Set("pageToken", pageToken)
16656	return c
16657}
16658
16659// Fields allows partial responses to be retrieved. See
16660// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
16661// for more information.
16662func (c *LocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsListCall {
16663	c.urlParams_.Set("fields", googleapi.CombineFields(s))
16664	return c
16665}
16666
16667// IfNoneMatch sets the optional parameter which makes the operation
16668// fail if the object's ETag matches the given value. This is useful for
16669// getting updates only after the object has changed since the last
16670// request. Use googleapi.IsNotModified to check whether the response
16671// error from Do is the result of In-None-Match.
16672func (c *LocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *LocationsBucketsViewsListCall {
16673	c.ifNoneMatch_ = entityTag
16674	return c
16675}
16676
16677// Context sets the context to be used in this call's Do method. Any
16678// pending HTTP request will be aborted if the provided context is
16679// canceled.
16680func (c *LocationsBucketsViewsListCall) Context(ctx context.Context) *LocationsBucketsViewsListCall {
16681	c.ctx_ = ctx
16682	return c
16683}
16684
16685// Header returns an http.Header that can be modified by the caller to
16686// add HTTP headers to the request.
16687func (c *LocationsBucketsViewsListCall) Header() http.Header {
16688	if c.header_ == nil {
16689		c.header_ = make(http.Header)
16690	}
16691	return c.header_
16692}
16693
16694func (c *LocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) {
16695	reqHeaders := make(http.Header)
16696	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
16697	for k, v := range c.header_ {
16698		reqHeaders[k] = v
16699	}
16700	reqHeaders.Set("User-Agent", c.s.userAgent())
16701	if c.ifNoneMatch_ != "" {
16702		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
16703	}
16704	var body io.Reader = nil
16705	c.urlParams_.Set("alt", alt)
16706	c.urlParams_.Set("prettyPrint", "false")
16707	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
16708	urls += "?" + c.urlParams_.Encode()
16709	req, err := http.NewRequest("GET", urls, body)
16710	if err != nil {
16711		return nil, err
16712	}
16713	req.Header = reqHeaders
16714	googleapi.Expand(req.URL, map[string]string{
16715		"parent": c.parent,
16716	})
16717	return gensupport.SendRequest(c.ctx_, c.s.client, req)
16718}
16719
16720// Do executes the "logging.locations.buckets.views.list" call.
16721// Exactly one of *ListViewsResponse or error will be non-nil. Any
16722// non-2xx status code is an error. Response headers are in either
16723// *ListViewsResponse.ServerResponse.Header or (if a response was
16724// returned at all) in error.(*googleapi.Error).Header. Use
16725// googleapi.IsNotModified to check whether the returned error was
16726// because http.StatusNotModified was returned.
16727func (c *LocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) {
16728	gensupport.SetOptions(c.urlParams_, opts...)
16729	res, err := c.doRequest("json")
16730	if res != nil && res.StatusCode == http.StatusNotModified {
16731		if res.Body != nil {
16732			res.Body.Close()
16733		}
16734		return nil, &googleapi.Error{
16735			Code:   res.StatusCode,
16736			Header: res.Header,
16737		}
16738	}
16739	if err != nil {
16740		return nil, err
16741	}
16742	defer googleapi.CloseBody(res)
16743	if err := googleapi.CheckResponse(res); err != nil {
16744		return nil, err
16745	}
16746	ret := &ListViewsResponse{
16747		ServerResponse: googleapi.ServerResponse{
16748			Header:         res.Header,
16749			HTTPStatusCode: res.StatusCode,
16750		},
16751	}
16752	target := &ret
16753	if err := gensupport.DecodeResponse(target, res); err != nil {
16754		return nil, err
16755	}
16756	return ret, nil
16757	// {
16758	//   "description": "Lists views on a log bucket.",
16759	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views",
16760	//   "httpMethod": "GET",
16761	//   "id": "logging.locations.buckets.views.list",
16762	//   "parameterOrder": [
16763	//     "parent"
16764	//   ],
16765	//   "parameters": {
16766	//     "pageSize": {
16767	//       "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.",
16768	//       "format": "int32",
16769	//       "location": "query",
16770	//       "type": "integer"
16771	//     },
16772	//     "pageToken": {
16773	//       "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.",
16774	//       "location": "query",
16775	//       "type": "string"
16776	//     },
16777	//     "parent": {
16778	//       "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ",
16779	//       "location": "path",
16780	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+$",
16781	//       "required": true,
16782	//       "type": "string"
16783	//     }
16784	//   },
16785	//   "path": "v2/{+parent}/views",
16786	//   "response": {
16787	//     "$ref": "ListViewsResponse"
16788	//   },
16789	//   "scopes": [
16790	//     "https://www.googleapis.com/auth/cloud-platform",
16791	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
16792	//     "https://www.googleapis.com/auth/logging.admin",
16793	//     "https://www.googleapis.com/auth/logging.read"
16794	//   ]
16795	// }
16796
16797}
16798
16799// Pages invokes f for each page of results.
16800// A non-nil error returned from f will halt the iteration.
16801// The provided context supersedes any context provided to the Context method.
16802func (c *LocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error {
16803	c.ctx_ = ctx
16804	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
16805	for {
16806		x, err := c.Do()
16807		if err != nil {
16808			return err
16809		}
16810		if err := f(x); err != nil {
16811			return err
16812		}
16813		if x.NextPageToken == "" {
16814			return nil
16815		}
16816		c.PageToken(x.NextPageToken)
16817	}
16818}
16819
16820// method id "logging.locations.buckets.views.patch":
16821
16822type LocationsBucketsViewsPatchCall struct {
16823	s          *Service
16824	name       string
16825	logview    *LogView
16826	urlParams_ gensupport.URLParams
16827	ctx_       context.Context
16828	header_    http.Header
16829}
16830
16831// Patch: Updates a view on a log bucket. This method replaces the
16832// following fields in the existing view with values from the new view:
16833// filter. If an UNAVAILABLE error is returned, this indicates that
16834// system is not in a state where it can update the view. If this
16835// occurs, please try again in a few minutes.
16836//
16837// - name: The full resource name of the view to update
16838//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
16839//   iews/[VIEW_ID]" For
16840//   example:"projects/my-project/locations/global/buckets/my-bucket/view
16841//   s/my-view".
16842func (r *LocationsBucketsViewsService) Patch(name string, logview *LogView) *LocationsBucketsViewsPatchCall {
16843	c := &LocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
16844	c.name = name
16845	c.logview = logview
16846	return c
16847}
16848
16849// UpdateMask sets the optional parameter "updateMask": Field mask that
16850// specifies the fields in view that need an update. A field will be
16851// overwritten if, and only if, it is in the update mask. name and
16852// output only fields cannot be updated.For a detailed FieldMask
16853// definition, see
16854// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor
16855// example: updateMask=filter
16856func (c *LocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *LocationsBucketsViewsPatchCall {
16857	c.urlParams_.Set("updateMask", updateMask)
16858	return c
16859}
16860
16861// Fields allows partial responses to be retrieved. See
16862// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
16863// for more information.
16864func (c *LocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *LocationsBucketsViewsPatchCall {
16865	c.urlParams_.Set("fields", googleapi.CombineFields(s))
16866	return c
16867}
16868
16869// Context sets the context to be used in this call's Do method. Any
16870// pending HTTP request will be aborted if the provided context is
16871// canceled.
16872func (c *LocationsBucketsViewsPatchCall) Context(ctx context.Context) *LocationsBucketsViewsPatchCall {
16873	c.ctx_ = ctx
16874	return c
16875}
16876
16877// Header returns an http.Header that can be modified by the caller to
16878// add HTTP headers to the request.
16879func (c *LocationsBucketsViewsPatchCall) Header() http.Header {
16880	if c.header_ == nil {
16881		c.header_ = make(http.Header)
16882	}
16883	return c.header_
16884}
16885
16886func (c *LocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) {
16887	reqHeaders := make(http.Header)
16888	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
16889	for k, v := range c.header_ {
16890		reqHeaders[k] = v
16891	}
16892	reqHeaders.Set("User-Agent", c.s.userAgent())
16893	var body io.Reader = nil
16894	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
16895	if err != nil {
16896		return nil, err
16897	}
16898	reqHeaders.Set("Content-Type", "application/json")
16899	c.urlParams_.Set("alt", alt)
16900	c.urlParams_.Set("prettyPrint", "false")
16901	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
16902	urls += "?" + c.urlParams_.Encode()
16903	req, err := http.NewRequest("PATCH", urls, body)
16904	if err != nil {
16905		return nil, err
16906	}
16907	req.Header = reqHeaders
16908	googleapi.Expand(req.URL, map[string]string{
16909		"name": c.name,
16910	})
16911	return gensupport.SendRequest(c.ctx_, c.s.client, req)
16912}
16913
16914// Do executes the "logging.locations.buckets.views.patch" call.
16915// Exactly one of *LogView or error will be non-nil. Any non-2xx status
16916// code is an error. Response headers are in either
16917// *LogView.ServerResponse.Header or (if a response was returned at all)
16918// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
16919// check whether the returned error was because http.StatusNotModified
16920// was returned.
16921func (c *LocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
16922	gensupport.SetOptions(c.urlParams_, opts...)
16923	res, err := c.doRequest("json")
16924	if res != nil && res.StatusCode == http.StatusNotModified {
16925		if res.Body != nil {
16926			res.Body.Close()
16927		}
16928		return nil, &googleapi.Error{
16929			Code:   res.StatusCode,
16930			Header: res.Header,
16931		}
16932	}
16933	if err != nil {
16934		return nil, err
16935	}
16936	defer googleapi.CloseBody(res)
16937	if err := googleapi.CheckResponse(res); err != nil {
16938		return nil, err
16939	}
16940	ret := &LogView{
16941		ServerResponse: googleapi.ServerResponse{
16942			Header:         res.Header,
16943			HTTPStatusCode: res.StatusCode,
16944		},
16945	}
16946	target := &ret
16947	if err := gensupport.DecodeResponse(target, res); err != nil {
16948		return nil, err
16949	}
16950	return ret, nil
16951	// {
16952	//   "description": "Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: filter. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.",
16953	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
16954	//   "httpMethod": "PATCH",
16955	//   "id": "logging.locations.buckets.views.patch",
16956	//   "parameterOrder": [
16957	//     "name"
16958	//   ],
16959	//   "parameters": {
16960	//     "name": {
16961	//       "description": "Required. The full resource name of the view to update \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"",
16962	//       "location": "path",
16963	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
16964	//       "required": true,
16965	//       "type": "string"
16966	//     },
16967	//     "updateMask": {
16968	//       "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.FieldMaskFor example: updateMask=filter",
16969	//       "format": "google-fieldmask",
16970	//       "location": "query",
16971	//       "type": "string"
16972	//     }
16973	//   },
16974	//   "path": "v2/{+name}",
16975	//   "request": {
16976	//     "$ref": "LogView"
16977	//   },
16978	//   "response": {
16979	//     "$ref": "LogView"
16980	//   },
16981	//   "scopes": [
16982	//     "https://www.googleapis.com/auth/cloud-platform",
16983	//     "https://www.googleapis.com/auth/logging.admin"
16984	//   ]
16985	// }
16986
16987}
16988
16989// method id "logging.locations.operations.cancel":
16990
16991type LocationsOperationsCancelCall struct {
16992	s                      *Service
16993	name                   string
16994	canceloperationrequest *CancelOperationRequest
16995	urlParams_             gensupport.URLParams
16996	ctx_                   context.Context
16997	header_                http.Header
16998}
16999
17000// Cancel: Starts asynchronous cancellation on a long-running operation.
17001// The server makes a best effort to cancel the operation, but success
17002// is not guaranteed. If the server doesn't support this method, it
17003// returns google.rpc.Code.UNIMPLEMENTED. Clients can use
17004// Operations.GetOperation or other methods to check whether the
17005// cancellation succeeded or whether the operation completed despite
17006// cancellation. On successful cancellation, the operation is not
17007// deleted; instead, it becomes an operation with an Operation.error
17008// value with a google.rpc.Status.code of 1, corresponding to
17009// Code.CANCELLED.
17010//
17011// - name: The name of the operation resource to be cancelled.
17012func (r *LocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *LocationsOperationsCancelCall {
17013	c := &LocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
17014	c.name = name
17015	c.canceloperationrequest = canceloperationrequest
17016	return c
17017}
17018
17019// Fields allows partial responses to be retrieved. See
17020// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
17021// for more information.
17022func (c *LocationsOperationsCancelCall) Fields(s ...googleapi.Field) *LocationsOperationsCancelCall {
17023	c.urlParams_.Set("fields", googleapi.CombineFields(s))
17024	return c
17025}
17026
17027// Context sets the context to be used in this call's Do method. Any
17028// pending HTTP request will be aborted if the provided context is
17029// canceled.
17030func (c *LocationsOperationsCancelCall) Context(ctx context.Context) *LocationsOperationsCancelCall {
17031	c.ctx_ = ctx
17032	return c
17033}
17034
17035// Header returns an http.Header that can be modified by the caller to
17036// add HTTP headers to the request.
17037func (c *LocationsOperationsCancelCall) Header() http.Header {
17038	if c.header_ == nil {
17039		c.header_ = make(http.Header)
17040	}
17041	return c.header_
17042}
17043
17044func (c *LocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
17045	reqHeaders := make(http.Header)
17046	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
17047	for k, v := range c.header_ {
17048		reqHeaders[k] = v
17049	}
17050	reqHeaders.Set("User-Agent", c.s.userAgent())
17051	var body io.Reader = nil
17052	body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
17053	if err != nil {
17054		return nil, err
17055	}
17056	reqHeaders.Set("Content-Type", "application/json")
17057	c.urlParams_.Set("alt", alt)
17058	c.urlParams_.Set("prettyPrint", "false")
17059	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel")
17060	urls += "?" + c.urlParams_.Encode()
17061	req, err := http.NewRequest("POST", urls, body)
17062	if err != nil {
17063		return nil, err
17064	}
17065	req.Header = reqHeaders
17066	googleapi.Expand(req.URL, map[string]string{
17067		"name": c.name,
17068	})
17069	return gensupport.SendRequest(c.ctx_, c.s.client, req)
17070}
17071
17072// Do executes the "logging.locations.operations.cancel" call.
17073// Exactly one of *Empty or error will be non-nil. Any non-2xx status
17074// code is an error. Response headers are in either
17075// *Empty.ServerResponse.Header or (if a response was returned at all)
17076// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
17077// check whether the returned error was because http.StatusNotModified
17078// was returned.
17079func (c *LocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
17080	gensupport.SetOptions(c.urlParams_, opts...)
17081	res, err := c.doRequest("json")
17082	if res != nil && res.StatusCode == http.StatusNotModified {
17083		if res.Body != nil {
17084			res.Body.Close()
17085		}
17086		return nil, &googleapi.Error{
17087			Code:   res.StatusCode,
17088			Header: res.Header,
17089		}
17090	}
17091	if err != nil {
17092		return nil, err
17093	}
17094	defer googleapi.CloseBody(res)
17095	if err := googleapi.CheckResponse(res); err != nil {
17096		return nil, err
17097	}
17098	ret := &Empty{
17099		ServerResponse: googleapi.ServerResponse{
17100			Header:         res.Header,
17101			HTTPStatusCode: res.StatusCode,
17102		},
17103	}
17104	target := &ret
17105	if err := gensupport.DecodeResponse(target, res); err != nil {
17106		return nil, err
17107	}
17108	return ret, nil
17109	// {
17110	//   "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.",
17111	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/operations/{operationsId}:cancel",
17112	//   "httpMethod": "POST",
17113	//   "id": "logging.locations.operations.cancel",
17114	//   "parameterOrder": [
17115	//     "name"
17116	//   ],
17117	//   "parameters": {
17118	//     "name": {
17119	//       "description": "The name of the operation resource to be cancelled.",
17120	//       "location": "path",
17121	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/operations/[^/]+$",
17122	//       "required": true,
17123	//       "type": "string"
17124	//     }
17125	//   },
17126	//   "path": "v2/{+name}:cancel",
17127	//   "request": {
17128	//     "$ref": "CancelOperationRequest"
17129	//   },
17130	//   "response": {
17131	//     "$ref": "Empty"
17132	//   },
17133	//   "scopes": [
17134	//     "https://www.googleapis.com/auth/cloud-platform",
17135	//     "https://www.googleapis.com/auth/logging.admin"
17136	//   ]
17137	// }
17138
17139}
17140
17141// method id "logging.locations.operations.get":
17142
17143type LocationsOperationsGetCall struct {
17144	s            *Service
17145	name         string
17146	urlParams_   gensupport.URLParams
17147	ifNoneMatch_ string
17148	ctx_         context.Context
17149	header_      http.Header
17150}
17151
17152// Get: Gets the latest state of a long-running operation. Clients can
17153// use this method to poll the operation result at intervals as
17154// recommended by the API service.
17155//
17156// - name: The name of the operation resource.
17157func (r *LocationsOperationsService) Get(name string) *LocationsOperationsGetCall {
17158	c := &LocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
17159	c.name = name
17160	return c
17161}
17162
17163// Fields allows partial responses to be retrieved. See
17164// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
17165// for more information.
17166func (c *LocationsOperationsGetCall) Fields(s ...googleapi.Field) *LocationsOperationsGetCall {
17167	c.urlParams_.Set("fields", googleapi.CombineFields(s))
17168	return c
17169}
17170
17171// IfNoneMatch sets the optional parameter which makes the operation
17172// fail if the object's ETag matches the given value. This is useful for
17173// getting updates only after the object has changed since the last
17174// request. Use googleapi.IsNotModified to check whether the response
17175// error from Do is the result of In-None-Match.
17176func (c *LocationsOperationsGetCall) IfNoneMatch(entityTag string) *LocationsOperationsGetCall {
17177	c.ifNoneMatch_ = entityTag
17178	return c
17179}
17180
17181// Context sets the context to be used in this call's Do method. Any
17182// pending HTTP request will be aborted if the provided context is
17183// canceled.
17184func (c *LocationsOperationsGetCall) Context(ctx context.Context) *LocationsOperationsGetCall {
17185	c.ctx_ = ctx
17186	return c
17187}
17188
17189// Header returns an http.Header that can be modified by the caller to
17190// add HTTP headers to the request.
17191func (c *LocationsOperationsGetCall) Header() http.Header {
17192	if c.header_ == nil {
17193		c.header_ = make(http.Header)
17194	}
17195	return c.header_
17196}
17197
17198func (c *LocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
17199	reqHeaders := make(http.Header)
17200	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
17201	for k, v := range c.header_ {
17202		reqHeaders[k] = v
17203	}
17204	reqHeaders.Set("User-Agent", c.s.userAgent())
17205	if c.ifNoneMatch_ != "" {
17206		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
17207	}
17208	var body io.Reader = nil
17209	c.urlParams_.Set("alt", alt)
17210	c.urlParams_.Set("prettyPrint", "false")
17211	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
17212	urls += "?" + c.urlParams_.Encode()
17213	req, err := http.NewRequest("GET", urls, body)
17214	if err != nil {
17215		return nil, err
17216	}
17217	req.Header = reqHeaders
17218	googleapi.Expand(req.URL, map[string]string{
17219		"name": c.name,
17220	})
17221	return gensupport.SendRequest(c.ctx_, c.s.client, req)
17222}
17223
17224// Do executes the "logging.locations.operations.get" call.
17225// Exactly one of *Operation or error will be non-nil. Any non-2xx
17226// status code is an error. Response headers are in either
17227// *Operation.ServerResponse.Header or (if a response was returned at
17228// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
17229// to check whether the returned error was because
17230// http.StatusNotModified was returned.
17231func (c *LocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
17232	gensupport.SetOptions(c.urlParams_, opts...)
17233	res, err := c.doRequest("json")
17234	if res != nil && res.StatusCode == http.StatusNotModified {
17235		if res.Body != nil {
17236			res.Body.Close()
17237		}
17238		return nil, &googleapi.Error{
17239			Code:   res.StatusCode,
17240			Header: res.Header,
17241		}
17242	}
17243	if err != nil {
17244		return nil, err
17245	}
17246	defer googleapi.CloseBody(res)
17247	if err := googleapi.CheckResponse(res); err != nil {
17248		return nil, err
17249	}
17250	ret := &Operation{
17251		ServerResponse: googleapi.ServerResponse{
17252			Header:         res.Header,
17253			HTTPStatusCode: res.StatusCode,
17254		},
17255	}
17256	target := &ret
17257	if err := gensupport.DecodeResponse(target, res); err != nil {
17258		return nil, err
17259	}
17260	return ret, nil
17261	// {
17262	//   "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.",
17263	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/operations/{operationsId}",
17264	//   "httpMethod": "GET",
17265	//   "id": "logging.locations.operations.get",
17266	//   "parameterOrder": [
17267	//     "name"
17268	//   ],
17269	//   "parameters": {
17270	//     "name": {
17271	//       "description": "The name of the operation resource.",
17272	//       "location": "path",
17273	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+/operations/[^/]+$",
17274	//       "required": true,
17275	//       "type": "string"
17276	//     }
17277	//   },
17278	//   "path": "v2/{+name}",
17279	//   "response": {
17280	//     "$ref": "Operation"
17281	//   },
17282	//   "scopes": [
17283	//     "https://www.googleapis.com/auth/cloud-platform",
17284	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
17285	//     "https://www.googleapis.com/auth/logging.admin",
17286	//     "https://www.googleapis.com/auth/logging.read"
17287	//   ]
17288	// }
17289
17290}
17291
17292// method id "logging.locations.operations.list":
17293
17294type LocationsOperationsListCall struct {
17295	s            *Service
17296	name         string
17297	urlParams_   gensupport.URLParams
17298	ifNoneMatch_ string
17299	ctx_         context.Context
17300	header_      http.Header
17301}
17302
17303// List: Lists operations that match the specified filter in the
17304// request. If the server doesn't support this method, it returns
17305// UNIMPLEMENTED.NOTE: the name binding allows API services to override
17306// the binding to use different resource name schemes, such as
17307// users/*/operations. To override the binding, API services can add a
17308// binding such as "/v1/{name=users/*}/operations" to their service
17309// configuration. For backwards compatibility, the default name includes
17310// the operations collection id, however overriding users must ensure
17311// the name binding is the parent resource, without the operations
17312// collection id.
17313//
17314// - name: The name of the operation's parent resource.
17315func (r *LocationsOperationsService) List(name string) *LocationsOperationsListCall {
17316	c := &LocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
17317	c.name = name
17318	return c
17319}
17320
17321// Filter sets the optional parameter "filter": The standard list
17322// filter.
17323func (c *LocationsOperationsListCall) Filter(filter string) *LocationsOperationsListCall {
17324	c.urlParams_.Set("filter", filter)
17325	return c
17326}
17327
17328// PageSize sets the optional parameter "pageSize": The standard list
17329// page size.
17330func (c *LocationsOperationsListCall) PageSize(pageSize int64) *LocationsOperationsListCall {
17331	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
17332	return c
17333}
17334
17335// PageToken sets the optional parameter "pageToken": The standard list
17336// page token.
17337func (c *LocationsOperationsListCall) PageToken(pageToken string) *LocationsOperationsListCall {
17338	c.urlParams_.Set("pageToken", pageToken)
17339	return c
17340}
17341
17342// Fields allows partial responses to be retrieved. See
17343// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
17344// for more information.
17345func (c *LocationsOperationsListCall) Fields(s ...googleapi.Field) *LocationsOperationsListCall {
17346	c.urlParams_.Set("fields", googleapi.CombineFields(s))
17347	return c
17348}
17349
17350// IfNoneMatch sets the optional parameter which makes the operation
17351// fail if the object's ETag matches the given value. This is useful for
17352// getting updates only after the object has changed since the last
17353// request. Use googleapi.IsNotModified to check whether the response
17354// error from Do is the result of In-None-Match.
17355func (c *LocationsOperationsListCall) IfNoneMatch(entityTag string) *LocationsOperationsListCall {
17356	c.ifNoneMatch_ = entityTag
17357	return c
17358}
17359
17360// Context sets the context to be used in this call's Do method. Any
17361// pending HTTP request will be aborted if the provided context is
17362// canceled.
17363func (c *LocationsOperationsListCall) Context(ctx context.Context) *LocationsOperationsListCall {
17364	c.ctx_ = ctx
17365	return c
17366}
17367
17368// Header returns an http.Header that can be modified by the caller to
17369// add HTTP headers to the request.
17370func (c *LocationsOperationsListCall) Header() http.Header {
17371	if c.header_ == nil {
17372		c.header_ = make(http.Header)
17373	}
17374	return c.header_
17375}
17376
17377func (c *LocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
17378	reqHeaders := make(http.Header)
17379	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
17380	for k, v := range c.header_ {
17381		reqHeaders[k] = v
17382	}
17383	reqHeaders.Set("User-Agent", c.s.userAgent())
17384	if c.ifNoneMatch_ != "" {
17385		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
17386	}
17387	var body io.Reader = nil
17388	c.urlParams_.Set("alt", alt)
17389	c.urlParams_.Set("prettyPrint", "false")
17390	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations")
17391	urls += "?" + c.urlParams_.Encode()
17392	req, err := http.NewRequest("GET", urls, body)
17393	if err != nil {
17394		return nil, err
17395	}
17396	req.Header = reqHeaders
17397	googleapi.Expand(req.URL, map[string]string{
17398		"name": c.name,
17399	})
17400	return gensupport.SendRequest(c.ctx_, c.s.client, req)
17401}
17402
17403// Do executes the "logging.locations.operations.list" call.
17404// Exactly one of *ListOperationsResponse or error will be non-nil. Any
17405// non-2xx status code is an error. Response headers are in either
17406// *ListOperationsResponse.ServerResponse.Header or (if a response was
17407// returned at all) in error.(*googleapi.Error).Header. Use
17408// googleapi.IsNotModified to check whether the returned error was
17409// because http.StatusNotModified was returned.
17410func (c *LocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
17411	gensupport.SetOptions(c.urlParams_, opts...)
17412	res, err := c.doRequest("json")
17413	if res != nil && res.StatusCode == http.StatusNotModified {
17414		if res.Body != nil {
17415			res.Body.Close()
17416		}
17417		return nil, &googleapi.Error{
17418			Code:   res.StatusCode,
17419			Header: res.Header,
17420		}
17421	}
17422	if err != nil {
17423		return nil, err
17424	}
17425	defer googleapi.CloseBody(res)
17426	if err := googleapi.CheckResponse(res); err != nil {
17427		return nil, err
17428	}
17429	ret := &ListOperationsResponse{
17430		ServerResponse: googleapi.ServerResponse{
17431			Header:         res.Header,
17432			HTTPStatusCode: res.StatusCode,
17433		},
17434	}
17435	target := &ret
17436	if err := gensupport.DecodeResponse(target, res); err != nil {
17437		return nil, err
17438	}
17439	return ret, nil
17440	// {
17441	//   "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as \"/v1/{name=users/*}/operations\" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.",
17442	//   "flatPath": "v2/{v2Id}/{v2Id1}/locations/{locationsId}/operations",
17443	//   "httpMethod": "GET",
17444	//   "id": "logging.locations.operations.list",
17445	//   "parameterOrder": [
17446	//     "name"
17447	//   ],
17448	//   "parameters": {
17449	//     "filter": {
17450	//       "description": "The standard list filter.",
17451	//       "location": "query",
17452	//       "type": "string"
17453	//     },
17454	//     "name": {
17455	//       "description": "The name of the operation's parent resource.",
17456	//       "location": "path",
17457	//       "pattern": "^[^/]+/[^/]+/locations/[^/]+$",
17458	//       "required": true,
17459	//       "type": "string"
17460	//     },
17461	//     "pageSize": {
17462	//       "description": "The standard list page size.",
17463	//       "format": "int32",
17464	//       "location": "query",
17465	//       "type": "integer"
17466	//     },
17467	//     "pageToken": {
17468	//       "description": "The standard list page token.",
17469	//       "location": "query",
17470	//       "type": "string"
17471	//     }
17472	//   },
17473	//   "path": "v2/{+name}/operations",
17474	//   "response": {
17475	//     "$ref": "ListOperationsResponse"
17476	//   },
17477	//   "scopes": [
17478	//     "https://www.googleapis.com/auth/cloud-platform",
17479	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
17480	//     "https://www.googleapis.com/auth/logging.admin",
17481	//     "https://www.googleapis.com/auth/logging.read"
17482	//   ]
17483	// }
17484
17485}
17486
17487// Pages invokes f for each page of results.
17488// A non-nil error returned from f will halt the iteration.
17489// The provided context supersedes any context provided to the Context method.
17490func (c *LocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
17491	c.ctx_ = ctx
17492	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
17493	for {
17494		x, err := c.Do()
17495		if err != nil {
17496			return err
17497		}
17498		if err := f(x); err != nil {
17499			return err
17500		}
17501		if x.NextPageToken == "" {
17502			return nil
17503		}
17504		c.PageToken(x.NextPageToken)
17505	}
17506}
17507
17508// method id "logging.logs.delete":
17509
17510type LogsDeleteCall struct {
17511	s          *Service
17512	logName    string
17513	urlParams_ gensupport.URLParams
17514	ctx_       context.Context
17515	header_    http.Header
17516}
17517
17518// Delete: Deletes all the log entries in a log for the _Default Log
17519// Bucket. The log reappears if it receives new entries. Log entries
17520// written shortly before the delete operation might not be deleted.
17521// Entries received after the delete operation with a timestamp before
17522// the operation will be deleted.
17523//
17524// - logName: The resource name of the log to delete:
17525//   projects/[PROJECT_ID]/logs/[LOG_ID]
17526//   organizations/[ORGANIZATION_ID]/logs/[LOG_ID]
17527//   billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]
17528//   folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For
17529//   example, "projects/my-project-id/logs/syslog",
17530//   "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For
17531//   more information about log names, see LogEntry.
17532func (r *LogsService) Delete(logName string) *LogsDeleteCall {
17533	c := &LogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
17534	c.logName = logName
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 *LogsDeleteCall) Fields(s ...googleapi.Field) *LogsDeleteCall {
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 *LogsDeleteCall) Context(ctx context.Context) *LogsDeleteCall {
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 *LogsDeleteCall) Header() http.Header {
17557	if c.header_ == nil {
17558		c.header_ = make(http.Header)
17559	}
17560	return c.header_
17561}
17562
17563func (c *LogsDeleteCall) doRequest(alt string) (*http.Response, error) {
17564	reqHeaders := make(http.Header)
17565	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
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	c.urlParams_.Set("alt", alt)
17572	c.urlParams_.Set("prettyPrint", "false")
17573	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}")
17574	urls += "?" + c.urlParams_.Encode()
17575	req, err := http.NewRequest("DELETE", urls, body)
17576	if err != nil {
17577		return nil, err
17578	}
17579	req.Header = reqHeaders
17580	googleapi.Expand(req.URL, map[string]string{
17581		"logName": c.logName,
17582	})
17583	return gensupport.SendRequest(c.ctx_, c.s.client, req)
17584}
17585
17586// Do executes the "logging.logs.delete" call.
17587// Exactly one of *Empty or error will be non-nil. Any non-2xx status
17588// code is an error. Response headers are in either
17589// *Empty.ServerResponse.Header or (if a response was returned at all)
17590// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
17591// check whether the returned error was because http.StatusNotModified
17592// was returned.
17593func (c *LogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
17594	gensupport.SetOptions(c.urlParams_, opts...)
17595	res, err := c.doRequest("json")
17596	if res != nil && res.StatusCode == http.StatusNotModified {
17597		if res.Body != nil {
17598			res.Body.Close()
17599		}
17600		return nil, &googleapi.Error{
17601			Code:   res.StatusCode,
17602			Header: res.Header,
17603		}
17604	}
17605	if err != nil {
17606		return nil, err
17607	}
17608	defer googleapi.CloseBody(res)
17609	if err := googleapi.CheckResponse(res); err != nil {
17610		return nil, err
17611	}
17612	ret := &Empty{
17613		ServerResponse: googleapi.ServerResponse{
17614			Header:         res.Header,
17615			HTTPStatusCode: res.StatusCode,
17616		},
17617	}
17618	target := &ret
17619	if err := gensupport.DecodeResponse(target, res); err != nil {
17620		return nil, err
17621	}
17622	return ret, nil
17623	// {
17624	//   "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.",
17625	//   "flatPath": "v2/{v2Id}/{v2Id1}/logs/{logsId}",
17626	//   "httpMethod": "DELETE",
17627	//   "id": "logging.logs.delete",
17628	//   "parameterOrder": [
17629	//     "logName"
17630	//   ],
17631	//   "parameters": {
17632	//     "logName": {
17633	//       "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.",
17634	//       "location": "path",
17635	//       "pattern": "^[^/]+/[^/]+/logs/[^/]+$",
17636	//       "required": true,
17637	//       "type": "string"
17638	//     }
17639	//   },
17640	//   "path": "v2/{+logName}",
17641	//   "response": {
17642	//     "$ref": "Empty"
17643	//   },
17644	//   "scopes": [
17645	//     "https://www.googleapis.com/auth/cloud-platform",
17646	//     "https://www.googleapis.com/auth/logging.admin"
17647	//   ]
17648	// }
17649
17650}
17651
17652// method id "logging.logs.list":
17653
17654type LogsListCall struct {
17655	s            *Service
17656	parent       string
17657	urlParams_   gensupport.URLParams
17658	ifNoneMatch_ string
17659	ctx_         context.Context
17660	header_      http.Header
17661}
17662
17663// List: Lists the logs in projects, organizations, folders, or billing
17664// accounts. Only logs that have entries are listed.
17665//
17666// - parent: The resource name that owns the logs: projects/[PROJECT_ID]
17667//   organizations/[ORGANIZATION_ID]
17668//   billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID].
17669func (r *LogsService) List(parent string) *LogsListCall {
17670	c := &LogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
17671	c.parent = parent
17672	return c
17673}
17674
17675// PageSize sets the optional parameter "pageSize": The maximum number
17676// of results to return from this request. Non-positive values are
17677// ignored. The presence of nextPageToken in the response indicates that
17678// more results might be available.
17679func (c *LogsListCall) PageSize(pageSize int64) *LogsListCall {
17680	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
17681	return c
17682}
17683
17684// PageToken sets the optional parameter "pageToken": If present, then
17685// retrieve the next batch of results from the preceding call to this
17686// method. pageToken must be the value of nextPageToken from the
17687// previous response. The values of other method parameters should be
17688// identical to those in the previous call.
17689func (c *LogsListCall) PageToken(pageToken string) *LogsListCall {
17690	c.urlParams_.Set("pageToken", pageToken)
17691	return c
17692}
17693
17694// ResourceNames sets the optional parameter "resourceNames": The
17695// resource name that owns the logs:
17696// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view
17697// s/[VIEW_ID]
17698// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE
17699// T_ID]/views/[VIEW_ID]
17700// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[
17701// BUCKET_ID]/views/[VIEW_ID]
17702// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/
17703// [VIEW_ID]To support legacy queries, it could also be:
17704// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID]
17705// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]
17706func (c *LogsListCall) ResourceNames(resourceNames ...string) *LogsListCall {
17707	c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...))
17708	return c
17709}
17710
17711// Fields allows partial responses to be retrieved. See
17712// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
17713// for more information.
17714func (c *LogsListCall) Fields(s ...googleapi.Field) *LogsListCall {
17715	c.urlParams_.Set("fields", googleapi.CombineFields(s))
17716	return c
17717}
17718
17719// IfNoneMatch sets the optional parameter which makes the operation
17720// fail if the object's ETag matches the given value. This is useful for
17721// getting updates only after the object has changed since the last
17722// request. Use googleapi.IsNotModified to check whether the response
17723// error from Do is the result of In-None-Match.
17724func (c *LogsListCall) IfNoneMatch(entityTag string) *LogsListCall {
17725	c.ifNoneMatch_ = entityTag
17726	return c
17727}
17728
17729// Context sets the context to be used in this call's Do method. Any
17730// pending HTTP request will be aborted if the provided context is
17731// canceled.
17732func (c *LogsListCall) Context(ctx context.Context) *LogsListCall {
17733	c.ctx_ = ctx
17734	return c
17735}
17736
17737// Header returns an http.Header that can be modified by the caller to
17738// add HTTP headers to the request.
17739func (c *LogsListCall) Header() http.Header {
17740	if c.header_ == nil {
17741		c.header_ = make(http.Header)
17742	}
17743	return c.header_
17744}
17745
17746func (c *LogsListCall) doRequest(alt string) (*http.Response, error) {
17747	reqHeaders := make(http.Header)
17748	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
17749	for k, v := range c.header_ {
17750		reqHeaders[k] = v
17751	}
17752	reqHeaders.Set("User-Agent", c.s.userAgent())
17753	if c.ifNoneMatch_ != "" {
17754		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
17755	}
17756	var body io.Reader = nil
17757	c.urlParams_.Set("alt", alt)
17758	c.urlParams_.Set("prettyPrint", "false")
17759	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs")
17760	urls += "?" + c.urlParams_.Encode()
17761	req, err := http.NewRequest("GET", urls, body)
17762	if err != nil {
17763		return nil, err
17764	}
17765	req.Header = reqHeaders
17766	googleapi.Expand(req.URL, map[string]string{
17767		"parent": c.parent,
17768	})
17769	return gensupport.SendRequest(c.ctx_, c.s.client, req)
17770}
17771
17772// Do executes the "logging.logs.list" call.
17773// Exactly one of *ListLogsResponse or error will be non-nil. Any
17774// non-2xx status code is an error. Response headers are in either
17775// *ListLogsResponse.ServerResponse.Header or (if a response was
17776// returned at all) in error.(*googleapi.Error).Header. Use
17777// googleapi.IsNotModified to check whether the returned error was
17778// because http.StatusNotModified was returned.
17779func (c *LogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) {
17780	gensupport.SetOptions(c.urlParams_, opts...)
17781	res, err := c.doRequest("json")
17782	if res != nil && res.StatusCode == http.StatusNotModified {
17783		if res.Body != nil {
17784			res.Body.Close()
17785		}
17786		return nil, &googleapi.Error{
17787			Code:   res.StatusCode,
17788			Header: res.Header,
17789		}
17790	}
17791	if err != nil {
17792		return nil, err
17793	}
17794	defer googleapi.CloseBody(res)
17795	if err := googleapi.CheckResponse(res); err != nil {
17796		return nil, err
17797	}
17798	ret := &ListLogsResponse{
17799		ServerResponse: googleapi.ServerResponse{
17800			Header:         res.Header,
17801			HTTPStatusCode: res.StatusCode,
17802		},
17803	}
17804	target := &ret
17805	if err := gensupport.DecodeResponse(target, res); err != nil {
17806		return nil, err
17807	}
17808	return ret, nil
17809	// {
17810	//   "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.",
17811	//   "flatPath": "v2/{v2Id}/{v2Id1}/logs",
17812	//   "httpMethod": "GET",
17813	//   "id": "logging.logs.list",
17814	//   "parameterOrder": [
17815	//     "parent"
17816	//   ],
17817	//   "parameters": {
17818	//     "pageSize": {
17819	//       "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.",
17820	//       "format": "int32",
17821	//       "location": "query",
17822	//       "type": "integer"
17823	//     },
17824	//     "pageToken": {
17825	//       "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.",
17826	//       "location": "query",
17827	//       "type": "string"
17828	//     },
17829	//     "parent": {
17830	//       "description": "Required. The resource name that owns the logs: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]",
17831	//       "location": "path",
17832	//       "pattern": "^[^/]+/[^/]+$",
17833	//       "required": true,
17834	//       "type": "string"
17835	//     },
17836	//     "resourceNames": {
17837	//       "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]",
17838	//       "location": "query",
17839	//       "repeated": true,
17840	//       "type": "string"
17841	//     }
17842	//   },
17843	//   "path": "v2/{+parent}/logs",
17844	//   "response": {
17845	//     "$ref": "ListLogsResponse"
17846	//   },
17847	//   "scopes": [
17848	//     "https://www.googleapis.com/auth/cloud-platform",
17849	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
17850	//     "https://www.googleapis.com/auth/logging.admin",
17851	//     "https://www.googleapis.com/auth/logging.read"
17852	//   ]
17853	// }
17854
17855}
17856
17857// Pages invokes f for each page of results.
17858// A non-nil error returned from f will halt the iteration.
17859// The provided context supersedes any context provided to the Context method.
17860func (c *LogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error {
17861	c.ctx_ = ctx
17862	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
17863	for {
17864		x, err := c.Do()
17865		if err != nil {
17866			return err
17867		}
17868		if err := f(x); err != nil {
17869			return err
17870		}
17871		if x.NextPageToken == "" {
17872			return nil
17873		}
17874		c.PageToken(x.NextPageToken)
17875	}
17876}
17877
17878// method id "logging.monitoredResourceDescriptors.list":
17879
17880type MonitoredResourceDescriptorsListCall struct {
17881	s            *Service
17882	urlParams_   gensupport.URLParams
17883	ifNoneMatch_ string
17884	ctx_         context.Context
17885	header_      http.Header
17886}
17887
17888// List: Lists the descriptors for monitored resource types used by
17889// Logging.
17890func (r *MonitoredResourceDescriptorsService) List() *MonitoredResourceDescriptorsListCall {
17891	c := &MonitoredResourceDescriptorsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
17892	return c
17893}
17894
17895// PageSize sets the optional parameter "pageSize": The maximum number
17896// of results to return from this request. Non-positive values are
17897// ignored. The presence of nextPageToken in the response indicates that
17898// more results might be available.
17899func (c *MonitoredResourceDescriptorsListCall) PageSize(pageSize int64) *MonitoredResourceDescriptorsListCall {
17900	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
17901	return c
17902}
17903
17904// PageToken sets the optional parameter "pageToken": If present, then
17905// retrieve the next batch of results from the preceding call to this
17906// method. pageToken must be the value of nextPageToken from the
17907// previous response. The values of other method parameters should be
17908// identical to those in the previous call.
17909func (c *MonitoredResourceDescriptorsListCall) PageToken(pageToken string) *MonitoredResourceDescriptorsListCall {
17910	c.urlParams_.Set("pageToken", pageToken)
17911	return c
17912}
17913
17914// Fields allows partial responses to be retrieved. See
17915// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
17916// for more information.
17917func (c *MonitoredResourceDescriptorsListCall) Fields(s ...googleapi.Field) *MonitoredResourceDescriptorsListCall {
17918	c.urlParams_.Set("fields", googleapi.CombineFields(s))
17919	return c
17920}
17921
17922// IfNoneMatch sets the optional parameter which makes the operation
17923// fail if the object's ETag matches the given value. This is useful for
17924// getting updates only after the object has changed since the last
17925// request. Use googleapi.IsNotModified to check whether the response
17926// error from Do is the result of In-None-Match.
17927func (c *MonitoredResourceDescriptorsListCall) IfNoneMatch(entityTag string) *MonitoredResourceDescriptorsListCall {
17928	c.ifNoneMatch_ = entityTag
17929	return c
17930}
17931
17932// Context sets the context to be used in this call's Do method. Any
17933// pending HTTP request will be aborted if the provided context is
17934// canceled.
17935func (c *MonitoredResourceDescriptorsListCall) Context(ctx context.Context) *MonitoredResourceDescriptorsListCall {
17936	c.ctx_ = ctx
17937	return c
17938}
17939
17940// Header returns an http.Header that can be modified by the caller to
17941// add HTTP headers to the request.
17942func (c *MonitoredResourceDescriptorsListCall) Header() http.Header {
17943	if c.header_ == nil {
17944		c.header_ = make(http.Header)
17945	}
17946	return c.header_
17947}
17948
17949func (c *MonitoredResourceDescriptorsListCall) doRequest(alt string) (*http.Response, error) {
17950	reqHeaders := make(http.Header)
17951	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
17952	for k, v := range c.header_ {
17953		reqHeaders[k] = v
17954	}
17955	reqHeaders.Set("User-Agent", c.s.userAgent())
17956	if c.ifNoneMatch_ != "" {
17957		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
17958	}
17959	var body io.Reader = nil
17960	c.urlParams_.Set("alt", alt)
17961	c.urlParams_.Set("prettyPrint", "false")
17962	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/monitoredResourceDescriptors")
17963	urls += "?" + c.urlParams_.Encode()
17964	req, err := http.NewRequest("GET", urls, body)
17965	if err != nil {
17966		return nil, err
17967	}
17968	req.Header = reqHeaders
17969	return gensupport.SendRequest(c.ctx_, c.s.client, req)
17970}
17971
17972// Do executes the "logging.monitoredResourceDescriptors.list" call.
17973// Exactly one of *ListMonitoredResourceDescriptorsResponse or error
17974// will be non-nil. Any non-2xx status code is an error. Response
17975// headers are in either
17976// *ListMonitoredResourceDescriptorsResponse.ServerResponse.Header or
17977// (if a response was returned at all) in
17978// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
17979// whether the returned error was because http.StatusNotModified was
17980// returned.
17981func (c *MonitoredResourceDescriptorsListCall) Do(opts ...googleapi.CallOption) (*ListMonitoredResourceDescriptorsResponse, error) {
17982	gensupport.SetOptions(c.urlParams_, opts...)
17983	res, err := c.doRequest("json")
17984	if res != nil && res.StatusCode == http.StatusNotModified {
17985		if res.Body != nil {
17986			res.Body.Close()
17987		}
17988		return nil, &googleapi.Error{
17989			Code:   res.StatusCode,
17990			Header: res.Header,
17991		}
17992	}
17993	if err != nil {
17994		return nil, err
17995	}
17996	defer googleapi.CloseBody(res)
17997	if err := googleapi.CheckResponse(res); err != nil {
17998		return nil, err
17999	}
18000	ret := &ListMonitoredResourceDescriptorsResponse{
18001		ServerResponse: googleapi.ServerResponse{
18002			Header:         res.Header,
18003			HTTPStatusCode: res.StatusCode,
18004		},
18005	}
18006	target := &ret
18007	if err := gensupport.DecodeResponse(target, res); err != nil {
18008		return nil, err
18009	}
18010	return ret, nil
18011	// {
18012	//   "description": "Lists the descriptors for monitored resource types used by Logging.",
18013	//   "flatPath": "v2/monitoredResourceDescriptors",
18014	//   "httpMethod": "GET",
18015	//   "id": "logging.monitoredResourceDescriptors.list",
18016	//   "parameterOrder": [],
18017	//   "parameters": {
18018	//     "pageSize": {
18019	//       "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.",
18020	//       "format": "int32",
18021	//       "location": "query",
18022	//       "type": "integer"
18023	//     },
18024	//     "pageToken": {
18025	//       "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.",
18026	//       "location": "query",
18027	//       "type": "string"
18028	//     }
18029	//   },
18030	//   "path": "v2/monitoredResourceDescriptors",
18031	//   "response": {
18032	//     "$ref": "ListMonitoredResourceDescriptorsResponse"
18033	//   },
18034	//   "scopes": [
18035	//     "https://www.googleapis.com/auth/cloud-platform",
18036	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
18037	//     "https://www.googleapis.com/auth/logging.admin",
18038	//     "https://www.googleapis.com/auth/logging.read"
18039	//   ]
18040	// }
18041
18042}
18043
18044// Pages invokes f for each page of results.
18045// A non-nil error returned from f will halt the iteration.
18046// The provided context supersedes any context provided to the Context method.
18047func (c *MonitoredResourceDescriptorsListCall) Pages(ctx context.Context, f func(*ListMonitoredResourceDescriptorsResponse) error) error {
18048	c.ctx_ = ctx
18049	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
18050	for {
18051		x, err := c.Do()
18052		if err != nil {
18053			return err
18054		}
18055		if err := f(x); err != nil {
18056			return err
18057		}
18058		if x.NextPageToken == "" {
18059			return nil
18060		}
18061		c.PageToken(x.NextPageToken)
18062	}
18063}
18064
18065// method id "logging.organizations.getCmekSettings":
18066
18067type OrganizationsGetCmekSettingsCall struct {
18068	s            *Service
18069	name         string
18070	urlParams_   gensupport.URLParams
18071	ifNoneMatch_ string
18072	ctx_         context.Context
18073	header_      http.Header
18074}
18075
18076// GetCmekSettings: Gets the Logs Router CMEK settings for the given
18077// resource.Note: CMEK for the Logs Router can currently only be
18078// configured for Google Cloud organizations. Once configured, it
18079// applies to all projects and folders in the Google Cloud
18080// organization.See Enabling CMEK for Logs Router
18081// (https://cloud.google.com/logging/docs/routing/managed-encryption)
18082// for more information.
18083//
18084// - name: The resource for which to retrieve CMEK settings.
18085//   "projects/[PROJECT_ID]/cmekSettings"
18086//   "organizations/[ORGANIZATION_ID]/cmekSettings"
18087//   "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
18088//   "folders/[FOLDER_ID]/cmekSettings" For
18089//   example:"organizations/12345/cmekSettings"Note: CMEK for the Logs
18090//   Router can currently only be configured for Google Cloud
18091//   organizations. Once configured, it applies to all projects and
18092//   folders in the Google Cloud organization.
18093func (r *OrganizationsService) GetCmekSettings(name string) *OrganizationsGetCmekSettingsCall {
18094	c := &OrganizationsGetCmekSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
18095	c.name = name
18096	return c
18097}
18098
18099// Fields allows partial responses to be retrieved. See
18100// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
18101// for more information.
18102func (c *OrganizationsGetCmekSettingsCall) Fields(s ...googleapi.Field) *OrganizationsGetCmekSettingsCall {
18103	c.urlParams_.Set("fields", googleapi.CombineFields(s))
18104	return c
18105}
18106
18107// IfNoneMatch sets the optional parameter which makes the operation
18108// fail if the object's ETag matches the given value. This is useful for
18109// getting updates only after the object has changed since the last
18110// request. Use googleapi.IsNotModified to check whether the response
18111// error from Do is the result of In-None-Match.
18112func (c *OrganizationsGetCmekSettingsCall) IfNoneMatch(entityTag string) *OrganizationsGetCmekSettingsCall {
18113	c.ifNoneMatch_ = entityTag
18114	return c
18115}
18116
18117// Context sets the context to be used in this call's Do method. Any
18118// pending HTTP request will be aborted if the provided context is
18119// canceled.
18120func (c *OrganizationsGetCmekSettingsCall) Context(ctx context.Context) *OrganizationsGetCmekSettingsCall {
18121	c.ctx_ = ctx
18122	return c
18123}
18124
18125// Header returns an http.Header that can be modified by the caller to
18126// add HTTP headers to the request.
18127func (c *OrganizationsGetCmekSettingsCall) Header() http.Header {
18128	if c.header_ == nil {
18129		c.header_ = make(http.Header)
18130	}
18131	return c.header_
18132}
18133
18134func (c *OrganizationsGetCmekSettingsCall) doRequest(alt string) (*http.Response, error) {
18135	reqHeaders := make(http.Header)
18136	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
18137	for k, v := range c.header_ {
18138		reqHeaders[k] = v
18139	}
18140	reqHeaders.Set("User-Agent", c.s.userAgent())
18141	if c.ifNoneMatch_ != "" {
18142		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
18143	}
18144	var body io.Reader = nil
18145	c.urlParams_.Set("alt", alt)
18146	c.urlParams_.Set("prettyPrint", "false")
18147	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings")
18148	urls += "?" + c.urlParams_.Encode()
18149	req, err := http.NewRequest("GET", urls, body)
18150	if err != nil {
18151		return nil, err
18152	}
18153	req.Header = reqHeaders
18154	googleapi.Expand(req.URL, map[string]string{
18155		"name": c.name,
18156	})
18157	return gensupport.SendRequest(c.ctx_, c.s.client, req)
18158}
18159
18160// Do executes the "logging.organizations.getCmekSettings" call.
18161// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx
18162// status code is an error. Response headers are in either
18163// *CmekSettings.ServerResponse.Header or (if a response was returned at
18164// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
18165// to check whether the returned error was because
18166// http.StatusNotModified was returned.
18167func (c *OrganizationsGetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) {
18168	gensupport.SetOptions(c.urlParams_, opts...)
18169	res, err := c.doRequest("json")
18170	if res != nil && res.StatusCode == http.StatusNotModified {
18171		if res.Body != nil {
18172			res.Body.Close()
18173		}
18174		return nil, &googleapi.Error{
18175			Code:   res.StatusCode,
18176			Header: res.Header,
18177		}
18178	}
18179	if err != nil {
18180		return nil, err
18181	}
18182	defer googleapi.CloseBody(res)
18183	if err := googleapi.CheckResponse(res); err != nil {
18184		return nil, err
18185	}
18186	ret := &CmekSettings{
18187		ServerResponse: googleapi.ServerResponse{
18188			Header:         res.Header,
18189			HTTPStatusCode: res.StatusCode,
18190		},
18191	}
18192	target := &ret
18193	if err := gensupport.DecodeResponse(target, res); err != nil {
18194		return nil, err
18195	}
18196	return ret, nil
18197	// {
18198	//   "description": "Gets the Logs Router CMEK settings for the given resource.Note: CMEK for the Logs Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Logs Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.",
18199	//   "flatPath": "v2/organizations/{organizationsId}/cmekSettings",
18200	//   "httpMethod": "GET",
18201	//   "id": "logging.organizations.getCmekSettings",
18202	//   "parameterOrder": [
18203	//     "name"
18204	//   ],
18205	//   "parameters": {
18206	//     "name": {
18207	//       "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\" For example:\"organizations/12345/cmekSettings\"Note: CMEK for the Logs Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.",
18208	//       "location": "path",
18209	//       "pattern": "^organizations/[^/]+$",
18210	//       "required": true,
18211	//       "type": "string"
18212	//     }
18213	//   },
18214	//   "path": "v2/{+name}/cmekSettings",
18215	//   "response": {
18216	//     "$ref": "CmekSettings"
18217	//   },
18218	//   "scopes": [
18219	//     "https://www.googleapis.com/auth/cloud-platform",
18220	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
18221	//     "https://www.googleapis.com/auth/logging.admin",
18222	//     "https://www.googleapis.com/auth/logging.read"
18223	//   ]
18224	// }
18225
18226}
18227
18228// method id "logging.organizations.updateCmekSettings":
18229
18230type OrganizationsUpdateCmekSettingsCall struct {
18231	s            *Service
18232	name         string
18233	cmeksettings *CmekSettings
18234	urlParams_   gensupport.URLParams
18235	ctx_         context.Context
18236	header_      http.Header
18237}
18238
18239// UpdateCmekSettings: Updates the Logs Router CMEK settings for the
18240// given resource.Note: CMEK for the Logs Router can currently only be
18241// configured for Google Cloud organizations. Once configured, it
18242// applies to all projects and folders in the Google Cloud
18243// organization.UpdateCmekSettings will fail if 1) kms_key_name is
18244// invalid, or 2) the associated service account does not have the
18245// required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for
18246// the key, or 3) access to the key is disabled.See Enabling CMEK for
18247// Logs Router
18248// (https://cloud.google.com/logging/docs/routing/managed-encryption)
18249// for more information.
18250//
18251// - name: The resource name for the CMEK settings to update.
18252//   "projects/[PROJECT_ID]/cmekSettings"
18253//   "organizations/[ORGANIZATION_ID]/cmekSettings"
18254//   "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
18255//   "folders/[FOLDER_ID]/cmekSettings" For
18256//   example:"organizations/12345/cmekSettings"Note: CMEK for the Logs
18257//   Router can currently only be configured for Google Cloud
18258//   organizations. Once configured, it applies to all projects and
18259//   folders in the Google Cloud organization.
18260func (r *OrganizationsService) UpdateCmekSettings(name string, cmeksettings *CmekSettings) *OrganizationsUpdateCmekSettingsCall {
18261	c := &OrganizationsUpdateCmekSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
18262	c.name = name
18263	c.cmeksettings = cmeksettings
18264	return c
18265}
18266
18267// UpdateMask sets the optional parameter "updateMask": Field mask
18268// identifying which fields from cmek_settings should be updated. A
18269// field will be overwritten if and only if it is in the update mask.
18270// Output only fields cannot be updated.See FieldMask for more
18271// information.For example: "updateMask=kmsKeyName"
18272func (c *OrganizationsUpdateCmekSettingsCall) UpdateMask(updateMask string) *OrganizationsUpdateCmekSettingsCall {
18273	c.urlParams_.Set("updateMask", updateMask)
18274	return c
18275}
18276
18277// Fields allows partial responses to be retrieved. See
18278// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
18279// for more information.
18280func (c *OrganizationsUpdateCmekSettingsCall) Fields(s ...googleapi.Field) *OrganizationsUpdateCmekSettingsCall {
18281	c.urlParams_.Set("fields", googleapi.CombineFields(s))
18282	return c
18283}
18284
18285// Context sets the context to be used in this call's Do method. Any
18286// pending HTTP request will be aborted if the provided context is
18287// canceled.
18288func (c *OrganizationsUpdateCmekSettingsCall) Context(ctx context.Context) *OrganizationsUpdateCmekSettingsCall {
18289	c.ctx_ = ctx
18290	return c
18291}
18292
18293// Header returns an http.Header that can be modified by the caller to
18294// add HTTP headers to the request.
18295func (c *OrganizationsUpdateCmekSettingsCall) Header() http.Header {
18296	if c.header_ == nil {
18297		c.header_ = make(http.Header)
18298	}
18299	return c.header_
18300}
18301
18302func (c *OrganizationsUpdateCmekSettingsCall) doRequest(alt string) (*http.Response, error) {
18303	reqHeaders := make(http.Header)
18304	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
18305	for k, v := range c.header_ {
18306		reqHeaders[k] = v
18307	}
18308	reqHeaders.Set("User-Agent", c.s.userAgent())
18309	var body io.Reader = nil
18310	body, err := googleapi.WithoutDataWrapper.JSONReader(c.cmeksettings)
18311	if err != nil {
18312		return nil, err
18313	}
18314	reqHeaders.Set("Content-Type", "application/json")
18315	c.urlParams_.Set("alt", alt)
18316	c.urlParams_.Set("prettyPrint", "false")
18317	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings")
18318	urls += "?" + c.urlParams_.Encode()
18319	req, err := http.NewRequest("PATCH", urls, body)
18320	if err != nil {
18321		return nil, err
18322	}
18323	req.Header = reqHeaders
18324	googleapi.Expand(req.URL, map[string]string{
18325		"name": c.name,
18326	})
18327	return gensupport.SendRequest(c.ctx_, c.s.client, req)
18328}
18329
18330// Do executes the "logging.organizations.updateCmekSettings" call.
18331// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx
18332// status code is an error. Response headers are in either
18333// *CmekSettings.ServerResponse.Header or (if a response was returned at
18334// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
18335// to check whether the returned error was because
18336// http.StatusNotModified was returned.
18337func (c *OrganizationsUpdateCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) {
18338	gensupport.SetOptions(c.urlParams_, opts...)
18339	res, err := c.doRequest("json")
18340	if res != nil && res.StatusCode == http.StatusNotModified {
18341		if res.Body != nil {
18342			res.Body.Close()
18343		}
18344		return nil, &googleapi.Error{
18345			Code:   res.StatusCode,
18346			Header: res.Header,
18347		}
18348	}
18349	if err != nil {
18350		return nil, err
18351	}
18352	defer googleapi.CloseBody(res)
18353	if err := googleapi.CheckResponse(res); err != nil {
18354		return nil, err
18355	}
18356	ret := &CmekSettings{
18357		ServerResponse: googleapi.ServerResponse{
18358			Header:         res.Header,
18359			HTTPStatusCode: res.StatusCode,
18360		},
18361	}
18362	target := &ret
18363	if err := gensupport.DecodeResponse(target, res); err != nil {
18364		return nil, err
18365	}
18366	return ret, nil
18367	// {
18368	//   "description": "Updates the Logs Router CMEK settings for the given resource.Note: CMEK for the Logs Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud 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.",
18369	//   "flatPath": "v2/organizations/{organizationsId}/cmekSettings",
18370	//   "httpMethod": "PATCH",
18371	//   "id": "logging.organizations.updateCmekSettings",
18372	//   "parameterOrder": [
18373	//     "name"
18374	//   ],
18375	//   "parameters": {
18376	//     "name": {
18377	//       "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\" For example:\"organizations/12345/cmekSettings\"Note: CMEK for the Logs Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.",
18378	//       "location": "path",
18379	//       "pattern": "^organizations/[^/]+$",
18380	//       "required": true,
18381	//       "type": "string"
18382	//     },
18383	//     "updateMask": {
18384	//       "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.For example: \"updateMask=kmsKeyName\"",
18385	//       "format": "google-fieldmask",
18386	//       "location": "query",
18387	//       "type": "string"
18388	//     }
18389	//   },
18390	//   "path": "v2/{+name}/cmekSettings",
18391	//   "request": {
18392	//     "$ref": "CmekSettings"
18393	//   },
18394	//   "response": {
18395	//     "$ref": "CmekSettings"
18396	//   },
18397	//   "scopes": [
18398	//     "https://www.googleapis.com/auth/cloud-platform",
18399	//     "https://www.googleapis.com/auth/logging.admin"
18400	//   ]
18401	// }
18402
18403}
18404
18405// method id "logging.organizations.exclusions.create":
18406
18407type OrganizationsExclusionsCreateCall struct {
18408	s            *Service
18409	parent       string
18410	logexclusion *LogExclusion
18411	urlParams_   gensupport.URLParams
18412	ctx_         context.Context
18413	header_      http.Header
18414}
18415
18416// Create: Creates a new exclusion in the _Default sink in a specified
18417// parent resource. Only log entries belonging to that resource can be
18418// excluded. You can have up to 10 exclusions in a resource.
18419//
18420// - parent: The parent resource in which to create the exclusion:
18421//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
18422//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For
18423//   examples:"projects/my-logging-project" "organizations/123456789".
18424func (r *OrganizationsExclusionsService) Create(parent string, logexclusion *LogExclusion) *OrganizationsExclusionsCreateCall {
18425	c := &OrganizationsExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
18426	c.parent = parent
18427	c.logexclusion = logexclusion
18428	return c
18429}
18430
18431// Fields allows partial responses to be retrieved. See
18432// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
18433// for more information.
18434func (c *OrganizationsExclusionsCreateCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsCreateCall {
18435	c.urlParams_.Set("fields", googleapi.CombineFields(s))
18436	return c
18437}
18438
18439// Context sets the context to be used in this call's Do method. Any
18440// pending HTTP request will be aborted if the provided context is
18441// canceled.
18442func (c *OrganizationsExclusionsCreateCall) Context(ctx context.Context) *OrganizationsExclusionsCreateCall {
18443	c.ctx_ = ctx
18444	return c
18445}
18446
18447// Header returns an http.Header that can be modified by the caller to
18448// add HTTP headers to the request.
18449func (c *OrganizationsExclusionsCreateCall) Header() http.Header {
18450	if c.header_ == nil {
18451		c.header_ = make(http.Header)
18452	}
18453	return c.header_
18454}
18455
18456func (c *OrganizationsExclusionsCreateCall) doRequest(alt string) (*http.Response, error) {
18457	reqHeaders := make(http.Header)
18458	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
18459	for k, v := range c.header_ {
18460		reqHeaders[k] = v
18461	}
18462	reqHeaders.Set("User-Agent", c.s.userAgent())
18463	var body io.Reader = nil
18464	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
18465	if err != nil {
18466		return nil, err
18467	}
18468	reqHeaders.Set("Content-Type", "application/json")
18469	c.urlParams_.Set("alt", alt)
18470	c.urlParams_.Set("prettyPrint", "false")
18471	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
18472	urls += "?" + c.urlParams_.Encode()
18473	req, err := http.NewRequest("POST", urls, body)
18474	if err != nil {
18475		return nil, err
18476	}
18477	req.Header = reqHeaders
18478	googleapi.Expand(req.URL, map[string]string{
18479		"parent": c.parent,
18480	})
18481	return gensupport.SendRequest(c.ctx_, c.s.client, req)
18482}
18483
18484// Do executes the "logging.organizations.exclusions.create" call.
18485// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
18486// status code is an error. Response headers are in either
18487// *LogExclusion.ServerResponse.Header or (if a response was returned at
18488// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
18489// to check whether the returned error was because
18490// http.StatusNotModified was returned.
18491func (c *OrganizationsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
18492	gensupport.SetOptions(c.urlParams_, opts...)
18493	res, err := c.doRequest("json")
18494	if res != nil && res.StatusCode == http.StatusNotModified {
18495		if res.Body != nil {
18496			res.Body.Close()
18497		}
18498		return nil, &googleapi.Error{
18499			Code:   res.StatusCode,
18500			Header: res.Header,
18501		}
18502	}
18503	if err != nil {
18504		return nil, err
18505	}
18506	defer googleapi.CloseBody(res)
18507	if err := googleapi.CheckResponse(res); err != nil {
18508		return nil, err
18509	}
18510	ret := &LogExclusion{
18511		ServerResponse: googleapi.ServerResponse{
18512			Header:         res.Header,
18513			HTTPStatusCode: res.StatusCode,
18514		},
18515	}
18516	target := &ret
18517	if err := gensupport.DecodeResponse(target, res); err != nil {
18518		return nil, err
18519	}
18520	return ret, nil
18521	// {
18522	//   "description": "Creates a new exclusion in the _Default sink 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.",
18523	//   "flatPath": "v2/organizations/{organizationsId}/exclusions",
18524	//   "httpMethod": "POST",
18525	//   "id": "logging.organizations.exclusions.create",
18526	//   "parameterOrder": [
18527	//     "parent"
18528	//   ],
18529	//   "parameters": {
18530	//     "parent": {
18531	//       "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-logging-project\" \"organizations/123456789\"",
18532	//       "location": "path",
18533	//       "pattern": "^organizations/[^/]+$",
18534	//       "required": true,
18535	//       "type": "string"
18536	//     }
18537	//   },
18538	//   "path": "v2/{+parent}/exclusions",
18539	//   "request": {
18540	//     "$ref": "LogExclusion"
18541	//   },
18542	//   "response": {
18543	//     "$ref": "LogExclusion"
18544	//   },
18545	//   "scopes": [
18546	//     "https://www.googleapis.com/auth/cloud-platform",
18547	//     "https://www.googleapis.com/auth/logging.admin"
18548	//   ]
18549	// }
18550
18551}
18552
18553// method id "logging.organizations.exclusions.delete":
18554
18555type OrganizationsExclusionsDeleteCall struct {
18556	s          *Service
18557	name       string
18558	urlParams_ gensupport.URLParams
18559	ctx_       context.Context
18560	header_    http.Header
18561}
18562
18563// Delete: Deletes an exclusion in the _Default sink.
18564//
18565// - name: The resource name of an existing exclusion to delete:
18566//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
18567//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
18568//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
18569//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For
18570//   example:"projects/my-project/exclusions/my-exclusion".
18571func (r *OrganizationsExclusionsService) Delete(name string) *OrganizationsExclusionsDeleteCall {
18572	c := &OrganizationsExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
18573	c.name = name
18574	return c
18575}
18576
18577// Fields allows partial responses to be retrieved. See
18578// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
18579// for more information.
18580func (c *OrganizationsExclusionsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsDeleteCall {
18581	c.urlParams_.Set("fields", googleapi.CombineFields(s))
18582	return c
18583}
18584
18585// Context sets the context to be used in this call's Do method. Any
18586// pending HTTP request will be aborted if the provided context is
18587// canceled.
18588func (c *OrganizationsExclusionsDeleteCall) Context(ctx context.Context) *OrganizationsExclusionsDeleteCall {
18589	c.ctx_ = ctx
18590	return c
18591}
18592
18593// Header returns an http.Header that can be modified by the caller to
18594// add HTTP headers to the request.
18595func (c *OrganizationsExclusionsDeleteCall) Header() http.Header {
18596	if c.header_ == nil {
18597		c.header_ = make(http.Header)
18598	}
18599	return c.header_
18600}
18601
18602func (c *OrganizationsExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) {
18603	reqHeaders := make(http.Header)
18604	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
18605	for k, v := range c.header_ {
18606		reqHeaders[k] = v
18607	}
18608	reqHeaders.Set("User-Agent", c.s.userAgent())
18609	var body io.Reader = nil
18610	c.urlParams_.Set("alt", alt)
18611	c.urlParams_.Set("prettyPrint", "false")
18612	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
18613	urls += "?" + c.urlParams_.Encode()
18614	req, err := http.NewRequest("DELETE", urls, body)
18615	if err != nil {
18616		return nil, err
18617	}
18618	req.Header = reqHeaders
18619	googleapi.Expand(req.URL, map[string]string{
18620		"name": c.name,
18621	})
18622	return gensupport.SendRequest(c.ctx_, c.s.client, req)
18623}
18624
18625// Do executes the "logging.organizations.exclusions.delete" call.
18626// Exactly one of *Empty or error will be non-nil. Any non-2xx status
18627// code is an error. Response headers are in either
18628// *Empty.ServerResponse.Header or (if a response was returned at all)
18629// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
18630// check whether the returned error was because http.StatusNotModified
18631// was returned.
18632func (c *OrganizationsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
18633	gensupport.SetOptions(c.urlParams_, opts...)
18634	res, err := c.doRequest("json")
18635	if res != nil && res.StatusCode == http.StatusNotModified {
18636		if res.Body != nil {
18637			res.Body.Close()
18638		}
18639		return nil, &googleapi.Error{
18640			Code:   res.StatusCode,
18641			Header: res.Header,
18642		}
18643	}
18644	if err != nil {
18645		return nil, err
18646	}
18647	defer googleapi.CloseBody(res)
18648	if err := googleapi.CheckResponse(res); err != nil {
18649		return nil, err
18650	}
18651	ret := &Empty{
18652		ServerResponse: googleapi.ServerResponse{
18653			Header:         res.Header,
18654			HTTPStatusCode: res.StatusCode,
18655		},
18656	}
18657	target := &ret
18658	if err := gensupport.DecodeResponse(target, res); err != nil {
18659		return nil, err
18660	}
18661	return ret, nil
18662	// {
18663	//   "description": "Deletes an exclusion in the _Default sink.",
18664	//   "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}",
18665	//   "httpMethod": "DELETE",
18666	//   "id": "logging.organizations.exclusions.delete",
18667	//   "parameterOrder": [
18668	//     "name"
18669	//   ],
18670	//   "parameters": {
18671	//     "name": {
18672	//       "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]\" For example:\"projects/my-project/exclusions/my-exclusion\"",
18673	//       "location": "path",
18674	//       "pattern": "^organizations/[^/]+/exclusions/[^/]+$",
18675	//       "required": true,
18676	//       "type": "string"
18677	//     }
18678	//   },
18679	//   "path": "v2/{+name}",
18680	//   "response": {
18681	//     "$ref": "Empty"
18682	//   },
18683	//   "scopes": [
18684	//     "https://www.googleapis.com/auth/cloud-platform",
18685	//     "https://www.googleapis.com/auth/logging.admin"
18686	//   ]
18687	// }
18688
18689}
18690
18691// method id "logging.organizations.exclusions.get":
18692
18693type OrganizationsExclusionsGetCall struct {
18694	s            *Service
18695	name         string
18696	urlParams_   gensupport.URLParams
18697	ifNoneMatch_ string
18698	ctx_         context.Context
18699	header_      http.Header
18700}
18701
18702// Get: Gets the description of an exclusion in the _Default sink.
18703//
18704// - name: The resource name of an existing exclusion:
18705//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
18706//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
18707//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
18708//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For
18709//   example:"projects/my-project/exclusions/my-exclusion".
18710func (r *OrganizationsExclusionsService) Get(name string) *OrganizationsExclusionsGetCall {
18711	c := &OrganizationsExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
18712	c.name = name
18713	return c
18714}
18715
18716// Fields allows partial responses to be retrieved. See
18717// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
18718// for more information.
18719func (c *OrganizationsExclusionsGetCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsGetCall {
18720	c.urlParams_.Set("fields", googleapi.CombineFields(s))
18721	return c
18722}
18723
18724// IfNoneMatch sets the optional parameter which makes the operation
18725// fail if the object's ETag matches the given value. This is useful for
18726// getting updates only after the object has changed since the last
18727// request. Use googleapi.IsNotModified to check whether the response
18728// error from Do is the result of In-None-Match.
18729func (c *OrganizationsExclusionsGetCall) IfNoneMatch(entityTag string) *OrganizationsExclusionsGetCall {
18730	c.ifNoneMatch_ = entityTag
18731	return c
18732}
18733
18734// Context sets the context to be used in this call's Do method. Any
18735// pending HTTP request will be aborted if the provided context is
18736// canceled.
18737func (c *OrganizationsExclusionsGetCall) Context(ctx context.Context) *OrganizationsExclusionsGetCall {
18738	c.ctx_ = ctx
18739	return c
18740}
18741
18742// Header returns an http.Header that can be modified by the caller to
18743// add HTTP headers to the request.
18744func (c *OrganizationsExclusionsGetCall) Header() http.Header {
18745	if c.header_ == nil {
18746		c.header_ = make(http.Header)
18747	}
18748	return c.header_
18749}
18750
18751func (c *OrganizationsExclusionsGetCall) doRequest(alt string) (*http.Response, error) {
18752	reqHeaders := make(http.Header)
18753	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
18754	for k, v := range c.header_ {
18755		reqHeaders[k] = v
18756	}
18757	reqHeaders.Set("User-Agent", c.s.userAgent())
18758	if c.ifNoneMatch_ != "" {
18759		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
18760	}
18761	var body io.Reader = nil
18762	c.urlParams_.Set("alt", alt)
18763	c.urlParams_.Set("prettyPrint", "false")
18764	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
18765	urls += "?" + c.urlParams_.Encode()
18766	req, err := http.NewRequest("GET", urls, body)
18767	if err != nil {
18768		return nil, err
18769	}
18770	req.Header = reqHeaders
18771	googleapi.Expand(req.URL, map[string]string{
18772		"name": c.name,
18773	})
18774	return gensupport.SendRequest(c.ctx_, c.s.client, req)
18775}
18776
18777// Do executes the "logging.organizations.exclusions.get" call.
18778// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
18779// status code is an error. Response headers are in either
18780// *LogExclusion.ServerResponse.Header or (if a response was returned at
18781// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
18782// to check whether the returned error was because
18783// http.StatusNotModified was returned.
18784func (c *OrganizationsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
18785	gensupport.SetOptions(c.urlParams_, opts...)
18786	res, err := c.doRequest("json")
18787	if res != nil && res.StatusCode == http.StatusNotModified {
18788		if res.Body != nil {
18789			res.Body.Close()
18790		}
18791		return nil, &googleapi.Error{
18792			Code:   res.StatusCode,
18793			Header: res.Header,
18794		}
18795	}
18796	if err != nil {
18797		return nil, err
18798	}
18799	defer googleapi.CloseBody(res)
18800	if err := googleapi.CheckResponse(res); err != nil {
18801		return nil, err
18802	}
18803	ret := &LogExclusion{
18804		ServerResponse: googleapi.ServerResponse{
18805			Header:         res.Header,
18806			HTTPStatusCode: res.StatusCode,
18807		},
18808	}
18809	target := &ret
18810	if err := gensupport.DecodeResponse(target, res); err != nil {
18811		return nil, err
18812	}
18813	return ret, nil
18814	// {
18815	//   "description": "Gets the description of an exclusion in the _Default sink.",
18816	//   "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}",
18817	//   "httpMethod": "GET",
18818	//   "id": "logging.organizations.exclusions.get",
18819	//   "parameterOrder": [
18820	//     "name"
18821	//   ],
18822	//   "parameters": {
18823	//     "name": {
18824	//       "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]\" For example:\"projects/my-project/exclusions/my-exclusion\"",
18825	//       "location": "path",
18826	//       "pattern": "^organizations/[^/]+/exclusions/[^/]+$",
18827	//       "required": true,
18828	//       "type": "string"
18829	//     }
18830	//   },
18831	//   "path": "v2/{+name}",
18832	//   "response": {
18833	//     "$ref": "LogExclusion"
18834	//   },
18835	//   "scopes": [
18836	//     "https://www.googleapis.com/auth/cloud-platform",
18837	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
18838	//     "https://www.googleapis.com/auth/logging.admin",
18839	//     "https://www.googleapis.com/auth/logging.read"
18840	//   ]
18841	// }
18842
18843}
18844
18845// method id "logging.organizations.exclusions.list":
18846
18847type OrganizationsExclusionsListCall struct {
18848	s            *Service
18849	parent       string
18850	urlParams_   gensupport.URLParams
18851	ifNoneMatch_ string
18852	ctx_         context.Context
18853	header_      http.Header
18854}
18855
18856// List: Lists all the exclusions on the _Default sink in a parent
18857// resource.
18858//
18859// - parent: The parent resource whose exclusions are to be listed.
18860//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
18861//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]".
18862func (r *OrganizationsExclusionsService) List(parent string) *OrganizationsExclusionsListCall {
18863	c := &OrganizationsExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
18864	c.parent = parent
18865	return c
18866}
18867
18868// PageSize sets the optional parameter "pageSize": The maximum number
18869// of results to return from this request. Non-positive values are
18870// ignored. The presence of nextPageToken in the response indicates that
18871// more results might be available.
18872func (c *OrganizationsExclusionsListCall) PageSize(pageSize int64) *OrganizationsExclusionsListCall {
18873	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
18874	return c
18875}
18876
18877// PageToken sets the optional parameter "pageToken": If present, then
18878// retrieve the next batch of results from the preceding call to this
18879// method. pageToken must be the value of nextPageToken from the
18880// previous response. The values of other method parameters should be
18881// identical to those in the previous call.
18882func (c *OrganizationsExclusionsListCall) PageToken(pageToken string) *OrganizationsExclusionsListCall {
18883	c.urlParams_.Set("pageToken", pageToken)
18884	return c
18885}
18886
18887// Fields allows partial responses to be retrieved. See
18888// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
18889// for more information.
18890func (c *OrganizationsExclusionsListCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsListCall {
18891	c.urlParams_.Set("fields", googleapi.CombineFields(s))
18892	return c
18893}
18894
18895// IfNoneMatch sets the optional parameter which makes the operation
18896// fail if the object's ETag matches the given value. This is useful for
18897// getting updates only after the object has changed since the last
18898// request. Use googleapi.IsNotModified to check whether the response
18899// error from Do is the result of In-None-Match.
18900func (c *OrganizationsExclusionsListCall) IfNoneMatch(entityTag string) *OrganizationsExclusionsListCall {
18901	c.ifNoneMatch_ = entityTag
18902	return c
18903}
18904
18905// Context sets the context to be used in this call's Do method. Any
18906// pending HTTP request will be aborted if the provided context is
18907// canceled.
18908func (c *OrganizationsExclusionsListCall) Context(ctx context.Context) *OrganizationsExclusionsListCall {
18909	c.ctx_ = ctx
18910	return c
18911}
18912
18913// Header returns an http.Header that can be modified by the caller to
18914// add HTTP headers to the request.
18915func (c *OrganizationsExclusionsListCall) Header() http.Header {
18916	if c.header_ == nil {
18917		c.header_ = make(http.Header)
18918	}
18919	return c.header_
18920}
18921
18922func (c *OrganizationsExclusionsListCall) doRequest(alt string) (*http.Response, error) {
18923	reqHeaders := make(http.Header)
18924	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
18925	for k, v := range c.header_ {
18926		reqHeaders[k] = v
18927	}
18928	reqHeaders.Set("User-Agent", c.s.userAgent())
18929	if c.ifNoneMatch_ != "" {
18930		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
18931	}
18932	var body io.Reader = nil
18933	c.urlParams_.Set("alt", alt)
18934	c.urlParams_.Set("prettyPrint", "false")
18935	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
18936	urls += "?" + c.urlParams_.Encode()
18937	req, err := http.NewRequest("GET", urls, body)
18938	if err != nil {
18939		return nil, err
18940	}
18941	req.Header = reqHeaders
18942	googleapi.Expand(req.URL, map[string]string{
18943		"parent": c.parent,
18944	})
18945	return gensupport.SendRequest(c.ctx_, c.s.client, req)
18946}
18947
18948// Do executes the "logging.organizations.exclusions.list" call.
18949// Exactly one of *ListExclusionsResponse or error will be non-nil. Any
18950// non-2xx status code is an error. Response headers are in either
18951// *ListExclusionsResponse.ServerResponse.Header or (if a response was
18952// returned at all) in error.(*googleapi.Error).Header. Use
18953// googleapi.IsNotModified to check whether the returned error was
18954// because http.StatusNotModified was returned.
18955func (c *OrganizationsExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) {
18956	gensupport.SetOptions(c.urlParams_, opts...)
18957	res, err := c.doRequest("json")
18958	if res != nil && res.StatusCode == http.StatusNotModified {
18959		if res.Body != nil {
18960			res.Body.Close()
18961		}
18962		return nil, &googleapi.Error{
18963			Code:   res.StatusCode,
18964			Header: res.Header,
18965		}
18966	}
18967	if err != nil {
18968		return nil, err
18969	}
18970	defer googleapi.CloseBody(res)
18971	if err := googleapi.CheckResponse(res); err != nil {
18972		return nil, err
18973	}
18974	ret := &ListExclusionsResponse{
18975		ServerResponse: googleapi.ServerResponse{
18976			Header:         res.Header,
18977			HTTPStatusCode: res.StatusCode,
18978		},
18979	}
18980	target := &ret
18981	if err := gensupport.DecodeResponse(target, res); err != nil {
18982		return nil, err
18983	}
18984	return ret, nil
18985	// {
18986	//   "description": "Lists all the exclusions on the _Default sink in a parent resource.",
18987	//   "flatPath": "v2/organizations/{organizationsId}/exclusions",
18988	//   "httpMethod": "GET",
18989	//   "id": "logging.organizations.exclusions.list",
18990	//   "parameterOrder": [
18991	//     "parent"
18992	//   ],
18993	//   "parameters": {
18994	//     "pageSize": {
18995	//       "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.",
18996	//       "format": "int32",
18997	//       "location": "query",
18998	//       "type": "integer"
18999	//     },
19000	//     "pageToken": {
19001	//       "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.",
19002	//       "location": "query",
19003	//       "type": "string"
19004	//     },
19005	//     "parent": {
19006	//       "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
19007	//       "location": "path",
19008	//       "pattern": "^organizations/[^/]+$",
19009	//       "required": true,
19010	//       "type": "string"
19011	//     }
19012	//   },
19013	//   "path": "v2/{+parent}/exclusions",
19014	//   "response": {
19015	//     "$ref": "ListExclusionsResponse"
19016	//   },
19017	//   "scopes": [
19018	//     "https://www.googleapis.com/auth/cloud-platform",
19019	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
19020	//     "https://www.googleapis.com/auth/logging.admin",
19021	//     "https://www.googleapis.com/auth/logging.read"
19022	//   ]
19023	// }
19024
19025}
19026
19027// Pages invokes f for each page of results.
19028// A non-nil error returned from f will halt the iteration.
19029// The provided context supersedes any context provided to the Context method.
19030func (c *OrganizationsExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error {
19031	c.ctx_ = ctx
19032	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
19033	for {
19034		x, err := c.Do()
19035		if err != nil {
19036			return err
19037		}
19038		if err := f(x); err != nil {
19039			return err
19040		}
19041		if x.NextPageToken == "" {
19042			return nil
19043		}
19044		c.PageToken(x.NextPageToken)
19045	}
19046}
19047
19048// method id "logging.organizations.exclusions.patch":
19049
19050type OrganizationsExclusionsPatchCall struct {
19051	s            *Service
19052	name         string
19053	logexclusion *LogExclusion
19054	urlParams_   gensupport.URLParams
19055	ctx_         context.Context
19056	header_      http.Header
19057}
19058
19059// Patch: Changes one or more properties of an existing exclusion in the
19060// _Default sink.
19061//
19062// - name: The resource name of the exclusion to update:
19063//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
19064//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
19065//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
19066//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For
19067//   example:"projects/my-project/exclusions/my-exclusion".
19068func (r *OrganizationsExclusionsService) Patch(name string, logexclusion *LogExclusion) *OrganizationsExclusionsPatchCall {
19069	c := &OrganizationsExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
19070	c.name = name
19071	c.logexclusion = logexclusion
19072	return c
19073}
19074
19075// UpdateMask sets the optional parameter "updateMask": Required. A
19076// non-empty list of fields to change in the existing exclusion. New
19077// values for the fields are taken from the corresponding fields in the
19078// LogExclusion included in this request. Fields not mentioned in
19079// update_mask are not changed and are ignored in the request.For
19080// example, to change the filter and description of an exclusion,
19081// specify an update_mask of "filter,description".
19082func (c *OrganizationsExclusionsPatchCall) UpdateMask(updateMask string) *OrganizationsExclusionsPatchCall {
19083	c.urlParams_.Set("updateMask", updateMask)
19084	return c
19085}
19086
19087// Fields allows partial responses to be retrieved. See
19088// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
19089// for more information.
19090func (c *OrganizationsExclusionsPatchCall) Fields(s ...googleapi.Field) *OrganizationsExclusionsPatchCall {
19091	c.urlParams_.Set("fields", googleapi.CombineFields(s))
19092	return c
19093}
19094
19095// Context sets the context to be used in this call's Do method. Any
19096// pending HTTP request will be aborted if the provided context is
19097// canceled.
19098func (c *OrganizationsExclusionsPatchCall) Context(ctx context.Context) *OrganizationsExclusionsPatchCall {
19099	c.ctx_ = ctx
19100	return c
19101}
19102
19103// Header returns an http.Header that can be modified by the caller to
19104// add HTTP headers to the request.
19105func (c *OrganizationsExclusionsPatchCall) Header() http.Header {
19106	if c.header_ == nil {
19107		c.header_ = make(http.Header)
19108	}
19109	return c.header_
19110}
19111
19112func (c *OrganizationsExclusionsPatchCall) doRequest(alt string) (*http.Response, error) {
19113	reqHeaders := make(http.Header)
19114	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
19115	for k, v := range c.header_ {
19116		reqHeaders[k] = v
19117	}
19118	reqHeaders.Set("User-Agent", c.s.userAgent())
19119	var body io.Reader = nil
19120	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
19121	if err != nil {
19122		return nil, err
19123	}
19124	reqHeaders.Set("Content-Type", "application/json")
19125	c.urlParams_.Set("alt", alt)
19126	c.urlParams_.Set("prettyPrint", "false")
19127	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
19128	urls += "?" + c.urlParams_.Encode()
19129	req, err := http.NewRequest("PATCH", urls, body)
19130	if err != nil {
19131		return nil, err
19132	}
19133	req.Header = reqHeaders
19134	googleapi.Expand(req.URL, map[string]string{
19135		"name": c.name,
19136	})
19137	return gensupport.SendRequest(c.ctx_, c.s.client, req)
19138}
19139
19140// Do executes the "logging.organizations.exclusions.patch" call.
19141// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
19142// status code is an error. Response headers are in either
19143// *LogExclusion.ServerResponse.Header or (if a response was returned at
19144// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
19145// to check whether the returned error was because
19146// http.StatusNotModified was returned.
19147func (c *OrganizationsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
19148	gensupport.SetOptions(c.urlParams_, opts...)
19149	res, err := c.doRequest("json")
19150	if res != nil && res.StatusCode == http.StatusNotModified {
19151		if res.Body != nil {
19152			res.Body.Close()
19153		}
19154		return nil, &googleapi.Error{
19155			Code:   res.StatusCode,
19156			Header: res.Header,
19157		}
19158	}
19159	if err != nil {
19160		return nil, err
19161	}
19162	defer googleapi.CloseBody(res)
19163	if err := googleapi.CheckResponse(res); err != nil {
19164		return nil, err
19165	}
19166	ret := &LogExclusion{
19167		ServerResponse: googleapi.ServerResponse{
19168			Header:         res.Header,
19169			HTTPStatusCode: res.StatusCode,
19170		},
19171	}
19172	target := &ret
19173	if err := gensupport.DecodeResponse(target, res); err != nil {
19174		return nil, err
19175	}
19176	return ret, nil
19177	// {
19178	//   "description": "Changes one or more properties of an existing exclusion in the _Default sink.",
19179	//   "flatPath": "v2/organizations/{organizationsId}/exclusions/{exclusionsId}",
19180	//   "httpMethod": "PATCH",
19181	//   "id": "logging.organizations.exclusions.patch",
19182	//   "parameterOrder": [
19183	//     "name"
19184	//   ],
19185	//   "parameters": {
19186	//     "name": {
19187	//       "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]\" For example:\"projects/my-project/exclusions/my-exclusion\"",
19188	//       "location": "path",
19189	//       "pattern": "^organizations/[^/]+/exclusions/[^/]+$",
19190	//       "required": true,
19191	//       "type": "string"
19192	//     },
19193	//     "updateMask": {
19194	//       "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\".",
19195	//       "format": "google-fieldmask",
19196	//       "location": "query",
19197	//       "type": "string"
19198	//     }
19199	//   },
19200	//   "path": "v2/{+name}",
19201	//   "request": {
19202	//     "$ref": "LogExclusion"
19203	//   },
19204	//   "response": {
19205	//     "$ref": "LogExclusion"
19206	//   },
19207	//   "scopes": [
19208	//     "https://www.googleapis.com/auth/cloud-platform",
19209	//     "https://www.googleapis.com/auth/logging.admin"
19210	//   ]
19211	// }
19212
19213}
19214
19215// method id "logging.organizations.locations.get":
19216
19217type OrganizationsLocationsGetCall struct {
19218	s            *Service
19219	name         string
19220	urlParams_   gensupport.URLParams
19221	ifNoneMatch_ string
19222	ctx_         context.Context
19223	header_      http.Header
19224}
19225
19226// Get: Gets information about a location.
19227//
19228// - name: Resource name for the location.
19229func (r *OrganizationsLocationsService) Get(name string) *OrganizationsLocationsGetCall {
19230	c := &OrganizationsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
19231	c.name = name
19232	return c
19233}
19234
19235// Fields allows partial responses to be retrieved. See
19236// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
19237// for more information.
19238func (c *OrganizationsLocationsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsGetCall {
19239	c.urlParams_.Set("fields", googleapi.CombineFields(s))
19240	return c
19241}
19242
19243// IfNoneMatch sets the optional parameter which makes the operation
19244// fail if the object's ETag matches the given value. This is useful for
19245// getting updates only after the object has changed since the last
19246// request. Use googleapi.IsNotModified to check whether the response
19247// error from Do is the result of In-None-Match.
19248func (c *OrganizationsLocationsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsGetCall {
19249	c.ifNoneMatch_ = entityTag
19250	return c
19251}
19252
19253// Context sets the context to be used in this call's Do method. Any
19254// pending HTTP request will be aborted if the provided context is
19255// canceled.
19256func (c *OrganizationsLocationsGetCall) Context(ctx context.Context) *OrganizationsLocationsGetCall {
19257	c.ctx_ = ctx
19258	return c
19259}
19260
19261// Header returns an http.Header that can be modified by the caller to
19262// add HTTP headers to the request.
19263func (c *OrganizationsLocationsGetCall) Header() http.Header {
19264	if c.header_ == nil {
19265		c.header_ = make(http.Header)
19266	}
19267	return c.header_
19268}
19269
19270func (c *OrganizationsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
19271	reqHeaders := make(http.Header)
19272	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
19273	for k, v := range c.header_ {
19274		reqHeaders[k] = v
19275	}
19276	reqHeaders.Set("User-Agent", c.s.userAgent())
19277	if c.ifNoneMatch_ != "" {
19278		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
19279	}
19280	var body io.Reader = nil
19281	c.urlParams_.Set("alt", alt)
19282	c.urlParams_.Set("prettyPrint", "false")
19283	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
19284	urls += "?" + c.urlParams_.Encode()
19285	req, err := http.NewRequest("GET", urls, body)
19286	if err != nil {
19287		return nil, err
19288	}
19289	req.Header = reqHeaders
19290	googleapi.Expand(req.URL, map[string]string{
19291		"name": c.name,
19292	})
19293	return gensupport.SendRequest(c.ctx_, c.s.client, req)
19294}
19295
19296// Do executes the "logging.organizations.locations.get" call.
19297// Exactly one of *Location or error will be non-nil. Any non-2xx status
19298// code is an error. Response headers are in either
19299// *Location.ServerResponse.Header or (if a response was returned at
19300// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
19301// to check whether the returned error was because
19302// http.StatusNotModified was returned.
19303func (c *OrganizationsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
19304	gensupport.SetOptions(c.urlParams_, opts...)
19305	res, err := c.doRequest("json")
19306	if res != nil && res.StatusCode == http.StatusNotModified {
19307		if res.Body != nil {
19308			res.Body.Close()
19309		}
19310		return nil, &googleapi.Error{
19311			Code:   res.StatusCode,
19312			Header: res.Header,
19313		}
19314	}
19315	if err != nil {
19316		return nil, err
19317	}
19318	defer googleapi.CloseBody(res)
19319	if err := googleapi.CheckResponse(res); err != nil {
19320		return nil, err
19321	}
19322	ret := &Location{
19323		ServerResponse: googleapi.ServerResponse{
19324			Header:         res.Header,
19325			HTTPStatusCode: res.StatusCode,
19326		},
19327	}
19328	target := &ret
19329	if err := gensupport.DecodeResponse(target, res); err != nil {
19330		return nil, err
19331	}
19332	return ret, nil
19333	// {
19334	//   "description": "Gets information about a location.",
19335	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}",
19336	//   "httpMethod": "GET",
19337	//   "id": "logging.organizations.locations.get",
19338	//   "parameterOrder": [
19339	//     "name"
19340	//   ],
19341	//   "parameters": {
19342	//     "name": {
19343	//       "description": "Resource name for the location.",
19344	//       "location": "path",
19345	//       "pattern": "^organizations/[^/]+/locations/[^/]+$",
19346	//       "required": true,
19347	//       "type": "string"
19348	//     }
19349	//   },
19350	//   "path": "v2/{+name}",
19351	//   "response": {
19352	//     "$ref": "Location"
19353	//   },
19354	//   "scopes": [
19355	//     "https://www.googleapis.com/auth/cloud-platform",
19356	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
19357	//     "https://www.googleapis.com/auth/logging.admin",
19358	//     "https://www.googleapis.com/auth/logging.read"
19359	//   ]
19360	// }
19361
19362}
19363
19364// method id "logging.organizations.locations.list":
19365
19366type OrganizationsLocationsListCall struct {
19367	s            *Service
19368	name         string
19369	urlParams_   gensupport.URLParams
19370	ifNoneMatch_ string
19371	ctx_         context.Context
19372	header_      http.Header
19373}
19374
19375// List: Lists information about the supported locations for this
19376// service.
19377//
19378// - name: The resource that owns the locations collection, if
19379//   applicable.
19380func (r *OrganizationsLocationsService) List(name string) *OrganizationsLocationsListCall {
19381	c := &OrganizationsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
19382	c.name = name
19383	return c
19384}
19385
19386// Filter sets the optional parameter "filter": A filter to narrow down
19387// results to a preferred subset. The filtering language accepts strings
19388// like "displayName=tokyo", and is documented in more detail in AIP-160
19389// (https://google.aip.dev/160).
19390func (c *OrganizationsLocationsListCall) Filter(filter string) *OrganizationsLocationsListCall {
19391	c.urlParams_.Set("filter", filter)
19392	return c
19393}
19394
19395// PageSize sets the optional parameter "pageSize": The maximum number
19396// of results to return. If not set, the service selects a default.
19397func (c *OrganizationsLocationsListCall) PageSize(pageSize int64) *OrganizationsLocationsListCall {
19398	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
19399	return c
19400}
19401
19402// PageToken sets the optional parameter "pageToken": A page token
19403// received from the next_page_token field in the response. Send that
19404// page token to receive the subsequent page.
19405func (c *OrganizationsLocationsListCall) PageToken(pageToken string) *OrganizationsLocationsListCall {
19406	c.urlParams_.Set("pageToken", pageToken)
19407	return c
19408}
19409
19410// Fields allows partial responses to be retrieved. See
19411// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
19412// for more information.
19413func (c *OrganizationsLocationsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsListCall {
19414	c.urlParams_.Set("fields", googleapi.CombineFields(s))
19415	return c
19416}
19417
19418// IfNoneMatch sets the optional parameter which makes the operation
19419// fail if the object's ETag matches the given value. This is useful for
19420// getting updates only after the object has changed since the last
19421// request. Use googleapi.IsNotModified to check whether the response
19422// error from Do is the result of In-None-Match.
19423func (c *OrganizationsLocationsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsListCall {
19424	c.ifNoneMatch_ = entityTag
19425	return c
19426}
19427
19428// Context sets the context to be used in this call's Do method. Any
19429// pending HTTP request will be aborted if the provided context is
19430// canceled.
19431func (c *OrganizationsLocationsListCall) Context(ctx context.Context) *OrganizationsLocationsListCall {
19432	c.ctx_ = ctx
19433	return c
19434}
19435
19436// Header returns an http.Header that can be modified by the caller to
19437// add HTTP headers to the request.
19438func (c *OrganizationsLocationsListCall) Header() http.Header {
19439	if c.header_ == nil {
19440		c.header_ = make(http.Header)
19441	}
19442	return c.header_
19443}
19444
19445func (c *OrganizationsLocationsListCall) doRequest(alt string) (*http.Response, error) {
19446	reqHeaders := make(http.Header)
19447	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
19448	for k, v := range c.header_ {
19449		reqHeaders[k] = v
19450	}
19451	reqHeaders.Set("User-Agent", c.s.userAgent())
19452	if c.ifNoneMatch_ != "" {
19453		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
19454	}
19455	var body io.Reader = nil
19456	c.urlParams_.Set("alt", alt)
19457	c.urlParams_.Set("prettyPrint", "false")
19458	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations")
19459	urls += "?" + c.urlParams_.Encode()
19460	req, err := http.NewRequest("GET", urls, body)
19461	if err != nil {
19462		return nil, err
19463	}
19464	req.Header = reqHeaders
19465	googleapi.Expand(req.URL, map[string]string{
19466		"name": c.name,
19467	})
19468	return gensupport.SendRequest(c.ctx_, c.s.client, req)
19469}
19470
19471// Do executes the "logging.organizations.locations.list" call.
19472// Exactly one of *ListLocationsResponse or error will be non-nil. Any
19473// non-2xx status code is an error. Response headers are in either
19474// *ListLocationsResponse.ServerResponse.Header or (if a response was
19475// returned at all) in error.(*googleapi.Error).Header. Use
19476// googleapi.IsNotModified to check whether the returned error was
19477// because http.StatusNotModified was returned.
19478func (c *OrganizationsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
19479	gensupport.SetOptions(c.urlParams_, opts...)
19480	res, err := c.doRequest("json")
19481	if res != nil && res.StatusCode == http.StatusNotModified {
19482		if res.Body != nil {
19483			res.Body.Close()
19484		}
19485		return nil, &googleapi.Error{
19486			Code:   res.StatusCode,
19487			Header: res.Header,
19488		}
19489	}
19490	if err != nil {
19491		return nil, err
19492	}
19493	defer googleapi.CloseBody(res)
19494	if err := googleapi.CheckResponse(res); err != nil {
19495		return nil, err
19496	}
19497	ret := &ListLocationsResponse{
19498		ServerResponse: googleapi.ServerResponse{
19499			Header:         res.Header,
19500			HTTPStatusCode: res.StatusCode,
19501		},
19502	}
19503	target := &ret
19504	if err := gensupport.DecodeResponse(target, res); err != nil {
19505		return nil, err
19506	}
19507	return ret, nil
19508	// {
19509	//   "description": "Lists information about the supported locations for this service.",
19510	//   "flatPath": "v2/organizations/{organizationsId}/locations",
19511	//   "httpMethod": "GET",
19512	//   "id": "logging.organizations.locations.list",
19513	//   "parameterOrder": [
19514	//     "name"
19515	//   ],
19516	//   "parameters": {
19517	//     "filter": {
19518	//       "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).",
19519	//       "location": "query",
19520	//       "type": "string"
19521	//     },
19522	//     "name": {
19523	//       "description": "The resource that owns the locations collection, if applicable.",
19524	//       "location": "path",
19525	//       "pattern": "^organizations/[^/]+$",
19526	//       "required": true,
19527	//       "type": "string"
19528	//     },
19529	//     "pageSize": {
19530	//       "description": "The maximum number of results to return. If not set, the service selects a default.",
19531	//       "format": "int32",
19532	//       "location": "query",
19533	//       "type": "integer"
19534	//     },
19535	//     "pageToken": {
19536	//       "description": "A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.",
19537	//       "location": "query",
19538	//       "type": "string"
19539	//     }
19540	//   },
19541	//   "path": "v2/{+name}/locations",
19542	//   "response": {
19543	//     "$ref": "ListLocationsResponse"
19544	//   },
19545	//   "scopes": [
19546	//     "https://www.googleapis.com/auth/cloud-platform",
19547	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
19548	//     "https://www.googleapis.com/auth/logging.admin",
19549	//     "https://www.googleapis.com/auth/logging.read"
19550	//   ]
19551	// }
19552
19553}
19554
19555// Pages invokes f for each page of results.
19556// A non-nil error returned from f will halt the iteration.
19557// The provided context supersedes any context provided to the Context method.
19558func (c *OrganizationsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
19559	c.ctx_ = ctx
19560	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
19561	for {
19562		x, err := c.Do()
19563		if err != nil {
19564			return err
19565		}
19566		if err := f(x); err != nil {
19567			return err
19568		}
19569		if x.NextPageToken == "" {
19570			return nil
19571		}
19572		c.PageToken(x.NextPageToken)
19573	}
19574}
19575
19576// method id "logging.organizations.locations.buckets.create":
19577
19578type OrganizationsLocationsBucketsCreateCall struct {
19579	s          *Service
19580	parent     string
19581	logbucket  *LogBucket
19582	urlParams_ gensupport.URLParams
19583	ctx_       context.Context
19584	header_    http.Header
19585}
19586
19587// Create: Creates a log bucket that can be used to store log entries.
19588// After a bucket has been created, the bucket's location cannot be
19589// changed.
19590//
19591// - parent: The resource in which to create the log bucket:
19592//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For
19593//   example:"projects/my-project/locations/global".
19594func (r *OrganizationsLocationsBucketsService) Create(parent string, logbucket *LogBucket) *OrganizationsLocationsBucketsCreateCall {
19595	c := &OrganizationsLocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
19596	c.parent = parent
19597	c.logbucket = logbucket
19598	return c
19599}
19600
19601// BucketId sets the optional parameter "bucketId": Required. A
19602// client-assigned identifier such as "my-bucket". Identifiers are
19603// limited to 100 characters and can include only letters, digits,
19604// underscores, hyphens, and periods.
19605func (c *OrganizationsLocationsBucketsCreateCall) BucketId(bucketId string) *OrganizationsLocationsBucketsCreateCall {
19606	c.urlParams_.Set("bucketId", bucketId)
19607	return c
19608}
19609
19610// Fields allows partial responses to be retrieved. See
19611// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
19612// for more information.
19613func (c *OrganizationsLocationsBucketsCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsCreateCall {
19614	c.urlParams_.Set("fields", googleapi.CombineFields(s))
19615	return c
19616}
19617
19618// Context sets the context to be used in this call's Do method. Any
19619// pending HTTP request will be aborted if the provided context is
19620// canceled.
19621func (c *OrganizationsLocationsBucketsCreateCall) Context(ctx context.Context) *OrganizationsLocationsBucketsCreateCall {
19622	c.ctx_ = ctx
19623	return c
19624}
19625
19626// Header returns an http.Header that can be modified by the caller to
19627// add HTTP headers to the request.
19628func (c *OrganizationsLocationsBucketsCreateCall) Header() http.Header {
19629	if c.header_ == nil {
19630		c.header_ = make(http.Header)
19631	}
19632	return c.header_
19633}
19634
19635func (c *OrganizationsLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) {
19636	reqHeaders := make(http.Header)
19637	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
19638	for k, v := range c.header_ {
19639		reqHeaders[k] = v
19640	}
19641	reqHeaders.Set("User-Agent", c.s.userAgent())
19642	var body io.Reader = nil
19643	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
19644	if err != nil {
19645		return nil, err
19646	}
19647	reqHeaders.Set("Content-Type", "application/json")
19648	c.urlParams_.Set("alt", alt)
19649	c.urlParams_.Set("prettyPrint", "false")
19650	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
19651	urls += "?" + c.urlParams_.Encode()
19652	req, err := http.NewRequest("POST", urls, body)
19653	if err != nil {
19654		return nil, err
19655	}
19656	req.Header = reqHeaders
19657	googleapi.Expand(req.URL, map[string]string{
19658		"parent": c.parent,
19659	})
19660	return gensupport.SendRequest(c.ctx_, c.s.client, req)
19661}
19662
19663// Do executes the "logging.organizations.locations.buckets.create" call.
19664// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
19665// status code is an error. Response headers are in either
19666// *LogBucket.ServerResponse.Header or (if a response was returned at
19667// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
19668// to check whether the returned error was because
19669// http.StatusNotModified was returned.
19670func (c *OrganizationsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
19671	gensupport.SetOptions(c.urlParams_, opts...)
19672	res, err := c.doRequest("json")
19673	if res != nil && res.StatusCode == http.StatusNotModified {
19674		if res.Body != nil {
19675			res.Body.Close()
19676		}
19677		return nil, &googleapi.Error{
19678			Code:   res.StatusCode,
19679			Header: res.Header,
19680		}
19681	}
19682	if err != nil {
19683		return nil, err
19684	}
19685	defer googleapi.CloseBody(res)
19686	if err := googleapi.CheckResponse(res); err != nil {
19687		return nil, err
19688	}
19689	ret := &LogBucket{
19690		ServerResponse: googleapi.ServerResponse{
19691			Header:         res.Header,
19692			HTTPStatusCode: res.StatusCode,
19693		},
19694	}
19695	target := &ret
19696	if err := gensupport.DecodeResponse(target, res); err != nil {
19697		return nil, err
19698	}
19699	return ret, nil
19700	// {
19701	//   "description": "Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.",
19702	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets",
19703	//   "httpMethod": "POST",
19704	//   "id": "logging.organizations.locations.buckets.create",
19705	//   "parameterOrder": [
19706	//     "parent"
19707	//   ],
19708	//   "parameters": {
19709	//     "bucketId": {
19710	//       "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.",
19711	//       "location": "query",
19712	//       "type": "string"
19713	//     },
19714	//     "parent": {
19715	//       "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"",
19716	//       "location": "path",
19717	//       "pattern": "^organizations/[^/]+/locations/[^/]+$",
19718	//       "required": true,
19719	//       "type": "string"
19720	//     }
19721	//   },
19722	//   "path": "v2/{+parent}/buckets",
19723	//   "request": {
19724	//     "$ref": "LogBucket"
19725	//   },
19726	//   "response": {
19727	//     "$ref": "LogBucket"
19728	//   },
19729	//   "scopes": [
19730	//     "https://www.googleapis.com/auth/cloud-platform",
19731	//     "https://www.googleapis.com/auth/logging.admin"
19732	//   ]
19733	// }
19734
19735}
19736
19737// method id "logging.organizations.locations.buckets.delete":
19738
19739type OrganizationsLocationsBucketsDeleteCall struct {
19740	s          *Service
19741	name       string
19742	urlParams_ gensupport.URLParams
19743	ctx_       context.Context
19744	header_    http.Header
19745}
19746
19747// Delete: Deletes a log bucket.Changes the bucket's lifecycle_state to
19748// the DELETE_REQUESTED state. After 7 days, the bucket will be purged
19749// and all log entries in the bucket will be permanently deleted.
19750//
19751// - name: The full resource name of the bucket to delete.
19752//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
19753//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
19754//   CKET_ID]"
19755//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
19756//   s/[BUCKET_ID]"
19757//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
19758//   For
19759//   example:"projects/my-project/locations/global/buckets/my-bucket".
19760func (r *OrganizationsLocationsBucketsService) Delete(name string) *OrganizationsLocationsBucketsDeleteCall {
19761	c := &OrganizationsLocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
19762	c.name = name
19763	return c
19764}
19765
19766// Fields allows partial responses to be retrieved. See
19767// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
19768// for more information.
19769func (c *OrganizationsLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsDeleteCall {
19770	c.urlParams_.Set("fields", googleapi.CombineFields(s))
19771	return c
19772}
19773
19774// Context sets the context to be used in this call's Do method. Any
19775// pending HTTP request will be aborted if the provided context is
19776// canceled.
19777func (c *OrganizationsLocationsBucketsDeleteCall) Context(ctx context.Context) *OrganizationsLocationsBucketsDeleteCall {
19778	c.ctx_ = ctx
19779	return c
19780}
19781
19782// Header returns an http.Header that can be modified by the caller to
19783// add HTTP headers to the request.
19784func (c *OrganizationsLocationsBucketsDeleteCall) Header() http.Header {
19785	if c.header_ == nil {
19786		c.header_ = make(http.Header)
19787	}
19788	return c.header_
19789}
19790
19791func (c *OrganizationsLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
19792	reqHeaders := make(http.Header)
19793	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
19794	for k, v := range c.header_ {
19795		reqHeaders[k] = v
19796	}
19797	reqHeaders.Set("User-Agent", c.s.userAgent())
19798	var body io.Reader = nil
19799	c.urlParams_.Set("alt", alt)
19800	c.urlParams_.Set("prettyPrint", "false")
19801	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
19802	urls += "?" + c.urlParams_.Encode()
19803	req, err := http.NewRequest("DELETE", urls, body)
19804	if err != nil {
19805		return nil, err
19806	}
19807	req.Header = reqHeaders
19808	googleapi.Expand(req.URL, map[string]string{
19809		"name": c.name,
19810	})
19811	return gensupport.SendRequest(c.ctx_, c.s.client, req)
19812}
19813
19814// Do executes the "logging.organizations.locations.buckets.delete" call.
19815// Exactly one of *Empty or error will be non-nil. Any non-2xx status
19816// code is an error. Response headers are in either
19817// *Empty.ServerResponse.Header or (if a response was returned at all)
19818// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
19819// check whether the returned error was because http.StatusNotModified
19820// was returned.
19821func (c *OrganizationsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
19822	gensupport.SetOptions(c.urlParams_, opts...)
19823	res, err := c.doRequest("json")
19824	if res != nil && res.StatusCode == http.StatusNotModified {
19825		if res.Body != nil {
19826			res.Body.Close()
19827		}
19828		return nil, &googleapi.Error{
19829			Code:   res.StatusCode,
19830			Header: res.Header,
19831		}
19832	}
19833	if err != nil {
19834		return nil, err
19835	}
19836	defer googleapi.CloseBody(res)
19837	if err := googleapi.CheckResponse(res); err != nil {
19838		return nil, err
19839	}
19840	ret := &Empty{
19841		ServerResponse: googleapi.ServerResponse{
19842			Header:         res.Header,
19843			HTTPStatusCode: res.StatusCode,
19844		},
19845	}
19846	target := &ret
19847	if err := gensupport.DecodeResponse(target, res); err != nil {
19848		return nil, err
19849	}
19850	return ret, nil
19851	// {
19852	//   "description": "Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.",
19853	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}",
19854	//   "httpMethod": "DELETE",
19855	//   "id": "logging.organizations.locations.buckets.delete",
19856	//   "parameterOrder": [
19857	//     "name"
19858	//   ],
19859	//   "parameters": {
19860	//     "name": {
19861	//       "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]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"",
19862	//       "location": "path",
19863	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$",
19864	//       "required": true,
19865	//       "type": "string"
19866	//     }
19867	//   },
19868	//   "path": "v2/{+name}",
19869	//   "response": {
19870	//     "$ref": "Empty"
19871	//   },
19872	//   "scopes": [
19873	//     "https://www.googleapis.com/auth/cloud-platform",
19874	//     "https://www.googleapis.com/auth/logging.admin"
19875	//   ]
19876	// }
19877
19878}
19879
19880// method id "logging.organizations.locations.buckets.get":
19881
19882type OrganizationsLocationsBucketsGetCall struct {
19883	s            *Service
19884	name         string
19885	urlParams_   gensupport.URLParams
19886	ifNoneMatch_ string
19887	ctx_         context.Context
19888	header_      http.Header
19889}
19890
19891// Get: Gets a log bucket.
19892//
19893// - name: The resource name of the bucket:
19894//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
19895//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
19896//   CKET_ID]"
19897//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
19898//   s/[BUCKET_ID]"
19899//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
19900//   For
19901//   example:"projects/my-project/locations/global/buckets/my-bucket".
19902func (r *OrganizationsLocationsBucketsService) Get(name string) *OrganizationsLocationsBucketsGetCall {
19903	c := &OrganizationsLocationsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
19904	c.name = name
19905	return c
19906}
19907
19908// Fields allows partial responses to be retrieved. See
19909// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
19910// for more information.
19911func (c *OrganizationsLocationsBucketsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsGetCall {
19912	c.urlParams_.Set("fields", googleapi.CombineFields(s))
19913	return c
19914}
19915
19916// IfNoneMatch sets the optional parameter which makes the operation
19917// fail if the object's ETag matches the given value. This is useful for
19918// getting updates only after the object has changed since the last
19919// request. Use googleapi.IsNotModified to check whether the response
19920// error from Do is the result of In-None-Match.
19921func (c *OrganizationsLocationsBucketsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsGetCall {
19922	c.ifNoneMatch_ = entityTag
19923	return c
19924}
19925
19926// Context sets the context to be used in this call's Do method. Any
19927// pending HTTP request will be aborted if the provided context is
19928// canceled.
19929func (c *OrganizationsLocationsBucketsGetCall) Context(ctx context.Context) *OrganizationsLocationsBucketsGetCall {
19930	c.ctx_ = ctx
19931	return c
19932}
19933
19934// Header returns an http.Header that can be modified by the caller to
19935// add HTTP headers to the request.
19936func (c *OrganizationsLocationsBucketsGetCall) Header() http.Header {
19937	if c.header_ == nil {
19938		c.header_ = make(http.Header)
19939	}
19940	return c.header_
19941}
19942
19943func (c *OrganizationsLocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) {
19944	reqHeaders := make(http.Header)
19945	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
19946	for k, v := range c.header_ {
19947		reqHeaders[k] = v
19948	}
19949	reqHeaders.Set("User-Agent", c.s.userAgent())
19950	if c.ifNoneMatch_ != "" {
19951		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
19952	}
19953	var body io.Reader = nil
19954	c.urlParams_.Set("alt", alt)
19955	c.urlParams_.Set("prettyPrint", "false")
19956	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
19957	urls += "?" + c.urlParams_.Encode()
19958	req, err := http.NewRequest("GET", urls, body)
19959	if err != nil {
19960		return nil, err
19961	}
19962	req.Header = reqHeaders
19963	googleapi.Expand(req.URL, map[string]string{
19964		"name": c.name,
19965	})
19966	return gensupport.SendRequest(c.ctx_, c.s.client, req)
19967}
19968
19969// Do executes the "logging.organizations.locations.buckets.get" call.
19970// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
19971// status code is an error. Response headers are in either
19972// *LogBucket.ServerResponse.Header or (if a response was returned at
19973// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
19974// to check whether the returned error was because
19975// http.StatusNotModified was returned.
19976func (c *OrganizationsLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
19977	gensupport.SetOptions(c.urlParams_, opts...)
19978	res, err := c.doRequest("json")
19979	if res != nil && res.StatusCode == http.StatusNotModified {
19980		if res.Body != nil {
19981			res.Body.Close()
19982		}
19983		return nil, &googleapi.Error{
19984			Code:   res.StatusCode,
19985			Header: res.Header,
19986		}
19987	}
19988	if err != nil {
19989		return nil, err
19990	}
19991	defer googleapi.CloseBody(res)
19992	if err := googleapi.CheckResponse(res); err != nil {
19993		return nil, err
19994	}
19995	ret := &LogBucket{
19996		ServerResponse: googleapi.ServerResponse{
19997			Header:         res.Header,
19998			HTTPStatusCode: res.StatusCode,
19999		},
20000	}
20001	target := &ret
20002	if err := gensupport.DecodeResponse(target, res); err != nil {
20003		return nil, err
20004	}
20005	return ret, nil
20006	// {
20007	//   "description": "Gets a log bucket.",
20008	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}",
20009	//   "httpMethod": "GET",
20010	//   "id": "logging.organizations.locations.buckets.get",
20011	//   "parameterOrder": [
20012	//     "name"
20013	//   ],
20014	//   "parameters": {
20015	//     "name": {
20016	//       "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]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"",
20017	//       "location": "path",
20018	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$",
20019	//       "required": true,
20020	//       "type": "string"
20021	//     }
20022	//   },
20023	//   "path": "v2/{+name}",
20024	//   "response": {
20025	//     "$ref": "LogBucket"
20026	//   },
20027	//   "scopes": [
20028	//     "https://www.googleapis.com/auth/cloud-platform",
20029	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
20030	//     "https://www.googleapis.com/auth/logging.admin",
20031	//     "https://www.googleapis.com/auth/logging.read"
20032	//   ]
20033	// }
20034
20035}
20036
20037// method id "logging.organizations.locations.buckets.list":
20038
20039type OrganizationsLocationsBucketsListCall struct {
20040	s            *Service
20041	parent       string
20042	urlParams_   gensupport.URLParams
20043	ifNoneMatch_ string
20044	ctx_         context.Context
20045	header_      http.Header
20046}
20047
20048// List: Lists log buckets.
20049//
20050// - parent: The parent resource whose buckets are to be listed:
20051//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
20052//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
20053//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
20054//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations
20055//   portion of the resource must be specified, but supplying the
20056//   character - in place of LOCATION_ID will return all buckets.
20057func (r *OrganizationsLocationsBucketsService) List(parent string) *OrganizationsLocationsBucketsListCall {
20058	c := &OrganizationsLocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
20059	c.parent = parent
20060	return c
20061}
20062
20063// PageSize sets the optional parameter "pageSize": The maximum number
20064// of results to return from this request. Non-positive values are
20065// ignored. The presence of nextPageToken in the response indicates that
20066// more results might be available.
20067func (c *OrganizationsLocationsBucketsListCall) PageSize(pageSize int64) *OrganizationsLocationsBucketsListCall {
20068	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
20069	return c
20070}
20071
20072// PageToken sets the optional parameter "pageToken": If present, then
20073// retrieve the next batch of results from the preceding call to this
20074// method. pageToken must be the value of nextPageToken from the
20075// previous response. The values of other method parameters should be
20076// identical to those in the previous call.
20077func (c *OrganizationsLocationsBucketsListCall) PageToken(pageToken string) *OrganizationsLocationsBucketsListCall {
20078	c.urlParams_.Set("pageToken", pageToken)
20079	return c
20080}
20081
20082// Fields allows partial responses to be retrieved. See
20083// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
20084// for more information.
20085func (c *OrganizationsLocationsBucketsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsListCall {
20086	c.urlParams_.Set("fields", googleapi.CombineFields(s))
20087	return c
20088}
20089
20090// IfNoneMatch sets the optional parameter which makes the operation
20091// fail if the object's ETag matches the given value. This is useful for
20092// getting updates only after the object has changed since the last
20093// request. Use googleapi.IsNotModified to check whether the response
20094// error from Do is the result of In-None-Match.
20095func (c *OrganizationsLocationsBucketsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsListCall {
20096	c.ifNoneMatch_ = entityTag
20097	return c
20098}
20099
20100// Context sets the context to be used in this call's Do method. Any
20101// pending HTTP request will be aborted if the provided context is
20102// canceled.
20103func (c *OrganizationsLocationsBucketsListCall) Context(ctx context.Context) *OrganizationsLocationsBucketsListCall {
20104	c.ctx_ = ctx
20105	return c
20106}
20107
20108// Header returns an http.Header that can be modified by the caller to
20109// add HTTP headers to the request.
20110func (c *OrganizationsLocationsBucketsListCall) Header() http.Header {
20111	if c.header_ == nil {
20112		c.header_ = make(http.Header)
20113	}
20114	return c.header_
20115}
20116
20117func (c *OrganizationsLocationsBucketsListCall) doRequest(alt string) (*http.Response, error) {
20118	reqHeaders := make(http.Header)
20119	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
20120	for k, v := range c.header_ {
20121		reqHeaders[k] = v
20122	}
20123	reqHeaders.Set("User-Agent", c.s.userAgent())
20124	if c.ifNoneMatch_ != "" {
20125		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
20126	}
20127	var body io.Reader = nil
20128	c.urlParams_.Set("alt", alt)
20129	c.urlParams_.Set("prettyPrint", "false")
20130	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
20131	urls += "?" + c.urlParams_.Encode()
20132	req, err := http.NewRequest("GET", urls, body)
20133	if err != nil {
20134		return nil, err
20135	}
20136	req.Header = reqHeaders
20137	googleapi.Expand(req.URL, map[string]string{
20138		"parent": c.parent,
20139	})
20140	return gensupport.SendRequest(c.ctx_, c.s.client, req)
20141}
20142
20143// Do executes the "logging.organizations.locations.buckets.list" call.
20144// Exactly one of *ListBucketsResponse or error will be non-nil. Any
20145// non-2xx status code is an error. Response headers are in either
20146// *ListBucketsResponse.ServerResponse.Header or (if a response was
20147// returned at all) in error.(*googleapi.Error).Header. Use
20148// googleapi.IsNotModified to check whether the returned error was
20149// because http.StatusNotModified was returned.
20150func (c *OrganizationsLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) {
20151	gensupport.SetOptions(c.urlParams_, opts...)
20152	res, err := c.doRequest("json")
20153	if res != nil && res.StatusCode == http.StatusNotModified {
20154		if res.Body != nil {
20155			res.Body.Close()
20156		}
20157		return nil, &googleapi.Error{
20158			Code:   res.StatusCode,
20159			Header: res.Header,
20160		}
20161	}
20162	if err != nil {
20163		return nil, err
20164	}
20165	defer googleapi.CloseBody(res)
20166	if err := googleapi.CheckResponse(res); err != nil {
20167		return nil, err
20168	}
20169	ret := &ListBucketsResponse{
20170		ServerResponse: googleapi.ServerResponse{
20171			Header:         res.Header,
20172			HTTPStatusCode: res.StatusCode,
20173		},
20174	}
20175	target := &ret
20176	if err := gensupport.DecodeResponse(target, res); err != nil {
20177		return nil, err
20178	}
20179	return ret, nil
20180	// {
20181	//   "description": "Lists log buckets.",
20182	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets",
20183	//   "httpMethod": "GET",
20184	//   "id": "logging.organizations.locations.buckets.list",
20185	//   "parameterOrder": [
20186	//     "parent"
20187	//   ],
20188	//   "parameters": {
20189	//     "pageSize": {
20190	//       "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.",
20191	//       "format": "int32",
20192	//       "location": "query",
20193	//       "type": "integer"
20194	//     },
20195	//     "pageToken": {
20196	//       "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.",
20197	//       "location": "query",
20198	//       "type": "string"
20199	//     },
20200	//     "parent": {
20201	//       "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.",
20202	//       "location": "path",
20203	//       "pattern": "^organizations/[^/]+/locations/[^/]+$",
20204	//       "required": true,
20205	//       "type": "string"
20206	//     }
20207	//   },
20208	//   "path": "v2/{+parent}/buckets",
20209	//   "response": {
20210	//     "$ref": "ListBucketsResponse"
20211	//   },
20212	//   "scopes": [
20213	//     "https://www.googleapis.com/auth/cloud-platform",
20214	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
20215	//     "https://www.googleapis.com/auth/logging.admin",
20216	//     "https://www.googleapis.com/auth/logging.read"
20217	//   ]
20218	// }
20219
20220}
20221
20222// Pages invokes f for each page of results.
20223// A non-nil error returned from f will halt the iteration.
20224// The provided context supersedes any context provided to the Context method.
20225func (c *OrganizationsLocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error {
20226	c.ctx_ = ctx
20227	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
20228	for {
20229		x, err := c.Do()
20230		if err != nil {
20231			return err
20232		}
20233		if err := f(x); err != nil {
20234			return err
20235		}
20236		if x.NextPageToken == "" {
20237			return nil
20238		}
20239		c.PageToken(x.NextPageToken)
20240	}
20241}
20242
20243// method id "logging.organizations.locations.buckets.patch":
20244
20245type OrganizationsLocationsBucketsPatchCall struct {
20246	s          *Service
20247	name       string
20248	logbucket  *LogBucket
20249	urlParams_ gensupport.URLParams
20250	ctx_       context.Context
20251	header_    http.Header
20252}
20253
20254// Patch: Updates a log bucket. This method replaces the following
20255// fields in the existing bucket with values from the new bucket:
20256// retention_periodIf the retention period is decreased and the bucket
20257// is locked, FAILED_PRECONDITION will be returned.If the bucket has a
20258// lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be
20259// returned.After a bucket has been created, the bucket's location
20260// cannot be changed.
20261//
20262// - name: The full resource name of the bucket to update.
20263//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
20264//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
20265//   CKET_ID]"
20266//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
20267//   s/[BUCKET_ID]"
20268//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
20269//   For
20270//   example:"projects/my-project/locations/global/buckets/my-bucket".
20271func (r *OrganizationsLocationsBucketsService) Patch(name string, logbucket *LogBucket) *OrganizationsLocationsBucketsPatchCall {
20272	c := &OrganizationsLocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
20273	c.name = name
20274	c.logbucket = logbucket
20275	return c
20276}
20277
20278// UpdateMask sets the optional parameter "updateMask": Required. Field
20279// mask that specifies the fields in bucket that need an update. A
20280// bucket field will be overwritten if, and only if, it is in the update
20281// mask. name and output only fields cannot be updated.For a detailed
20282// FieldMask definition, see:
20283// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor
20284// example: updateMask=retention_days
20285func (c *OrganizationsLocationsBucketsPatchCall) UpdateMask(updateMask string) *OrganizationsLocationsBucketsPatchCall {
20286	c.urlParams_.Set("updateMask", updateMask)
20287	return c
20288}
20289
20290// Fields allows partial responses to be retrieved. See
20291// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
20292// for more information.
20293func (c *OrganizationsLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsPatchCall {
20294	c.urlParams_.Set("fields", googleapi.CombineFields(s))
20295	return c
20296}
20297
20298// Context sets the context to be used in this call's Do method. Any
20299// pending HTTP request will be aborted if the provided context is
20300// canceled.
20301func (c *OrganizationsLocationsBucketsPatchCall) Context(ctx context.Context) *OrganizationsLocationsBucketsPatchCall {
20302	c.ctx_ = ctx
20303	return c
20304}
20305
20306// Header returns an http.Header that can be modified by the caller to
20307// add HTTP headers to the request.
20308func (c *OrganizationsLocationsBucketsPatchCall) Header() http.Header {
20309	if c.header_ == nil {
20310		c.header_ = make(http.Header)
20311	}
20312	return c.header_
20313}
20314
20315func (c *OrganizationsLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
20316	reqHeaders := make(http.Header)
20317	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
20318	for k, v := range c.header_ {
20319		reqHeaders[k] = v
20320	}
20321	reqHeaders.Set("User-Agent", c.s.userAgent())
20322	var body io.Reader = nil
20323	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
20324	if err != nil {
20325		return nil, err
20326	}
20327	reqHeaders.Set("Content-Type", "application/json")
20328	c.urlParams_.Set("alt", alt)
20329	c.urlParams_.Set("prettyPrint", "false")
20330	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
20331	urls += "?" + c.urlParams_.Encode()
20332	req, err := http.NewRequest("PATCH", urls, body)
20333	if err != nil {
20334		return nil, err
20335	}
20336	req.Header = reqHeaders
20337	googleapi.Expand(req.URL, map[string]string{
20338		"name": c.name,
20339	})
20340	return gensupport.SendRequest(c.ctx_, c.s.client, req)
20341}
20342
20343// Do executes the "logging.organizations.locations.buckets.patch" call.
20344// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
20345// status code is an error. Response headers are in either
20346// *LogBucket.ServerResponse.Header or (if a response was returned at
20347// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
20348// to check whether the returned error was because
20349// http.StatusNotModified was returned.
20350func (c *OrganizationsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
20351	gensupport.SetOptions(c.urlParams_, opts...)
20352	res, err := c.doRequest("json")
20353	if res != nil && res.StatusCode == http.StatusNotModified {
20354		if res.Body != nil {
20355			res.Body.Close()
20356		}
20357		return nil, &googleapi.Error{
20358			Code:   res.StatusCode,
20359			Header: res.Header,
20360		}
20361	}
20362	if err != nil {
20363		return nil, err
20364	}
20365	defer googleapi.CloseBody(res)
20366	if err := googleapi.CheckResponse(res); err != nil {
20367		return nil, err
20368	}
20369	ret := &LogBucket{
20370		ServerResponse: googleapi.ServerResponse{
20371			Header:         res.Header,
20372			HTTPStatusCode: res.StatusCode,
20373		},
20374	}
20375	target := &ret
20376	if err := gensupport.DecodeResponse(target, res); err != nil {
20377		return nil, err
20378	}
20379	return ret, nil
20380	// {
20381	//   "description": "Updates a log 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 lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.",
20382	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}",
20383	//   "httpMethod": "PATCH",
20384	//   "id": "logging.organizations.locations.buckets.patch",
20385	//   "parameterOrder": [
20386	//     "name"
20387	//   ],
20388	//   "parameters": {
20389	//     "name": {
20390	//       "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]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"",
20391	//       "location": "path",
20392	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$",
20393	//       "required": true,
20394	//       "type": "string"
20395	//     },
20396	//     "updateMask": {
20397	//       "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.FieldMaskFor example: updateMask=retention_days",
20398	//       "format": "google-fieldmask",
20399	//       "location": "query",
20400	//       "type": "string"
20401	//     }
20402	//   },
20403	//   "path": "v2/{+name}",
20404	//   "request": {
20405	//     "$ref": "LogBucket"
20406	//   },
20407	//   "response": {
20408	//     "$ref": "LogBucket"
20409	//   },
20410	//   "scopes": [
20411	//     "https://www.googleapis.com/auth/cloud-platform",
20412	//     "https://www.googleapis.com/auth/logging.admin"
20413	//   ]
20414	// }
20415
20416}
20417
20418// method id "logging.organizations.locations.buckets.undelete":
20419
20420type OrganizationsLocationsBucketsUndeleteCall struct {
20421	s                     *Service
20422	name                  string
20423	undeletebucketrequest *UndeleteBucketRequest
20424	urlParams_            gensupport.URLParams
20425	ctx_                  context.Context
20426	header_               http.Header
20427}
20428
20429// Undelete: Undeletes a log bucket. A bucket that has been deleted can
20430// be undeleted within the grace period of 7 days.
20431//
20432// - name: The full resource name of the bucket to undelete.
20433//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
20434//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
20435//   CKET_ID]"
20436//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
20437//   s/[BUCKET_ID]"
20438//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
20439//   For
20440//   example:"projects/my-project/locations/global/buckets/my-bucket".
20441func (r *OrganizationsLocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *OrganizationsLocationsBucketsUndeleteCall {
20442	c := &OrganizationsLocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
20443	c.name = name
20444	c.undeletebucketrequest = undeletebucketrequest
20445	return c
20446}
20447
20448// Fields allows partial responses to be retrieved. See
20449// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
20450// for more information.
20451func (c *OrganizationsLocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsUndeleteCall {
20452	c.urlParams_.Set("fields", googleapi.CombineFields(s))
20453	return c
20454}
20455
20456// Context sets the context to be used in this call's Do method. Any
20457// pending HTTP request will be aborted if the provided context is
20458// canceled.
20459func (c *OrganizationsLocationsBucketsUndeleteCall) Context(ctx context.Context) *OrganizationsLocationsBucketsUndeleteCall {
20460	c.ctx_ = ctx
20461	return c
20462}
20463
20464// Header returns an http.Header that can be modified by the caller to
20465// add HTTP headers to the request.
20466func (c *OrganizationsLocationsBucketsUndeleteCall) Header() http.Header {
20467	if c.header_ == nil {
20468		c.header_ = make(http.Header)
20469	}
20470	return c.header_
20471}
20472
20473func (c *OrganizationsLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) {
20474	reqHeaders := make(http.Header)
20475	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
20476	for k, v := range c.header_ {
20477		reqHeaders[k] = v
20478	}
20479	reqHeaders.Set("User-Agent", c.s.userAgent())
20480	var body io.Reader = nil
20481	body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest)
20482	if err != nil {
20483		return nil, err
20484	}
20485	reqHeaders.Set("Content-Type", "application/json")
20486	c.urlParams_.Set("alt", alt)
20487	c.urlParams_.Set("prettyPrint", "false")
20488	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete")
20489	urls += "?" + c.urlParams_.Encode()
20490	req, err := http.NewRequest("POST", urls, body)
20491	if err != nil {
20492		return nil, err
20493	}
20494	req.Header = reqHeaders
20495	googleapi.Expand(req.URL, map[string]string{
20496		"name": c.name,
20497	})
20498	return gensupport.SendRequest(c.ctx_, c.s.client, req)
20499}
20500
20501// Do executes the "logging.organizations.locations.buckets.undelete" call.
20502// Exactly one of *Empty or error will be non-nil. Any non-2xx status
20503// code is an error. Response headers are in either
20504// *Empty.ServerResponse.Header or (if a response was returned at all)
20505// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
20506// check whether the returned error was because http.StatusNotModified
20507// was returned.
20508func (c *OrganizationsLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
20509	gensupport.SetOptions(c.urlParams_, opts...)
20510	res, err := c.doRequest("json")
20511	if res != nil && res.StatusCode == http.StatusNotModified {
20512		if res.Body != nil {
20513			res.Body.Close()
20514		}
20515		return nil, &googleapi.Error{
20516			Code:   res.StatusCode,
20517			Header: res.Header,
20518		}
20519	}
20520	if err != nil {
20521		return nil, err
20522	}
20523	defer googleapi.CloseBody(res)
20524	if err := googleapi.CheckResponse(res); err != nil {
20525		return nil, err
20526	}
20527	ret := &Empty{
20528		ServerResponse: googleapi.ServerResponse{
20529			Header:         res.Header,
20530			HTTPStatusCode: res.StatusCode,
20531		},
20532	}
20533	target := &ret
20534	if err := gensupport.DecodeResponse(target, res); err != nil {
20535		return nil, err
20536	}
20537	return ret, nil
20538	// {
20539	//   "description": "Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.",
20540	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}:undelete",
20541	//   "httpMethod": "POST",
20542	//   "id": "logging.organizations.locations.buckets.undelete",
20543	//   "parameterOrder": [
20544	//     "name"
20545	//   ],
20546	//   "parameters": {
20547	//     "name": {
20548	//       "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]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"",
20549	//       "location": "path",
20550	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$",
20551	//       "required": true,
20552	//       "type": "string"
20553	//     }
20554	//   },
20555	//   "path": "v2/{+name}:undelete",
20556	//   "request": {
20557	//     "$ref": "UndeleteBucketRequest"
20558	//   },
20559	//   "response": {
20560	//     "$ref": "Empty"
20561	//   },
20562	//   "scopes": [
20563	//     "https://www.googleapis.com/auth/cloud-platform",
20564	//     "https://www.googleapis.com/auth/logging.admin"
20565	//   ]
20566	// }
20567
20568}
20569
20570// method id "logging.organizations.locations.buckets.views.create":
20571
20572type OrganizationsLocationsBucketsViewsCreateCall struct {
20573	s          *Service
20574	parent     string
20575	logview    *LogView
20576	urlParams_ gensupport.URLParams
20577	ctx_       context.Context
20578	header_    http.Header
20579}
20580
20581// Create: Creates a view over log entries in a log bucket. A bucket may
20582// contain a maximum of 30 views.
20583//
20584// - parent: The bucket in which to create the view
20585//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
20586//   ` For
20587//   example:"projects/my-project/locations/global/buckets/my-bucket".
20588func (r *OrganizationsLocationsBucketsViewsService) Create(parent string, logview *LogView) *OrganizationsLocationsBucketsViewsCreateCall {
20589	c := &OrganizationsLocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
20590	c.parent = parent
20591	c.logview = logview
20592	return c
20593}
20594
20595// ViewId sets the optional parameter "viewId": Required. The id to use
20596// for this view.
20597func (c *OrganizationsLocationsBucketsViewsCreateCall) ViewId(viewId string) *OrganizationsLocationsBucketsViewsCreateCall {
20598	c.urlParams_.Set("viewId", viewId)
20599	return c
20600}
20601
20602// Fields allows partial responses to be retrieved. See
20603// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
20604// for more information.
20605func (c *OrganizationsLocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsCreateCall {
20606	c.urlParams_.Set("fields", googleapi.CombineFields(s))
20607	return c
20608}
20609
20610// Context sets the context to be used in this call's Do method. Any
20611// pending HTTP request will be aborted if the provided context is
20612// canceled.
20613func (c *OrganizationsLocationsBucketsViewsCreateCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsCreateCall {
20614	c.ctx_ = ctx
20615	return c
20616}
20617
20618// Header returns an http.Header that can be modified by the caller to
20619// add HTTP headers to the request.
20620func (c *OrganizationsLocationsBucketsViewsCreateCall) Header() http.Header {
20621	if c.header_ == nil {
20622		c.header_ = make(http.Header)
20623	}
20624	return c.header_
20625}
20626
20627func (c *OrganizationsLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) {
20628	reqHeaders := make(http.Header)
20629	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
20630	for k, v := range c.header_ {
20631		reqHeaders[k] = v
20632	}
20633	reqHeaders.Set("User-Agent", c.s.userAgent())
20634	var body io.Reader = nil
20635	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
20636	if err != nil {
20637		return nil, err
20638	}
20639	reqHeaders.Set("Content-Type", "application/json")
20640	c.urlParams_.Set("alt", alt)
20641	c.urlParams_.Set("prettyPrint", "false")
20642	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
20643	urls += "?" + c.urlParams_.Encode()
20644	req, err := http.NewRequest("POST", urls, body)
20645	if err != nil {
20646		return nil, err
20647	}
20648	req.Header = reqHeaders
20649	googleapi.Expand(req.URL, map[string]string{
20650		"parent": c.parent,
20651	})
20652	return gensupport.SendRequest(c.ctx_, c.s.client, req)
20653}
20654
20655// Do executes the "logging.organizations.locations.buckets.views.create" call.
20656// Exactly one of *LogView or error will be non-nil. Any non-2xx status
20657// code is an error. Response headers are in either
20658// *LogView.ServerResponse.Header or (if a response was returned at all)
20659// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
20660// check whether the returned error was because http.StatusNotModified
20661// was returned.
20662func (c *OrganizationsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
20663	gensupport.SetOptions(c.urlParams_, opts...)
20664	res, err := c.doRequest("json")
20665	if res != nil && res.StatusCode == http.StatusNotModified {
20666		if res.Body != nil {
20667			res.Body.Close()
20668		}
20669		return nil, &googleapi.Error{
20670			Code:   res.StatusCode,
20671			Header: res.Header,
20672		}
20673	}
20674	if err != nil {
20675		return nil, err
20676	}
20677	defer googleapi.CloseBody(res)
20678	if err := googleapi.CheckResponse(res); err != nil {
20679		return nil, err
20680	}
20681	ret := &LogView{
20682		ServerResponse: googleapi.ServerResponse{
20683			Header:         res.Header,
20684			HTTPStatusCode: res.StatusCode,
20685		},
20686	}
20687	target := &ret
20688	if err := gensupport.DecodeResponse(target, res); err != nil {
20689		return nil, err
20690	}
20691	return ret, nil
20692	// {
20693	//   "description": "Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.",
20694	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views",
20695	//   "httpMethod": "POST",
20696	//   "id": "logging.organizations.locations.buckets.views.create",
20697	//   "parameterOrder": [
20698	//     "parent"
20699	//   ],
20700	//   "parameters": {
20701	//     "parent": {
20702	//       "description": "Required. The bucket in which to create the view `\"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\"` For example:\"projects/my-project/locations/global/buckets/my-bucket\"",
20703	//       "location": "path",
20704	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$",
20705	//       "required": true,
20706	//       "type": "string"
20707	//     },
20708	//     "viewId": {
20709	//       "description": "Required. The id to use for this view.",
20710	//       "location": "query",
20711	//       "type": "string"
20712	//     }
20713	//   },
20714	//   "path": "v2/{+parent}/views",
20715	//   "request": {
20716	//     "$ref": "LogView"
20717	//   },
20718	//   "response": {
20719	//     "$ref": "LogView"
20720	//   },
20721	//   "scopes": [
20722	//     "https://www.googleapis.com/auth/cloud-platform",
20723	//     "https://www.googleapis.com/auth/logging.admin"
20724	//   ]
20725	// }
20726
20727}
20728
20729// method id "logging.organizations.locations.buckets.views.delete":
20730
20731type OrganizationsLocationsBucketsViewsDeleteCall struct {
20732	s          *Service
20733	name       string
20734	urlParams_ gensupport.URLParams
20735	ctx_       context.Context
20736	header_    http.Header
20737}
20738
20739// Delete: Deletes a view on a log bucket. If an UNAVAILABLE error is
20740// returned, this indicates that system is not in a state where it can
20741// delete the view. If this occurs, please try again in a few minutes.
20742//
20743// - name: The full resource name of the view to delete:
20744//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
20745//   iews/[VIEW_ID]" For
20746//   example:"projects/my-project/locations/global/buckets/my-bucket/view
20747//   s/my-view".
20748func (r *OrganizationsLocationsBucketsViewsService) Delete(name string) *OrganizationsLocationsBucketsViewsDeleteCall {
20749	c := &OrganizationsLocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
20750	c.name = name
20751	return c
20752}
20753
20754// Fields allows partial responses to be retrieved. See
20755// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
20756// for more information.
20757func (c *OrganizationsLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsDeleteCall {
20758	c.urlParams_.Set("fields", googleapi.CombineFields(s))
20759	return c
20760}
20761
20762// Context sets the context to be used in this call's Do method. Any
20763// pending HTTP request will be aborted if the provided context is
20764// canceled.
20765func (c *OrganizationsLocationsBucketsViewsDeleteCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsDeleteCall {
20766	c.ctx_ = ctx
20767	return c
20768}
20769
20770// Header returns an http.Header that can be modified by the caller to
20771// add HTTP headers to the request.
20772func (c *OrganizationsLocationsBucketsViewsDeleteCall) Header() http.Header {
20773	if c.header_ == nil {
20774		c.header_ = make(http.Header)
20775	}
20776	return c.header_
20777}
20778
20779func (c *OrganizationsLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) {
20780	reqHeaders := make(http.Header)
20781	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
20782	for k, v := range c.header_ {
20783		reqHeaders[k] = v
20784	}
20785	reqHeaders.Set("User-Agent", c.s.userAgent())
20786	var body io.Reader = nil
20787	c.urlParams_.Set("alt", alt)
20788	c.urlParams_.Set("prettyPrint", "false")
20789	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
20790	urls += "?" + c.urlParams_.Encode()
20791	req, err := http.NewRequest("DELETE", urls, body)
20792	if err != nil {
20793		return nil, err
20794	}
20795	req.Header = reqHeaders
20796	googleapi.Expand(req.URL, map[string]string{
20797		"name": c.name,
20798	})
20799	return gensupport.SendRequest(c.ctx_, c.s.client, req)
20800}
20801
20802// Do executes the "logging.organizations.locations.buckets.views.delete" call.
20803// Exactly one of *Empty or error will be non-nil. Any non-2xx status
20804// code is an error. Response headers are in either
20805// *Empty.ServerResponse.Header or (if a response was returned at all)
20806// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
20807// check whether the returned error was because http.StatusNotModified
20808// was returned.
20809func (c *OrganizationsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
20810	gensupport.SetOptions(c.urlParams_, opts...)
20811	res, err := c.doRequest("json")
20812	if res != nil && res.StatusCode == http.StatusNotModified {
20813		if res.Body != nil {
20814			res.Body.Close()
20815		}
20816		return nil, &googleapi.Error{
20817			Code:   res.StatusCode,
20818			Header: res.Header,
20819		}
20820	}
20821	if err != nil {
20822		return nil, err
20823	}
20824	defer googleapi.CloseBody(res)
20825	if err := googleapi.CheckResponse(res); err != nil {
20826		return nil, err
20827	}
20828	ret := &Empty{
20829		ServerResponse: googleapi.ServerResponse{
20830			Header:         res.Header,
20831			HTTPStatusCode: res.StatusCode,
20832		},
20833	}
20834	target := &ret
20835	if err := gensupport.DecodeResponse(target, res); err != nil {
20836		return nil, err
20837	}
20838	return ret, nil
20839	// {
20840	//   "description": "Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.",
20841	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
20842	//   "httpMethod": "DELETE",
20843	//   "id": "logging.organizations.locations.buckets.views.delete",
20844	//   "parameterOrder": [
20845	//     "name"
20846	//   ],
20847	//   "parameters": {
20848	//     "name": {
20849	//       "description": "Required. The full resource name of the view to delete: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"",
20850	//       "location": "path",
20851	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
20852	//       "required": true,
20853	//       "type": "string"
20854	//     }
20855	//   },
20856	//   "path": "v2/{+name}",
20857	//   "response": {
20858	//     "$ref": "Empty"
20859	//   },
20860	//   "scopes": [
20861	//     "https://www.googleapis.com/auth/cloud-platform",
20862	//     "https://www.googleapis.com/auth/logging.admin"
20863	//   ]
20864	// }
20865
20866}
20867
20868// method id "logging.organizations.locations.buckets.views.get":
20869
20870type OrganizationsLocationsBucketsViewsGetCall struct {
20871	s            *Service
20872	name         string
20873	urlParams_   gensupport.URLParams
20874	ifNoneMatch_ string
20875	ctx_         context.Context
20876	header_      http.Header
20877}
20878
20879// Get: Gets a view on a log bucket..
20880//
20881// - name: The resource name of the policy:
20882//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
20883//   iews/[VIEW_ID]" For
20884//   example:"projects/my-project/locations/global/buckets/my-bucket/view
20885//   s/my-view".
20886func (r *OrganizationsLocationsBucketsViewsService) Get(name string) *OrganizationsLocationsBucketsViewsGetCall {
20887	c := &OrganizationsLocationsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
20888	c.name = name
20889	return c
20890}
20891
20892// Fields allows partial responses to be retrieved. See
20893// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
20894// for more information.
20895func (c *OrganizationsLocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsGetCall {
20896	c.urlParams_.Set("fields", googleapi.CombineFields(s))
20897	return c
20898}
20899
20900// IfNoneMatch sets the optional parameter which makes the operation
20901// fail if the object's ETag matches the given value. This is useful for
20902// getting updates only after the object has changed since the last
20903// request. Use googleapi.IsNotModified to check whether the response
20904// error from Do is the result of In-None-Match.
20905func (c *OrganizationsLocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsViewsGetCall {
20906	c.ifNoneMatch_ = entityTag
20907	return c
20908}
20909
20910// Context sets the context to be used in this call's Do method. Any
20911// pending HTTP request will be aborted if the provided context is
20912// canceled.
20913func (c *OrganizationsLocationsBucketsViewsGetCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsGetCall {
20914	c.ctx_ = ctx
20915	return c
20916}
20917
20918// Header returns an http.Header that can be modified by the caller to
20919// add HTTP headers to the request.
20920func (c *OrganizationsLocationsBucketsViewsGetCall) Header() http.Header {
20921	if c.header_ == nil {
20922		c.header_ = make(http.Header)
20923	}
20924	return c.header_
20925}
20926
20927func (c *OrganizationsLocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) {
20928	reqHeaders := make(http.Header)
20929	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
20930	for k, v := range c.header_ {
20931		reqHeaders[k] = v
20932	}
20933	reqHeaders.Set("User-Agent", c.s.userAgent())
20934	if c.ifNoneMatch_ != "" {
20935		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
20936	}
20937	var body io.Reader = nil
20938	c.urlParams_.Set("alt", alt)
20939	c.urlParams_.Set("prettyPrint", "false")
20940	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
20941	urls += "?" + c.urlParams_.Encode()
20942	req, err := http.NewRequest("GET", urls, body)
20943	if err != nil {
20944		return nil, err
20945	}
20946	req.Header = reqHeaders
20947	googleapi.Expand(req.URL, map[string]string{
20948		"name": c.name,
20949	})
20950	return gensupport.SendRequest(c.ctx_, c.s.client, req)
20951}
20952
20953// Do executes the "logging.organizations.locations.buckets.views.get" call.
20954// Exactly one of *LogView or error will be non-nil. Any non-2xx status
20955// code is an error. Response headers are in either
20956// *LogView.ServerResponse.Header or (if a response was returned at all)
20957// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
20958// check whether the returned error was because http.StatusNotModified
20959// was returned.
20960func (c *OrganizationsLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
20961	gensupport.SetOptions(c.urlParams_, opts...)
20962	res, err := c.doRequest("json")
20963	if res != nil && res.StatusCode == http.StatusNotModified {
20964		if res.Body != nil {
20965			res.Body.Close()
20966		}
20967		return nil, &googleapi.Error{
20968			Code:   res.StatusCode,
20969			Header: res.Header,
20970		}
20971	}
20972	if err != nil {
20973		return nil, err
20974	}
20975	defer googleapi.CloseBody(res)
20976	if err := googleapi.CheckResponse(res); err != nil {
20977		return nil, err
20978	}
20979	ret := &LogView{
20980		ServerResponse: googleapi.ServerResponse{
20981			Header:         res.Header,
20982			HTTPStatusCode: res.StatusCode,
20983		},
20984	}
20985	target := &ret
20986	if err := gensupport.DecodeResponse(target, res); err != nil {
20987		return nil, err
20988	}
20989	return ret, nil
20990	// {
20991	//   "description": "Gets a view on a log bucket..",
20992	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
20993	//   "httpMethod": "GET",
20994	//   "id": "logging.organizations.locations.buckets.views.get",
20995	//   "parameterOrder": [
20996	//     "name"
20997	//   ],
20998	//   "parameters": {
20999	//     "name": {
21000	//       "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"",
21001	//       "location": "path",
21002	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
21003	//       "required": true,
21004	//       "type": "string"
21005	//     }
21006	//   },
21007	//   "path": "v2/{+name}",
21008	//   "response": {
21009	//     "$ref": "LogView"
21010	//   },
21011	//   "scopes": [
21012	//     "https://www.googleapis.com/auth/cloud-platform",
21013	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
21014	//     "https://www.googleapis.com/auth/logging.admin",
21015	//     "https://www.googleapis.com/auth/logging.read"
21016	//   ]
21017	// }
21018
21019}
21020
21021// method id "logging.organizations.locations.buckets.views.list":
21022
21023type OrganizationsLocationsBucketsViewsListCall struct {
21024	s            *Service
21025	parent       string
21026	urlParams_   gensupport.URLParams
21027	ifNoneMatch_ string
21028	ctx_         context.Context
21029	header_      http.Header
21030}
21031
21032// List: Lists views on a log bucket.
21033//
21034// - parent: The bucket whose views are to be listed:
21035//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]".
21036func (r *OrganizationsLocationsBucketsViewsService) List(parent string) *OrganizationsLocationsBucketsViewsListCall {
21037	c := &OrganizationsLocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
21038	c.parent = parent
21039	return c
21040}
21041
21042// PageSize sets the optional parameter "pageSize": The maximum number
21043// of results to return from this request.Non-positive values are
21044// ignored. The presence of nextPageToken in the response indicates that
21045// more results might be available.
21046func (c *OrganizationsLocationsBucketsViewsListCall) PageSize(pageSize int64) *OrganizationsLocationsBucketsViewsListCall {
21047	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
21048	return c
21049}
21050
21051// PageToken sets the optional parameter "pageToken": If present, then
21052// retrieve the next batch of results from the preceding call to this
21053// method. pageToken must be the value of nextPageToken from the
21054// previous response. The values of other method parameters should be
21055// identical to those in the previous call.
21056func (c *OrganizationsLocationsBucketsViewsListCall) PageToken(pageToken string) *OrganizationsLocationsBucketsViewsListCall {
21057	c.urlParams_.Set("pageToken", pageToken)
21058	return c
21059}
21060
21061// Fields allows partial responses to be retrieved. See
21062// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
21063// for more information.
21064func (c *OrganizationsLocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsListCall {
21065	c.urlParams_.Set("fields", googleapi.CombineFields(s))
21066	return c
21067}
21068
21069// IfNoneMatch sets the optional parameter which makes the operation
21070// fail if the object's ETag matches the given value. This is useful for
21071// getting updates only after the object has changed since the last
21072// request. Use googleapi.IsNotModified to check whether the response
21073// error from Do is the result of In-None-Match.
21074func (c *OrganizationsLocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsBucketsViewsListCall {
21075	c.ifNoneMatch_ = entityTag
21076	return c
21077}
21078
21079// Context sets the context to be used in this call's Do method. Any
21080// pending HTTP request will be aborted if the provided context is
21081// canceled.
21082func (c *OrganizationsLocationsBucketsViewsListCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsListCall {
21083	c.ctx_ = ctx
21084	return c
21085}
21086
21087// Header returns an http.Header that can be modified by the caller to
21088// add HTTP headers to the request.
21089func (c *OrganizationsLocationsBucketsViewsListCall) Header() http.Header {
21090	if c.header_ == nil {
21091		c.header_ = make(http.Header)
21092	}
21093	return c.header_
21094}
21095
21096func (c *OrganizationsLocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) {
21097	reqHeaders := make(http.Header)
21098	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
21099	for k, v := range c.header_ {
21100		reqHeaders[k] = v
21101	}
21102	reqHeaders.Set("User-Agent", c.s.userAgent())
21103	if c.ifNoneMatch_ != "" {
21104		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
21105	}
21106	var body io.Reader = nil
21107	c.urlParams_.Set("alt", alt)
21108	c.urlParams_.Set("prettyPrint", "false")
21109	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
21110	urls += "?" + c.urlParams_.Encode()
21111	req, err := http.NewRequest("GET", urls, body)
21112	if err != nil {
21113		return nil, err
21114	}
21115	req.Header = reqHeaders
21116	googleapi.Expand(req.URL, map[string]string{
21117		"parent": c.parent,
21118	})
21119	return gensupport.SendRequest(c.ctx_, c.s.client, req)
21120}
21121
21122// Do executes the "logging.organizations.locations.buckets.views.list" call.
21123// Exactly one of *ListViewsResponse or error will be non-nil. Any
21124// non-2xx status code is an error. Response headers are in either
21125// *ListViewsResponse.ServerResponse.Header or (if a response was
21126// returned at all) in error.(*googleapi.Error).Header. Use
21127// googleapi.IsNotModified to check whether the returned error was
21128// because http.StatusNotModified was returned.
21129func (c *OrganizationsLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) {
21130	gensupport.SetOptions(c.urlParams_, opts...)
21131	res, err := c.doRequest("json")
21132	if res != nil && res.StatusCode == http.StatusNotModified {
21133		if res.Body != nil {
21134			res.Body.Close()
21135		}
21136		return nil, &googleapi.Error{
21137			Code:   res.StatusCode,
21138			Header: res.Header,
21139		}
21140	}
21141	if err != nil {
21142		return nil, err
21143	}
21144	defer googleapi.CloseBody(res)
21145	if err := googleapi.CheckResponse(res); err != nil {
21146		return nil, err
21147	}
21148	ret := &ListViewsResponse{
21149		ServerResponse: googleapi.ServerResponse{
21150			Header:         res.Header,
21151			HTTPStatusCode: res.StatusCode,
21152		},
21153	}
21154	target := &ret
21155	if err := gensupport.DecodeResponse(target, res); err != nil {
21156		return nil, err
21157	}
21158	return ret, nil
21159	// {
21160	//   "description": "Lists views on a log bucket.",
21161	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views",
21162	//   "httpMethod": "GET",
21163	//   "id": "logging.organizations.locations.buckets.views.list",
21164	//   "parameterOrder": [
21165	//     "parent"
21166	//   ],
21167	//   "parameters": {
21168	//     "pageSize": {
21169	//       "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.",
21170	//       "format": "int32",
21171	//       "location": "query",
21172	//       "type": "integer"
21173	//     },
21174	//     "pageToken": {
21175	//       "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.",
21176	//       "location": "query",
21177	//       "type": "string"
21178	//     },
21179	//     "parent": {
21180	//       "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ",
21181	//       "location": "path",
21182	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+$",
21183	//       "required": true,
21184	//       "type": "string"
21185	//     }
21186	//   },
21187	//   "path": "v2/{+parent}/views",
21188	//   "response": {
21189	//     "$ref": "ListViewsResponse"
21190	//   },
21191	//   "scopes": [
21192	//     "https://www.googleapis.com/auth/cloud-platform",
21193	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
21194	//     "https://www.googleapis.com/auth/logging.admin",
21195	//     "https://www.googleapis.com/auth/logging.read"
21196	//   ]
21197	// }
21198
21199}
21200
21201// Pages invokes f for each page of results.
21202// A non-nil error returned from f will halt the iteration.
21203// The provided context supersedes any context provided to the Context method.
21204func (c *OrganizationsLocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error {
21205	c.ctx_ = ctx
21206	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
21207	for {
21208		x, err := c.Do()
21209		if err != nil {
21210			return err
21211		}
21212		if err := f(x); err != nil {
21213			return err
21214		}
21215		if x.NextPageToken == "" {
21216			return nil
21217		}
21218		c.PageToken(x.NextPageToken)
21219	}
21220}
21221
21222// method id "logging.organizations.locations.buckets.views.patch":
21223
21224type OrganizationsLocationsBucketsViewsPatchCall struct {
21225	s          *Service
21226	name       string
21227	logview    *LogView
21228	urlParams_ gensupport.URLParams
21229	ctx_       context.Context
21230	header_    http.Header
21231}
21232
21233// Patch: Updates a view on a log bucket. This method replaces the
21234// following fields in the existing view with values from the new view:
21235// filter. If an UNAVAILABLE error is returned, this indicates that
21236// system is not in a state where it can update the view. If this
21237// occurs, please try again in a few minutes.
21238//
21239// - name: The full resource name of the view to update
21240//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
21241//   iews/[VIEW_ID]" For
21242//   example:"projects/my-project/locations/global/buckets/my-bucket/view
21243//   s/my-view".
21244func (r *OrganizationsLocationsBucketsViewsService) Patch(name string, logview *LogView) *OrganizationsLocationsBucketsViewsPatchCall {
21245	c := &OrganizationsLocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
21246	c.name = name
21247	c.logview = logview
21248	return c
21249}
21250
21251// UpdateMask sets the optional parameter "updateMask": Field mask that
21252// specifies the fields in view that need an update. A field will be
21253// overwritten if, and only if, it is in the update mask. name and
21254// output only fields cannot be updated.For a detailed FieldMask
21255// definition, see
21256// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor
21257// example: updateMask=filter
21258func (c *OrganizationsLocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *OrganizationsLocationsBucketsViewsPatchCall {
21259	c.urlParams_.Set("updateMask", updateMask)
21260	return c
21261}
21262
21263// Fields allows partial responses to be retrieved. See
21264// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
21265// for more information.
21266func (c *OrganizationsLocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *OrganizationsLocationsBucketsViewsPatchCall {
21267	c.urlParams_.Set("fields", googleapi.CombineFields(s))
21268	return c
21269}
21270
21271// Context sets the context to be used in this call's Do method. Any
21272// pending HTTP request will be aborted if the provided context is
21273// canceled.
21274func (c *OrganizationsLocationsBucketsViewsPatchCall) Context(ctx context.Context) *OrganizationsLocationsBucketsViewsPatchCall {
21275	c.ctx_ = ctx
21276	return c
21277}
21278
21279// Header returns an http.Header that can be modified by the caller to
21280// add HTTP headers to the request.
21281func (c *OrganizationsLocationsBucketsViewsPatchCall) Header() http.Header {
21282	if c.header_ == nil {
21283		c.header_ = make(http.Header)
21284	}
21285	return c.header_
21286}
21287
21288func (c *OrganizationsLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) {
21289	reqHeaders := make(http.Header)
21290	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
21291	for k, v := range c.header_ {
21292		reqHeaders[k] = v
21293	}
21294	reqHeaders.Set("User-Agent", c.s.userAgent())
21295	var body io.Reader = nil
21296	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
21297	if err != nil {
21298		return nil, err
21299	}
21300	reqHeaders.Set("Content-Type", "application/json")
21301	c.urlParams_.Set("alt", alt)
21302	c.urlParams_.Set("prettyPrint", "false")
21303	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
21304	urls += "?" + c.urlParams_.Encode()
21305	req, err := http.NewRequest("PATCH", urls, body)
21306	if err != nil {
21307		return nil, err
21308	}
21309	req.Header = reqHeaders
21310	googleapi.Expand(req.URL, map[string]string{
21311		"name": c.name,
21312	})
21313	return gensupport.SendRequest(c.ctx_, c.s.client, req)
21314}
21315
21316// Do executes the "logging.organizations.locations.buckets.views.patch" call.
21317// Exactly one of *LogView or error will be non-nil. Any non-2xx status
21318// code is an error. Response headers are in either
21319// *LogView.ServerResponse.Header or (if a response was returned at all)
21320// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
21321// check whether the returned error was because http.StatusNotModified
21322// was returned.
21323func (c *OrganizationsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
21324	gensupport.SetOptions(c.urlParams_, opts...)
21325	res, err := c.doRequest("json")
21326	if res != nil && res.StatusCode == http.StatusNotModified {
21327		if res.Body != nil {
21328			res.Body.Close()
21329		}
21330		return nil, &googleapi.Error{
21331			Code:   res.StatusCode,
21332			Header: res.Header,
21333		}
21334	}
21335	if err != nil {
21336		return nil, err
21337	}
21338	defer googleapi.CloseBody(res)
21339	if err := googleapi.CheckResponse(res); err != nil {
21340		return nil, err
21341	}
21342	ret := &LogView{
21343		ServerResponse: googleapi.ServerResponse{
21344			Header:         res.Header,
21345			HTTPStatusCode: res.StatusCode,
21346		},
21347	}
21348	target := &ret
21349	if err := gensupport.DecodeResponse(target, res); err != nil {
21350		return nil, err
21351	}
21352	return ret, nil
21353	// {
21354	//   "description": "Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: filter. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.",
21355	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
21356	//   "httpMethod": "PATCH",
21357	//   "id": "logging.organizations.locations.buckets.views.patch",
21358	//   "parameterOrder": [
21359	//     "name"
21360	//   ],
21361	//   "parameters": {
21362	//     "name": {
21363	//       "description": "Required. The full resource name of the view to update \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"",
21364	//       "location": "path",
21365	//       "pattern": "^organizations/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
21366	//       "required": true,
21367	//       "type": "string"
21368	//     },
21369	//     "updateMask": {
21370	//       "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.FieldMaskFor example: updateMask=filter",
21371	//       "format": "google-fieldmask",
21372	//       "location": "query",
21373	//       "type": "string"
21374	//     }
21375	//   },
21376	//   "path": "v2/{+name}",
21377	//   "request": {
21378	//     "$ref": "LogView"
21379	//   },
21380	//   "response": {
21381	//     "$ref": "LogView"
21382	//   },
21383	//   "scopes": [
21384	//     "https://www.googleapis.com/auth/cloud-platform",
21385	//     "https://www.googleapis.com/auth/logging.admin"
21386	//   ]
21387	// }
21388
21389}
21390
21391// method id "logging.organizations.locations.operations.cancel":
21392
21393type OrganizationsLocationsOperationsCancelCall struct {
21394	s                      *Service
21395	name                   string
21396	canceloperationrequest *CancelOperationRequest
21397	urlParams_             gensupport.URLParams
21398	ctx_                   context.Context
21399	header_                http.Header
21400}
21401
21402// Cancel: Starts asynchronous cancellation on a long-running operation.
21403// The server makes a best effort to cancel the operation, but success
21404// is not guaranteed. If the server doesn't support this method, it
21405// returns google.rpc.Code.UNIMPLEMENTED. Clients can use
21406// Operations.GetOperation or other methods to check whether the
21407// cancellation succeeded or whether the operation completed despite
21408// cancellation. On successful cancellation, the operation is not
21409// deleted; instead, it becomes an operation with an Operation.error
21410// value with a google.rpc.Status.code of 1, corresponding to
21411// Code.CANCELLED.
21412//
21413// - name: The name of the operation resource to be cancelled.
21414func (r *OrganizationsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *OrganizationsLocationsOperationsCancelCall {
21415	c := &OrganizationsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
21416	c.name = name
21417	c.canceloperationrequest = canceloperationrequest
21418	return c
21419}
21420
21421// Fields allows partial responses to be retrieved. See
21422// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
21423// for more information.
21424func (c *OrganizationsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOperationsCancelCall {
21425	c.urlParams_.Set("fields", googleapi.CombineFields(s))
21426	return c
21427}
21428
21429// Context sets the context to be used in this call's Do method. Any
21430// pending HTTP request will be aborted if the provided context is
21431// canceled.
21432func (c *OrganizationsLocationsOperationsCancelCall) Context(ctx context.Context) *OrganizationsLocationsOperationsCancelCall {
21433	c.ctx_ = ctx
21434	return c
21435}
21436
21437// Header returns an http.Header that can be modified by the caller to
21438// add HTTP headers to the request.
21439func (c *OrganizationsLocationsOperationsCancelCall) Header() http.Header {
21440	if c.header_ == nil {
21441		c.header_ = make(http.Header)
21442	}
21443	return c.header_
21444}
21445
21446func (c *OrganizationsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
21447	reqHeaders := make(http.Header)
21448	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
21449	for k, v := range c.header_ {
21450		reqHeaders[k] = v
21451	}
21452	reqHeaders.Set("User-Agent", c.s.userAgent())
21453	var body io.Reader = nil
21454	body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
21455	if err != nil {
21456		return nil, err
21457	}
21458	reqHeaders.Set("Content-Type", "application/json")
21459	c.urlParams_.Set("alt", alt)
21460	c.urlParams_.Set("prettyPrint", "false")
21461	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel")
21462	urls += "?" + c.urlParams_.Encode()
21463	req, err := http.NewRequest("POST", urls, body)
21464	if err != nil {
21465		return nil, err
21466	}
21467	req.Header = reqHeaders
21468	googleapi.Expand(req.URL, map[string]string{
21469		"name": c.name,
21470	})
21471	return gensupport.SendRequest(c.ctx_, c.s.client, req)
21472}
21473
21474// Do executes the "logging.organizations.locations.operations.cancel" call.
21475// Exactly one of *Empty or error will be non-nil. Any non-2xx status
21476// code is an error. Response headers are in either
21477// *Empty.ServerResponse.Header or (if a response was returned at all)
21478// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
21479// check whether the returned error was because http.StatusNotModified
21480// was returned.
21481func (c *OrganizationsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
21482	gensupport.SetOptions(c.urlParams_, opts...)
21483	res, err := c.doRequest("json")
21484	if res != nil && res.StatusCode == http.StatusNotModified {
21485		if res.Body != nil {
21486			res.Body.Close()
21487		}
21488		return nil, &googleapi.Error{
21489			Code:   res.StatusCode,
21490			Header: res.Header,
21491		}
21492	}
21493	if err != nil {
21494		return nil, err
21495	}
21496	defer googleapi.CloseBody(res)
21497	if err := googleapi.CheckResponse(res); err != nil {
21498		return nil, err
21499	}
21500	ret := &Empty{
21501		ServerResponse: googleapi.ServerResponse{
21502			Header:         res.Header,
21503			HTTPStatusCode: res.StatusCode,
21504		},
21505	}
21506	target := &ret
21507	if err := gensupport.DecodeResponse(target, res); err != nil {
21508		return nil, err
21509	}
21510	return ret, nil
21511	// {
21512	//   "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.",
21513	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/operations/{operationsId}:cancel",
21514	//   "httpMethod": "POST",
21515	//   "id": "logging.organizations.locations.operations.cancel",
21516	//   "parameterOrder": [
21517	//     "name"
21518	//   ],
21519	//   "parameters": {
21520	//     "name": {
21521	//       "description": "The name of the operation resource to be cancelled.",
21522	//       "location": "path",
21523	//       "pattern": "^organizations/[^/]+/locations/[^/]+/operations/[^/]+$",
21524	//       "required": true,
21525	//       "type": "string"
21526	//     }
21527	//   },
21528	//   "path": "v2/{+name}:cancel",
21529	//   "request": {
21530	//     "$ref": "CancelOperationRequest"
21531	//   },
21532	//   "response": {
21533	//     "$ref": "Empty"
21534	//   },
21535	//   "scopes": [
21536	//     "https://www.googleapis.com/auth/cloud-platform",
21537	//     "https://www.googleapis.com/auth/logging.admin"
21538	//   ]
21539	// }
21540
21541}
21542
21543// method id "logging.organizations.locations.operations.get":
21544
21545type OrganizationsLocationsOperationsGetCall struct {
21546	s            *Service
21547	name         string
21548	urlParams_   gensupport.URLParams
21549	ifNoneMatch_ string
21550	ctx_         context.Context
21551	header_      http.Header
21552}
21553
21554// Get: Gets the latest state of a long-running operation. Clients can
21555// use this method to poll the operation result at intervals as
21556// recommended by the API service.
21557//
21558// - name: The name of the operation resource.
21559func (r *OrganizationsLocationsOperationsService) Get(name string) *OrganizationsLocationsOperationsGetCall {
21560	c := &OrganizationsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
21561	c.name = name
21562	return c
21563}
21564
21565// Fields allows partial responses to be retrieved. See
21566// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
21567// for more information.
21568func (c *OrganizationsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOperationsGetCall {
21569	c.urlParams_.Set("fields", googleapi.CombineFields(s))
21570	return c
21571}
21572
21573// IfNoneMatch sets the optional parameter which makes the operation
21574// fail if the object's ETag matches the given value. This is useful for
21575// getting updates only after the object has changed since the last
21576// request. Use googleapi.IsNotModified to check whether the response
21577// error from Do is the result of In-None-Match.
21578func (c *OrganizationsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *OrganizationsLocationsOperationsGetCall {
21579	c.ifNoneMatch_ = entityTag
21580	return c
21581}
21582
21583// Context sets the context to be used in this call's Do method. Any
21584// pending HTTP request will be aborted if the provided context is
21585// canceled.
21586func (c *OrganizationsLocationsOperationsGetCall) Context(ctx context.Context) *OrganizationsLocationsOperationsGetCall {
21587	c.ctx_ = ctx
21588	return c
21589}
21590
21591// Header returns an http.Header that can be modified by the caller to
21592// add HTTP headers to the request.
21593func (c *OrganizationsLocationsOperationsGetCall) Header() http.Header {
21594	if c.header_ == nil {
21595		c.header_ = make(http.Header)
21596	}
21597	return c.header_
21598}
21599
21600func (c *OrganizationsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
21601	reqHeaders := make(http.Header)
21602	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
21603	for k, v := range c.header_ {
21604		reqHeaders[k] = v
21605	}
21606	reqHeaders.Set("User-Agent", c.s.userAgent())
21607	if c.ifNoneMatch_ != "" {
21608		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
21609	}
21610	var body io.Reader = nil
21611	c.urlParams_.Set("alt", alt)
21612	c.urlParams_.Set("prettyPrint", "false")
21613	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
21614	urls += "?" + c.urlParams_.Encode()
21615	req, err := http.NewRequest("GET", urls, body)
21616	if err != nil {
21617		return nil, err
21618	}
21619	req.Header = reqHeaders
21620	googleapi.Expand(req.URL, map[string]string{
21621		"name": c.name,
21622	})
21623	return gensupport.SendRequest(c.ctx_, c.s.client, req)
21624}
21625
21626// Do executes the "logging.organizations.locations.operations.get" call.
21627// Exactly one of *Operation or error will be non-nil. Any non-2xx
21628// status code is an error. Response headers are in either
21629// *Operation.ServerResponse.Header or (if a response was returned at
21630// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
21631// to check whether the returned error was because
21632// http.StatusNotModified was returned.
21633func (c *OrganizationsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
21634	gensupport.SetOptions(c.urlParams_, opts...)
21635	res, err := c.doRequest("json")
21636	if res != nil && res.StatusCode == http.StatusNotModified {
21637		if res.Body != nil {
21638			res.Body.Close()
21639		}
21640		return nil, &googleapi.Error{
21641			Code:   res.StatusCode,
21642			Header: res.Header,
21643		}
21644	}
21645	if err != nil {
21646		return nil, err
21647	}
21648	defer googleapi.CloseBody(res)
21649	if err := googleapi.CheckResponse(res); err != nil {
21650		return nil, err
21651	}
21652	ret := &Operation{
21653		ServerResponse: googleapi.ServerResponse{
21654			Header:         res.Header,
21655			HTTPStatusCode: res.StatusCode,
21656		},
21657	}
21658	target := &ret
21659	if err := gensupport.DecodeResponse(target, res); err != nil {
21660		return nil, err
21661	}
21662	return ret, nil
21663	// {
21664	//   "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.",
21665	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/operations/{operationsId}",
21666	//   "httpMethod": "GET",
21667	//   "id": "logging.organizations.locations.operations.get",
21668	//   "parameterOrder": [
21669	//     "name"
21670	//   ],
21671	//   "parameters": {
21672	//     "name": {
21673	//       "description": "The name of the operation resource.",
21674	//       "location": "path",
21675	//       "pattern": "^organizations/[^/]+/locations/[^/]+/operations/[^/]+$",
21676	//       "required": true,
21677	//       "type": "string"
21678	//     }
21679	//   },
21680	//   "path": "v2/{+name}",
21681	//   "response": {
21682	//     "$ref": "Operation"
21683	//   },
21684	//   "scopes": [
21685	//     "https://www.googleapis.com/auth/cloud-platform",
21686	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
21687	//     "https://www.googleapis.com/auth/logging.admin",
21688	//     "https://www.googleapis.com/auth/logging.read"
21689	//   ]
21690	// }
21691
21692}
21693
21694// method id "logging.organizations.locations.operations.list":
21695
21696type OrganizationsLocationsOperationsListCall struct {
21697	s            *Service
21698	name         string
21699	urlParams_   gensupport.URLParams
21700	ifNoneMatch_ string
21701	ctx_         context.Context
21702	header_      http.Header
21703}
21704
21705// List: Lists operations that match the specified filter in the
21706// request. If the server doesn't support this method, it returns
21707// UNIMPLEMENTED.NOTE: the name binding allows API services to override
21708// the binding to use different resource name schemes, such as
21709// users/*/operations. To override the binding, API services can add a
21710// binding such as "/v1/{name=users/*}/operations" to their service
21711// configuration. For backwards compatibility, the default name includes
21712// the operations collection id, however overriding users must ensure
21713// the name binding is the parent resource, without the operations
21714// collection id.
21715//
21716// - name: The name of the operation's parent resource.
21717func (r *OrganizationsLocationsOperationsService) List(name string) *OrganizationsLocationsOperationsListCall {
21718	c := &OrganizationsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
21719	c.name = name
21720	return c
21721}
21722
21723// Filter sets the optional parameter "filter": The standard list
21724// filter.
21725func (c *OrganizationsLocationsOperationsListCall) Filter(filter string) *OrganizationsLocationsOperationsListCall {
21726	c.urlParams_.Set("filter", filter)
21727	return c
21728}
21729
21730// PageSize sets the optional parameter "pageSize": The standard list
21731// page size.
21732func (c *OrganizationsLocationsOperationsListCall) PageSize(pageSize int64) *OrganizationsLocationsOperationsListCall {
21733	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
21734	return c
21735}
21736
21737// PageToken sets the optional parameter "pageToken": The standard list
21738// page token.
21739func (c *OrganizationsLocationsOperationsListCall) PageToken(pageToken string) *OrganizationsLocationsOperationsListCall {
21740	c.urlParams_.Set("pageToken", pageToken)
21741	return c
21742}
21743
21744// Fields allows partial responses to be retrieved. See
21745// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
21746// for more information.
21747func (c *OrganizationsLocationsOperationsListCall) Fields(s ...googleapi.Field) *OrganizationsLocationsOperationsListCall {
21748	c.urlParams_.Set("fields", googleapi.CombineFields(s))
21749	return c
21750}
21751
21752// IfNoneMatch sets the optional parameter which makes the operation
21753// fail if the object's ETag matches the given value. This is useful for
21754// getting updates only after the object has changed since the last
21755// request. Use googleapi.IsNotModified to check whether the response
21756// error from Do is the result of In-None-Match.
21757func (c *OrganizationsLocationsOperationsListCall) IfNoneMatch(entityTag string) *OrganizationsLocationsOperationsListCall {
21758	c.ifNoneMatch_ = entityTag
21759	return c
21760}
21761
21762// Context sets the context to be used in this call's Do method. Any
21763// pending HTTP request will be aborted if the provided context is
21764// canceled.
21765func (c *OrganizationsLocationsOperationsListCall) Context(ctx context.Context) *OrganizationsLocationsOperationsListCall {
21766	c.ctx_ = ctx
21767	return c
21768}
21769
21770// Header returns an http.Header that can be modified by the caller to
21771// add HTTP headers to the request.
21772func (c *OrganizationsLocationsOperationsListCall) Header() http.Header {
21773	if c.header_ == nil {
21774		c.header_ = make(http.Header)
21775	}
21776	return c.header_
21777}
21778
21779func (c *OrganizationsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
21780	reqHeaders := make(http.Header)
21781	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
21782	for k, v := range c.header_ {
21783		reqHeaders[k] = v
21784	}
21785	reqHeaders.Set("User-Agent", c.s.userAgent())
21786	if c.ifNoneMatch_ != "" {
21787		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
21788	}
21789	var body io.Reader = nil
21790	c.urlParams_.Set("alt", alt)
21791	c.urlParams_.Set("prettyPrint", "false")
21792	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations")
21793	urls += "?" + c.urlParams_.Encode()
21794	req, err := http.NewRequest("GET", urls, body)
21795	if err != nil {
21796		return nil, err
21797	}
21798	req.Header = reqHeaders
21799	googleapi.Expand(req.URL, map[string]string{
21800		"name": c.name,
21801	})
21802	return gensupport.SendRequest(c.ctx_, c.s.client, req)
21803}
21804
21805// Do executes the "logging.organizations.locations.operations.list" call.
21806// Exactly one of *ListOperationsResponse or error will be non-nil. Any
21807// non-2xx status code is an error. Response headers are in either
21808// *ListOperationsResponse.ServerResponse.Header or (if a response was
21809// returned at all) in error.(*googleapi.Error).Header. Use
21810// googleapi.IsNotModified to check whether the returned error was
21811// because http.StatusNotModified was returned.
21812func (c *OrganizationsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
21813	gensupport.SetOptions(c.urlParams_, opts...)
21814	res, err := c.doRequest("json")
21815	if res != nil && res.StatusCode == http.StatusNotModified {
21816		if res.Body != nil {
21817			res.Body.Close()
21818		}
21819		return nil, &googleapi.Error{
21820			Code:   res.StatusCode,
21821			Header: res.Header,
21822		}
21823	}
21824	if err != nil {
21825		return nil, err
21826	}
21827	defer googleapi.CloseBody(res)
21828	if err := googleapi.CheckResponse(res); err != nil {
21829		return nil, err
21830	}
21831	ret := &ListOperationsResponse{
21832		ServerResponse: googleapi.ServerResponse{
21833			Header:         res.Header,
21834			HTTPStatusCode: res.StatusCode,
21835		},
21836	}
21837	target := &ret
21838	if err := gensupport.DecodeResponse(target, res); err != nil {
21839		return nil, err
21840	}
21841	return ret, nil
21842	// {
21843	//   "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as \"/v1/{name=users/*}/operations\" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.",
21844	//   "flatPath": "v2/organizations/{organizationsId}/locations/{locationsId}/operations",
21845	//   "httpMethod": "GET",
21846	//   "id": "logging.organizations.locations.operations.list",
21847	//   "parameterOrder": [
21848	//     "name"
21849	//   ],
21850	//   "parameters": {
21851	//     "filter": {
21852	//       "description": "The standard list filter.",
21853	//       "location": "query",
21854	//       "type": "string"
21855	//     },
21856	//     "name": {
21857	//       "description": "The name of the operation's parent resource.",
21858	//       "location": "path",
21859	//       "pattern": "^organizations/[^/]+/locations/[^/]+$",
21860	//       "required": true,
21861	//       "type": "string"
21862	//     },
21863	//     "pageSize": {
21864	//       "description": "The standard list page size.",
21865	//       "format": "int32",
21866	//       "location": "query",
21867	//       "type": "integer"
21868	//     },
21869	//     "pageToken": {
21870	//       "description": "The standard list page token.",
21871	//       "location": "query",
21872	//       "type": "string"
21873	//     }
21874	//   },
21875	//   "path": "v2/{+name}/operations",
21876	//   "response": {
21877	//     "$ref": "ListOperationsResponse"
21878	//   },
21879	//   "scopes": [
21880	//     "https://www.googleapis.com/auth/cloud-platform",
21881	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
21882	//     "https://www.googleapis.com/auth/logging.admin",
21883	//     "https://www.googleapis.com/auth/logging.read"
21884	//   ]
21885	// }
21886
21887}
21888
21889// Pages invokes f for each page of results.
21890// A non-nil error returned from f will halt the iteration.
21891// The provided context supersedes any context provided to the Context method.
21892func (c *OrganizationsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
21893	c.ctx_ = ctx
21894	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
21895	for {
21896		x, err := c.Do()
21897		if err != nil {
21898			return err
21899		}
21900		if err := f(x); err != nil {
21901			return err
21902		}
21903		if x.NextPageToken == "" {
21904			return nil
21905		}
21906		c.PageToken(x.NextPageToken)
21907	}
21908}
21909
21910// method id "logging.organizations.logs.delete":
21911
21912type OrganizationsLogsDeleteCall struct {
21913	s          *Service
21914	logName    string
21915	urlParams_ gensupport.URLParams
21916	ctx_       context.Context
21917	header_    http.Header
21918}
21919
21920// Delete: Deletes all the log entries in a log for the _Default Log
21921// Bucket. The log reappears if it receives new entries. Log entries
21922// written shortly before the delete operation might not be deleted.
21923// Entries received after the delete operation with a timestamp before
21924// the operation will be deleted.
21925//
21926// - logName: The resource name of the log to delete:
21927//   projects/[PROJECT_ID]/logs/[LOG_ID]
21928//   organizations/[ORGANIZATION_ID]/logs/[LOG_ID]
21929//   billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]
21930//   folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For
21931//   example, "projects/my-project-id/logs/syslog",
21932//   "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For
21933//   more information about log names, see LogEntry.
21934func (r *OrganizationsLogsService) Delete(logName string) *OrganizationsLogsDeleteCall {
21935	c := &OrganizationsLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
21936	c.logName = logName
21937	return c
21938}
21939
21940// Fields allows partial responses to be retrieved. See
21941// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
21942// for more information.
21943func (c *OrganizationsLogsDeleteCall) Fields(s ...googleapi.Field) *OrganizationsLogsDeleteCall {
21944	c.urlParams_.Set("fields", googleapi.CombineFields(s))
21945	return c
21946}
21947
21948// Context sets the context to be used in this call's Do method. Any
21949// pending HTTP request will be aborted if the provided context is
21950// canceled.
21951func (c *OrganizationsLogsDeleteCall) Context(ctx context.Context) *OrganizationsLogsDeleteCall {
21952	c.ctx_ = ctx
21953	return c
21954}
21955
21956// Header returns an http.Header that can be modified by the caller to
21957// add HTTP headers to the request.
21958func (c *OrganizationsLogsDeleteCall) Header() http.Header {
21959	if c.header_ == nil {
21960		c.header_ = make(http.Header)
21961	}
21962	return c.header_
21963}
21964
21965func (c *OrganizationsLogsDeleteCall) doRequest(alt string) (*http.Response, error) {
21966	reqHeaders := make(http.Header)
21967	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
21968	for k, v := range c.header_ {
21969		reqHeaders[k] = v
21970	}
21971	reqHeaders.Set("User-Agent", c.s.userAgent())
21972	var body io.Reader = nil
21973	c.urlParams_.Set("alt", alt)
21974	c.urlParams_.Set("prettyPrint", "false")
21975	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}")
21976	urls += "?" + c.urlParams_.Encode()
21977	req, err := http.NewRequest("DELETE", urls, body)
21978	if err != nil {
21979		return nil, err
21980	}
21981	req.Header = reqHeaders
21982	googleapi.Expand(req.URL, map[string]string{
21983		"logName": c.logName,
21984	})
21985	return gensupport.SendRequest(c.ctx_, c.s.client, req)
21986}
21987
21988// Do executes the "logging.organizations.logs.delete" call.
21989// Exactly one of *Empty or error will be non-nil. Any non-2xx status
21990// code is an error. Response headers are in either
21991// *Empty.ServerResponse.Header or (if a response was returned at all)
21992// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
21993// check whether the returned error was because http.StatusNotModified
21994// was returned.
21995func (c *OrganizationsLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
21996	gensupport.SetOptions(c.urlParams_, opts...)
21997	res, err := c.doRequest("json")
21998	if res != nil && res.StatusCode == http.StatusNotModified {
21999		if res.Body != nil {
22000			res.Body.Close()
22001		}
22002		return nil, &googleapi.Error{
22003			Code:   res.StatusCode,
22004			Header: res.Header,
22005		}
22006	}
22007	if err != nil {
22008		return nil, err
22009	}
22010	defer googleapi.CloseBody(res)
22011	if err := googleapi.CheckResponse(res); err != nil {
22012		return nil, err
22013	}
22014	ret := &Empty{
22015		ServerResponse: googleapi.ServerResponse{
22016			Header:         res.Header,
22017			HTTPStatusCode: res.StatusCode,
22018		},
22019	}
22020	target := &ret
22021	if err := gensupport.DecodeResponse(target, res); err != nil {
22022		return nil, err
22023	}
22024	return ret, nil
22025	// {
22026	//   "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.",
22027	//   "flatPath": "v2/organizations/{organizationsId}/logs/{logsId}",
22028	//   "httpMethod": "DELETE",
22029	//   "id": "logging.organizations.logs.delete",
22030	//   "parameterOrder": [
22031	//     "logName"
22032	//   ],
22033	//   "parameters": {
22034	//     "logName": {
22035	//       "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.",
22036	//       "location": "path",
22037	//       "pattern": "^organizations/[^/]+/logs/[^/]+$",
22038	//       "required": true,
22039	//       "type": "string"
22040	//     }
22041	//   },
22042	//   "path": "v2/{+logName}",
22043	//   "response": {
22044	//     "$ref": "Empty"
22045	//   },
22046	//   "scopes": [
22047	//     "https://www.googleapis.com/auth/cloud-platform",
22048	//     "https://www.googleapis.com/auth/logging.admin"
22049	//   ]
22050	// }
22051
22052}
22053
22054// method id "logging.organizations.logs.list":
22055
22056type OrganizationsLogsListCall struct {
22057	s            *Service
22058	parent       string
22059	urlParams_   gensupport.URLParams
22060	ifNoneMatch_ string
22061	ctx_         context.Context
22062	header_      http.Header
22063}
22064
22065// List: Lists the logs in projects, organizations, folders, or billing
22066// accounts. Only logs that have entries are listed.
22067//
22068// - parent: The resource name that owns the logs: projects/[PROJECT_ID]
22069//   organizations/[ORGANIZATION_ID]
22070//   billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID].
22071func (r *OrganizationsLogsService) List(parent string) *OrganizationsLogsListCall {
22072	c := &OrganizationsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
22073	c.parent = parent
22074	return c
22075}
22076
22077// PageSize sets the optional parameter "pageSize": The maximum number
22078// of results to return from this request. Non-positive values are
22079// ignored. The presence of nextPageToken in the response indicates that
22080// more results might be available.
22081func (c *OrganizationsLogsListCall) PageSize(pageSize int64) *OrganizationsLogsListCall {
22082	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
22083	return c
22084}
22085
22086// PageToken sets the optional parameter "pageToken": If present, then
22087// retrieve the next batch of results from the preceding call to this
22088// method. pageToken must be the value of nextPageToken from the
22089// previous response. The values of other method parameters should be
22090// identical to those in the previous call.
22091func (c *OrganizationsLogsListCall) PageToken(pageToken string) *OrganizationsLogsListCall {
22092	c.urlParams_.Set("pageToken", pageToken)
22093	return c
22094}
22095
22096// ResourceNames sets the optional parameter "resourceNames": The
22097// resource name that owns the logs:
22098// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view
22099// s/[VIEW_ID]
22100// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE
22101// T_ID]/views/[VIEW_ID]
22102// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[
22103// BUCKET_ID]/views/[VIEW_ID]
22104// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/
22105// [VIEW_ID]To support legacy queries, it could also be:
22106// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID]
22107// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]
22108func (c *OrganizationsLogsListCall) ResourceNames(resourceNames ...string) *OrganizationsLogsListCall {
22109	c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...))
22110	return c
22111}
22112
22113// Fields allows partial responses to be retrieved. See
22114// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
22115// for more information.
22116func (c *OrganizationsLogsListCall) Fields(s ...googleapi.Field) *OrganizationsLogsListCall {
22117	c.urlParams_.Set("fields", googleapi.CombineFields(s))
22118	return c
22119}
22120
22121// IfNoneMatch sets the optional parameter which makes the operation
22122// fail if the object's ETag matches the given value. This is useful for
22123// getting updates only after the object has changed since the last
22124// request. Use googleapi.IsNotModified to check whether the response
22125// error from Do is the result of In-None-Match.
22126func (c *OrganizationsLogsListCall) IfNoneMatch(entityTag string) *OrganizationsLogsListCall {
22127	c.ifNoneMatch_ = entityTag
22128	return c
22129}
22130
22131// Context sets the context to be used in this call's Do method. Any
22132// pending HTTP request will be aborted if the provided context is
22133// canceled.
22134func (c *OrganizationsLogsListCall) Context(ctx context.Context) *OrganizationsLogsListCall {
22135	c.ctx_ = ctx
22136	return c
22137}
22138
22139// Header returns an http.Header that can be modified by the caller to
22140// add HTTP headers to the request.
22141func (c *OrganizationsLogsListCall) Header() http.Header {
22142	if c.header_ == nil {
22143		c.header_ = make(http.Header)
22144	}
22145	return c.header_
22146}
22147
22148func (c *OrganizationsLogsListCall) doRequest(alt string) (*http.Response, error) {
22149	reqHeaders := make(http.Header)
22150	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
22151	for k, v := range c.header_ {
22152		reqHeaders[k] = v
22153	}
22154	reqHeaders.Set("User-Agent", c.s.userAgent())
22155	if c.ifNoneMatch_ != "" {
22156		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
22157	}
22158	var body io.Reader = nil
22159	c.urlParams_.Set("alt", alt)
22160	c.urlParams_.Set("prettyPrint", "false")
22161	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs")
22162	urls += "?" + c.urlParams_.Encode()
22163	req, err := http.NewRequest("GET", urls, body)
22164	if err != nil {
22165		return nil, err
22166	}
22167	req.Header = reqHeaders
22168	googleapi.Expand(req.URL, map[string]string{
22169		"parent": c.parent,
22170	})
22171	return gensupport.SendRequest(c.ctx_, c.s.client, req)
22172}
22173
22174// Do executes the "logging.organizations.logs.list" call.
22175// Exactly one of *ListLogsResponse or error will be non-nil. Any
22176// non-2xx status code is an error. Response headers are in either
22177// *ListLogsResponse.ServerResponse.Header or (if a response was
22178// returned at all) in error.(*googleapi.Error).Header. Use
22179// googleapi.IsNotModified to check whether the returned error was
22180// because http.StatusNotModified was returned.
22181func (c *OrganizationsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) {
22182	gensupport.SetOptions(c.urlParams_, opts...)
22183	res, err := c.doRequest("json")
22184	if res != nil && res.StatusCode == http.StatusNotModified {
22185		if res.Body != nil {
22186			res.Body.Close()
22187		}
22188		return nil, &googleapi.Error{
22189			Code:   res.StatusCode,
22190			Header: res.Header,
22191		}
22192	}
22193	if err != nil {
22194		return nil, err
22195	}
22196	defer googleapi.CloseBody(res)
22197	if err := googleapi.CheckResponse(res); err != nil {
22198		return nil, err
22199	}
22200	ret := &ListLogsResponse{
22201		ServerResponse: googleapi.ServerResponse{
22202			Header:         res.Header,
22203			HTTPStatusCode: res.StatusCode,
22204		},
22205	}
22206	target := &ret
22207	if err := gensupport.DecodeResponse(target, res); err != nil {
22208		return nil, err
22209	}
22210	return ret, nil
22211	// {
22212	//   "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.",
22213	//   "flatPath": "v2/organizations/{organizationsId}/logs",
22214	//   "httpMethod": "GET",
22215	//   "id": "logging.organizations.logs.list",
22216	//   "parameterOrder": [
22217	//     "parent"
22218	//   ],
22219	//   "parameters": {
22220	//     "pageSize": {
22221	//       "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.",
22222	//       "format": "int32",
22223	//       "location": "query",
22224	//       "type": "integer"
22225	//     },
22226	//     "pageToken": {
22227	//       "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.",
22228	//       "location": "query",
22229	//       "type": "string"
22230	//     },
22231	//     "parent": {
22232	//       "description": "Required. The resource name that owns the logs: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]",
22233	//       "location": "path",
22234	//       "pattern": "^organizations/[^/]+$",
22235	//       "required": true,
22236	//       "type": "string"
22237	//     },
22238	//     "resourceNames": {
22239	//       "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]",
22240	//       "location": "query",
22241	//       "repeated": true,
22242	//       "type": "string"
22243	//     }
22244	//   },
22245	//   "path": "v2/{+parent}/logs",
22246	//   "response": {
22247	//     "$ref": "ListLogsResponse"
22248	//   },
22249	//   "scopes": [
22250	//     "https://www.googleapis.com/auth/cloud-platform",
22251	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
22252	//     "https://www.googleapis.com/auth/logging.admin",
22253	//     "https://www.googleapis.com/auth/logging.read"
22254	//   ]
22255	// }
22256
22257}
22258
22259// Pages invokes f for each page of results.
22260// A non-nil error returned from f will halt the iteration.
22261// The provided context supersedes any context provided to the Context method.
22262func (c *OrganizationsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error {
22263	c.ctx_ = ctx
22264	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
22265	for {
22266		x, err := c.Do()
22267		if err != nil {
22268			return err
22269		}
22270		if err := f(x); err != nil {
22271			return err
22272		}
22273		if x.NextPageToken == "" {
22274			return nil
22275		}
22276		c.PageToken(x.NextPageToken)
22277	}
22278}
22279
22280// method id "logging.organizations.sinks.create":
22281
22282type OrganizationsSinksCreateCall struct {
22283	s          *Service
22284	parent     string
22285	logsink    *LogSink
22286	urlParams_ gensupport.URLParams
22287	ctx_       context.Context
22288	header_    http.Header
22289}
22290
22291// Create: Creates a sink that exports specified log entries to a
22292// destination. The export of newly-ingested log entries begins
22293// immediately, unless the sink's writer_identity is not permitted to
22294// write to the destination. A sink can export log entries only from the
22295// resource owning the sink.
22296//
22297// - parent: The resource in which to create the sink:
22298//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
22299//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For
22300//   examples:"projects/my-project" "organizations/123456789".
22301func (r *OrganizationsSinksService) Create(parent string, logsink *LogSink) *OrganizationsSinksCreateCall {
22302	c := &OrganizationsSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
22303	c.parent = parent
22304	c.logsink = logsink
22305	return c
22306}
22307
22308// UniqueWriterIdentity sets the optional parameter
22309// "uniqueWriterIdentity": Determines the kind of IAM identity returned
22310// as writer_identity in the new sink. If this value is omitted or set
22311// to false, and if the sink's parent is a project, then the value
22312// returned as writer_identity is the same group or service account used
22313// by Cloud Logging before the addition of writer identities to this
22314// API. The sink's destination must be in the same project as the sink
22315// itself.If this field is set to true, or if the sink is owned by a
22316// non-project resource such as an organization, then the value of
22317// writer_identity will be a unique service account used only for
22318// exports from the new sink. For more information, see writer_identity
22319// in LogSink.
22320func (c *OrganizationsSinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *OrganizationsSinksCreateCall {
22321	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
22322	return c
22323}
22324
22325// Fields allows partial responses to be retrieved. See
22326// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
22327// for more information.
22328func (c *OrganizationsSinksCreateCall) Fields(s ...googleapi.Field) *OrganizationsSinksCreateCall {
22329	c.urlParams_.Set("fields", googleapi.CombineFields(s))
22330	return c
22331}
22332
22333// Context sets the context to be used in this call's Do method. Any
22334// pending HTTP request will be aborted if the provided context is
22335// canceled.
22336func (c *OrganizationsSinksCreateCall) Context(ctx context.Context) *OrganizationsSinksCreateCall {
22337	c.ctx_ = ctx
22338	return c
22339}
22340
22341// Header returns an http.Header that can be modified by the caller to
22342// add HTTP headers to the request.
22343func (c *OrganizationsSinksCreateCall) Header() http.Header {
22344	if c.header_ == nil {
22345		c.header_ = make(http.Header)
22346	}
22347	return c.header_
22348}
22349
22350func (c *OrganizationsSinksCreateCall) doRequest(alt string) (*http.Response, error) {
22351	reqHeaders := make(http.Header)
22352	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
22353	for k, v := range c.header_ {
22354		reqHeaders[k] = v
22355	}
22356	reqHeaders.Set("User-Agent", c.s.userAgent())
22357	var body io.Reader = nil
22358	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
22359	if err != nil {
22360		return nil, err
22361	}
22362	reqHeaders.Set("Content-Type", "application/json")
22363	c.urlParams_.Set("alt", alt)
22364	c.urlParams_.Set("prettyPrint", "false")
22365	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
22366	urls += "?" + c.urlParams_.Encode()
22367	req, err := http.NewRequest("POST", urls, body)
22368	if err != nil {
22369		return nil, err
22370	}
22371	req.Header = reqHeaders
22372	googleapi.Expand(req.URL, map[string]string{
22373		"parent": c.parent,
22374	})
22375	return gensupport.SendRequest(c.ctx_, c.s.client, req)
22376}
22377
22378// Do executes the "logging.organizations.sinks.create" call.
22379// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
22380// code is an error. Response headers are in either
22381// *LogSink.ServerResponse.Header or (if a response was returned at all)
22382// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
22383// check whether the returned error was because http.StatusNotModified
22384// was returned.
22385func (c *OrganizationsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
22386	gensupport.SetOptions(c.urlParams_, opts...)
22387	res, err := c.doRequest("json")
22388	if res != nil && res.StatusCode == http.StatusNotModified {
22389		if res.Body != nil {
22390			res.Body.Close()
22391		}
22392		return nil, &googleapi.Error{
22393			Code:   res.StatusCode,
22394			Header: res.Header,
22395		}
22396	}
22397	if err != nil {
22398		return nil, err
22399	}
22400	defer googleapi.CloseBody(res)
22401	if err := googleapi.CheckResponse(res); err != nil {
22402		return nil, err
22403	}
22404	ret := &LogSink{
22405		ServerResponse: googleapi.ServerResponse{
22406			Header:         res.Header,
22407			HTTPStatusCode: res.StatusCode,
22408		},
22409	}
22410	target := &ret
22411	if err := gensupport.DecodeResponse(target, res); err != nil {
22412		return nil, err
22413	}
22414	return ret, nil
22415	// {
22416	//   "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.",
22417	//   "flatPath": "v2/organizations/{organizationsId}/sinks",
22418	//   "httpMethod": "POST",
22419	//   "id": "logging.organizations.sinks.create",
22420	//   "parameterOrder": [
22421	//     "parent"
22422	//   ],
22423	//   "parameters": {
22424	//     "parent": {
22425	//       "description": "Required. The resource in which to create the sink: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-project\" \"organizations/123456789\"",
22426	//       "location": "path",
22427	//       "pattern": "^organizations/[^/]+$",
22428	//       "required": true,
22429	//       "type": "string"
22430	//     },
22431	//     "uniqueWriterIdentity": {
22432	//       "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 Cloud 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.",
22433	//       "location": "query",
22434	//       "type": "boolean"
22435	//     }
22436	//   },
22437	//   "path": "v2/{+parent}/sinks",
22438	//   "request": {
22439	//     "$ref": "LogSink"
22440	//   },
22441	//   "response": {
22442	//     "$ref": "LogSink"
22443	//   },
22444	//   "scopes": [
22445	//     "https://www.googleapis.com/auth/cloud-platform",
22446	//     "https://www.googleapis.com/auth/logging.admin"
22447	//   ]
22448	// }
22449
22450}
22451
22452// method id "logging.organizations.sinks.delete":
22453
22454type OrganizationsSinksDeleteCall struct {
22455	s          *Service
22456	sinkNameid string
22457	urlParams_ gensupport.URLParams
22458	ctx_       context.Context
22459	header_    http.Header
22460}
22461
22462// Delete: Deletes a sink. If the sink has a unique writer_identity,
22463// then that service account is also deleted.
22464//
22465// - sinkName: The full resource name of the sink to delete, including
22466//   the parent resource and the sink identifier:
22467//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
22468//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
22469//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
22470//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" For
22471//   example:"projects/my-project/sinks/my-sink".
22472func (r *OrganizationsSinksService) Delete(sinkNameid string) *OrganizationsSinksDeleteCall {
22473	c := &OrganizationsSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
22474	c.sinkNameid = sinkNameid
22475	return c
22476}
22477
22478// Fields allows partial responses to be retrieved. See
22479// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
22480// for more information.
22481func (c *OrganizationsSinksDeleteCall) Fields(s ...googleapi.Field) *OrganizationsSinksDeleteCall {
22482	c.urlParams_.Set("fields", googleapi.CombineFields(s))
22483	return c
22484}
22485
22486// Context sets the context to be used in this call's Do method. Any
22487// pending HTTP request will be aborted if the provided context is
22488// canceled.
22489func (c *OrganizationsSinksDeleteCall) Context(ctx context.Context) *OrganizationsSinksDeleteCall {
22490	c.ctx_ = ctx
22491	return c
22492}
22493
22494// Header returns an http.Header that can be modified by the caller to
22495// add HTTP headers to the request.
22496func (c *OrganizationsSinksDeleteCall) Header() http.Header {
22497	if c.header_ == nil {
22498		c.header_ = make(http.Header)
22499	}
22500	return c.header_
22501}
22502
22503func (c *OrganizationsSinksDeleteCall) doRequest(alt string) (*http.Response, error) {
22504	reqHeaders := make(http.Header)
22505	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
22506	for k, v := range c.header_ {
22507		reqHeaders[k] = v
22508	}
22509	reqHeaders.Set("User-Agent", c.s.userAgent())
22510	var body io.Reader = nil
22511	c.urlParams_.Set("alt", alt)
22512	c.urlParams_.Set("prettyPrint", "false")
22513	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
22514	urls += "?" + c.urlParams_.Encode()
22515	req, err := http.NewRequest("DELETE", urls, body)
22516	if err != nil {
22517		return nil, err
22518	}
22519	req.Header = reqHeaders
22520	googleapi.Expand(req.URL, map[string]string{
22521		"sinkName": c.sinkNameid,
22522	})
22523	return gensupport.SendRequest(c.ctx_, c.s.client, req)
22524}
22525
22526// Do executes the "logging.organizations.sinks.delete" call.
22527// Exactly one of *Empty or error will be non-nil. Any non-2xx status
22528// code is an error. Response headers are in either
22529// *Empty.ServerResponse.Header or (if a response was returned at all)
22530// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
22531// check whether the returned error was because http.StatusNotModified
22532// was returned.
22533func (c *OrganizationsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
22534	gensupport.SetOptions(c.urlParams_, opts...)
22535	res, err := c.doRequest("json")
22536	if res != nil && res.StatusCode == http.StatusNotModified {
22537		if res.Body != nil {
22538			res.Body.Close()
22539		}
22540		return nil, &googleapi.Error{
22541			Code:   res.StatusCode,
22542			Header: res.Header,
22543		}
22544	}
22545	if err != nil {
22546		return nil, err
22547	}
22548	defer googleapi.CloseBody(res)
22549	if err := googleapi.CheckResponse(res); err != nil {
22550		return nil, err
22551	}
22552	ret := &Empty{
22553		ServerResponse: googleapi.ServerResponse{
22554			Header:         res.Header,
22555			HTTPStatusCode: res.StatusCode,
22556		},
22557	}
22558	target := &ret
22559	if err := gensupport.DecodeResponse(target, res); err != nil {
22560		return nil, err
22561	}
22562	return ret, nil
22563	// {
22564	//   "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.",
22565	//   "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}",
22566	//   "httpMethod": "DELETE",
22567	//   "id": "logging.organizations.sinks.delete",
22568	//   "parameterOrder": [
22569	//     "sinkName"
22570	//   ],
22571	//   "parameters": {
22572	//     "sinkName": {
22573	//       "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]\" For example:\"projects/my-project/sinks/my-sink\"",
22574	//       "location": "path",
22575	//       "pattern": "^organizations/[^/]+/sinks/[^/]+$",
22576	//       "required": true,
22577	//       "type": "string"
22578	//     }
22579	//   },
22580	//   "path": "v2/{+sinkName}",
22581	//   "response": {
22582	//     "$ref": "Empty"
22583	//   },
22584	//   "scopes": [
22585	//     "https://www.googleapis.com/auth/cloud-platform",
22586	//     "https://www.googleapis.com/auth/logging.admin"
22587	//   ]
22588	// }
22589
22590}
22591
22592// method id "logging.organizations.sinks.get":
22593
22594type OrganizationsSinksGetCall struct {
22595	s            *Service
22596	sinkName     string
22597	urlParams_   gensupport.URLParams
22598	ifNoneMatch_ string
22599	ctx_         context.Context
22600	header_      http.Header
22601}
22602
22603// Get: Gets a sink.
22604//
22605// - sinkName: The resource name of the sink:
22606//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
22607//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
22608//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
22609//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" For
22610//   example:"projects/my-project/sinks/my-sink".
22611func (r *OrganizationsSinksService) Get(sinkName string) *OrganizationsSinksGetCall {
22612	c := &OrganizationsSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
22613	c.sinkName = sinkName
22614	return c
22615}
22616
22617// Fields allows partial responses to be retrieved. See
22618// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
22619// for more information.
22620func (c *OrganizationsSinksGetCall) Fields(s ...googleapi.Field) *OrganizationsSinksGetCall {
22621	c.urlParams_.Set("fields", googleapi.CombineFields(s))
22622	return c
22623}
22624
22625// IfNoneMatch sets the optional parameter which makes the operation
22626// fail if the object's ETag matches the given value. This is useful for
22627// getting updates only after the object has changed since the last
22628// request. Use googleapi.IsNotModified to check whether the response
22629// error from Do is the result of In-None-Match.
22630func (c *OrganizationsSinksGetCall) IfNoneMatch(entityTag string) *OrganizationsSinksGetCall {
22631	c.ifNoneMatch_ = entityTag
22632	return c
22633}
22634
22635// Context sets the context to be used in this call's Do method. Any
22636// pending HTTP request will be aborted if the provided context is
22637// canceled.
22638func (c *OrganizationsSinksGetCall) Context(ctx context.Context) *OrganizationsSinksGetCall {
22639	c.ctx_ = ctx
22640	return c
22641}
22642
22643// Header returns an http.Header that can be modified by the caller to
22644// add HTTP headers to the request.
22645func (c *OrganizationsSinksGetCall) Header() http.Header {
22646	if c.header_ == nil {
22647		c.header_ = make(http.Header)
22648	}
22649	return c.header_
22650}
22651
22652func (c *OrganizationsSinksGetCall) doRequest(alt string) (*http.Response, error) {
22653	reqHeaders := make(http.Header)
22654	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
22655	for k, v := range c.header_ {
22656		reqHeaders[k] = v
22657	}
22658	reqHeaders.Set("User-Agent", c.s.userAgent())
22659	if c.ifNoneMatch_ != "" {
22660		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
22661	}
22662	var body io.Reader = nil
22663	c.urlParams_.Set("alt", alt)
22664	c.urlParams_.Set("prettyPrint", "false")
22665	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
22666	urls += "?" + c.urlParams_.Encode()
22667	req, err := http.NewRequest("GET", urls, body)
22668	if err != nil {
22669		return nil, err
22670	}
22671	req.Header = reqHeaders
22672	googleapi.Expand(req.URL, map[string]string{
22673		"sinkName": c.sinkName,
22674	})
22675	return gensupport.SendRequest(c.ctx_, c.s.client, req)
22676}
22677
22678// Do executes the "logging.organizations.sinks.get" call.
22679// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
22680// code is an error. Response headers are in either
22681// *LogSink.ServerResponse.Header or (if a response was returned at all)
22682// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
22683// check whether the returned error was because http.StatusNotModified
22684// was returned.
22685func (c *OrganizationsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
22686	gensupport.SetOptions(c.urlParams_, opts...)
22687	res, err := c.doRequest("json")
22688	if res != nil && res.StatusCode == http.StatusNotModified {
22689		if res.Body != nil {
22690			res.Body.Close()
22691		}
22692		return nil, &googleapi.Error{
22693			Code:   res.StatusCode,
22694			Header: res.Header,
22695		}
22696	}
22697	if err != nil {
22698		return nil, err
22699	}
22700	defer googleapi.CloseBody(res)
22701	if err := googleapi.CheckResponse(res); err != nil {
22702		return nil, err
22703	}
22704	ret := &LogSink{
22705		ServerResponse: googleapi.ServerResponse{
22706			Header:         res.Header,
22707			HTTPStatusCode: res.StatusCode,
22708		},
22709	}
22710	target := &ret
22711	if err := gensupport.DecodeResponse(target, res); err != nil {
22712		return nil, err
22713	}
22714	return ret, nil
22715	// {
22716	//   "description": "Gets a sink.",
22717	//   "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}",
22718	//   "httpMethod": "GET",
22719	//   "id": "logging.organizations.sinks.get",
22720	//   "parameterOrder": [
22721	//     "sinkName"
22722	//   ],
22723	//   "parameters": {
22724	//     "sinkName": {
22725	//       "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]\" For example:\"projects/my-project/sinks/my-sink\"",
22726	//       "location": "path",
22727	//       "pattern": "^organizations/[^/]+/sinks/[^/]+$",
22728	//       "required": true,
22729	//       "type": "string"
22730	//     }
22731	//   },
22732	//   "path": "v2/{+sinkName}",
22733	//   "response": {
22734	//     "$ref": "LogSink"
22735	//   },
22736	//   "scopes": [
22737	//     "https://www.googleapis.com/auth/cloud-platform",
22738	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
22739	//     "https://www.googleapis.com/auth/logging.admin",
22740	//     "https://www.googleapis.com/auth/logging.read"
22741	//   ]
22742	// }
22743
22744}
22745
22746// method id "logging.organizations.sinks.list":
22747
22748type OrganizationsSinksListCall struct {
22749	s            *Service
22750	parent       string
22751	urlParams_   gensupport.URLParams
22752	ifNoneMatch_ string
22753	ctx_         context.Context
22754	header_      http.Header
22755}
22756
22757// List: Lists sinks.
22758//
22759// - parent: The parent resource whose sinks are to be listed:
22760//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
22761//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]".
22762func (r *OrganizationsSinksService) List(parent string) *OrganizationsSinksListCall {
22763	c := &OrganizationsSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
22764	c.parent = parent
22765	return c
22766}
22767
22768// PageSize sets the optional parameter "pageSize": The maximum number
22769// of results to return from this request. Non-positive values are
22770// ignored. The presence of nextPageToken in the response indicates that
22771// more results might be available.
22772func (c *OrganizationsSinksListCall) PageSize(pageSize int64) *OrganizationsSinksListCall {
22773	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
22774	return c
22775}
22776
22777// PageToken sets the optional parameter "pageToken": If present, then
22778// retrieve the next batch of results from the preceding call to this
22779// method. pageToken must be the value of nextPageToken from the
22780// previous response. The values of other method parameters should be
22781// identical to those in the previous call.
22782func (c *OrganizationsSinksListCall) PageToken(pageToken string) *OrganizationsSinksListCall {
22783	c.urlParams_.Set("pageToken", pageToken)
22784	return c
22785}
22786
22787// Fields allows partial responses to be retrieved. See
22788// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
22789// for more information.
22790func (c *OrganizationsSinksListCall) Fields(s ...googleapi.Field) *OrganizationsSinksListCall {
22791	c.urlParams_.Set("fields", googleapi.CombineFields(s))
22792	return c
22793}
22794
22795// IfNoneMatch sets the optional parameter which makes the operation
22796// fail if the object's ETag matches the given value. This is useful for
22797// getting updates only after the object has changed since the last
22798// request. Use googleapi.IsNotModified to check whether the response
22799// error from Do is the result of In-None-Match.
22800func (c *OrganizationsSinksListCall) IfNoneMatch(entityTag string) *OrganizationsSinksListCall {
22801	c.ifNoneMatch_ = entityTag
22802	return c
22803}
22804
22805// Context sets the context to be used in this call's Do method. Any
22806// pending HTTP request will be aborted if the provided context is
22807// canceled.
22808func (c *OrganizationsSinksListCall) Context(ctx context.Context) *OrganizationsSinksListCall {
22809	c.ctx_ = ctx
22810	return c
22811}
22812
22813// Header returns an http.Header that can be modified by the caller to
22814// add HTTP headers to the request.
22815func (c *OrganizationsSinksListCall) Header() http.Header {
22816	if c.header_ == nil {
22817		c.header_ = make(http.Header)
22818	}
22819	return c.header_
22820}
22821
22822func (c *OrganizationsSinksListCall) doRequest(alt string) (*http.Response, error) {
22823	reqHeaders := make(http.Header)
22824	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
22825	for k, v := range c.header_ {
22826		reqHeaders[k] = v
22827	}
22828	reqHeaders.Set("User-Agent", c.s.userAgent())
22829	if c.ifNoneMatch_ != "" {
22830		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
22831	}
22832	var body io.Reader = nil
22833	c.urlParams_.Set("alt", alt)
22834	c.urlParams_.Set("prettyPrint", "false")
22835	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
22836	urls += "?" + c.urlParams_.Encode()
22837	req, err := http.NewRequest("GET", urls, body)
22838	if err != nil {
22839		return nil, err
22840	}
22841	req.Header = reqHeaders
22842	googleapi.Expand(req.URL, map[string]string{
22843		"parent": c.parent,
22844	})
22845	return gensupport.SendRequest(c.ctx_, c.s.client, req)
22846}
22847
22848// Do executes the "logging.organizations.sinks.list" call.
22849// Exactly one of *ListSinksResponse or error will be non-nil. Any
22850// non-2xx status code is an error. Response headers are in either
22851// *ListSinksResponse.ServerResponse.Header or (if a response was
22852// returned at all) in error.(*googleapi.Error).Header. Use
22853// googleapi.IsNotModified to check whether the returned error was
22854// because http.StatusNotModified was returned.
22855func (c *OrganizationsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) {
22856	gensupport.SetOptions(c.urlParams_, opts...)
22857	res, err := c.doRequest("json")
22858	if res != nil && res.StatusCode == http.StatusNotModified {
22859		if res.Body != nil {
22860			res.Body.Close()
22861		}
22862		return nil, &googleapi.Error{
22863			Code:   res.StatusCode,
22864			Header: res.Header,
22865		}
22866	}
22867	if err != nil {
22868		return nil, err
22869	}
22870	defer googleapi.CloseBody(res)
22871	if err := googleapi.CheckResponse(res); err != nil {
22872		return nil, err
22873	}
22874	ret := &ListSinksResponse{
22875		ServerResponse: googleapi.ServerResponse{
22876			Header:         res.Header,
22877			HTTPStatusCode: res.StatusCode,
22878		},
22879	}
22880	target := &ret
22881	if err := gensupport.DecodeResponse(target, res); err != nil {
22882		return nil, err
22883	}
22884	return ret, nil
22885	// {
22886	//   "description": "Lists sinks.",
22887	//   "flatPath": "v2/organizations/{organizationsId}/sinks",
22888	//   "httpMethod": "GET",
22889	//   "id": "logging.organizations.sinks.list",
22890	//   "parameterOrder": [
22891	//     "parent"
22892	//   ],
22893	//   "parameters": {
22894	//     "pageSize": {
22895	//       "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.",
22896	//       "format": "int32",
22897	//       "location": "query",
22898	//       "type": "integer"
22899	//     },
22900	//     "pageToken": {
22901	//       "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.",
22902	//       "location": "query",
22903	//       "type": "string"
22904	//     },
22905	//     "parent": {
22906	//       "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
22907	//       "location": "path",
22908	//       "pattern": "^organizations/[^/]+$",
22909	//       "required": true,
22910	//       "type": "string"
22911	//     }
22912	//   },
22913	//   "path": "v2/{+parent}/sinks",
22914	//   "response": {
22915	//     "$ref": "ListSinksResponse"
22916	//   },
22917	//   "scopes": [
22918	//     "https://www.googleapis.com/auth/cloud-platform",
22919	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
22920	//     "https://www.googleapis.com/auth/logging.admin",
22921	//     "https://www.googleapis.com/auth/logging.read"
22922	//   ]
22923	// }
22924
22925}
22926
22927// Pages invokes f for each page of results.
22928// A non-nil error returned from f will halt the iteration.
22929// The provided context supersedes any context provided to the Context method.
22930func (c *OrganizationsSinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error {
22931	c.ctx_ = ctx
22932	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
22933	for {
22934		x, err := c.Do()
22935		if err != nil {
22936			return err
22937		}
22938		if err := f(x); err != nil {
22939			return err
22940		}
22941		if x.NextPageToken == "" {
22942			return nil
22943		}
22944		c.PageToken(x.NextPageToken)
22945	}
22946}
22947
22948// method id "logging.organizations.sinks.patch":
22949
22950type OrganizationsSinksPatchCall struct {
22951	s          *Service
22952	sinkNameid string
22953	logsink    *LogSink
22954	urlParams_ gensupport.URLParams
22955	ctx_       context.Context
22956	header_    http.Header
22957}
22958
22959// Patch: Updates a sink. This method replaces the following fields in
22960// the existing sink with values from the new sink: destination, and
22961// filter.The updated sink might also have a new writer_identity; see
22962// the unique_writer_identity field.
22963//
22964// - sinkName: The full resource name of the sink to update, including
22965//   the parent resource and the sink identifier:
22966//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
22967//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
22968//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
22969//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" For
22970//   example:"projects/my-project/sinks/my-sink".
22971func (r *OrganizationsSinksService) Patch(sinkNameid string, logsink *LogSink) *OrganizationsSinksPatchCall {
22972	c := &OrganizationsSinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
22973	c.sinkNameid = sinkNameid
22974	c.logsink = logsink
22975	return c
22976}
22977
22978// UniqueWriterIdentity sets the optional parameter
22979// "uniqueWriterIdentity": See sinks.create for a description of this
22980// field. When updating a sink, the effect of this field on the value of
22981// writer_identity in the updated sink depends on both the old and new
22982// values of this field: If the old and new values of this field are
22983// both false or both true, then there is no change to the sink's
22984// writer_identity. If the old value is false and the new value is true,
22985// then writer_identity is changed to a unique service account. It is an
22986// error if the old value is true and the new value is set to false or
22987// defaulted to false.
22988func (c *OrganizationsSinksPatchCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *OrganizationsSinksPatchCall {
22989	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
22990	return c
22991}
22992
22993// UpdateMask sets the optional parameter "updateMask": Field mask that
22994// specifies the fields in sink that need an update. A sink field will
22995// be overwritten if, and only if, it is in the update mask. name and
22996// output only fields cannot be updated.An empty updateMask is
22997// temporarily treated as using the following mask for backwards
22998// compatibility purposes:destination,filter,includeChildrenAt some
22999// point in the future, behavior will be removed and specifying an empty
23000// updateMask will be an error.For a detailed FieldMask definition, see
23001// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor
23002// example: updateMask=filter
23003func (c *OrganizationsSinksPatchCall) UpdateMask(updateMask string) *OrganizationsSinksPatchCall {
23004	c.urlParams_.Set("updateMask", updateMask)
23005	return c
23006}
23007
23008// Fields allows partial responses to be retrieved. See
23009// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
23010// for more information.
23011func (c *OrganizationsSinksPatchCall) Fields(s ...googleapi.Field) *OrganizationsSinksPatchCall {
23012	c.urlParams_.Set("fields", googleapi.CombineFields(s))
23013	return c
23014}
23015
23016// Context sets the context to be used in this call's Do method. Any
23017// pending HTTP request will be aborted if the provided context is
23018// canceled.
23019func (c *OrganizationsSinksPatchCall) Context(ctx context.Context) *OrganizationsSinksPatchCall {
23020	c.ctx_ = ctx
23021	return c
23022}
23023
23024// Header returns an http.Header that can be modified by the caller to
23025// add HTTP headers to the request.
23026func (c *OrganizationsSinksPatchCall) Header() http.Header {
23027	if c.header_ == nil {
23028		c.header_ = make(http.Header)
23029	}
23030	return c.header_
23031}
23032
23033func (c *OrganizationsSinksPatchCall) doRequest(alt string) (*http.Response, error) {
23034	reqHeaders := make(http.Header)
23035	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
23036	for k, v := range c.header_ {
23037		reqHeaders[k] = v
23038	}
23039	reqHeaders.Set("User-Agent", c.s.userAgent())
23040	var body io.Reader = nil
23041	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
23042	if err != nil {
23043		return nil, err
23044	}
23045	reqHeaders.Set("Content-Type", "application/json")
23046	c.urlParams_.Set("alt", alt)
23047	c.urlParams_.Set("prettyPrint", "false")
23048	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
23049	urls += "?" + c.urlParams_.Encode()
23050	req, err := http.NewRequest("PATCH", urls, body)
23051	if err != nil {
23052		return nil, err
23053	}
23054	req.Header = reqHeaders
23055	googleapi.Expand(req.URL, map[string]string{
23056		"sinkName": c.sinkNameid,
23057	})
23058	return gensupport.SendRequest(c.ctx_, c.s.client, req)
23059}
23060
23061// Do executes the "logging.organizations.sinks.patch" call.
23062// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
23063// code is an error. Response headers are in either
23064// *LogSink.ServerResponse.Header or (if a response was returned at all)
23065// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
23066// check whether the returned error was because http.StatusNotModified
23067// was returned.
23068func (c *OrganizationsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
23069	gensupport.SetOptions(c.urlParams_, opts...)
23070	res, err := c.doRequest("json")
23071	if res != nil && res.StatusCode == http.StatusNotModified {
23072		if res.Body != nil {
23073			res.Body.Close()
23074		}
23075		return nil, &googleapi.Error{
23076			Code:   res.StatusCode,
23077			Header: res.Header,
23078		}
23079	}
23080	if err != nil {
23081		return nil, err
23082	}
23083	defer googleapi.CloseBody(res)
23084	if err := googleapi.CheckResponse(res); err != nil {
23085		return nil, err
23086	}
23087	ret := &LogSink{
23088		ServerResponse: googleapi.ServerResponse{
23089			Header:         res.Header,
23090			HTTPStatusCode: res.StatusCode,
23091		},
23092	}
23093	target := &ret
23094	if err := gensupport.DecodeResponse(target, res); err != nil {
23095		return nil, err
23096	}
23097	return ret, nil
23098	// {
23099	//   "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.",
23100	//   "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}",
23101	//   "httpMethod": "PATCH",
23102	//   "id": "logging.organizations.sinks.patch",
23103	//   "parameterOrder": [
23104	//     "sinkName"
23105	//   ],
23106	//   "parameters": {
23107	//     "sinkName": {
23108	//       "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]\" For example:\"projects/my-project/sinks/my-sink\"",
23109	//       "location": "path",
23110	//       "pattern": "^organizations/[^/]+/sinks/[^/]+$",
23111	//       "required": true,
23112	//       "type": "string"
23113	//     },
23114	//     "uniqueWriterIdentity": {
23115	//       "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.",
23116	//       "location": "query",
23117	//       "type": "boolean"
23118	//     },
23119	//     "updateMask": {
23120	//       "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,includeChildrenAt 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.FieldMaskFor example: updateMask=filter",
23121	//       "format": "google-fieldmask",
23122	//       "location": "query",
23123	//       "type": "string"
23124	//     }
23125	//   },
23126	//   "path": "v2/{+sinkName}",
23127	//   "request": {
23128	//     "$ref": "LogSink"
23129	//   },
23130	//   "response": {
23131	//     "$ref": "LogSink"
23132	//   },
23133	//   "scopes": [
23134	//     "https://www.googleapis.com/auth/cloud-platform",
23135	//     "https://www.googleapis.com/auth/logging.admin"
23136	//   ]
23137	// }
23138
23139}
23140
23141// method id "logging.organizations.sinks.update":
23142
23143type OrganizationsSinksUpdateCall struct {
23144	s          *Service
23145	sinkNameid string
23146	logsink    *LogSink
23147	urlParams_ gensupport.URLParams
23148	ctx_       context.Context
23149	header_    http.Header
23150}
23151
23152// Update: Updates a sink. This method replaces the following fields in
23153// the existing sink with values from the new sink: destination, and
23154// filter.The updated sink might also have a new writer_identity; see
23155// the unique_writer_identity field.
23156//
23157// - sinkName: The full resource name of the sink to update, including
23158//   the parent resource and the sink identifier:
23159//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
23160//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
23161//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
23162//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" For
23163//   example:"projects/my-project/sinks/my-sink".
23164func (r *OrganizationsSinksService) Update(sinkNameid string, logsink *LogSink) *OrganizationsSinksUpdateCall {
23165	c := &OrganizationsSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
23166	c.sinkNameid = sinkNameid
23167	c.logsink = logsink
23168	return c
23169}
23170
23171// UniqueWriterIdentity sets the optional parameter
23172// "uniqueWriterIdentity": See sinks.create for a description of this
23173// field. When updating a sink, the effect of this field on the value of
23174// writer_identity in the updated sink depends on both the old and new
23175// values of this field: If the old and new values of this field are
23176// both false or both true, then there is no change to the sink's
23177// writer_identity. If the old value is false and the new value is true,
23178// then writer_identity is changed to a unique service account. It is an
23179// error if the old value is true and the new value is set to false or
23180// defaulted to false.
23181func (c *OrganizationsSinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *OrganizationsSinksUpdateCall {
23182	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
23183	return c
23184}
23185
23186// UpdateMask sets the optional parameter "updateMask": Field mask that
23187// specifies the fields in sink that need an update. A sink field will
23188// be overwritten if, and only if, it is in the update mask. name and
23189// output only fields cannot be updated.An empty updateMask is
23190// temporarily treated as using the following mask for backwards
23191// compatibility purposes:destination,filter,includeChildrenAt some
23192// point in the future, behavior will be removed and specifying an empty
23193// updateMask will be an error.For a detailed FieldMask definition, see
23194// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor
23195// example: updateMask=filter
23196func (c *OrganizationsSinksUpdateCall) UpdateMask(updateMask string) *OrganizationsSinksUpdateCall {
23197	c.urlParams_.Set("updateMask", updateMask)
23198	return c
23199}
23200
23201// Fields allows partial responses to be retrieved. See
23202// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
23203// for more information.
23204func (c *OrganizationsSinksUpdateCall) Fields(s ...googleapi.Field) *OrganizationsSinksUpdateCall {
23205	c.urlParams_.Set("fields", googleapi.CombineFields(s))
23206	return c
23207}
23208
23209// Context sets the context to be used in this call's Do method. Any
23210// pending HTTP request will be aborted if the provided context is
23211// canceled.
23212func (c *OrganizationsSinksUpdateCall) Context(ctx context.Context) *OrganizationsSinksUpdateCall {
23213	c.ctx_ = ctx
23214	return c
23215}
23216
23217// Header returns an http.Header that can be modified by the caller to
23218// add HTTP headers to the request.
23219func (c *OrganizationsSinksUpdateCall) Header() http.Header {
23220	if c.header_ == nil {
23221		c.header_ = make(http.Header)
23222	}
23223	return c.header_
23224}
23225
23226func (c *OrganizationsSinksUpdateCall) doRequest(alt string) (*http.Response, error) {
23227	reqHeaders := make(http.Header)
23228	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
23229	for k, v := range c.header_ {
23230		reqHeaders[k] = v
23231	}
23232	reqHeaders.Set("User-Agent", c.s.userAgent())
23233	var body io.Reader = nil
23234	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
23235	if err != nil {
23236		return nil, err
23237	}
23238	reqHeaders.Set("Content-Type", "application/json")
23239	c.urlParams_.Set("alt", alt)
23240	c.urlParams_.Set("prettyPrint", "false")
23241	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
23242	urls += "?" + c.urlParams_.Encode()
23243	req, err := http.NewRequest("PUT", urls, body)
23244	if err != nil {
23245		return nil, err
23246	}
23247	req.Header = reqHeaders
23248	googleapi.Expand(req.URL, map[string]string{
23249		"sinkName": c.sinkNameid,
23250	})
23251	return gensupport.SendRequest(c.ctx_, c.s.client, req)
23252}
23253
23254// Do executes the "logging.organizations.sinks.update" call.
23255// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
23256// code is an error. Response headers are in either
23257// *LogSink.ServerResponse.Header or (if a response was returned at all)
23258// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
23259// check whether the returned error was because http.StatusNotModified
23260// was returned.
23261func (c *OrganizationsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
23262	gensupport.SetOptions(c.urlParams_, opts...)
23263	res, err := c.doRequest("json")
23264	if res != nil && res.StatusCode == http.StatusNotModified {
23265		if res.Body != nil {
23266			res.Body.Close()
23267		}
23268		return nil, &googleapi.Error{
23269			Code:   res.StatusCode,
23270			Header: res.Header,
23271		}
23272	}
23273	if err != nil {
23274		return nil, err
23275	}
23276	defer googleapi.CloseBody(res)
23277	if err := googleapi.CheckResponse(res); err != nil {
23278		return nil, err
23279	}
23280	ret := &LogSink{
23281		ServerResponse: googleapi.ServerResponse{
23282			Header:         res.Header,
23283			HTTPStatusCode: res.StatusCode,
23284		},
23285	}
23286	target := &ret
23287	if err := gensupport.DecodeResponse(target, res); err != nil {
23288		return nil, err
23289	}
23290	return ret, nil
23291	// {
23292	//   "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.",
23293	//   "flatPath": "v2/organizations/{organizationsId}/sinks/{sinksId}",
23294	//   "httpMethod": "PUT",
23295	//   "id": "logging.organizations.sinks.update",
23296	//   "parameterOrder": [
23297	//     "sinkName"
23298	//   ],
23299	//   "parameters": {
23300	//     "sinkName": {
23301	//       "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]\" For example:\"projects/my-project/sinks/my-sink\"",
23302	//       "location": "path",
23303	//       "pattern": "^organizations/[^/]+/sinks/[^/]+$",
23304	//       "required": true,
23305	//       "type": "string"
23306	//     },
23307	//     "uniqueWriterIdentity": {
23308	//       "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.",
23309	//       "location": "query",
23310	//       "type": "boolean"
23311	//     },
23312	//     "updateMask": {
23313	//       "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,includeChildrenAt 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.FieldMaskFor example: updateMask=filter",
23314	//       "format": "google-fieldmask",
23315	//       "location": "query",
23316	//       "type": "string"
23317	//     }
23318	//   },
23319	//   "path": "v2/{+sinkName}",
23320	//   "request": {
23321	//     "$ref": "LogSink"
23322	//   },
23323	//   "response": {
23324	//     "$ref": "LogSink"
23325	//   },
23326	//   "scopes": [
23327	//     "https://www.googleapis.com/auth/cloud-platform",
23328	//     "https://www.googleapis.com/auth/logging.admin"
23329	//   ]
23330	// }
23331
23332}
23333
23334// method id "logging.projects.exclusions.create":
23335
23336type ProjectsExclusionsCreateCall struct {
23337	s            *Service
23338	parent       string
23339	logexclusion *LogExclusion
23340	urlParams_   gensupport.URLParams
23341	ctx_         context.Context
23342	header_      http.Header
23343}
23344
23345// Create: Creates a new exclusion in the _Default sink in a specified
23346// parent resource. Only log entries belonging to that resource can be
23347// excluded. You can have up to 10 exclusions in a resource.
23348//
23349// - parent: The parent resource in which to create the exclusion:
23350//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
23351//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For
23352//   examples:"projects/my-logging-project" "organizations/123456789".
23353func (r *ProjectsExclusionsService) Create(parent string, logexclusion *LogExclusion) *ProjectsExclusionsCreateCall {
23354	c := &ProjectsExclusionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
23355	c.parent = parent
23356	c.logexclusion = logexclusion
23357	return c
23358}
23359
23360// Fields allows partial responses to be retrieved. See
23361// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
23362// for more information.
23363func (c *ProjectsExclusionsCreateCall) Fields(s ...googleapi.Field) *ProjectsExclusionsCreateCall {
23364	c.urlParams_.Set("fields", googleapi.CombineFields(s))
23365	return c
23366}
23367
23368// Context sets the context to be used in this call's Do method. Any
23369// pending HTTP request will be aborted if the provided context is
23370// canceled.
23371func (c *ProjectsExclusionsCreateCall) Context(ctx context.Context) *ProjectsExclusionsCreateCall {
23372	c.ctx_ = ctx
23373	return c
23374}
23375
23376// Header returns an http.Header that can be modified by the caller to
23377// add HTTP headers to the request.
23378func (c *ProjectsExclusionsCreateCall) Header() http.Header {
23379	if c.header_ == nil {
23380		c.header_ = make(http.Header)
23381	}
23382	return c.header_
23383}
23384
23385func (c *ProjectsExclusionsCreateCall) doRequest(alt string) (*http.Response, error) {
23386	reqHeaders := make(http.Header)
23387	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
23388	for k, v := range c.header_ {
23389		reqHeaders[k] = v
23390	}
23391	reqHeaders.Set("User-Agent", c.s.userAgent())
23392	var body io.Reader = nil
23393	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
23394	if err != nil {
23395		return nil, err
23396	}
23397	reqHeaders.Set("Content-Type", "application/json")
23398	c.urlParams_.Set("alt", alt)
23399	c.urlParams_.Set("prettyPrint", "false")
23400	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
23401	urls += "?" + c.urlParams_.Encode()
23402	req, err := http.NewRequest("POST", urls, body)
23403	if err != nil {
23404		return nil, err
23405	}
23406	req.Header = reqHeaders
23407	googleapi.Expand(req.URL, map[string]string{
23408		"parent": c.parent,
23409	})
23410	return gensupport.SendRequest(c.ctx_, c.s.client, req)
23411}
23412
23413// Do executes the "logging.projects.exclusions.create" call.
23414// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
23415// status code is an error. Response headers are in either
23416// *LogExclusion.ServerResponse.Header or (if a response was returned at
23417// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
23418// to check whether the returned error was because
23419// http.StatusNotModified was returned.
23420func (c *ProjectsExclusionsCreateCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
23421	gensupport.SetOptions(c.urlParams_, opts...)
23422	res, err := c.doRequest("json")
23423	if res != nil && res.StatusCode == http.StatusNotModified {
23424		if res.Body != nil {
23425			res.Body.Close()
23426		}
23427		return nil, &googleapi.Error{
23428			Code:   res.StatusCode,
23429			Header: res.Header,
23430		}
23431	}
23432	if err != nil {
23433		return nil, err
23434	}
23435	defer googleapi.CloseBody(res)
23436	if err := googleapi.CheckResponse(res); err != nil {
23437		return nil, err
23438	}
23439	ret := &LogExclusion{
23440		ServerResponse: googleapi.ServerResponse{
23441			Header:         res.Header,
23442			HTTPStatusCode: res.StatusCode,
23443		},
23444	}
23445	target := &ret
23446	if err := gensupport.DecodeResponse(target, res); err != nil {
23447		return nil, err
23448	}
23449	return ret, nil
23450	// {
23451	//   "description": "Creates a new exclusion in the _Default sink 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.",
23452	//   "flatPath": "v2/projects/{projectsId}/exclusions",
23453	//   "httpMethod": "POST",
23454	//   "id": "logging.projects.exclusions.create",
23455	//   "parameterOrder": [
23456	//     "parent"
23457	//   ],
23458	//   "parameters": {
23459	//     "parent": {
23460	//       "description": "Required. The parent resource in which to create the exclusion: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-logging-project\" \"organizations/123456789\"",
23461	//       "location": "path",
23462	//       "pattern": "^projects/[^/]+$",
23463	//       "required": true,
23464	//       "type": "string"
23465	//     }
23466	//   },
23467	//   "path": "v2/{+parent}/exclusions",
23468	//   "request": {
23469	//     "$ref": "LogExclusion"
23470	//   },
23471	//   "response": {
23472	//     "$ref": "LogExclusion"
23473	//   },
23474	//   "scopes": [
23475	//     "https://www.googleapis.com/auth/cloud-platform",
23476	//     "https://www.googleapis.com/auth/logging.admin"
23477	//   ]
23478	// }
23479
23480}
23481
23482// method id "logging.projects.exclusions.delete":
23483
23484type ProjectsExclusionsDeleteCall struct {
23485	s          *Service
23486	name       string
23487	urlParams_ gensupport.URLParams
23488	ctx_       context.Context
23489	header_    http.Header
23490}
23491
23492// Delete: Deletes an exclusion in the _Default sink.
23493//
23494// - name: The resource name of an existing exclusion to delete:
23495//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
23496//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
23497//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
23498//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For
23499//   example:"projects/my-project/exclusions/my-exclusion".
23500func (r *ProjectsExclusionsService) Delete(name string) *ProjectsExclusionsDeleteCall {
23501	c := &ProjectsExclusionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
23502	c.name = name
23503	return c
23504}
23505
23506// Fields allows partial responses to be retrieved. See
23507// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
23508// for more information.
23509func (c *ProjectsExclusionsDeleteCall) Fields(s ...googleapi.Field) *ProjectsExclusionsDeleteCall {
23510	c.urlParams_.Set("fields", googleapi.CombineFields(s))
23511	return c
23512}
23513
23514// Context sets the context to be used in this call's Do method. Any
23515// pending HTTP request will be aborted if the provided context is
23516// canceled.
23517func (c *ProjectsExclusionsDeleteCall) Context(ctx context.Context) *ProjectsExclusionsDeleteCall {
23518	c.ctx_ = ctx
23519	return c
23520}
23521
23522// Header returns an http.Header that can be modified by the caller to
23523// add HTTP headers to the request.
23524func (c *ProjectsExclusionsDeleteCall) Header() http.Header {
23525	if c.header_ == nil {
23526		c.header_ = make(http.Header)
23527	}
23528	return c.header_
23529}
23530
23531func (c *ProjectsExclusionsDeleteCall) doRequest(alt string) (*http.Response, error) {
23532	reqHeaders := make(http.Header)
23533	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
23534	for k, v := range c.header_ {
23535		reqHeaders[k] = v
23536	}
23537	reqHeaders.Set("User-Agent", c.s.userAgent())
23538	var body io.Reader = nil
23539	c.urlParams_.Set("alt", alt)
23540	c.urlParams_.Set("prettyPrint", "false")
23541	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
23542	urls += "?" + c.urlParams_.Encode()
23543	req, err := http.NewRequest("DELETE", urls, body)
23544	if err != nil {
23545		return nil, err
23546	}
23547	req.Header = reqHeaders
23548	googleapi.Expand(req.URL, map[string]string{
23549		"name": c.name,
23550	})
23551	return gensupport.SendRequest(c.ctx_, c.s.client, req)
23552}
23553
23554// Do executes the "logging.projects.exclusions.delete" call.
23555// Exactly one of *Empty or error will be non-nil. Any non-2xx status
23556// code is an error. Response headers are in either
23557// *Empty.ServerResponse.Header or (if a response was returned at all)
23558// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
23559// check whether the returned error was because http.StatusNotModified
23560// was returned.
23561func (c *ProjectsExclusionsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
23562	gensupport.SetOptions(c.urlParams_, opts...)
23563	res, err := c.doRequest("json")
23564	if res != nil && res.StatusCode == http.StatusNotModified {
23565		if res.Body != nil {
23566			res.Body.Close()
23567		}
23568		return nil, &googleapi.Error{
23569			Code:   res.StatusCode,
23570			Header: res.Header,
23571		}
23572	}
23573	if err != nil {
23574		return nil, err
23575	}
23576	defer googleapi.CloseBody(res)
23577	if err := googleapi.CheckResponse(res); err != nil {
23578		return nil, err
23579	}
23580	ret := &Empty{
23581		ServerResponse: googleapi.ServerResponse{
23582			Header:         res.Header,
23583			HTTPStatusCode: res.StatusCode,
23584		},
23585	}
23586	target := &ret
23587	if err := gensupport.DecodeResponse(target, res); err != nil {
23588		return nil, err
23589	}
23590	return ret, nil
23591	// {
23592	//   "description": "Deletes an exclusion in the _Default sink.",
23593	//   "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}",
23594	//   "httpMethod": "DELETE",
23595	//   "id": "logging.projects.exclusions.delete",
23596	//   "parameterOrder": [
23597	//     "name"
23598	//   ],
23599	//   "parameters": {
23600	//     "name": {
23601	//       "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]\" For example:\"projects/my-project/exclusions/my-exclusion\"",
23602	//       "location": "path",
23603	//       "pattern": "^projects/[^/]+/exclusions/[^/]+$",
23604	//       "required": true,
23605	//       "type": "string"
23606	//     }
23607	//   },
23608	//   "path": "v2/{+name}",
23609	//   "response": {
23610	//     "$ref": "Empty"
23611	//   },
23612	//   "scopes": [
23613	//     "https://www.googleapis.com/auth/cloud-platform",
23614	//     "https://www.googleapis.com/auth/logging.admin"
23615	//   ]
23616	// }
23617
23618}
23619
23620// method id "logging.projects.exclusions.get":
23621
23622type ProjectsExclusionsGetCall struct {
23623	s            *Service
23624	name         string
23625	urlParams_   gensupport.URLParams
23626	ifNoneMatch_ string
23627	ctx_         context.Context
23628	header_      http.Header
23629}
23630
23631// Get: Gets the description of an exclusion in the _Default sink.
23632//
23633// - name: The resource name of an existing exclusion:
23634//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
23635//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
23636//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
23637//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For
23638//   example:"projects/my-project/exclusions/my-exclusion".
23639func (r *ProjectsExclusionsService) Get(name string) *ProjectsExclusionsGetCall {
23640	c := &ProjectsExclusionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
23641	c.name = name
23642	return c
23643}
23644
23645// Fields allows partial responses to be retrieved. See
23646// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
23647// for more information.
23648func (c *ProjectsExclusionsGetCall) Fields(s ...googleapi.Field) *ProjectsExclusionsGetCall {
23649	c.urlParams_.Set("fields", googleapi.CombineFields(s))
23650	return c
23651}
23652
23653// IfNoneMatch sets the optional parameter which makes the operation
23654// fail if the object's ETag matches the given value. This is useful for
23655// getting updates only after the object has changed since the last
23656// request. Use googleapi.IsNotModified to check whether the response
23657// error from Do is the result of In-None-Match.
23658func (c *ProjectsExclusionsGetCall) IfNoneMatch(entityTag string) *ProjectsExclusionsGetCall {
23659	c.ifNoneMatch_ = entityTag
23660	return c
23661}
23662
23663// Context sets the context to be used in this call's Do method. Any
23664// pending HTTP request will be aborted if the provided context is
23665// canceled.
23666func (c *ProjectsExclusionsGetCall) Context(ctx context.Context) *ProjectsExclusionsGetCall {
23667	c.ctx_ = ctx
23668	return c
23669}
23670
23671// Header returns an http.Header that can be modified by the caller to
23672// add HTTP headers to the request.
23673func (c *ProjectsExclusionsGetCall) Header() http.Header {
23674	if c.header_ == nil {
23675		c.header_ = make(http.Header)
23676	}
23677	return c.header_
23678}
23679
23680func (c *ProjectsExclusionsGetCall) doRequest(alt string) (*http.Response, error) {
23681	reqHeaders := make(http.Header)
23682	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
23683	for k, v := range c.header_ {
23684		reqHeaders[k] = v
23685	}
23686	reqHeaders.Set("User-Agent", c.s.userAgent())
23687	if c.ifNoneMatch_ != "" {
23688		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
23689	}
23690	var body io.Reader = nil
23691	c.urlParams_.Set("alt", alt)
23692	c.urlParams_.Set("prettyPrint", "false")
23693	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
23694	urls += "?" + c.urlParams_.Encode()
23695	req, err := http.NewRequest("GET", urls, body)
23696	if err != nil {
23697		return nil, err
23698	}
23699	req.Header = reqHeaders
23700	googleapi.Expand(req.URL, map[string]string{
23701		"name": c.name,
23702	})
23703	return gensupport.SendRequest(c.ctx_, c.s.client, req)
23704}
23705
23706// Do executes the "logging.projects.exclusions.get" call.
23707// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
23708// status code is an error. Response headers are in either
23709// *LogExclusion.ServerResponse.Header or (if a response was returned at
23710// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
23711// to check whether the returned error was because
23712// http.StatusNotModified was returned.
23713func (c *ProjectsExclusionsGetCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
23714	gensupport.SetOptions(c.urlParams_, opts...)
23715	res, err := c.doRequest("json")
23716	if res != nil && res.StatusCode == http.StatusNotModified {
23717		if res.Body != nil {
23718			res.Body.Close()
23719		}
23720		return nil, &googleapi.Error{
23721			Code:   res.StatusCode,
23722			Header: res.Header,
23723		}
23724	}
23725	if err != nil {
23726		return nil, err
23727	}
23728	defer googleapi.CloseBody(res)
23729	if err := googleapi.CheckResponse(res); err != nil {
23730		return nil, err
23731	}
23732	ret := &LogExclusion{
23733		ServerResponse: googleapi.ServerResponse{
23734			Header:         res.Header,
23735			HTTPStatusCode: res.StatusCode,
23736		},
23737	}
23738	target := &ret
23739	if err := gensupport.DecodeResponse(target, res); err != nil {
23740		return nil, err
23741	}
23742	return ret, nil
23743	// {
23744	//   "description": "Gets the description of an exclusion in the _Default sink.",
23745	//   "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}",
23746	//   "httpMethod": "GET",
23747	//   "id": "logging.projects.exclusions.get",
23748	//   "parameterOrder": [
23749	//     "name"
23750	//   ],
23751	//   "parameters": {
23752	//     "name": {
23753	//       "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]\" For example:\"projects/my-project/exclusions/my-exclusion\"",
23754	//       "location": "path",
23755	//       "pattern": "^projects/[^/]+/exclusions/[^/]+$",
23756	//       "required": true,
23757	//       "type": "string"
23758	//     }
23759	//   },
23760	//   "path": "v2/{+name}",
23761	//   "response": {
23762	//     "$ref": "LogExclusion"
23763	//   },
23764	//   "scopes": [
23765	//     "https://www.googleapis.com/auth/cloud-platform",
23766	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
23767	//     "https://www.googleapis.com/auth/logging.admin",
23768	//     "https://www.googleapis.com/auth/logging.read"
23769	//   ]
23770	// }
23771
23772}
23773
23774// method id "logging.projects.exclusions.list":
23775
23776type ProjectsExclusionsListCall struct {
23777	s            *Service
23778	parent       string
23779	urlParams_   gensupport.URLParams
23780	ifNoneMatch_ string
23781	ctx_         context.Context
23782	header_      http.Header
23783}
23784
23785// List: Lists all the exclusions on the _Default sink in a parent
23786// resource.
23787//
23788// - parent: The parent resource whose exclusions are to be listed.
23789//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
23790//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]".
23791func (r *ProjectsExclusionsService) List(parent string) *ProjectsExclusionsListCall {
23792	c := &ProjectsExclusionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
23793	c.parent = parent
23794	return c
23795}
23796
23797// PageSize sets the optional parameter "pageSize": The maximum number
23798// of results to return from this request. Non-positive values are
23799// ignored. The presence of nextPageToken in the response indicates that
23800// more results might be available.
23801func (c *ProjectsExclusionsListCall) PageSize(pageSize int64) *ProjectsExclusionsListCall {
23802	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
23803	return c
23804}
23805
23806// PageToken sets the optional parameter "pageToken": If present, then
23807// retrieve the next batch of results from the preceding call to this
23808// method. pageToken must be the value of nextPageToken from the
23809// previous response. The values of other method parameters should be
23810// identical to those in the previous call.
23811func (c *ProjectsExclusionsListCall) PageToken(pageToken string) *ProjectsExclusionsListCall {
23812	c.urlParams_.Set("pageToken", pageToken)
23813	return c
23814}
23815
23816// Fields allows partial responses to be retrieved. See
23817// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
23818// for more information.
23819func (c *ProjectsExclusionsListCall) Fields(s ...googleapi.Field) *ProjectsExclusionsListCall {
23820	c.urlParams_.Set("fields", googleapi.CombineFields(s))
23821	return c
23822}
23823
23824// IfNoneMatch sets the optional parameter which makes the operation
23825// fail if the object's ETag matches the given value. This is useful for
23826// getting updates only after the object has changed since the last
23827// request. Use googleapi.IsNotModified to check whether the response
23828// error from Do is the result of In-None-Match.
23829func (c *ProjectsExclusionsListCall) IfNoneMatch(entityTag string) *ProjectsExclusionsListCall {
23830	c.ifNoneMatch_ = entityTag
23831	return c
23832}
23833
23834// Context sets the context to be used in this call's Do method. Any
23835// pending HTTP request will be aborted if the provided context is
23836// canceled.
23837func (c *ProjectsExclusionsListCall) Context(ctx context.Context) *ProjectsExclusionsListCall {
23838	c.ctx_ = ctx
23839	return c
23840}
23841
23842// Header returns an http.Header that can be modified by the caller to
23843// add HTTP headers to the request.
23844func (c *ProjectsExclusionsListCall) Header() http.Header {
23845	if c.header_ == nil {
23846		c.header_ = make(http.Header)
23847	}
23848	return c.header_
23849}
23850
23851func (c *ProjectsExclusionsListCall) doRequest(alt string) (*http.Response, error) {
23852	reqHeaders := make(http.Header)
23853	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
23854	for k, v := range c.header_ {
23855		reqHeaders[k] = v
23856	}
23857	reqHeaders.Set("User-Agent", c.s.userAgent())
23858	if c.ifNoneMatch_ != "" {
23859		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
23860	}
23861	var body io.Reader = nil
23862	c.urlParams_.Set("alt", alt)
23863	c.urlParams_.Set("prettyPrint", "false")
23864	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/exclusions")
23865	urls += "?" + c.urlParams_.Encode()
23866	req, err := http.NewRequest("GET", urls, body)
23867	if err != nil {
23868		return nil, err
23869	}
23870	req.Header = reqHeaders
23871	googleapi.Expand(req.URL, map[string]string{
23872		"parent": c.parent,
23873	})
23874	return gensupport.SendRequest(c.ctx_, c.s.client, req)
23875}
23876
23877// Do executes the "logging.projects.exclusions.list" call.
23878// Exactly one of *ListExclusionsResponse or error will be non-nil. Any
23879// non-2xx status code is an error. Response headers are in either
23880// *ListExclusionsResponse.ServerResponse.Header or (if a response was
23881// returned at all) in error.(*googleapi.Error).Header. Use
23882// googleapi.IsNotModified to check whether the returned error was
23883// because http.StatusNotModified was returned.
23884func (c *ProjectsExclusionsListCall) Do(opts ...googleapi.CallOption) (*ListExclusionsResponse, error) {
23885	gensupport.SetOptions(c.urlParams_, opts...)
23886	res, err := c.doRequest("json")
23887	if res != nil && res.StatusCode == http.StatusNotModified {
23888		if res.Body != nil {
23889			res.Body.Close()
23890		}
23891		return nil, &googleapi.Error{
23892			Code:   res.StatusCode,
23893			Header: res.Header,
23894		}
23895	}
23896	if err != nil {
23897		return nil, err
23898	}
23899	defer googleapi.CloseBody(res)
23900	if err := googleapi.CheckResponse(res); err != nil {
23901		return nil, err
23902	}
23903	ret := &ListExclusionsResponse{
23904		ServerResponse: googleapi.ServerResponse{
23905			Header:         res.Header,
23906			HTTPStatusCode: res.StatusCode,
23907		},
23908	}
23909	target := &ret
23910	if err := gensupport.DecodeResponse(target, res); err != nil {
23911		return nil, err
23912	}
23913	return ret, nil
23914	// {
23915	//   "description": "Lists all the exclusions on the _Default sink in a parent resource.",
23916	//   "flatPath": "v2/projects/{projectsId}/exclusions",
23917	//   "httpMethod": "GET",
23918	//   "id": "logging.projects.exclusions.list",
23919	//   "parameterOrder": [
23920	//     "parent"
23921	//   ],
23922	//   "parameters": {
23923	//     "pageSize": {
23924	//       "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.",
23925	//       "format": "int32",
23926	//       "location": "query",
23927	//       "type": "integer"
23928	//     },
23929	//     "pageToken": {
23930	//       "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.",
23931	//       "location": "query",
23932	//       "type": "string"
23933	//     },
23934	//     "parent": {
23935	//       "description": "Required. The parent resource whose exclusions are to be listed. \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
23936	//       "location": "path",
23937	//       "pattern": "^projects/[^/]+$",
23938	//       "required": true,
23939	//       "type": "string"
23940	//     }
23941	//   },
23942	//   "path": "v2/{+parent}/exclusions",
23943	//   "response": {
23944	//     "$ref": "ListExclusionsResponse"
23945	//   },
23946	//   "scopes": [
23947	//     "https://www.googleapis.com/auth/cloud-platform",
23948	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
23949	//     "https://www.googleapis.com/auth/logging.admin",
23950	//     "https://www.googleapis.com/auth/logging.read"
23951	//   ]
23952	// }
23953
23954}
23955
23956// Pages invokes f for each page of results.
23957// A non-nil error returned from f will halt the iteration.
23958// The provided context supersedes any context provided to the Context method.
23959func (c *ProjectsExclusionsListCall) Pages(ctx context.Context, f func(*ListExclusionsResponse) error) error {
23960	c.ctx_ = ctx
23961	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
23962	for {
23963		x, err := c.Do()
23964		if err != nil {
23965			return err
23966		}
23967		if err := f(x); err != nil {
23968			return err
23969		}
23970		if x.NextPageToken == "" {
23971			return nil
23972		}
23973		c.PageToken(x.NextPageToken)
23974	}
23975}
23976
23977// method id "logging.projects.exclusions.patch":
23978
23979type ProjectsExclusionsPatchCall struct {
23980	s            *Service
23981	name         string
23982	logexclusion *LogExclusion
23983	urlParams_   gensupport.URLParams
23984	ctx_         context.Context
23985	header_      http.Header
23986}
23987
23988// Patch: Changes one or more properties of an existing exclusion in the
23989// _Default sink.
23990//
23991// - name: The resource name of the exclusion to update:
23992//   "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
23993//   "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
23994//   "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
23995//   "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]" For
23996//   example:"projects/my-project/exclusions/my-exclusion".
23997func (r *ProjectsExclusionsService) Patch(name string, logexclusion *LogExclusion) *ProjectsExclusionsPatchCall {
23998	c := &ProjectsExclusionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
23999	c.name = name
24000	c.logexclusion = logexclusion
24001	return c
24002}
24003
24004// UpdateMask sets the optional parameter "updateMask": Required. A
24005// non-empty list of fields to change in the existing exclusion. New
24006// values for the fields are taken from the corresponding fields in the
24007// LogExclusion included in this request. Fields not mentioned in
24008// update_mask are not changed and are ignored in the request.For
24009// example, to change the filter and description of an exclusion,
24010// specify an update_mask of "filter,description".
24011func (c *ProjectsExclusionsPatchCall) UpdateMask(updateMask string) *ProjectsExclusionsPatchCall {
24012	c.urlParams_.Set("updateMask", updateMask)
24013	return c
24014}
24015
24016// Fields allows partial responses to be retrieved. See
24017// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
24018// for more information.
24019func (c *ProjectsExclusionsPatchCall) Fields(s ...googleapi.Field) *ProjectsExclusionsPatchCall {
24020	c.urlParams_.Set("fields", googleapi.CombineFields(s))
24021	return c
24022}
24023
24024// Context sets the context to be used in this call's Do method. Any
24025// pending HTTP request will be aborted if the provided context is
24026// canceled.
24027func (c *ProjectsExclusionsPatchCall) Context(ctx context.Context) *ProjectsExclusionsPatchCall {
24028	c.ctx_ = ctx
24029	return c
24030}
24031
24032// Header returns an http.Header that can be modified by the caller to
24033// add HTTP headers to the request.
24034func (c *ProjectsExclusionsPatchCall) Header() http.Header {
24035	if c.header_ == nil {
24036		c.header_ = make(http.Header)
24037	}
24038	return c.header_
24039}
24040
24041func (c *ProjectsExclusionsPatchCall) doRequest(alt string) (*http.Response, error) {
24042	reqHeaders := make(http.Header)
24043	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
24044	for k, v := range c.header_ {
24045		reqHeaders[k] = v
24046	}
24047	reqHeaders.Set("User-Agent", c.s.userAgent())
24048	var body io.Reader = nil
24049	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logexclusion)
24050	if err != nil {
24051		return nil, err
24052	}
24053	reqHeaders.Set("Content-Type", "application/json")
24054	c.urlParams_.Set("alt", alt)
24055	c.urlParams_.Set("prettyPrint", "false")
24056	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
24057	urls += "?" + c.urlParams_.Encode()
24058	req, err := http.NewRequest("PATCH", urls, body)
24059	if err != nil {
24060		return nil, err
24061	}
24062	req.Header = reqHeaders
24063	googleapi.Expand(req.URL, map[string]string{
24064		"name": c.name,
24065	})
24066	return gensupport.SendRequest(c.ctx_, c.s.client, req)
24067}
24068
24069// Do executes the "logging.projects.exclusions.patch" call.
24070// Exactly one of *LogExclusion or error will be non-nil. Any non-2xx
24071// status code is an error. Response headers are in either
24072// *LogExclusion.ServerResponse.Header or (if a response was returned at
24073// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
24074// to check whether the returned error was because
24075// http.StatusNotModified was returned.
24076func (c *ProjectsExclusionsPatchCall) Do(opts ...googleapi.CallOption) (*LogExclusion, error) {
24077	gensupport.SetOptions(c.urlParams_, opts...)
24078	res, err := c.doRequest("json")
24079	if res != nil && res.StatusCode == http.StatusNotModified {
24080		if res.Body != nil {
24081			res.Body.Close()
24082		}
24083		return nil, &googleapi.Error{
24084			Code:   res.StatusCode,
24085			Header: res.Header,
24086		}
24087	}
24088	if err != nil {
24089		return nil, err
24090	}
24091	defer googleapi.CloseBody(res)
24092	if err := googleapi.CheckResponse(res); err != nil {
24093		return nil, err
24094	}
24095	ret := &LogExclusion{
24096		ServerResponse: googleapi.ServerResponse{
24097			Header:         res.Header,
24098			HTTPStatusCode: res.StatusCode,
24099		},
24100	}
24101	target := &ret
24102	if err := gensupport.DecodeResponse(target, res); err != nil {
24103		return nil, err
24104	}
24105	return ret, nil
24106	// {
24107	//   "description": "Changes one or more properties of an existing exclusion in the _Default sink.",
24108	//   "flatPath": "v2/projects/{projectsId}/exclusions/{exclusionsId}",
24109	//   "httpMethod": "PATCH",
24110	//   "id": "logging.projects.exclusions.patch",
24111	//   "parameterOrder": [
24112	//     "name"
24113	//   ],
24114	//   "parameters": {
24115	//     "name": {
24116	//       "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]\" For example:\"projects/my-project/exclusions/my-exclusion\"",
24117	//       "location": "path",
24118	//       "pattern": "^projects/[^/]+/exclusions/[^/]+$",
24119	//       "required": true,
24120	//       "type": "string"
24121	//     },
24122	//     "updateMask": {
24123	//       "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\".",
24124	//       "format": "google-fieldmask",
24125	//       "location": "query",
24126	//       "type": "string"
24127	//     }
24128	//   },
24129	//   "path": "v2/{+name}",
24130	//   "request": {
24131	//     "$ref": "LogExclusion"
24132	//   },
24133	//   "response": {
24134	//     "$ref": "LogExclusion"
24135	//   },
24136	//   "scopes": [
24137	//     "https://www.googleapis.com/auth/cloud-platform",
24138	//     "https://www.googleapis.com/auth/logging.admin"
24139	//   ]
24140	// }
24141
24142}
24143
24144// method id "logging.projects.locations.get":
24145
24146type ProjectsLocationsGetCall struct {
24147	s            *Service
24148	name         string
24149	urlParams_   gensupport.URLParams
24150	ifNoneMatch_ string
24151	ctx_         context.Context
24152	header_      http.Header
24153}
24154
24155// Get: Gets information about a location.
24156//
24157// - name: Resource name for the location.
24158func (r *ProjectsLocationsService) Get(name string) *ProjectsLocationsGetCall {
24159	c := &ProjectsLocationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
24160	c.name = name
24161	return c
24162}
24163
24164// Fields allows partial responses to be retrieved. See
24165// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
24166// for more information.
24167func (c *ProjectsLocationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGetCall {
24168	c.urlParams_.Set("fields", googleapi.CombineFields(s))
24169	return c
24170}
24171
24172// IfNoneMatch sets the optional parameter which makes the operation
24173// fail if the object's ETag matches the given value. This is useful for
24174// getting updates only after the object has changed since the last
24175// request. Use googleapi.IsNotModified to check whether the response
24176// error from Do is the result of In-None-Match.
24177func (c *ProjectsLocationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGetCall {
24178	c.ifNoneMatch_ = entityTag
24179	return c
24180}
24181
24182// Context sets the context to be used in this call's Do method. Any
24183// pending HTTP request will be aborted if the provided context is
24184// canceled.
24185func (c *ProjectsLocationsGetCall) Context(ctx context.Context) *ProjectsLocationsGetCall {
24186	c.ctx_ = ctx
24187	return c
24188}
24189
24190// Header returns an http.Header that can be modified by the caller to
24191// add HTTP headers to the request.
24192func (c *ProjectsLocationsGetCall) Header() http.Header {
24193	if c.header_ == nil {
24194		c.header_ = make(http.Header)
24195	}
24196	return c.header_
24197}
24198
24199func (c *ProjectsLocationsGetCall) doRequest(alt string) (*http.Response, error) {
24200	reqHeaders := make(http.Header)
24201	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
24202	for k, v := range c.header_ {
24203		reqHeaders[k] = v
24204	}
24205	reqHeaders.Set("User-Agent", c.s.userAgent())
24206	if c.ifNoneMatch_ != "" {
24207		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
24208	}
24209	var body io.Reader = nil
24210	c.urlParams_.Set("alt", alt)
24211	c.urlParams_.Set("prettyPrint", "false")
24212	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
24213	urls += "?" + c.urlParams_.Encode()
24214	req, err := http.NewRequest("GET", urls, body)
24215	if err != nil {
24216		return nil, err
24217	}
24218	req.Header = reqHeaders
24219	googleapi.Expand(req.URL, map[string]string{
24220		"name": c.name,
24221	})
24222	return gensupport.SendRequest(c.ctx_, c.s.client, req)
24223}
24224
24225// Do executes the "logging.projects.locations.get" call.
24226// Exactly one of *Location or error will be non-nil. Any non-2xx status
24227// code is an error. Response headers are in either
24228// *Location.ServerResponse.Header or (if a response was returned at
24229// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
24230// to check whether the returned error was because
24231// http.StatusNotModified was returned.
24232func (c *ProjectsLocationsGetCall) Do(opts ...googleapi.CallOption) (*Location, error) {
24233	gensupport.SetOptions(c.urlParams_, opts...)
24234	res, err := c.doRequest("json")
24235	if res != nil && res.StatusCode == http.StatusNotModified {
24236		if res.Body != nil {
24237			res.Body.Close()
24238		}
24239		return nil, &googleapi.Error{
24240			Code:   res.StatusCode,
24241			Header: res.Header,
24242		}
24243	}
24244	if err != nil {
24245		return nil, err
24246	}
24247	defer googleapi.CloseBody(res)
24248	if err := googleapi.CheckResponse(res); err != nil {
24249		return nil, err
24250	}
24251	ret := &Location{
24252		ServerResponse: googleapi.ServerResponse{
24253			Header:         res.Header,
24254			HTTPStatusCode: res.StatusCode,
24255		},
24256	}
24257	target := &ret
24258	if err := gensupport.DecodeResponse(target, res); err != nil {
24259		return nil, err
24260	}
24261	return ret, nil
24262	// {
24263	//   "description": "Gets information about a location.",
24264	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}",
24265	//   "httpMethod": "GET",
24266	//   "id": "logging.projects.locations.get",
24267	//   "parameterOrder": [
24268	//     "name"
24269	//   ],
24270	//   "parameters": {
24271	//     "name": {
24272	//       "description": "Resource name for the location.",
24273	//       "location": "path",
24274	//       "pattern": "^projects/[^/]+/locations/[^/]+$",
24275	//       "required": true,
24276	//       "type": "string"
24277	//     }
24278	//   },
24279	//   "path": "v2/{+name}",
24280	//   "response": {
24281	//     "$ref": "Location"
24282	//   },
24283	//   "scopes": [
24284	//     "https://www.googleapis.com/auth/cloud-platform",
24285	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
24286	//     "https://www.googleapis.com/auth/logging.admin",
24287	//     "https://www.googleapis.com/auth/logging.read"
24288	//   ]
24289	// }
24290
24291}
24292
24293// method id "logging.projects.locations.list":
24294
24295type ProjectsLocationsListCall struct {
24296	s            *Service
24297	name         string
24298	urlParams_   gensupport.URLParams
24299	ifNoneMatch_ string
24300	ctx_         context.Context
24301	header_      http.Header
24302}
24303
24304// List: Lists information about the supported locations for this
24305// service.
24306//
24307// - name: The resource that owns the locations collection, if
24308//   applicable.
24309func (r *ProjectsLocationsService) List(name string) *ProjectsLocationsListCall {
24310	c := &ProjectsLocationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
24311	c.name = name
24312	return c
24313}
24314
24315// Filter sets the optional parameter "filter": A filter to narrow down
24316// results to a preferred subset. The filtering language accepts strings
24317// like "displayName=tokyo", and is documented in more detail in AIP-160
24318// (https://google.aip.dev/160).
24319func (c *ProjectsLocationsListCall) Filter(filter string) *ProjectsLocationsListCall {
24320	c.urlParams_.Set("filter", filter)
24321	return c
24322}
24323
24324// PageSize sets the optional parameter "pageSize": The maximum number
24325// of results to return. If not set, the service selects a default.
24326func (c *ProjectsLocationsListCall) PageSize(pageSize int64) *ProjectsLocationsListCall {
24327	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
24328	return c
24329}
24330
24331// PageToken sets the optional parameter "pageToken": A page token
24332// received from the next_page_token field in the response. Send that
24333// page token to receive the subsequent page.
24334func (c *ProjectsLocationsListCall) PageToken(pageToken string) *ProjectsLocationsListCall {
24335	c.urlParams_.Set("pageToken", pageToken)
24336	return c
24337}
24338
24339// Fields allows partial responses to be retrieved. See
24340// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
24341// for more information.
24342func (c *ProjectsLocationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsListCall {
24343	c.urlParams_.Set("fields", googleapi.CombineFields(s))
24344	return c
24345}
24346
24347// IfNoneMatch sets the optional parameter which makes the operation
24348// fail if the object's ETag matches the given value. This is useful for
24349// getting updates only after the object has changed since the last
24350// request. Use googleapi.IsNotModified to check whether the response
24351// error from Do is the result of In-None-Match.
24352func (c *ProjectsLocationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsListCall {
24353	c.ifNoneMatch_ = entityTag
24354	return c
24355}
24356
24357// Context sets the context to be used in this call's Do method. Any
24358// pending HTTP request will be aborted if the provided context is
24359// canceled.
24360func (c *ProjectsLocationsListCall) Context(ctx context.Context) *ProjectsLocationsListCall {
24361	c.ctx_ = ctx
24362	return c
24363}
24364
24365// Header returns an http.Header that can be modified by the caller to
24366// add HTTP headers to the request.
24367func (c *ProjectsLocationsListCall) Header() http.Header {
24368	if c.header_ == nil {
24369		c.header_ = make(http.Header)
24370	}
24371	return c.header_
24372}
24373
24374func (c *ProjectsLocationsListCall) doRequest(alt string) (*http.Response, error) {
24375	reqHeaders := make(http.Header)
24376	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
24377	for k, v := range c.header_ {
24378		reqHeaders[k] = v
24379	}
24380	reqHeaders.Set("User-Agent", c.s.userAgent())
24381	if c.ifNoneMatch_ != "" {
24382		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
24383	}
24384	var body io.Reader = nil
24385	c.urlParams_.Set("alt", alt)
24386	c.urlParams_.Set("prettyPrint", "false")
24387	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/locations")
24388	urls += "?" + c.urlParams_.Encode()
24389	req, err := http.NewRequest("GET", urls, body)
24390	if err != nil {
24391		return nil, err
24392	}
24393	req.Header = reqHeaders
24394	googleapi.Expand(req.URL, map[string]string{
24395		"name": c.name,
24396	})
24397	return gensupport.SendRequest(c.ctx_, c.s.client, req)
24398}
24399
24400// Do executes the "logging.projects.locations.list" call.
24401// Exactly one of *ListLocationsResponse or error will be non-nil. Any
24402// non-2xx status code is an error. Response headers are in either
24403// *ListLocationsResponse.ServerResponse.Header or (if a response was
24404// returned at all) in error.(*googleapi.Error).Header. Use
24405// googleapi.IsNotModified to check whether the returned error was
24406// because http.StatusNotModified was returned.
24407func (c *ProjectsLocationsListCall) Do(opts ...googleapi.CallOption) (*ListLocationsResponse, error) {
24408	gensupport.SetOptions(c.urlParams_, opts...)
24409	res, err := c.doRequest("json")
24410	if res != nil && res.StatusCode == http.StatusNotModified {
24411		if res.Body != nil {
24412			res.Body.Close()
24413		}
24414		return nil, &googleapi.Error{
24415			Code:   res.StatusCode,
24416			Header: res.Header,
24417		}
24418	}
24419	if err != nil {
24420		return nil, err
24421	}
24422	defer googleapi.CloseBody(res)
24423	if err := googleapi.CheckResponse(res); err != nil {
24424		return nil, err
24425	}
24426	ret := &ListLocationsResponse{
24427		ServerResponse: googleapi.ServerResponse{
24428			Header:         res.Header,
24429			HTTPStatusCode: res.StatusCode,
24430		},
24431	}
24432	target := &ret
24433	if err := gensupport.DecodeResponse(target, res); err != nil {
24434		return nil, err
24435	}
24436	return ret, nil
24437	// {
24438	//   "description": "Lists information about the supported locations for this service.",
24439	//   "flatPath": "v2/projects/{projectsId}/locations",
24440	//   "httpMethod": "GET",
24441	//   "id": "logging.projects.locations.list",
24442	//   "parameterOrder": [
24443	//     "name"
24444	//   ],
24445	//   "parameters": {
24446	//     "filter": {
24447	//       "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).",
24448	//       "location": "query",
24449	//       "type": "string"
24450	//     },
24451	//     "name": {
24452	//       "description": "The resource that owns the locations collection, if applicable.",
24453	//       "location": "path",
24454	//       "pattern": "^projects/[^/]+$",
24455	//       "required": true,
24456	//       "type": "string"
24457	//     },
24458	//     "pageSize": {
24459	//       "description": "The maximum number of results to return. If not set, the service selects a default.",
24460	//       "format": "int32",
24461	//       "location": "query",
24462	//       "type": "integer"
24463	//     },
24464	//     "pageToken": {
24465	//       "description": "A page token received from the next_page_token field in the response. Send that page token to receive the subsequent page.",
24466	//       "location": "query",
24467	//       "type": "string"
24468	//     }
24469	//   },
24470	//   "path": "v2/{+name}/locations",
24471	//   "response": {
24472	//     "$ref": "ListLocationsResponse"
24473	//   },
24474	//   "scopes": [
24475	//     "https://www.googleapis.com/auth/cloud-platform",
24476	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
24477	//     "https://www.googleapis.com/auth/logging.admin",
24478	//     "https://www.googleapis.com/auth/logging.read"
24479	//   ]
24480	// }
24481
24482}
24483
24484// Pages invokes f for each page of results.
24485// A non-nil error returned from f will halt the iteration.
24486// The provided context supersedes any context provided to the Context method.
24487func (c *ProjectsLocationsListCall) Pages(ctx context.Context, f func(*ListLocationsResponse) error) error {
24488	c.ctx_ = ctx
24489	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
24490	for {
24491		x, err := c.Do()
24492		if err != nil {
24493			return err
24494		}
24495		if err := f(x); err != nil {
24496			return err
24497		}
24498		if x.NextPageToken == "" {
24499			return nil
24500		}
24501		c.PageToken(x.NextPageToken)
24502	}
24503}
24504
24505// method id "logging.projects.locations.buckets.create":
24506
24507type ProjectsLocationsBucketsCreateCall struct {
24508	s          *Service
24509	parent     string
24510	logbucket  *LogBucket
24511	urlParams_ gensupport.URLParams
24512	ctx_       context.Context
24513	header_    http.Header
24514}
24515
24516// Create: Creates a log bucket that can be used to store log entries.
24517// After a bucket has been created, the bucket's location cannot be
24518// changed.
24519//
24520// - parent: The resource in which to create the log bucket:
24521//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]" For
24522//   example:"projects/my-project/locations/global".
24523func (r *ProjectsLocationsBucketsService) Create(parent string, logbucket *LogBucket) *ProjectsLocationsBucketsCreateCall {
24524	c := &ProjectsLocationsBucketsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
24525	c.parent = parent
24526	c.logbucket = logbucket
24527	return c
24528}
24529
24530// BucketId sets the optional parameter "bucketId": Required. A
24531// client-assigned identifier such as "my-bucket". Identifiers are
24532// limited to 100 characters and can include only letters, digits,
24533// underscores, hyphens, and periods.
24534func (c *ProjectsLocationsBucketsCreateCall) BucketId(bucketId string) *ProjectsLocationsBucketsCreateCall {
24535	c.urlParams_.Set("bucketId", bucketId)
24536	return c
24537}
24538
24539// Fields allows partial responses to be retrieved. See
24540// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
24541// for more information.
24542func (c *ProjectsLocationsBucketsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsCreateCall {
24543	c.urlParams_.Set("fields", googleapi.CombineFields(s))
24544	return c
24545}
24546
24547// Context sets the context to be used in this call's Do method. Any
24548// pending HTTP request will be aborted if the provided context is
24549// canceled.
24550func (c *ProjectsLocationsBucketsCreateCall) Context(ctx context.Context) *ProjectsLocationsBucketsCreateCall {
24551	c.ctx_ = ctx
24552	return c
24553}
24554
24555// Header returns an http.Header that can be modified by the caller to
24556// add HTTP headers to the request.
24557func (c *ProjectsLocationsBucketsCreateCall) Header() http.Header {
24558	if c.header_ == nil {
24559		c.header_ = make(http.Header)
24560	}
24561	return c.header_
24562}
24563
24564func (c *ProjectsLocationsBucketsCreateCall) doRequest(alt string) (*http.Response, error) {
24565	reqHeaders := make(http.Header)
24566	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
24567	for k, v := range c.header_ {
24568		reqHeaders[k] = v
24569	}
24570	reqHeaders.Set("User-Agent", c.s.userAgent())
24571	var body io.Reader = nil
24572	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
24573	if err != nil {
24574		return nil, err
24575	}
24576	reqHeaders.Set("Content-Type", "application/json")
24577	c.urlParams_.Set("alt", alt)
24578	c.urlParams_.Set("prettyPrint", "false")
24579	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
24580	urls += "?" + c.urlParams_.Encode()
24581	req, err := http.NewRequest("POST", urls, body)
24582	if err != nil {
24583		return nil, err
24584	}
24585	req.Header = reqHeaders
24586	googleapi.Expand(req.URL, map[string]string{
24587		"parent": c.parent,
24588	})
24589	return gensupport.SendRequest(c.ctx_, c.s.client, req)
24590}
24591
24592// Do executes the "logging.projects.locations.buckets.create" call.
24593// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
24594// status code is an error. Response headers are in either
24595// *LogBucket.ServerResponse.Header or (if a response was returned at
24596// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
24597// to check whether the returned error was because
24598// http.StatusNotModified was returned.
24599func (c *ProjectsLocationsBucketsCreateCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
24600	gensupport.SetOptions(c.urlParams_, opts...)
24601	res, err := c.doRequest("json")
24602	if res != nil && res.StatusCode == http.StatusNotModified {
24603		if res.Body != nil {
24604			res.Body.Close()
24605		}
24606		return nil, &googleapi.Error{
24607			Code:   res.StatusCode,
24608			Header: res.Header,
24609		}
24610	}
24611	if err != nil {
24612		return nil, err
24613	}
24614	defer googleapi.CloseBody(res)
24615	if err := googleapi.CheckResponse(res); err != nil {
24616		return nil, err
24617	}
24618	ret := &LogBucket{
24619		ServerResponse: googleapi.ServerResponse{
24620			Header:         res.Header,
24621			HTTPStatusCode: res.StatusCode,
24622		},
24623	}
24624	target := &ret
24625	if err := gensupport.DecodeResponse(target, res); err != nil {
24626		return nil, err
24627	}
24628	return ret, nil
24629	// {
24630	//   "description": "Creates a log bucket that can be used to store log entries. After a bucket has been created, the bucket's location cannot be changed.",
24631	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets",
24632	//   "httpMethod": "POST",
24633	//   "id": "logging.projects.locations.buckets.create",
24634	//   "parameterOrder": [
24635	//     "parent"
24636	//   ],
24637	//   "parameters": {
24638	//     "bucketId": {
24639	//       "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.",
24640	//       "location": "query",
24641	//       "type": "string"
24642	//     },
24643	//     "parent": {
24644	//       "description": "Required. The resource in which to create the log bucket: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]\" For example:\"projects/my-project/locations/global\"",
24645	//       "location": "path",
24646	//       "pattern": "^projects/[^/]+/locations/[^/]+$",
24647	//       "required": true,
24648	//       "type": "string"
24649	//     }
24650	//   },
24651	//   "path": "v2/{+parent}/buckets",
24652	//   "request": {
24653	//     "$ref": "LogBucket"
24654	//   },
24655	//   "response": {
24656	//     "$ref": "LogBucket"
24657	//   },
24658	//   "scopes": [
24659	//     "https://www.googleapis.com/auth/cloud-platform",
24660	//     "https://www.googleapis.com/auth/logging.admin"
24661	//   ]
24662	// }
24663
24664}
24665
24666// method id "logging.projects.locations.buckets.delete":
24667
24668type ProjectsLocationsBucketsDeleteCall struct {
24669	s          *Service
24670	name       string
24671	urlParams_ gensupport.URLParams
24672	ctx_       context.Context
24673	header_    http.Header
24674}
24675
24676// Delete: Deletes a log bucket.Changes the bucket's lifecycle_state to
24677// the DELETE_REQUESTED state. After 7 days, the bucket will be purged
24678// and all log entries in the bucket will be permanently deleted.
24679//
24680// - name: The full resource name of the bucket to delete.
24681//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
24682//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
24683//   CKET_ID]"
24684//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
24685//   s/[BUCKET_ID]"
24686//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
24687//   For
24688//   example:"projects/my-project/locations/global/buckets/my-bucket".
24689func (r *ProjectsLocationsBucketsService) Delete(name string) *ProjectsLocationsBucketsDeleteCall {
24690	c := &ProjectsLocationsBucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
24691	c.name = name
24692	return c
24693}
24694
24695// Fields allows partial responses to be retrieved. See
24696// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
24697// for more information.
24698func (c *ProjectsLocationsBucketsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsDeleteCall {
24699	c.urlParams_.Set("fields", googleapi.CombineFields(s))
24700	return c
24701}
24702
24703// Context sets the context to be used in this call's Do method. Any
24704// pending HTTP request will be aborted if the provided context is
24705// canceled.
24706func (c *ProjectsLocationsBucketsDeleteCall) Context(ctx context.Context) *ProjectsLocationsBucketsDeleteCall {
24707	c.ctx_ = ctx
24708	return c
24709}
24710
24711// Header returns an http.Header that can be modified by the caller to
24712// add HTTP headers to the request.
24713func (c *ProjectsLocationsBucketsDeleteCall) Header() http.Header {
24714	if c.header_ == nil {
24715		c.header_ = make(http.Header)
24716	}
24717	return c.header_
24718}
24719
24720func (c *ProjectsLocationsBucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
24721	reqHeaders := make(http.Header)
24722	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
24723	for k, v := range c.header_ {
24724		reqHeaders[k] = v
24725	}
24726	reqHeaders.Set("User-Agent", c.s.userAgent())
24727	var body io.Reader = nil
24728	c.urlParams_.Set("alt", alt)
24729	c.urlParams_.Set("prettyPrint", "false")
24730	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
24731	urls += "?" + c.urlParams_.Encode()
24732	req, err := http.NewRequest("DELETE", urls, body)
24733	if err != nil {
24734		return nil, err
24735	}
24736	req.Header = reqHeaders
24737	googleapi.Expand(req.URL, map[string]string{
24738		"name": c.name,
24739	})
24740	return gensupport.SendRequest(c.ctx_, c.s.client, req)
24741}
24742
24743// Do executes the "logging.projects.locations.buckets.delete" call.
24744// Exactly one of *Empty or error will be non-nil. Any non-2xx status
24745// code is an error. Response headers are in either
24746// *Empty.ServerResponse.Header or (if a response was returned at all)
24747// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
24748// check whether the returned error was because http.StatusNotModified
24749// was returned.
24750func (c *ProjectsLocationsBucketsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
24751	gensupport.SetOptions(c.urlParams_, opts...)
24752	res, err := c.doRequest("json")
24753	if res != nil && res.StatusCode == http.StatusNotModified {
24754		if res.Body != nil {
24755			res.Body.Close()
24756		}
24757		return nil, &googleapi.Error{
24758			Code:   res.StatusCode,
24759			Header: res.Header,
24760		}
24761	}
24762	if err != nil {
24763		return nil, err
24764	}
24765	defer googleapi.CloseBody(res)
24766	if err := googleapi.CheckResponse(res); err != nil {
24767		return nil, err
24768	}
24769	ret := &Empty{
24770		ServerResponse: googleapi.ServerResponse{
24771			Header:         res.Header,
24772			HTTPStatusCode: res.StatusCode,
24773		},
24774	}
24775	target := &ret
24776	if err := gensupport.DecodeResponse(target, res); err != nil {
24777		return nil, err
24778	}
24779	return ret, nil
24780	// {
24781	//   "description": "Deletes a log bucket.Changes the bucket's lifecycle_state to the DELETE_REQUESTED state. After 7 days, the bucket will be purged and all log entries in the bucket will be permanently deleted.",
24782	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}",
24783	//   "httpMethod": "DELETE",
24784	//   "id": "logging.projects.locations.buckets.delete",
24785	//   "parameterOrder": [
24786	//     "name"
24787	//   ],
24788	//   "parameters": {
24789	//     "name": {
24790	//       "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]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"",
24791	//       "location": "path",
24792	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$",
24793	//       "required": true,
24794	//       "type": "string"
24795	//     }
24796	//   },
24797	//   "path": "v2/{+name}",
24798	//   "response": {
24799	//     "$ref": "Empty"
24800	//   },
24801	//   "scopes": [
24802	//     "https://www.googleapis.com/auth/cloud-platform",
24803	//     "https://www.googleapis.com/auth/logging.admin"
24804	//   ]
24805	// }
24806
24807}
24808
24809// method id "logging.projects.locations.buckets.get":
24810
24811type ProjectsLocationsBucketsGetCall struct {
24812	s            *Service
24813	name         string
24814	urlParams_   gensupport.URLParams
24815	ifNoneMatch_ string
24816	ctx_         context.Context
24817	header_      http.Header
24818}
24819
24820// Get: Gets a log bucket.
24821//
24822// - name: The resource name of the bucket:
24823//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
24824//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
24825//   CKET_ID]"
24826//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
24827//   s/[BUCKET_ID]"
24828//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
24829//   For
24830//   example:"projects/my-project/locations/global/buckets/my-bucket".
24831func (r *ProjectsLocationsBucketsService) Get(name string) *ProjectsLocationsBucketsGetCall {
24832	c := &ProjectsLocationsBucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
24833	c.name = name
24834	return c
24835}
24836
24837// Fields allows partial responses to be retrieved. See
24838// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
24839// for more information.
24840func (c *ProjectsLocationsBucketsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsGetCall {
24841	c.urlParams_.Set("fields", googleapi.CombineFields(s))
24842	return c
24843}
24844
24845// IfNoneMatch sets the optional parameter which makes the operation
24846// fail if the object's ETag matches the given value. This is useful for
24847// getting updates only after the object has changed since the last
24848// request. Use googleapi.IsNotModified to check whether the response
24849// error from Do is the result of In-None-Match.
24850func (c *ProjectsLocationsBucketsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsGetCall {
24851	c.ifNoneMatch_ = entityTag
24852	return c
24853}
24854
24855// Context sets the context to be used in this call's Do method. Any
24856// pending HTTP request will be aborted if the provided context is
24857// canceled.
24858func (c *ProjectsLocationsBucketsGetCall) Context(ctx context.Context) *ProjectsLocationsBucketsGetCall {
24859	c.ctx_ = ctx
24860	return c
24861}
24862
24863// Header returns an http.Header that can be modified by the caller to
24864// add HTTP headers to the request.
24865func (c *ProjectsLocationsBucketsGetCall) Header() http.Header {
24866	if c.header_ == nil {
24867		c.header_ = make(http.Header)
24868	}
24869	return c.header_
24870}
24871
24872func (c *ProjectsLocationsBucketsGetCall) doRequest(alt string) (*http.Response, error) {
24873	reqHeaders := make(http.Header)
24874	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
24875	for k, v := range c.header_ {
24876		reqHeaders[k] = v
24877	}
24878	reqHeaders.Set("User-Agent", c.s.userAgent())
24879	if c.ifNoneMatch_ != "" {
24880		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
24881	}
24882	var body io.Reader = nil
24883	c.urlParams_.Set("alt", alt)
24884	c.urlParams_.Set("prettyPrint", "false")
24885	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
24886	urls += "?" + c.urlParams_.Encode()
24887	req, err := http.NewRequest("GET", urls, body)
24888	if err != nil {
24889		return nil, err
24890	}
24891	req.Header = reqHeaders
24892	googleapi.Expand(req.URL, map[string]string{
24893		"name": c.name,
24894	})
24895	return gensupport.SendRequest(c.ctx_, c.s.client, req)
24896}
24897
24898// Do executes the "logging.projects.locations.buckets.get" call.
24899// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
24900// status code is an error. Response headers are in either
24901// *LogBucket.ServerResponse.Header or (if a response was returned at
24902// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
24903// to check whether the returned error was because
24904// http.StatusNotModified was returned.
24905func (c *ProjectsLocationsBucketsGetCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
24906	gensupport.SetOptions(c.urlParams_, opts...)
24907	res, err := c.doRequest("json")
24908	if res != nil && res.StatusCode == http.StatusNotModified {
24909		if res.Body != nil {
24910			res.Body.Close()
24911		}
24912		return nil, &googleapi.Error{
24913			Code:   res.StatusCode,
24914			Header: res.Header,
24915		}
24916	}
24917	if err != nil {
24918		return nil, err
24919	}
24920	defer googleapi.CloseBody(res)
24921	if err := googleapi.CheckResponse(res); err != nil {
24922		return nil, err
24923	}
24924	ret := &LogBucket{
24925		ServerResponse: googleapi.ServerResponse{
24926			Header:         res.Header,
24927			HTTPStatusCode: res.StatusCode,
24928		},
24929	}
24930	target := &ret
24931	if err := gensupport.DecodeResponse(target, res); err != nil {
24932		return nil, err
24933	}
24934	return ret, nil
24935	// {
24936	//   "description": "Gets a log bucket.",
24937	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}",
24938	//   "httpMethod": "GET",
24939	//   "id": "logging.projects.locations.buckets.get",
24940	//   "parameterOrder": [
24941	//     "name"
24942	//   ],
24943	//   "parameters": {
24944	//     "name": {
24945	//       "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]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"",
24946	//       "location": "path",
24947	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$",
24948	//       "required": true,
24949	//       "type": "string"
24950	//     }
24951	//   },
24952	//   "path": "v2/{+name}",
24953	//   "response": {
24954	//     "$ref": "LogBucket"
24955	//   },
24956	//   "scopes": [
24957	//     "https://www.googleapis.com/auth/cloud-platform",
24958	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
24959	//     "https://www.googleapis.com/auth/logging.admin",
24960	//     "https://www.googleapis.com/auth/logging.read"
24961	//   ]
24962	// }
24963
24964}
24965
24966// method id "logging.projects.locations.buckets.list":
24967
24968type ProjectsLocationsBucketsListCall struct {
24969	s            *Service
24970	parent       string
24971	urlParams_   gensupport.URLParams
24972	ifNoneMatch_ string
24973	ctx_         context.Context
24974	header_      http.Header
24975}
24976
24977// List: Lists log buckets.
24978//
24979// - parent: The parent resource whose buckets are to be listed:
24980//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
24981//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
24982//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
24983//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]" Note: The locations
24984//   portion of the resource must be specified, but supplying the
24985//   character - in place of LOCATION_ID will return all buckets.
24986func (r *ProjectsLocationsBucketsService) List(parent string) *ProjectsLocationsBucketsListCall {
24987	c := &ProjectsLocationsBucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
24988	c.parent = parent
24989	return c
24990}
24991
24992// PageSize sets the optional parameter "pageSize": The maximum number
24993// of results to return from this request. Non-positive values are
24994// ignored. The presence of nextPageToken in the response indicates that
24995// more results might be available.
24996func (c *ProjectsLocationsBucketsListCall) PageSize(pageSize int64) *ProjectsLocationsBucketsListCall {
24997	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
24998	return c
24999}
25000
25001// PageToken sets the optional parameter "pageToken": If present, then
25002// retrieve the next batch of results from the preceding call to this
25003// method. pageToken must be the value of nextPageToken from the
25004// previous response. The values of other method parameters should be
25005// identical to those in the previous call.
25006func (c *ProjectsLocationsBucketsListCall) PageToken(pageToken string) *ProjectsLocationsBucketsListCall {
25007	c.urlParams_.Set("pageToken", pageToken)
25008	return c
25009}
25010
25011// Fields allows partial responses to be retrieved. See
25012// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
25013// for more information.
25014func (c *ProjectsLocationsBucketsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsListCall {
25015	c.urlParams_.Set("fields", googleapi.CombineFields(s))
25016	return c
25017}
25018
25019// IfNoneMatch sets the optional parameter which makes the operation
25020// fail if the object's ETag matches the given value. This is useful for
25021// getting updates only after the object has changed since the last
25022// request. Use googleapi.IsNotModified to check whether the response
25023// error from Do is the result of In-None-Match.
25024func (c *ProjectsLocationsBucketsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsListCall {
25025	c.ifNoneMatch_ = entityTag
25026	return c
25027}
25028
25029// Context sets the context to be used in this call's Do method. Any
25030// pending HTTP request will be aborted if the provided context is
25031// canceled.
25032func (c *ProjectsLocationsBucketsListCall) Context(ctx context.Context) *ProjectsLocationsBucketsListCall {
25033	c.ctx_ = ctx
25034	return c
25035}
25036
25037// Header returns an http.Header that can be modified by the caller to
25038// add HTTP headers to the request.
25039func (c *ProjectsLocationsBucketsListCall) Header() http.Header {
25040	if c.header_ == nil {
25041		c.header_ = make(http.Header)
25042	}
25043	return c.header_
25044}
25045
25046func (c *ProjectsLocationsBucketsListCall) doRequest(alt string) (*http.Response, error) {
25047	reqHeaders := make(http.Header)
25048	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
25049	for k, v := range c.header_ {
25050		reqHeaders[k] = v
25051	}
25052	reqHeaders.Set("User-Agent", c.s.userAgent())
25053	if c.ifNoneMatch_ != "" {
25054		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
25055	}
25056	var body io.Reader = nil
25057	c.urlParams_.Set("alt", alt)
25058	c.urlParams_.Set("prettyPrint", "false")
25059	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/buckets")
25060	urls += "?" + c.urlParams_.Encode()
25061	req, err := http.NewRequest("GET", urls, body)
25062	if err != nil {
25063		return nil, err
25064	}
25065	req.Header = reqHeaders
25066	googleapi.Expand(req.URL, map[string]string{
25067		"parent": c.parent,
25068	})
25069	return gensupport.SendRequest(c.ctx_, c.s.client, req)
25070}
25071
25072// Do executes the "logging.projects.locations.buckets.list" call.
25073// Exactly one of *ListBucketsResponse or error will be non-nil. Any
25074// non-2xx status code is an error. Response headers are in either
25075// *ListBucketsResponse.ServerResponse.Header or (if a response was
25076// returned at all) in error.(*googleapi.Error).Header. Use
25077// googleapi.IsNotModified to check whether the returned error was
25078// because http.StatusNotModified was returned.
25079func (c *ProjectsLocationsBucketsListCall) Do(opts ...googleapi.CallOption) (*ListBucketsResponse, error) {
25080	gensupport.SetOptions(c.urlParams_, opts...)
25081	res, err := c.doRequest("json")
25082	if res != nil && res.StatusCode == http.StatusNotModified {
25083		if res.Body != nil {
25084			res.Body.Close()
25085		}
25086		return nil, &googleapi.Error{
25087			Code:   res.StatusCode,
25088			Header: res.Header,
25089		}
25090	}
25091	if err != nil {
25092		return nil, err
25093	}
25094	defer googleapi.CloseBody(res)
25095	if err := googleapi.CheckResponse(res); err != nil {
25096		return nil, err
25097	}
25098	ret := &ListBucketsResponse{
25099		ServerResponse: googleapi.ServerResponse{
25100			Header:         res.Header,
25101			HTTPStatusCode: res.StatusCode,
25102		},
25103	}
25104	target := &ret
25105	if err := gensupport.DecodeResponse(target, res); err != nil {
25106		return nil, err
25107	}
25108	return ret, nil
25109	// {
25110	//   "description": "Lists log buckets.",
25111	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets",
25112	//   "httpMethod": "GET",
25113	//   "id": "logging.projects.locations.buckets.list",
25114	//   "parameterOrder": [
25115	//     "parent"
25116	//   ],
25117	//   "parameters": {
25118	//     "pageSize": {
25119	//       "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.",
25120	//       "format": "int32",
25121	//       "location": "query",
25122	//       "type": "integer"
25123	//     },
25124	//     "pageToken": {
25125	//       "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.",
25126	//       "location": "query",
25127	//       "type": "string"
25128	//     },
25129	//     "parent": {
25130	//       "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.",
25131	//       "location": "path",
25132	//       "pattern": "^projects/[^/]+/locations/[^/]+$",
25133	//       "required": true,
25134	//       "type": "string"
25135	//     }
25136	//   },
25137	//   "path": "v2/{+parent}/buckets",
25138	//   "response": {
25139	//     "$ref": "ListBucketsResponse"
25140	//   },
25141	//   "scopes": [
25142	//     "https://www.googleapis.com/auth/cloud-platform",
25143	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
25144	//     "https://www.googleapis.com/auth/logging.admin",
25145	//     "https://www.googleapis.com/auth/logging.read"
25146	//   ]
25147	// }
25148
25149}
25150
25151// Pages invokes f for each page of results.
25152// A non-nil error returned from f will halt the iteration.
25153// The provided context supersedes any context provided to the Context method.
25154func (c *ProjectsLocationsBucketsListCall) Pages(ctx context.Context, f func(*ListBucketsResponse) error) error {
25155	c.ctx_ = ctx
25156	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
25157	for {
25158		x, err := c.Do()
25159		if err != nil {
25160			return err
25161		}
25162		if err := f(x); err != nil {
25163			return err
25164		}
25165		if x.NextPageToken == "" {
25166			return nil
25167		}
25168		c.PageToken(x.NextPageToken)
25169	}
25170}
25171
25172// method id "logging.projects.locations.buckets.patch":
25173
25174type ProjectsLocationsBucketsPatchCall struct {
25175	s          *Service
25176	name       string
25177	logbucket  *LogBucket
25178	urlParams_ gensupport.URLParams
25179	ctx_       context.Context
25180	header_    http.Header
25181}
25182
25183// Patch: Updates a log bucket. This method replaces the following
25184// fields in the existing bucket with values from the new bucket:
25185// retention_periodIf the retention period is decreased and the bucket
25186// is locked, FAILED_PRECONDITION will be returned.If the bucket has a
25187// lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be
25188// returned.After a bucket has been created, the bucket's location
25189// cannot be changed.
25190//
25191// - name: The full resource name of the bucket to update.
25192//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
25193//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
25194//   CKET_ID]"
25195//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
25196//   s/[BUCKET_ID]"
25197//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
25198//   For
25199//   example:"projects/my-project/locations/global/buckets/my-bucket".
25200func (r *ProjectsLocationsBucketsService) Patch(name string, logbucket *LogBucket) *ProjectsLocationsBucketsPatchCall {
25201	c := &ProjectsLocationsBucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
25202	c.name = name
25203	c.logbucket = logbucket
25204	return c
25205}
25206
25207// UpdateMask sets the optional parameter "updateMask": Required. Field
25208// mask that specifies the fields in bucket that need an update. A
25209// bucket field will be overwritten if, and only if, it is in the update
25210// mask. name and output only fields cannot be updated.For a detailed
25211// FieldMask definition, see:
25212// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor
25213// example: updateMask=retention_days
25214func (c *ProjectsLocationsBucketsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsBucketsPatchCall {
25215	c.urlParams_.Set("updateMask", updateMask)
25216	return c
25217}
25218
25219// Fields allows partial responses to be retrieved. See
25220// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
25221// for more information.
25222func (c *ProjectsLocationsBucketsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsPatchCall {
25223	c.urlParams_.Set("fields", googleapi.CombineFields(s))
25224	return c
25225}
25226
25227// Context sets the context to be used in this call's Do method. Any
25228// pending HTTP request will be aborted if the provided context is
25229// canceled.
25230func (c *ProjectsLocationsBucketsPatchCall) Context(ctx context.Context) *ProjectsLocationsBucketsPatchCall {
25231	c.ctx_ = ctx
25232	return c
25233}
25234
25235// Header returns an http.Header that can be modified by the caller to
25236// add HTTP headers to the request.
25237func (c *ProjectsLocationsBucketsPatchCall) Header() http.Header {
25238	if c.header_ == nil {
25239		c.header_ = make(http.Header)
25240	}
25241	return c.header_
25242}
25243
25244func (c *ProjectsLocationsBucketsPatchCall) doRequest(alt string) (*http.Response, error) {
25245	reqHeaders := make(http.Header)
25246	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
25247	for k, v := range c.header_ {
25248		reqHeaders[k] = v
25249	}
25250	reqHeaders.Set("User-Agent", c.s.userAgent())
25251	var body io.Reader = nil
25252	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logbucket)
25253	if err != nil {
25254		return nil, err
25255	}
25256	reqHeaders.Set("Content-Type", "application/json")
25257	c.urlParams_.Set("alt", alt)
25258	c.urlParams_.Set("prettyPrint", "false")
25259	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
25260	urls += "?" + c.urlParams_.Encode()
25261	req, err := http.NewRequest("PATCH", urls, body)
25262	if err != nil {
25263		return nil, err
25264	}
25265	req.Header = reqHeaders
25266	googleapi.Expand(req.URL, map[string]string{
25267		"name": c.name,
25268	})
25269	return gensupport.SendRequest(c.ctx_, c.s.client, req)
25270}
25271
25272// Do executes the "logging.projects.locations.buckets.patch" call.
25273// Exactly one of *LogBucket or error will be non-nil. Any non-2xx
25274// status code is an error. Response headers are in either
25275// *LogBucket.ServerResponse.Header or (if a response was returned at
25276// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
25277// to check whether the returned error was because
25278// http.StatusNotModified was returned.
25279func (c *ProjectsLocationsBucketsPatchCall) Do(opts ...googleapi.CallOption) (*LogBucket, error) {
25280	gensupport.SetOptions(c.urlParams_, opts...)
25281	res, err := c.doRequest("json")
25282	if res != nil && res.StatusCode == http.StatusNotModified {
25283		if res.Body != nil {
25284			res.Body.Close()
25285		}
25286		return nil, &googleapi.Error{
25287			Code:   res.StatusCode,
25288			Header: res.Header,
25289		}
25290	}
25291	if err != nil {
25292		return nil, err
25293	}
25294	defer googleapi.CloseBody(res)
25295	if err := googleapi.CheckResponse(res); err != nil {
25296		return nil, err
25297	}
25298	ret := &LogBucket{
25299		ServerResponse: googleapi.ServerResponse{
25300			Header:         res.Header,
25301			HTTPStatusCode: res.StatusCode,
25302		},
25303	}
25304	target := &ret
25305	if err := gensupport.DecodeResponse(target, res); err != nil {
25306		return nil, err
25307	}
25308	return ret, nil
25309	// {
25310	//   "description": "Updates a log 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 lifecycle_state of DELETE_REQUESTED, then FAILED_PRECONDITION will be returned.After a bucket has been created, the bucket's location cannot be changed.",
25311	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}",
25312	//   "httpMethod": "PATCH",
25313	//   "id": "logging.projects.locations.buckets.patch",
25314	//   "parameterOrder": [
25315	//     "name"
25316	//   ],
25317	//   "parameters": {
25318	//     "name": {
25319	//       "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]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"",
25320	//       "location": "path",
25321	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$",
25322	//       "required": true,
25323	//       "type": "string"
25324	//     },
25325	//     "updateMask": {
25326	//       "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.FieldMaskFor example: updateMask=retention_days",
25327	//       "format": "google-fieldmask",
25328	//       "location": "query",
25329	//       "type": "string"
25330	//     }
25331	//   },
25332	//   "path": "v2/{+name}",
25333	//   "request": {
25334	//     "$ref": "LogBucket"
25335	//   },
25336	//   "response": {
25337	//     "$ref": "LogBucket"
25338	//   },
25339	//   "scopes": [
25340	//     "https://www.googleapis.com/auth/cloud-platform",
25341	//     "https://www.googleapis.com/auth/logging.admin"
25342	//   ]
25343	// }
25344
25345}
25346
25347// method id "logging.projects.locations.buckets.undelete":
25348
25349type ProjectsLocationsBucketsUndeleteCall struct {
25350	s                     *Service
25351	name                  string
25352	undeletebucketrequest *UndeleteBucketRequest
25353	urlParams_            gensupport.URLParams
25354	ctx_                  context.Context
25355	header_               http.Header
25356}
25357
25358// Undelete: Undeletes a log bucket. A bucket that has been deleted can
25359// be undeleted within the grace period of 7 days.
25360//
25361// - name: The full resource name of the bucket to undelete.
25362//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
25363//   "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BU
25364//   CKET_ID]"
25365//   "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/bucket
25366//   s/[BUCKET_ID]"
25367//   "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
25368//   For
25369//   example:"projects/my-project/locations/global/buckets/my-bucket".
25370func (r *ProjectsLocationsBucketsService) Undelete(name string, undeletebucketrequest *UndeleteBucketRequest) *ProjectsLocationsBucketsUndeleteCall {
25371	c := &ProjectsLocationsBucketsUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
25372	c.name = name
25373	c.undeletebucketrequest = undeletebucketrequest
25374	return c
25375}
25376
25377// Fields allows partial responses to be retrieved. See
25378// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
25379// for more information.
25380func (c *ProjectsLocationsBucketsUndeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsUndeleteCall {
25381	c.urlParams_.Set("fields", googleapi.CombineFields(s))
25382	return c
25383}
25384
25385// Context sets the context to be used in this call's Do method. Any
25386// pending HTTP request will be aborted if the provided context is
25387// canceled.
25388func (c *ProjectsLocationsBucketsUndeleteCall) Context(ctx context.Context) *ProjectsLocationsBucketsUndeleteCall {
25389	c.ctx_ = ctx
25390	return c
25391}
25392
25393// Header returns an http.Header that can be modified by the caller to
25394// add HTTP headers to the request.
25395func (c *ProjectsLocationsBucketsUndeleteCall) Header() http.Header {
25396	if c.header_ == nil {
25397		c.header_ = make(http.Header)
25398	}
25399	return c.header_
25400}
25401
25402func (c *ProjectsLocationsBucketsUndeleteCall) doRequest(alt string) (*http.Response, error) {
25403	reqHeaders := make(http.Header)
25404	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
25405	for k, v := range c.header_ {
25406		reqHeaders[k] = v
25407	}
25408	reqHeaders.Set("User-Agent", c.s.userAgent())
25409	var body io.Reader = nil
25410	body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletebucketrequest)
25411	if err != nil {
25412		return nil, err
25413	}
25414	reqHeaders.Set("Content-Type", "application/json")
25415	c.urlParams_.Set("alt", alt)
25416	c.urlParams_.Set("prettyPrint", "false")
25417	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:undelete")
25418	urls += "?" + c.urlParams_.Encode()
25419	req, err := http.NewRequest("POST", urls, body)
25420	if err != nil {
25421		return nil, err
25422	}
25423	req.Header = reqHeaders
25424	googleapi.Expand(req.URL, map[string]string{
25425		"name": c.name,
25426	})
25427	return gensupport.SendRequest(c.ctx_, c.s.client, req)
25428}
25429
25430// Do executes the "logging.projects.locations.buckets.undelete" call.
25431// Exactly one of *Empty or error will be non-nil. Any non-2xx status
25432// code is an error. Response headers are in either
25433// *Empty.ServerResponse.Header or (if a response was returned at all)
25434// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
25435// check whether the returned error was because http.StatusNotModified
25436// was returned.
25437func (c *ProjectsLocationsBucketsUndeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
25438	gensupport.SetOptions(c.urlParams_, opts...)
25439	res, err := c.doRequest("json")
25440	if res != nil && res.StatusCode == http.StatusNotModified {
25441		if res.Body != nil {
25442			res.Body.Close()
25443		}
25444		return nil, &googleapi.Error{
25445			Code:   res.StatusCode,
25446			Header: res.Header,
25447		}
25448	}
25449	if err != nil {
25450		return nil, err
25451	}
25452	defer googleapi.CloseBody(res)
25453	if err := googleapi.CheckResponse(res); err != nil {
25454		return nil, err
25455	}
25456	ret := &Empty{
25457		ServerResponse: googleapi.ServerResponse{
25458			Header:         res.Header,
25459			HTTPStatusCode: res.StatusCode,
25460		},
25461	}
25462	target := &ret
25463	if err := gensupport.DecodeResponse(target, res); err != nil {
25464		return nil, err
25465	}
25466	return ret, nil
25467	// {
25468	//   "description": "Undeletes a log bucket. A bucket that has been deleted can be undeleted within the grace period of 7 days.",
25469	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}:undelete",
25470	//   "httpMethod": "POST",
25471	//   "id": "logging.projects.locations.buckets.undelete",
25472	//   "parameterOrder": [
25473	//     "name"
25474	//   ],
25475	//   "parameters": {
25476	//     "name": {
25477	//       "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]\" For example:\"projects/my-project/locations/global/buckets/my-bucket\"",
25478	//       "location": "path",
25479	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$",
25480	//       "required": true,
25481	//       "type": "string"
25482	//     }
25483	//   },
25484	//   "path": "v2/{+name}:undelete",
25485	//   "request": {
25486	//     "$ref": "UndeleteBucketRequest"
25487	//   },
25488	//   "response": {
25489	//     "$ref": "Empty"
25490	//   },
25491	//   "scopes": [
25492	//     "https://www.googleapis.com/auth/cloud-platform",
25493	//     "https://www.googleapis.com/auth/logging.admin"
25494	//   ]
25495	// }
25496
25497}
25498
25499// method id "logging.projects.locations.buckets.views.create":
25500
25501type ProjectsLocationsBucketsViewsCreateCall struct {
25502	s          *Service
25503	parent     string
25504	logview    *LogView
25505	urlParams_ gensupport.URLParams
25506	ctx_       context.Context
25507	header_    http.Header
25508}
25509
25510// Create: Creates a view over log entries in a log bucket. A bucket may
25511// contain a maximum of 30 views.
25512//
25513// - parent: The bucket in which to create the view
25514//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
25515//   ` For
25516//   example:"projects/my-project/locations/global/buckets/my-bucket".
25517func (r *ProjectsLocationsBucketsViewsService) Create(parent string, logview *LogView) *ProjectsLocationsBucketsViewsCreateCall {
25518	c := &ProjectsLocationsBucketsViewsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
25519	c.parent = parent
25520	c.logview = logview
25521	return c
25522}
25523
25524// ViewId sets the optional parameter "viewId": Required. The id to use
25525// for this view.
25526func (c *ProjectsLocationsBucketsViewsCreateCall) ViewId(viewId string) *ProjectsLocationsBucketsViewsCreateCall {
25527	c.urlParams_.Set("viewId", viewId)
25528	return c
25529}
25530
25531// Fields allows partial responses to be retrieved. See
25532// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
25533// for more information.
25534func (c *ProjectsLocationsBucketsViewsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsCreateCall {
25535	c.urlParams_.Set("fields", googleapi.CombineFields(s))
25536	return c
25537}
25538
25539// Context sets the context to be used in this call's Do method. Any
25540// pending HTTP request will be aborted if the provided context is
25541// canceled.
25542func (c *ProjectsLocationsBucketsViewsCreateCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsCreateCall {
25543	c.ctx_ = ctx
25544	return c
25545}
25546
25547// Header returns an http.Header that can be modified by the caller to
25548// add HTTP headers to the request.
25549func (c *ProjectsLocationsBucketsViewsCreateCall) Header() http.Header {
25550	if c.header_ == nil {
25551		c.header_ = make(http.Header)
25552	}
25553	return c.header_
25554}
25555
25556func (c *ProjectsLocationsBucketsViewsCreateCall) doRequest(alt string) (*http.Response, error) {
25557	reqHeaders := make(http.Header)
25558	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
25559	for k, v := range c.header_ {
25560		reqHeaders[k] = v
25561	}
25562	reqHeaders.Set("User-Agent", c.s.userAgent())
25563	var body io.Reader = nil
25564	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
25565	if err != nil {
25566		return nil, err
25567	}
25568	reqHeaders.Set("Content-Type", "application/json")
25569	c.urlParams_.Set("alt", alt)
25570	c.urlParams_.Set("prettyPrint", "false")
25571	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
25572	urls += "?" + c.urlParams_.Encode()
25573	req, err := http.NewRequest("POST", urls, body)
25574	if err != nil {
25575		return nil, err
25576	}
25577	req.Header = reqHeaders
25578	googleapi.Expand(req.URL, map[string]string{
25579		"parent": c.parent,
25580	})
25581	return gensupport.SendRequest(c.ctx_, c.s.client, req)
25582}
25583
25584// Do executes the "logging.projects.locations.buckets.views.create" call.
25585// Exactly one of *LogView or error will be non-nil. Any non-2xx status
25586// code is an error. Response headers are in either
25587// *LogView.ServerResponse.Header or (if a response was returned at all)
25588// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
25589// check whether the returned error was because http.StatusNotModified
25590// was returned.
25591func (c *ProjectsLocationsBucketsViewsCreateCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
25592	gensupport.SetOptions(c.urlParams_, opts...)
25593	res, err := c.doRequest("json")
25594	if res != nil && res.StatusCode == http.StatusNotModified {
25595		if res.Body != nil {
25596			res.Body.Close()
25597		}
25598		return nil, &googleapi.Error{
25599			Code:   res.StatusCode,
25600			Header: res.Header,
25601		}
25602	}
25603	if err != nil {
25604		return nil, err
25605	}
25606	defer googleapi.CloseBody(res)
25607	if err := googleapi.CheckResponse(res); err != nil {
25608		return nil, err
25609	}
25610	ret := &LogView{
25611		ServerResponse: googleapi.ServerResponse{
25612			Header:         res.Header,
25613			HTTPStatusCode: res.StatusCode,
25614		},
25615	}
25616	target := &ret
25617	if err := gensupport.DecodeResponse(target, res); err != nil {
25618		return nil, err
25619	}
25620	return ret, nil
25621	// {
25622	//   "description": "Creates a view over log entries in a log bucket. A bucket may contain a maximum of 30 views.",
25623	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views",
25624	//   "httpMethod": "POST",
25625	//   "id": "logging.projects.locations.buckets.views.create",
25626	//   "parameterOrder": [
25627	//     "parent"
25628	//   ],
25629	//   "parameters": {
25630	//     "parent": {
25631	//       "description": "Required. The bucket in which to create the view `\"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\"` For example:\"projects/my-project/locations/global/buckets/my-bucket\"",
25632	//       "location": "path",
25633	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$",
25634	//       "required": true,
25635	//       "type": "string"
25636	//     },
25637	//     "viewId": {
25638	//       "description": "Required. The id to use for this view.",
25639	//       "location": "query",
25640	//       "type": "string"
25641	//     }
25642	//   },
25643	//   "path": "v2/{+parent}/views",
25644	//   "request": {
25645	//     "$ref": "LogView"
25646	//   },
25647	//   "response": {
25648	//     "$ref": "LogView"
25649	//   },
25650	//   "scopes": [
25651	//     "https://www.googleapis.com/auth/cloud-platform",
25652	//     "https://www.googleapis.com/auth/logging.admin"
25653	//   ]
25654	// }
25655
25656}
25657
25658// method id "logging.projects.locations.buckets.views.delete":
25659
25660type ProjectsLocationsBucketsViewsDeleteCall struct {
25661	s          *Service
25662	name       string
25663	urlParams_ gensupport.URLParams
25664	ctx_       context.Context
25665	header_    http.Header
25666}
25667
25668// Delete: Deletes a view on a log bucket. If an UNAVAILABLE error is
25669// returned, this indicates that system is not in a state where it can
25670// delete the view. If this occurs, please try again in a few minutes.
25671//
25672// - name: The full resource name of the view to delete:
25673//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
25674//   iews/[VIEW_ID]" For
25675//   example:"projects/my-project/locations/global/buckets/my-bucket/view
25676//   s/my-view".
25677func (r *ProjectsLocationsBucketsViewsService) Delete(name string) *ProjectsLocationsBucketsViewsDeleteCall {
25678	c := &ProjectsLocationsBucketsViewsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
25679	c.name = name
25680	return c
25681}
25682
25683// Fields allows partial responses to be retrieved. See
25684// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
25685// for more information.
25686func (c *ProjectsLocationsBucketsViewsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsDeleteCall {
25687	c.urlParams_.Set("fields", googleapi.CombineFields(s))
25688	return c
25689}
25690
25691// Context sets the context to be used in this call's Do method. Any
25692// pending HTTP request will be aborted if the provided context is
25693// canceled.
25694func (c *ProjectsLocationsBucketsViewsDeleteCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsDeleteCall {
25695	c.ctx_ = ctx
25696	return c
25697}
25698
25699// Header returns an http.Header that can be modified by the caller to
25700// add HTTP headers to the request.
25701func (c *ProjectsLocationsBucketsViewsDeleteCall) Header() http.Header {
25702	if c.header_ == nil {
25703		c.header_ = make(http.Header)
25704	}
25705	return c.header_
25706}
25707
25708func (c *ProjectsLocationsBucketsViewsDeleteCall) doRequest(alt string) (*http.Response, error) {
25709	reqHeaders := make(http.Header)
25710	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
25711	for k, v := range c.header_ {
25712		reqHeaders[k] = v
25713	}
25714	reqHeaders.Set("User-Agent", c.s.userAgent())
25715	var body io.Reader = nil
25716	c.urlParams_.Set("alt", alt)
25717	c.urlParams_.Set("prettyPrint", "false")
25718	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
25719	urls += "?" + c.urlParams_.Encode()
25720	req, err := http.NewRequest("DELETE", urls, body)
25721	if err != nil {
25722		return nil, err
25723	}
25724	req.Header = reqHeaders
25725	googleapi.Expand(req.URL, map[string]string{
25726		"name": c.name,
25727	})
25728	return gensupport.SendRequest(c.ctx_, c.s.client, req)
25729}
25730
25731// Do executes the "logging.projects.locations.buckets.views.delete" call.
25732// Exactly one of *Empty or error will be non-nil. Any non-2xx status
25733// code is an error. Response headers are in either
25734// *Empty.ServerResponse.Header or (if a response was returned at all)
25735// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
25736// check whether the returned error was because http.StatusNotModified
25737// was returned.
25738func (c *ProjectsLocationsBucketsViewsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
25739	gensupport.SetOptions(c.urlParams_, opts...)
25740	res, err := c.doRequest("json")
25741	if res != nil && res.StatusCode == http.StatusNotModified {
25742		if res.Body != nil {
25743			res.Body.Close()
25744		}
25745		return nil, &googleapi.Error{
25746			Code:   res.StatusCode,
25747			Header: res.Header,
25748		}
25749	}
25750	if err != nil {
25751		return nil, err
25752	}
25753	defer googleapi.CloseBody(res)
25754	if err := googleapi.CheckResponse(res); err != nil {
25755		return nil, err
25756	}
25757	ret := &Empty{
25758		ServerResponse: googleapi.ServerResponse{
25759			Header:         res.Header,
25760			HTTPStatusCode: res.StatusCode,
25761		},
25762	}
25763	target := &ret
25764	if err := gensupport.DecodeResponse(target, res); err != nil {
25765		return nil, err
25766	}
25767	return ret, nil
25768	// {
25769	//   "description": "Deletes a view on a log bucket. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can delete the view. If this occurs, please try again in a few minutes.",
25770	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
25771	//   "httpMethod": "DELETE",
25772	//   "id": "logging.projects.locations.buckets.views.delete",
25773	//   "parameterOrder": [
25774	//     "name"
25775	//   ],
25776	//   "parameters": {
25777	//     "name": {
25778	//       "description": "Required. The full resource name of the view to delete: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"",
25779	//       "location": "path",
25780	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
25781	//       "required": true,
25782	//       "type": "string"
25783	//     }
25784	//   },
25785	//   "path": "v2/{+name}",
25786	//   "response": {
25787	//     "$ref": "Empty"
25788	//   },
25789	//   "scopes": [
25790	//     "https://www.googleapis.com/auth/cloud-platform",
25791	//     "https://www.googleapis.com/auth/logging.admin"
25792	//   ]
25793	// }
25794
25795}
25796
25797// method id "logging.projects.locations.buckets.views.get":
25798
25799type ProjectsLocationsBucketsViewsGetCall struct {
25800	s            *Service
25801	name         string
25802	urlParams_   gensupport.URLParams
25803	ifNoneMatch_ string
25804	ctx_         context.Context
25805	header_      http.Header
25806}
25807
25808// Get: Gets a view on a log bucket..
25809//
25810// - name: The resource name of the policy:
25811//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
25812//   iews/[VIEW_ID]" For
25813//   example:"projects/my-project/locations/global/buckets/my-bucket/view
25814//   s/my-view".
25815func (r *ProjectsLocationsBucketsViewsService) Get(name string) *ProjectsLocationsBucketsViewsGetCall {
25816	c := &ProjectsLocationsBucketsViewsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
25817	c.name = name
25818	return c
25819}
25820
25821// Fields allows partial responses to be retrieved. See
25822// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
25823// for more information.
25824func (c *ProjectsLocationsBucketsViewsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsGetCall {
25825	c.urlParams_.Set("fields", googleapi.CombineFields(s))
25826	return c
25827}
25828
25829// IfNoneMatch sets the optional parameter which makes the operation
25830// fail if the object's ETag matches the given value. This is useful for
25831// getting updates only after the object has changed since the last
25832// request. Use googleapi.IsNotModified to check whether the response
25833// error from Do is the result of In-None-Match.
25834func (c *ProjectsLocationsBucketsViewsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsViewsGetCall {
25835	c.ifNoneMatch_ = entityTag
25836	return c
25837}
25838
25839// Context sets the context to be used in this call's Do method. Any
25840// pending HTTP request will be aborted if the provided context is
25841// canceled.
25842func (c *ProjectsLocationsBucketsViewsGetCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsGetCall {
25843	c.ctx_ = ctx
25844	return c
25845}
25846
25847// Header returns an http.Header that can be modified by the caller to
25848// add HTTP headers to the request.
25849func (c *ProjectsLocationsBucketsViewsGetCall) Header() http.Header {
25850	if c.header_ == nil {
25851		c.header_ = make(http.Header)
25852	}
25853	return c.header_
25854}
25855
25856func (c *ProjectsLocationsBucketsViewsGetCall) doRequest(alt string) (*http.Response, error) {
25857	reqHeaders := make(http.Header)
25858	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
25859	for k, v := range c.header_ {
25860		reqHeaders[k] = v
25861	}
25862	reqHeaders.Set("User-Agent", c.s.userAgent())
25863	if c.ifNoneMatch_ != "" {
25864		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
25865	}
25866	var body io.Reader = nil
25867	c.urlParams_.Set("alt", alt)
25868	c.urlParams_.Set("prettyPrint", "false")
25869	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
25870	urls += "?" + c.urlParams_.Encode()
25871	req, err := http.NewRequest("GET", urls, body)
25872	if err != nil {
25873		return nil, err
25874	}
25875	req.Header = reqHeaders
25876	googleapi.Expand(req.URL, map[string]string{
25877		"name": c.name,
25878	})
25879	return gensupport.SendRequest(c.ctx_, c.s.client, req)
25880}
25881
25882// Do executes the "logging.projects.locations.buckets.views.get" call.
25883// Exactly one of *LogView or error will be non-nil. Any non-2xx status
25884// code is an error. Response headers are in either
25885// *LogView.ServerResponse.Header or (if a response was returned at all)
25886// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
25887// check whether the returned error was because http.StatusNotModified
25888// was returned.
25889func (c *ProjectsLocationsBucketsViewsGetCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
25890	gensupport.SetOptions(c.urlParams_, opts...)
25891	res, err := c.doRequest("json")
25892	if res != nil && res.StatusCode == http.StatusNotModified {
25893		if res.Body != nil {
25894			res.Body.Close()
25895		}
25896		return nil, &googleapi.Error{
25897			Code:   res.StatusCode,
25898			Header: res.Header,
25899		}
25900	}
25901	if err != nil {
25902		return nil, err
25903	}
25904	defer googleapi.CloseBody(res)
25905	if err := googleapi.CheckResponse(res); err != nil {
25906		return nil, err
25907	}
25908	ret := &LogView{
25909		ServerResponse: googleapi.ServerResponse{
25910			Header:         res.Header,
25911			HTTPStatusCode: res.StatusCode,
25912		},
25913	}
25914	target := &ret
25915	if err := gensupport.DecodeResponse(target, res); err != nil {
25916		return nil, err
25917	}
25918	return ret, nil
25919	// {
25920	//   "description": "Gets a view on a log bucket..",
25921	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
25922	//   "httpMethod": "GET",
25923	//   "id": "logging.projects.locations.buckets.views.get",
25924	//   "parameterOrder": [
25925	//     "name"
25926	//   ],
25927	//   "parameters": {
25928	//     "name": {
25929	//       "description": "Required. The resource name of the policy: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"",
25930	//       "location": "path",
25931	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
25932	//       "required": true,
25933	//       "type": "string"
25934	//     }
25935	//   },
25936	//   "path": "v2/{+name}",
25937	//   "response": {
25938	//     "$ref": "LogView"
25939	//   },
25940	//   "scopes": [
25941	//     "https://www.googleapis.com/auth/cloud-platform",
25942	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
25943	//     "https://www.googleapis.com/auth/logging.admin",
25944	//     "https://www.googleapis.com/auth/logging.read"
25945	//   ]
25946	// }
25947
25948}
25949
25950// method id "logging.projects.locations.buckets.views.list":
25951
25952type ProjectsLocationsBucketsViewsListCall struct {
25953	s            *Service
25954	parent       string
25955	urlParams_   gensupport.URLParams
25956	ifNoneMatch_ string
25957	ctx_         context.Context
25958	header_      http.Header
25959}
25960
25961// List: Lists views on a log bucket.
25962//
25963// - parent: The bucket whose views are to be listed:
25964//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]".
25965func (r *ProjectsLocationsBucketsViewsService) List(parent string) *ProjectsLocationsBucketsViewsListCall {
25966	c := &ProjectsLocationsBucketsViewsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
25967	c.parent = parent
25968	return c
25969}
25970
25971// PageSize sets the optional parameter "pageSize": The maximum number
25972// of results to return from this request.Non-positive values are
25973// ignored. The presence of nextPageToken in the response indicates that
25974// more results might be available.
25975func (c *ProjectsLocationsBucketsViewsListCall) PageSize(pageSize int64) *ProjectsLocationsBucketsViewsListCall {
25976	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
25977	return c
25978}
25979
25980// PageToken sets the optional parameter "pageToken": If present, then
25981// retrieve the next batch of results from the preceding call to this
25982// method. pageToken must be the value of nextPageToken from the
25983// previous response. The values of other method parameters should be
25984// identical to those in the previous call.
25985func (c *ProjectsLocationsBucketsViewsListCall) PageToken(pageToken string) *ProjectsLocationsBucketsViewsListCall {
25986	c.urlParams_.Set("pageToken", pageToken)
25987	return c
25988}
25989
25990// Fields allows partial responses to be retrieved. See
25991// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
25992// for more information.
25993func (c *ProjectsLocationsBucketsViewsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsListCall {
25994	c.urlParams_.Set("fields", googleapi.CombineFields(s))
25995	return c
25996}
25997
25998// IfNoneMatch sets the optional parameter which makes the operation
25999// fail if the object's ETag matches the given value. This is useful for
26000// getting updates only after the object has changed since the last
26001// request. Use googleapi.IsNotModified to check whether the response
26002// error from Do is the result of In-None-Match.
26003func (c *ProjectsLocationsBucketsViewsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsBucketsViewsListCall {
26004	c.ifNoneMatch_ = entityTag
26005	return c
26006}
26007
26008// Context sets the context to be used in this call's Do method. Any
26009// pending HTTP request will be aborted if the provided context is
26010// canceled.
26011func (c *ProjectsLocationsBucketsViewsListCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsListCall {
26012	c.ctx_ = ctx
26013	return c
26014}
26015
26016// Header returns an http.Header that can be modified by the caller to
26017// add HTTP headers to the request.
26018func (c *ProjectsLocationsBucketsViewsListCall) Header() http.Header {
26019	if c.header_ == nil {
26020		c.header_ = make(http.Header)
26021	}
26022	return c.header_
26023}
26024
26025func (c *ProjectsLocationsBucketsViewsListCall) doRequest(alt string) (*http.Response, error) {
26026	reqHeaders := make(http.Header)
26027	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
26028	for k, v := range c.header_ {
26029		reqHeaders[k] = v
26030	}
26031	reqHeaders.Set("User-Agent", c.s.userAgent())
26032	if c.ifNoneMatch_ != "" {
26033		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
26034	}
26035	var body io.Reader = nil
26036	c.urlParams_.Set("alt", alt)
26037	c.urlParams_.Set("prettyPrint", "false")
26038	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/views")
26039	urls += "?" + c.urlParams_.Encode()
26040	req, err := http.NewRequest("GET", urls, body)
26041	if err != nil {
26042		return nil, err
26043	}
26044	req.Header = reqHeaders
26045	googleapi.Expand(req.URL, map[string]string{
26046		"parent": c.parent,
26047	})
26048	return gensupport.SendRequest(c.ctx_, c.s.client, req)
26049}
26050
26051// Do executes the "logging.projects.locations.buckets.views.list" call.
26052// Exactly one of *ListViewsResponse or error will be non-nil. Any
26053// non-2xx status code is an error. Response headers are in either
26054// *ListViewsResponse.ServerResponse.Header or (if a response was
26055// returned at all) in error.(*googleapi.Error).Header. Use
26056// googleapi.IsNotModified to check whether the returned error was
26057// because http.StatusNotModified was returned.
26058func (c *ProjectsLocationsBucketsViewsListCall) Do(opts ...googleapi.CallOption) (*ListViewsResponse, error) {
26059	gensupport.SetOptions(c.urlParams_, opts...)
26060	res, err := c.doRequest("json")
26061	if res != nil && res.StatusCode == http.StatusNotModified {
26062		if res.Body != nil {
26063			res.Body.Close()
26064		}
26065		return nil, &googleapi.Error{
26066			Code:   res.StatusCode,
26067			Header: res.Header,
26068		}
26069	}
26070	if err != nil {
26071		return nil, err
26072	}
26073	defer googleapi.CloseBody(res)
26074	if err := googleapi.CheckResponse(res); err != nil {
26075		return nil, err
26076	}
26077	ret := &ListViewsResponse{
26078		ServerResponse: googleapi.ServerResponse{
26079			Header:         res.Header,
26080			HTTPStatusCode: res.StatusCode,
26081		},
26082	}
26083	target := &ret
26084	if err := gensupport.DecodeResponse(target, res); err != nil {
26085		return nil, err
26086	}
26087	return ret, nil
26088	// {
26089	//   "description": "Lists views on a log bucket.",
26090	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views",
26091	//   "httpMethod": "GET",
26092	//   "id": "logging.projects.locations.buckets.views.list",
26093	//   "parameterOrder": [
26094	//     "parent"
26095	//   ],
26096	//   "parameters": {
26097	//     "pageSize": {
26098	//       "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.",
26099	//       "format": "int32",
26100	//       "location": "query",
26101	//       "type": "integer"
26102	//     },
26103	//     "pageToken": {
26104	//       "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.",
26105	//       "location": "query",
26106	//       "type": "string"
26107	//     },
26108	//     "parent": {
26109	//       "description": "Required. The bucket whose views are to be listed: \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]\" ",
26110	//       "location": "path",
26111	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+$",
26112	//       "required": true,
26113	//       "type": "string"
26114	//     }
26115	//   },
26116	//   "path": "v2/{+parent}/views",
26117	//   "response": {
26118	//     "$ref": "ListViewsResponse"
26119	//   },
26120	//   "scopes": [
26121	//     "https://www.googleapis.com/auth/cloud-platform",
26122	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
26123	//     "https://www.googleapis.com/auth/logging.admin",
26124	//     "https://www.googleapis.com/auth/logging.read"
26125	//   ]
26126	// }
26127
26128}
26129
26130// Pages invokes f for each page of results.
26131// A non-nil error returned from f will halt the iteration.
26132// The provided context supersedes any context provided to the Context method.
26133func (c *ProjectsLocationsBucketsViewsListCall) Pages(ctx context.Context, f func(*ListViewsResponse) error) error {
26134	c.ctx_ = ctx
26135	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
26136	for {
26137		x, err := c.Do()
26138		if err != nil {
26139			return err
26140		}
26141		if err := f(x); err != nil {
26142			return err
26143		}
26144		if x.NextPageToken == "" {
26145			return nil
26146		}
26147		c.PageToken(x.NextPageToken)
26148	}
26149}
26150
26151// method id "logging.projects.locations.buckets.views.patch":
26152
26153type ProjectsLocationsBucketsViewsPatchCall struct {
26154	s          *Service
26155	name       string
26156	logview    *LogView
26157	urlParams_ gensupport.URLParams
26158	ctx_       context.Context
26159	header_    http.Header
26160}
26161
26162// Patch: Updates a view on a log bucket. This method replaces the
26163// following fields in the existing view with values from the new view:
26164// filter. If an UNAVAILABLE error is returned, this indicates that
26165// system is not in a state where it can update the view. If this
26166// occurs, please try again in a few minutes.
26167//
26168// - name: The full resource name of the view to update
26169//   "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/v
26170//   iews/[VIEW_ID]" For
26171//   example:"projects/my-project/locations/global/buckets/my-bucket/view
26172//   s/my-view".
26173func (r *ProjectsLocationsBucketsViewsService) Patch(name string, logview *LogView) *ProjectsLocationsBucketsViewsPatchCall {
26174	c := &ProjectsLocationsBucketsViewsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
26175	c.name = name
26176	c.logview = logview
26177	return c
26178}
26179
26180// UpdateMask sets the optional parameter "updateMask": Field mask that
26181// specifies the fields in view that need an update. A field will be
26182// overwritten if, and only if, it is in the update mask. name and
26183// output only fields cannot be updated.For a detailed FieldMask
26184// definition, see
26185// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor
26186// example: updateMask=filter
26187func (c *ProjectsLocationsBucketsViewsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsBucketsViewsPatchCall {
26188	c.urlParams_.Set("updateMask", updateMask)
26189	return c
26190}
26191
26192// Fields allows partial responses to be retrieved. See
26193// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
26194// for more information.
26195func (c *ProjectsLocationsBucketsViewsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsBucketsViewsPatchCall {
26196	c.urlParams_.Set("fields", googleapi.CombineFields(s))
26197	return c
26198}
26199
26200// Context sets the context to be used in this call's Do method. Any
26201// pending HTTP request will be aborted if the provided context is
26202// canceled.
26203func (c *ProjectsLocationsBucketsViewsPatchCall) Context(ctx context.Context) *ProjectsLocationsBucketsViewsPatchCall {
26204	c.ctx_ = ctx
26205	return c
26206}
26207
26208// Header returns an http.Header that can be modified by the caller to
26209// add HTTP headers to the request.
26210func (c *ProjectsLocationsBucketsViewsPatchCall) Header() http.Header {
26211	if c.header_ == nil {
26212		c.header_ = make(http.Header)
26213	}
26214	return c.header_
26215}
26216
26217func (c *ProjectsLocationsBucketsViewsPatchCall) doRequest(alt string) (*http.Response, error) {
26218	reqHeaders := make(http.Header)
26219	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
26220	for k, v := range c.header_ {
26221		reqHeaders[k] = v
26222	}
26223	reqHeaders.Set("User-Agent", c.s.userAgent())
26224	var body io.Reader = nil
26225	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logview)
26226	if err != nil {
26227		return nil, err
26228	}
26229	reqHeaders.Set("Content-Type", "application/json")
26230	c.urlParams_.Set("alt", alt)
26231	c.urlParams_.Set("prettyPrint", "false")
26232	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
26233	urls += "?" + c.urlParams_.Encode()
26234	req, err := http.NewRequest("PATCH", urls, body)
26235	if err != nil {
26236		return nil, err
26237	}
26238	req.Header = reqHeaders
26239	googleapi.Expand(req.URL, map[string]string{
26240		"name": c.name,
26241	})
26242	return gensupport.SendRequest(c.ctx_, c.s.client, req)
26243}
26244
26245// Do executes the "logging.projects.locations.buckets.views.patch" call.
26246// Exactly one of *LogView or error will be non-nil. Any non-2xx status
26247// code is an error. Response headers are in either
26248// *LogView.ServerResponse.Header or (if a response was returned at all)
26249// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
26250// check whether the returned error was because http.StatusNotModified
26251// was returned.
26252func (c *ProjectsLocationsBucketsViewsPatchCall) Do(opts ...googleapi.CallOption) (*LogView, error) {
26253	gensupport.SetOptions(c.urlParams_, opts...)
26254	res, err := c.doRequest("json")
26255	if res != nil && res.StatusCode == http.StatusNotModified {
26256		if res.Body != nil {
26257			res.Body.Close()
26258		}
26259		return nil, &googleapi.Error{
26260			Code:   res.StatusCode,
26261			Header: res.Header,
26262		}
26263	}
26264	if err != nil {
26265		return nil, err
26266	}
26267	defer googleapi.CloseBody(res)
26268	if err := googleapi.CheckResponse(res); err != nil {
26269		return nil, err
26270	}
26271	ret := &LogView{
26272		ServerResponse: googleapi.ServerResponse{
26273			Header:         res.Header,
26274			HTTPStatusCode: res.StatusCode,
26275		},
26276	}
26277	target := &ret
26278	if err := gensupport.DecodeResponse(target, res); err != nil {
26279		return nil, err
26280	}
26281	return ret, nil
26282	// {
26283	//   "description": "Updates a view on a log bucket. This method replaces the following fields in the existing view with values from the new view: filter. If an UNAVAILABLE error is returned, this indicates that system is not in a state where it can update the view. If this occurs, please try again in a few minutes.",
26284	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/buckets/{bucketsId}/views/{viewsId}",
26285	//   "httpMethod": "PATCH",
26286	//   "id": "logging.projects.locations.buckets.views.patch",
26287	//   "parameterOrder": [
26288	//     "name"
26289	//   ],
26290	//   "parameters": {
26291	//     "name": {
26292	//       "description": "Required. The full resource name of the view to update \"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]\" For example:\"projects/my-project/locations/global/buckets/my-bucket/views/my-view\"",
26293	//       "location": "path",
26294	//       "pattern": "^projects/[^/]+/locations/[^/]+/buckets/[^/]+/views/[^/]+$",
26295	//       "required": true,
26296	//       "type": "string"
26297	//     },
26298	//     "updateMask": {
26299	//       "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.FieldMaskFor example: updateMask=filter",
26300	//       "format": "google-fieldmask",
26301	//       "location": "query",
26302	//       "type": "string"
26303	//     }
26304	//   },
26305	//   "path": "v2/{+name}",
26306	//   "request": {
26307	//     "$ref": "LogView"
26308	//   },
26309	//   "response": {
26310	//     "$ref": "LogView"
26311	//   },
26312	//   "scopes": [
26313	//     "https://www.googleapis.com/auth/cloud-platform",
26314	//     "https://www.googleapis.com/auth/logging.admin"
26315	//   ]
26316	// }
26317
26318}
26319
26320// method id "logging.projects.locations.operations.cancel":
26321
26322type ProjectsLocationsOperationsCancelCall struct {
26323	s                      *Service
26324	name                   string
26325	canceloperationrequest *CancelOperationRequest
26326	urlParams_             gensupport.URLParams
26327	ctx_                   context.Context
26328	header_                http.Header
26329}
26330
26331// Cancel: Starts asynchronous cancellation on a long-running operation.
26332// The server makes a best effort to cancel the operation, but success
26333// is not guaranteed. If the server doesn't support this method, it
26334// returns google.rpc.Code.UNIMPLEMENTED. Clients can use
26335// Operations.GetOperation or other methods to check whether the
26336// cancellation succeeded or whether the operation completed despite
26337// cancellation. On successful cancellation, the operation is not
26338// deleted; instead, it becomes an operation with an Operation.error
26339// value with a google.rpc.Status.code of 1, corresponding to
26340// Code.CANCELLED.
26341//
26342// - name: The name of the operation resource to be cancelled.
26343func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall {
26344	c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
26345	c.name = name
26346	c.canceloperationrequest = canceloperationrequest
26347	return c
26348}
26349
26350// Fields allows partial responses to be retrieved. See
26351// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
26352// for more information.
26353func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall {
26354	c.urlParams_.Set("fields", googleapi.CombineFields(s))
26355	return c
26356}
26357
26358// Context sets the context to be used in this call's Do method. Any
26359// pending HTTP request will be aborted if the provided context is
26360// canceled.
26361func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall {
26362	c.ctx_ = ctx
26363	return c
26364}
26365
26366// Header returns an http.Header that can be modified by the caller to
26367// add HTTP headers to the request.
26368func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header {
26369	if c.header_ == nil {
26370		c.header_ = make(http.Header)
26371	}
26372	return c.header_
26373}
26374
26375func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
26376	reqHeaders := make(http.Header)
26377	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
26378	for k, v := range c.header_ {
26379		reqHeaders[k] = v
26380	}
26381	reqHeaders.Set("User-Agent", c.s.userAgent())
26382	var body io.Reader = nil
26383	body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest)
26384	if err != nil {
26385		return nil, err
26386	}
26387	reqHeaders.Set("Content-Type", "application/json")
26388	c.urlParams_.Set("alt", alt)
26389	c.urlParams_.Set("prettyPrint", "false")
26390	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}:cancel")
26391	urls += "?" + c.urlParams_.Encode()
26392	req, err := http.NewRequest("POST", urls, body)
26393	if err != nil {
26394		return nil, err
26395	}
26396	req.Header = reqHeaders
26397	googleapi.Expand(req.URL, map[string]string{
26398		"name": c.name,
26399	})
26400	return gensupport.SendRequest(c.ctx_, c.s.client, req)
26401}
26402
26403// Do executes the "logging.projects.locations.operations.cancel" call.
26404// Exactly one of *Empty or error will be non-nil. Any non-2xx status
26405// code is an error. Response headers are in either
26406// *Empty.ServerResponse.Header or (if a response was returned at all)
26407// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
26408// check whether the returned error was because http.StatusNotModified
26409// was returned.
26410func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
26411	gensupport.SetOptions(c.urlParams_, opts...)
26412	res, err := c.doRequest("json")
26413	if res != nil && res.StatusCode == http.StatusNotModified {
26414		if res.Body != nil {
26415			res.Body.Close()
26416		}
26417		return nil, &googleapi.Error{
26418			Code:   res.StatusCode,
26419			Header: res.Header,
26420		}
26421	}
26422	if err != nil {
26423		return nil, err
26424	}
26425	defer googleapi.CloseBody(res)
26426	if err := googleapi.CheckResponse(res); err != nil {
26427		return nil, err
26428	}
26429	ret := &Empty{
26430		ServerResponse: googleapi.ServerResponse{
26431			Header:         res.Header,
26432			HTTPStatusCode: res.StatusCode,
26433		},
26434	}
26435	target := &ret
26436	if err := gensupport.DecodeResponse(target, res); err != nil {
26437		return nil, err
26438	}
26439	return ret, nil
26440	// {
26441	//   "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to Code.CANCELLED.",
26442	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:cancel",
26443	//   "httpMethod": "POST",
26444	//   "id": "logging.projects.locations.operations.cancel",
26445	//   "parameterOrder": [
26446	//     "name"
26447	//   ],
26448	//   "parameters": {
26449	//     "name": {
26450	//       "description": "The name of the operation resource to be cancelled.",
26451	//       "location": "path",
26452	//       "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$",
26453	//       "required": true,
26454	//       "type": "string"
26455	//     }
26456	//   },
26457	//   "path": "v2/{+name}:cancel",
26458	//   "request": {
26459	//     "$ref": "CancelOperationRequest"
26460	//   },
26461	//   "response": {
26462	//     "$ref": "Empty"
26463	//   },
26464	//   "scopes": [
26465	//     "https://www.googleapis.com/auth/cloud-platform",
26466	//     "https://www.googleapis.com/auth/logging.admin"
26467	//   ]
26468	// }
26469
26470}
26471
26472// method id "logging.projects.locations.operations.get":
26473
26474type ProjectsLocationsOperationsGetCall struct {
26475	s            *Service
26476	name         string
26477	urlParams_   gensupport.URLParams
26478	ifNoneMatch_ string
26479	ctx_         context.Context
26480	header_      http.Header
26481}
26482
26483// Get: Gets the latest state of a long-running operation. Clients can
26484// use this method to poll the operation result at intervals as
26485// recommended by the API service.
26486//
26487// - name: The name of the operation resource.
26488func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall {
26489	c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
26490	c.name = name
26491	return c
26492}
26493
26494// Fields allows partial responses to be retrieved. See
26495// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
26496// for more information.
26497func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall {
26498	c.urlParams_.Set("fields", googleapi.CombineFields(s))
26499	return c
26500}
26501
26502// IfNoneMatch sets the optional parameter which makes the operation
26503// fail if the object's ETag matches the given value. This is useful for
26504// getting updates only after the object has changed since the last
26505// request. Use googleapi.IsNotModified to check whether the response
26506// error from Do is the result of In-None-Match.
26507func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall {
26508	c.ifNoneMatch_ = entityTag
26509	return c
26510}
26511
26512// Context sets the context to be used in this call's Do method. Any
26513// pending HTTP request will be aborted if the provided context is
26514// canceled.
26515func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall {
26516	c.ctx_ = ctx
26517	return c
26518}
26519
26520// Header returns an http.Header that can be modified by the caller to
26521// add HTTP headers to the request.
26522func (c *ProjectsLocationsOperationsGetCall) Header() http.Header {
26523	if c.header_ == nil {
26524		c.header_ = make(http.Header)
26525	}
26526	return c.header_
26527}
26528
26529func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
26530	reqHeaders := make(http.Header)
26531	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
26532	for k, v := range c.header_ {
26533		reqHeaders[k] = v
26534	}
26535	reqHeaders.Set("User-Agent", c.s.userAgent())
26536	if c.ifNoneMatch_ != "" {
26537		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
26538	}
26539	var body io.Reader = nil
26540	c.urlParams_.Set("alt", alt)
26541	c.urlParams_.Set("prettyPrint", "false")
26542	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}")
26543	urls += "?" + c.urlParams_.Encode()
26544	req, err := http.NewRequest("GET", urls, body)
26545	if err != nil {
26546		return nil, err
26547	}
26548	req.Header = reqHeaders
26549	googleapi.Expand(req.URL, map[string]string{
26550		"name": c.name,
26551	})
26552	return gensupport.SendRequest(c.ctx_, c.s.client, req)
26553}
26554
26555// Do executes the "logging.projects.locations.operations.get" call.
26556// Exactly one of *Operation or error will be non-nil. Any non-2xx
26557// status code is an error. Response headers are in either
26558// *Operation.ServerResponse.Header or (if a response was returned at
26559// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
26560// to check whether the returned error was because
26561// http.StatusNotModified was returned.
26562func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
26563	gensupport.SetOptions(c.urlParams_, opts...)
26564	res, err := c.doRequest("json")
26565	if res != nil && res.StatusCode == http.StatusNotModified {
26566		if res.Body != nil {
26567			res.Body.Close()
26568		}
26569		return nil, &googleapi.Error{
26570			Code:   res.StatusCode,
26571			Header: res.Header,
26572		}
26573	}
26574	if err != nil {
26575		return nil, err
26576	}
26577	defer googleapi.CloseBody(res)
26578	if err := googleapi.CheckResponse(res); err != nil {
26579		return nil, err
26580	}
26581	ret := &Operation{
26582		ServerResponse: googleapi.ServerResponse{
26583			Header:         res.Header,
26584			HTTPStatusCode: res.StatusCode,
26585		},
26586	}
26587	target := &ret
26588	if err := gensupport.DecodeResponse(target, res); err != nil {
26589		return nil, err
26590	}
26591	return ret, nil
26592	// {
26593	//   "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.",
26594	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}",
26595	//   "httpMethod": "GET",
26596	//   "id": "logging.projects.locations.operations.get",
26597	//   "parameterOrder": [
26598	//     "name"
26599	//   ],
26600	//   "parameters": {
26601	//     "name": {
26602	//       "description": "The name of the operation resource.",
26603	//       "location": "path",
26604	//       "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$",
26605	//       "required": true,
26606	//       "type": "string"
26607	//     }
26608	//   },
26609	//   "path": "v2/{+name}",
26610	//   "response": {
26611	//     "$ref": "Operation"
26612	//   },
26613	//   "scopes": [
26614	//     "https://www.googleapis.com/auth/cloud-platform",
26615	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
26616	//     "https://www.googleapis.com/auth/logging.admin",
26617	//     "https://www.googleapis.com/auth/logging.read"
26618	//   ]
26619	// }
26620
26621}
26622
26623// method id "logging.projects.locations.operations.list":
26624
26625type ProjectsLocationsOperationsListCall struct {
26626	s            *Service
26627	name         string
26628	urlParams_   gensupport.URLParams
26629	ifNoneMatch_ string
26630	ctx_         context.Context
26631	header_      http.Header
26632}
26633
26634// List: Lists operations that match the specified filter in the
26635// request. If the server doesn't support this method, it returns
26636// UNIMPLEMENTED.NOTE: the name binding allows API services to override
26637// the binding to use different resource name schemes, such as
26638// users/*/operations. To override the binding, API services can add a
26639// binding such as "/v1/{name=users/*}/operations" to their service
26640// configuration. For backwards compatibility, the default name includes
26641// the operations collection id, however overriding users must ensure
26642// the name binding is the parent resource, without the operations
26643// collection id.
26644//
26645// - name: The name of the operation's parent resource.
26646func (r *ProjectsLocationsOperationsService) List(name string) *ProjectsLocationsOperationsListCall {
26647	c := &ProjectsLocationsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
26648	c.name = name
26649	return c
26650}
26651
26652// Filter sets the optional parameter "filter": The standard list
26653// filter.
26654func (c *ProjectsLocationsOperationsListCall) Filter(filter string) *ProjectsLocationsOperationsListCall {
26655	c.urlParams_.Set("filter", filter)
26656	return c
26657}
26658
26659// PageSize sets the optional parameter "pageSize": The standard list
26660// page size.
26661func (c *ProjectsLocationsOperationsListCall) PageSize(pageSize int64) *ProjectsLocationsOperationsListCall {
26662	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
26663	return c
26664}
26665
26666// PageToken sets the optional parameter "pageToken": The standard list
26667// page token.
26668func (c *ProjectsLocationsOperationsListCall) PageToken(pageToken string) *ProjectsLocationsOperationsListCall {
26669	c.urlParams_.Set("pageToken", pageToken)
26670	return c
26671}
26672
26673// Fields allows partial responses to be retrieved. See
26674// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
26675// for more information.
26676func (c *ProjectsLocationsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsListCall {
26677	c.urlParams_.Set("fields", googleapi.CombineFields(s))
26678	return c
26679}
26680
26681// IfNoneMatch sets the optional parameter which makes the operation
26682// fail if the object's ETag matches the given value. This is useful for
26683// getting updates only after the object has changed since the last
26684// request. Use googleapi.IsNotModified to check whether the response
26685// error from Do is the result of In-None-Match.
26686func (c *ProjectsLocationsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsListCall {
26687	c.ifNoneMatch_ = entityTag
26688	return c
26689}
26690
26691// Context sets the context to be used in this call's Do method. Any
26692// pending HTTP request will be aborted if the provided context is
26693// canceled.
26694func (c *ProjectsLocationsOperationsListCall) Context(ctx context.Context) *ProjectsLocationsOperationsListCall {
26695	c.ctx_ = ctx
26696	return c
26697}
26698
26699// Header returns an http.Header that can be modified by the caller to
26700// add HTTP headers to the request.
26701func (c *ProjectsLocationsOperationsListCall) Header() http.Header {
26702	if c.header_ == nil {
26703		c.header_ = make(http.Header)
26704	}
26705	return c.header_
26706}
26707
26708func (c *ProjectsLocationsOperationsListCall) doRequest(alt string) (*http.Response, error) {
26709	reqHeaders := make(http.Header)
26710	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
26711	for k, v := range c.header_ {
26712		reqHeaders[k] = v
26713	}
26714	reqHeaders.Set("User-Agent", c.s.userAgent())
26715	if c.ifNoneMatch_ != "" {
26716		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
26717	}
26718	var body io.Reader = nil
26719	c.urlParams_.Set("alt", alt)
26720	c.urlParams_.Set("prettyPrint", "false")
26721	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/operations")
26722	urls += "?" + c.urlParams_.Encode()
26723	req, err := http.NewRequest("GET", urls, body)
26724	if err != nil {
26725		return nil, err
26726	}
26727	req.Header = reqHeaders
26728	googleapi.Expand(req.URL, map[string]string{
26729		"name": c.name,
26730	})
26731	return gensupport.SendRequest(c.ctx_, c.s.client, req)
26732}
26733
26734// Do executes the "logging.projects.locations.operations.list" call.
26735// Exactly one of *ListOperationsResponse or error will be non-nil. Any
26736// non-2xx status code is an error. Response headers are in either
26737// *ListOperationsResponse.ServerResponse.Header or (if a response was
26738// returned at all) in error.(*googleapi.Error).Header. Use
26739// googleapi.IsNotModified to check whether the returned error was
26740// because http.StatusNotModified was returned.
26741func (c *ProjectsLocationsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
26742	gensupport.SetOptions(c.urlParams_, opts...)
26743	res, err := c.doRequest("json")
26744	if res != nil && res.StatusCode == http.StatusNotModified {
26745		if res.Body != nil {
26746			res.Body.Close()
26747		}
26748		return nil, &googleapi.Error{
26749			Code:   res.StatusCode,
26750			Header: res.Header,
26751		}
26752	}
26753	if err != nil {
26754		return nil, err
26755	}
26756	defer googleapi.CloseBody(res)
26757	if err := googleapi.CheckResponse(res); err != nil {
26758		return nil, err
26759	}
26760	ret := &ListOperationsResponse{
26761		ServerResponse: googleapi.ServerResponse{
26762			Header:         res.Header,
26763			HTTPStatusCode: res.StatusCode,
26764		},
26765	}
26766	target := &ret
26767	if err := gensupport.DecodeResponse(target, res); err != nil {
26768		return nil, err
26769	}
26770	return ret, nil
26771	// {
26772	//   "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as \"/v1/{name=users/*}/operations\" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.",
26773	//   "flatPath": "v2/projects/{projectsId}/locations/{locationsId}/operations",
26774	//   "httpMethod": "GET",
26775	//   "id": "logging.projects.locations.operations.list",
26776	//   "parameterOrder": [
26777	//     "name"
26778	//   ],
26779	//   "parameters": {
26780	//     "filter": {
26781	//       "description": "The standard list filter.",
26782	//       "location": "query",
26783	//       "type": "string"
26784	//     },
26785	//     "name": {
26786	//       "description": "The name of the operation's parent resource.",
26787	//       "location": "path",
26788	//       "pattern": "^projects/[^/]+/locations/[^/]+$",
26789	//       "required": true,
26790	//       "type": "string"
26791	//     },
26792	//     "pageSize": {
26793	//       "description": "The standard list page size.",
26794	//       "format": "int32",
26795	//       "location": "query",
26796	//       "type": "integer"
26797	//     },
26798	//     "pageToken": {
26799	//       "description": "The standard list page token.",
26800	//       "location": "query",
26801	//       "type": "string"
26802	//     }
26803	//   },
26804	//   "path": "v2/{+name}/operations",
26805	//   "response": {
26806	//     "$ref": "ListOperationsResponse"
26807	//   },
26808	//   "scopes": [
26809	//     "https://www.googleapis.com/auth/cloud-platform",
26810	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
26811	//     "https://www.googleapis.com/auth/logging.admin",
26812	//     "https://www.googleapis.com/auth/logging.read"
26813	//   ]
26814	// }
26815
26816}
26817
26818// Pages invokes f for each page of results.
26819// A non-nil error returned from f will halt the iteration.
26820// The provided context supersedes any context provided to the Context method.
26821func (c *ProjectsLocationsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
26822	c.ctx_ = ctx
26823	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
26824	for {
26825		x, err := c.Do()
26826		if err != nil {
26827			return err
26828		}
26829		if err := f(x); err != nil {
26830			return err
26831		}
26832		if x.NextPageToken == "" {
26833			return nil
26834		}
26835		c.PageToken(x.NextPageToken)
26836	}
26837}
26838
26839// method id "logging.projects.logs.delete":
26840
26841type ProjectsLogsDeleteCall struct {
26842	s          *Service
26843	logName    string
26844	urlParams_ gensupport.URLParams
26845	ctx_       context.Context
26846	header_    http.Header
26847}
26848
26849// Delete: Deletes all the log entries in a log for the _Default Log
26850// Bucket. The log reappears if it receives new entries. Log entries
26851// written shortly before the delete operation might not be deleted.
26852// Entries received after the delete operation with a timestamp before
26853// the operation will be deleted.
26854//
26855// - logName: The resource name of the log to delete:
26856//   projects/[PROJECT_ID]/logs/[LOG_ID]
26857//   organizations/[ORGANIZATION_ID]/logs/[LOG_ID]
26858//   billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]
26859//   folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For
26860//   example, "projects/my-project-id/logs/syslog",
26861//   "organizations/123/logs/cloudaudit.googleapis.com%2Factivity".For
26862//   more information about log names, see LogEntry.
26863func (r *ProjectsLogsService) Delete(logName string) *ProjectsLogsDeleteCall {
26864	c := &ProjectsLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
26865	c.logName = logName
26866	return c
26867}
26868
26869// Fields allows partial responses to be retrieved. See
26870// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
26871// for more information.
26872func (c *ProjectsLogsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLogsDeleteCall {
26873	c.urlParams_.Set("fields", googleapi.CombineFields(s))
26874	return c
26875}
26876
26877// Context sets the context to be used in this call's Do method. Any
26878// pending HTTP request will be aborted if the provided context is
26879// canceled.
26880func (c *ProjectsLogsDeleteCall) Context(ctx context.Context) *ProjectsLogsDeleteCall {
26881	c.ctx_ = ctx
26882	return c
26883}
26884
26885// Header returns an http.Header that can be modified by the caller to
26886// add HTTP headers to the request.
26887func (c *ProjectsLogsDeleteCall) Header() http.Header {
26888	if c.header_ == nil {
26889		c.header_ = make(http.Header)
26890	}
26891	return c.header_
26892}
26893
26894func (c *ProjectsLogsDeleteCall) doRequest(alt string) (*http.Response, error) {
26895	reqHeaders := make(http.Header)
26896	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
26897	for k, v := range c.header_ {
26898		reqHeaders[k] = v
26899	}
26900	reqHeaders.Set("User-Agent", c.s.userAgent())
26901	var body io.Reader = nil
26902	c.urlParams_.Set("alt", alt)
26903	c.urlParams_.Set("prettyPrint", "false")
26904	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+logName}")
26905	urls += "?" + c.urlParams_.Encode()
26906	req, err := http.NewRequest("DELETE", urls, body)
26907	if err != nil {
26908		return nil, err
26909	}
26910	req.Header = reqHeaders
26911	googleapi.Expand(req.URL, map[string]string{
26912		"logName": c.logName,
26913	})
26914	return gensupport.SendRequest(c.ctx_, c.s.client, req)
26915}
26916
26917// Do executes the "logging.projects.logs.delete" call.
26918// Exactly one of *Empty or error will be non-nil. Any non-2xx status
26919// code is an error. Response headers are in either
26920// *Empty.ServerResponse.Header or (if a response was returned at all)
26921// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
26922// check whether the returned error was because http.StatusNotModified
26923// was returned.
26924func (c *ProjectsLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
26925	gensupport.SetOptions(c.urlParams_, opts...)
26926	res, err := c.doRequest("json")
26927	if res != nil && res.StatusCode == http.StatusNotModified {
26928		if res.Body != nil {
26929			res.Body.Close()
26930		}
26931		return nil, &googleapi.Error{
26932			Code:   res.StatusCode,
26933			Header: res.Header,
26934		}
26935	}
26936	if err != nil {
26937		return nil, err
26938	}
26939	defer googleapi.CloseBody(res)
26940	if err := googleapi.CheckResponse(res); err != nil {
26941		return nil, err
26942	}
26943	ret := &Empty{
26944		ServerResponse: googleapi.ServerResponse{
26945			Header:         res.Header,
26946			HTTPStatusCode: res.StatusCode,
26947		},
26948	}
26949	target := &ret
26950	if err := gensupport.DecodeResponse(target, res); err != nil {
26951		return nil, err
26952	}
26953	return ret, nil
26954	// {
26955	//   "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.",
26956	//   "flatPath": "v2/projects/{projectsId}/logs/{logsId}",
26957	//   "httpMethod": "DELETE",
26958	//   "id": "logging.projects.logs.delete",
26959	//   "parameterOrder": [
26960	//     "logName"
26961	//   ],
26962	//   "parameters": {
26963	//     "logName": {
26964	//       "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.",
26965	//       "location": "path",
26966	//       "pattern": "^projects/[^/]+/logs/[^/]+$",
26967	//       "required": true,
26968	//       "type": "string"
26969	//     }
26970	//   },
26971	//   "path": "v2/{+logName}",
26972	//   "response": {
26973	//     "$ref": "Empty"
26974	//   },
26975	//   "scopes": [
26976	//     "https://www.googleapis.com/auth/cloud-platform",
26977	//     "https://www.googleapis.com/auth/logging.admin"
26978	//   ]
26979	// }
26980
26981}
26982
26983// method id "logging.projects.logs.list":
26984
26985type ProjectsLogsListCall struct {
26986	s            *Service
26987	parent       string
26988	urlParams_   gensupport.URLParams
26989	ifNoneMatch_ string
26990	ctx_         context.Context
26991	header_      http.Header
26992}
26993
26994// List: Lists the logs in projects, organizations, folders, or billing
26995// accounts. Only logs that have entries are listed.
26996//
26997// - parent: The resource name that owns the logs: projects/[PROJECT_ID]
26998//   organizations/[ORGANIZATION_ID]
26999//   billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID].
27000func (r *ProjectsLogsService) List(parent string) *ProjectsLogsListCall {
27001	c := &ProjectsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
27002	c.parent = parent
27003	return c
27004}
27005
27006// PageSize sets the optional parameter "pageSize": The maximum number
27007// of results to return from this request. Non-positive values are
27008// ignored. The presence of nextPageToken in the response indicates that
27009// more results might be available.
27010func (c *ProjectsLogsListCall) PageSize(pageSize int64) *ProjectsLogsListCall {
27011	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
27012	return c
27013}
27014
27015// PageToken sets the optional parameter "pageToken": If present, then
27016// retrieve the next batch of results from the preceding call to this
27017// method. pageToken must be the value of nextPageToken from the
27018// previous response. The values of other method parameters should be
27019// identical to those in the previous call.
27020func (c *ProjectsLogsListCall) PageToken(pageToken string) *ProjectsLogsListCall {
27021	c.urlParams_.Set("pageToken", pageToken)
27022	return c
27023}
27024
27025// ResourceNames sets the optional parameter "resourceNames": The
27026// resource name that owns the logs:
27027// projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/view
27028// s/[VIEW_ID]
27029// organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKE
27030// T_ID]/views/[VIEW_ID]
27031// billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[
27032// BUCKET_ID]/views/[VIEW_ID]
27033// folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/
27034// [VIEW_ID]To support legacy queries, it could also be:
27035// projects/[PROJECT_ID] organizations/[ORGANIZATION_ID]
27036// billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]
27037func (c *ProjectsLogsListCall) ResourceNames(resourceNames ...string) *ProjectsLogsListCall {
27038	c.urlParams_.SetMulti("resourceNames", append([]string{}, resourceNames...))
27039	return c
27040}
27041
27042// Fields allows partial responses to be retrieved. See
27043// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
27044// for more information.
27045func (c *ProjectsLogsListCall) Fields(s ...googleapi.Field) *ProjectsLogsListCall {
27046	c.urlParams_.Set("fields", googleapi.CombineFields(s))
27047	return c
27048}
27049
27050// IfNoneMatch sets the optional parameter which makes the operation
27051// fail if the object's ETag matches the given value. This is useful for
27052// getting updates only after the object has changed since the last
27053// request. Use googleapi.IsNotModified to check whether the response
27054// error from Do is the result of In-None-Match.
27055func (c *ProjectsLogsListCall) IfNoneMatch(entityTag string) *ProjectsLogsListCall {
27056	c.ifNoneMatch_ = entityTag
27057	return c
27058}
27059
27060// Context sets the context to be used in this call's Do method. Any
27061// pending HTTP request will be aborted if the provided context is
27062// canceled.
27063func (c *ProjectsLogsListCall) Context(ctx context.Context) *ProjectsLogsListCall {
27064	c.ctx_ = ctx
27065	return c
27066}
27067
27068// Header returns an http.Header that can be modified by the caller to
27069// add HTTP headers to the request.
27070func (c *ProjectsLogsListCall) Header() http.Header {
27071	if c.header_ == nil {
27072		c.header_ = make(http.Header)
27073	}
27074	return c.header_
27075}
27076
27077func (c *ProjectsLogsListCall) doRequest(alt string) (*http.Response, error) {
27078	reqHeaders := make(http.Header)
27079	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
27080	for k, v := range c.header_ {
27081		reqHeaders[k] = v
27082	}
27083	reqHeaders.Set("User-Agent", c.s.userAgent())
27084	if c.ifNoneMatch_ != "" {
27085		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
27086	}
27087	var body io.Reader = nil
27088	c.urlParams_.Set("alt", alt)
27089	c.urlParams_.Set("prettyPrint", "false")
27090	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/logs")
27091	urls += "?" + c.urlParams_.Encode()
27092	req, err := http.NewRequest("GET", urls, body)
27093	if err != nil {
27094		return nil, err
27095	}
27096	req.Header = reqHeaders
27097	googleapi.Expand(req.URL, map[string]string{
27098		"parent": c.parent,
27099	})
27100	return gensupport.SendRequest(c.ctx_, c.s.client, req)
27101}
27102
27103// Do executes the "logging.projects.logs.list" call.
27104// Exactly one of *ListLogsResponse or error will be non-nil. Any
27105// non-2xx status code is an error. Response headers are in either
27106// *ListLogsResponse.ServerResponse.Header or (if a response was
27107// returned at all) in error.(*googleapi.Error).Header. Use
27108// googleapi.IsNotModified to check whether the returned error was
27109// because http.StatusNotModified was returned.
27110func (c *ProjectsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) {
27111	gensupport.SetOptions(c.urlParams_, opts...)
27112	res, err := c.doRequest("json")
27113	if res != nil && res.StatusCode == http.StatusNotModified {
27114		if res.Body != nil {
27115			res.Body.Close()
27116		}
27117		return nil, &googleapi.Error{
27118			Code:   res.StatusCode,
27119			Header: res.Header,
27120		}
27121	}
27122	if err != nil {
27123		return nil, err
27124	}
27125	defer googleapi.CloseBody(res)
27126	if err := googleapi.CheckResponse(res); err != nil {
27127		return nil, err
27128	}
27129	ret := &ListLogsResponse{
27130		ServerResponse: googleapi.ServerResponse{
27131			Header:         res.Header,
27132			HTTPStatusCode: res.StatusCode,
27133		},
27134	}
27135	target := &ret
27136	if err := gensupport.DecodeResponse(target, res); err != nil {
27137		return nil, err
27138	}
27139	return ret, nil
27140	// {
27141	//   "description": "Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed.",
27142	//   "flatPath": "v2/projects/{projectsId}/logs",
27143	//   "httpMethod": "GET",
27144	//   "id": "logging.projects.logs.list",
27145	//   "parameterOrder": [
27146	//     "parent"
27147	//   ],
27148	//   "parameters": {
27149	//     "pageSize": {
27150	//       "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.",
27151	//       "format": "int32",
27152	//       "location": "query",
27153	//       "type": "integer"
27154	//     },
27155	//     "pageToken": {
27156	//       "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.",
27157	//       "location": "query",
27158	//       "type": "string"
27159	//     },
27160	//     "parent": {
27161	//       "description": "Required. The resource name that owns the logs: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]",
27162	//       "location": "path",
27163	//       "pattern": "^projects/[^/]+$",
27164	//       "required": true,
27165	//       "type": "string"
27166	//     },
27167	//     "resourceNames": {
27168	//       "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]",
27169	//       "location": "query",
27170	//       "repeated": true,
27171	//       "type": "string"
27172	//     }
27173	//   },
27174	//   "path": "v2/{+parent}/logs",
27175	//   "response": {
27176	//     "$ref": "ListLogsResponse"
27177	//   },
27178	//   "scopes": [
27179	//     "https://www.googleapis.com/auth/cloud-platform",
27180	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
27181	//     "https://www.googleapis.com/auth/logging.admin",
27182	//     "https://www.googleapis.com/auth/logging.read"
27183	//   ]
27184	// }
27185
27186}
27187
27188// Pages invokes f for each page of results.
27189// A non-nil error returned from f will halt the iteration.
27190// The provided context supersedes any context provided to the Context method.
27191func (c *ProjectsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error {
27192	c.ctx_ = ctx
27193	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
27194	for {
27195		x, err := c.Do()
27196		if err != nil {
27197			return err
27198		}
27199		if err := f(x); err != nil {
27200			return err
27201		}
27202		if x.NextPageToken == "" {
27203			return nil
27204		}
27205		c.PageToken(x.NextPageToken)
27206	}
27207}
27208
27209// method id "logging.projects.metrics.create":
27210
27211type ProjectsMetricsCreateCall struct {
27212	s          *Service
27213	parent     string
27214	logmetric  *LogMetric
27215	urlParams_ gensupport.URLParams
27216	ctx_       context.Context
27217	header_    http.Header
27218}
27219
27220// Create: Creates a logs-based metric.
27221//
27222// - parent: The resource name of the project in which to create the
27223//   metric: "projects/[PROJECT_ID]" The new metric must be provided in
27224//   the request.
27225func (r *ProjectsMetricsService) Create(parent string, logmetric *LogMetric) *ProjectsMetricsCreateCall {
27226	c := &ProjectsMetricsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
27227	c.parent = parent
27228	c.logmetric = logmetric
27229	return c
27230}
27231
27232// Fields allows partial responses to be retrieved. See
27233// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
27234// for more information.
27235func (c *ProjectsMetricsCreateCall) Fields(s ...googleapi.Field) *ProjectsMetricsCreateCall {
27236	c.urlParams_.Set("fields", googleapi.CombineFields(s))
27237	return c
27238}
27239
27240// Context sets the context to be used in this call's Do method. Any
27241// pending HTTP request will be aborted if the provided context is
27242// canceled.
27243func (c *ProjectsMetricsCreateCall) Context(ctx context.Context) *ProjectsMetricsCreateCall {
27244	c.ctx_ = ctx
27245	return c
27246}
27247
27248// Header returns an http.Header that can be modified by the caller to
27249// add HTTP headers to the request.
27250func (c *ProjectsMetricsCreateCall) Header() http.Header {
27251	if c.header_ == nil {
27252		c.header_ = make(http.Header)
27253	}
27254	return c.header_
27255}
27256
27257func (c *ProjectsMetricsCreateCall) doRequest(alt string) (*http.Response, error) {
27258	reqHeaders := make(http.Header)
27259	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
27260	for k, v := range c.header_ {
27261		reqHeaders[k] = v
27262	}
27263	reqHeaders.Set("User-Agent", c.s.userAgent())
27264	var body io.Reader = nil
27265	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logmetric)
27266	if err != nil {
27267		return nil, err
27268	}
27269	reqHeaders.Set("Content-Type", "application/json")
27270	c.urlParams_.Set("alt", alt)
27271	c.urlParams_.Set("prettyPrint", "false")
27272	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/metrics")
27273	urls += "?" + c.urlParams_.Encode()
27274	req, err := http.NewRequest("POST", urls, body)
27275	if err != nil {
27276		return nil, err
27277	}
27278	req.Header = reqHeaders
27279	googleapi.Expand(req.URL, map[string]string{
27280		"parent": c.parent,
27281	})
27282	return gensupport.SendRequest(c.ctx_, c.s.client, req)
27283}
27284
27285// Do executes the "logging.projects.metrics.create" call.
27286// Exactly one of *LogMetric or error will be non-nil. Any non-2xx
27287// status code is an error. Response headers are in either
27288// *LogMetric.ServerResponse.Header or (if a response was returned at
27289// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
27290// to check whether the returned error was because
27291// http.StatusNotModified was returned.
27292func (c *ProjectsMetricsCreateCall) Do(opts ...googleapi.CallOption) (*LogMetric, error) {
27293	gensupport.SetOptions(c.urlParams_, opts...)
27294	res, err := c.doRequest("json")
27295	if res != nil && res.StatusCode == http.StatusNotModified {
27296		if res.Body != nil {
27297			res.Body.Close()
27298		}
27299		return nil, &googleapi.Error{
27300			Code:   res.StatusCode,
27301			Header: res.Header,
27302		}
27303	}
27304	if err != nil {
27305		return nil, err
27306	}
27307	defer googleapi.CloseBody(res)
27308	if err := googleapi.CheckResponse(res); err != nil {
27309		return nil, err
27310	}
27311	ret := &LogMetric{
27312		ServerResponse: googleapi.ServerResponse{
27313			Header:         res.Header,
27314			HTTPStatusCode: res.StatusCode,
27315		},
27316	}
27317	target := &ret
27318	if err := gensupport.DecodeResponse(target, res); err != nil {
27319		return nil, err
27320	}
27321	return ret, nil
27322	// {
27323	//   "description": "Creates a logs-based metric.",
27324	//   "flatPath": "v2/projects/{projectsId}/metrics",
27325	//   "httpMethod": "POST",
27326	//   "id": "logging.projects.metrics.create",
27327	//   "parameterOrder": [
27328	//     "parent"
27329	//   ],
27330	//   "parameters": {
27331	//     "parent": {
27332	//       "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.",
27333	//       "location": "path",
27334	//       "pattern": "^projects/[^/]+$",
27335	//       "required": true,
27336	//       "type": "string"
27337	//     }
27338	//   },
27339	//   "path": "v2/{+parent}/metrics",
27340	//   "request": {
27341	//     "$ref": "LogMetric"
27342	//   },
27343	//   "response": {
27344	//     "$ref": "LogMetric"
27345	//   },
27346	//   "scopes": [
27347	//     "https://www.googleapis.com/auth/cloud-platform",
27348	//     "https://www.googleapis.com/auth/logging.admin",
27349	//     "https://www.googleapis.com/auth/logging.write"
27350	//   ]
27351	// }
27352
27353}
27354
27355// method id "logging.projects.metrics.delete":
27356
27357type ProjectsMetricsDeleteCall struct {
27358	s          *Service
27359	metricName string
27360	urlParams_ gensupport.URLParams
27361	ctx_       context.Context
27362	header_    http.Header
27363}
27364
27365// Delete: Deletes a logs-based metric.
27366//
27367// - metricName: The resource name of the metric to delete:
27368//   "projects/[PROJECT_ID]/metrics/[METRIC_ID]".
27369func (r *ProjectsMetricsService) Delete(metricName string) *ProjectsMetricsDeleteCall {
27370	c := &ProjectsMetricsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
27371	c.metricName = metricName
27372	return c
27373}
27374
27375// Fields allows partial responses to be retrieved. See
27376// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
27377// for more information.
27378func (c *ProjectsMetricsDeleteCall) Fields(s ...googleapi.Field) *ProjectsMetricsDeleteCall {
27379	c.urlParams_.Set("fields", googleapi.CombineFields(s))
27380	return c
27381}
27382
27383// Context sets the context to be used in this call's Do method. Any
27384// pending HTTP request will be aborted if the provided context is
27385// canceled.
27386func (c *ProjectsMetricsDeleteCall) Context(ctx context.Context) *ProjectsMetricsDeleteCall {
27387	c.ctx_ = ctx
27388	return c
27389}
27390
27391// Header returns an http.Header that can be modified by the caller to
27392// add HTTP headers to the request.
27393func (c *ProjectsMetricsDeleteCall) Header() http.Header {
27394	if c.header_ == nil {
27395		c.header_ = make(http.Header)
27396	}
27397	return c.header_
27398}
27399
27400func (c *ProjectsMetricsDeleteCall) doRequest(alt string) (*http.Response, error) {
27401	reqHeaders := make(http.Header)
27402	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
27403	for k, v := range c.header_ {
27404		reqHeaders[k] = v
27405	}
27406	reqHeaders.Set("User-Agent", c.s.userAgent())
27407	var body io.Reader = nil
27408	c.urlParams_.Set("alt", alt)
27409	c.urlParams_.Set("prettyPrint", "false")
27410	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+metricName}")
27411	urls += "?" + c.urlParams_.Encode()
27412	req, err := http.NewRequest("DELETE", urls, body)
27413	if err != nil {
27414		return nil, err
27415	}
27416	req.Header = reqHeaders
27417	googleapi.Expand(req.URL, map[string]string{
27418		"metricName": c.metricName,
27419	})
27420	return gensupport.SendRequest(c.ctx_, c.s.client, req)
27421}
27422
27423// Do executes the "logging.projects.metrics.delete" call.
27424// Exactly one of *Empty or error will be non-nil. Any non-2xx status
27425// code is an error. Response headers are in either
27426// *Empty.ServerResponse.Header or (if a response was returned at all)
27427// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
27428// check whether the returned error was because http.StatusNotModified
27429// was returned.
27430func (c *ProjectsMetricsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
27431	gensupport.SetOptions(c.urlParams_, opts...)
27432	res, err := c.doRequest("json")
27433	if res != nil && res.StatusCode == http.StatusNotModified {
27434		if res.Body != nil {
27435			res.Body.Close()
27436		}
27437		return nil, &googleapi.Error{
27438			Code:   res.StatusCode,
27439			Header: res.Header,
27440		}
27441	}
27442	if err != nil {
27443		return nil, err
27444	}
27445	defer googleapi.CloseBody(res)
27446	if err := googleapi.CheckResponse(res); err != nil {
27447		return nil, err
27448	}
27449	ret := &Empty{
27450		ServerResponse: googleapi.ServerResponse{
27451			Header:         res.Header,
27452			HTTPStatusCode: res.StatusCode,
27453		},
27454	}
27455	target := &ret
27456	if err := gensupport.DecodeResponse(target, res); err != nil {
27457		return nil, err
27458	}
27459	return ret, nil
27460	// {
27461	//   "description": "Deletes a logs-based metric.",
27462	//   "flatPath": "v2/projects/{projectsId}/metrics/{metricsId}",
27463	//   "httpMethod": "DELETE",
27464	//   "id": "logging.projects.metrics.delete",
27465	//   "parameterOrder": [
27466	//     "metricName"
27467	//   ],
27468	//   "parameters": {
27469	//     "metricName": {
27470	//       "description": "Required. The resource name of the metric to delete: \"projects/[PROJECT_ID]/metrics/[METRIC_ID]\" ",
27471	//       "location": "path",
27472	//       "pattern": "^projects/[^/]+/metrics/[^/]+$",
27473	//       "required": true,
27474	//       "type": "string"
27475	//     }
27476	//   },
27477	//   "path": "v2/{+metricName}",
27478	//   "response": {
27479	//     "$ref": "Empty"
27480	//   },
27481	//   "scopes": [
27482	//     "https://www.googleapis.com/auth/cloud-platform",
27483	//     "https://www.googleapis.com/auth/logging.admin",
27484	//     "https://www.googleapis.com/auth/logging.write"
27485	//   ]
27486	// }
27487
27488}
27489
27490// method id "logging.projects.metrics.get":
27491
27492type ProjectsMetricsGetCall struct {
27493	s            *Service
27494	metricName   string
27495	urlParams_   gensupport.URLParams
27496	ifNoneMatch_ string
27497	ctx_         context.Context
27498	header_      http.Header
27499}
27500
27501// Get: Gets a logs-based metric.
27502//
27503// - metricName: The resource name of the desired metric:
27504//   "projects/[PROJECT_ID]/metrics/[METRIC_ID]".
27505func (r *ProjectsMetricsService) Get(metricName string) *ProjectsMetricsGetCall {
27506	c := &ProjectsMetricsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
27507	c.metricName = metricName
27508	return c
27509}
27510
27511// Fields allows partial responses to be retrieved. See
27512// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
27513// for more information.
27514func (c *ProjectsMetricsGetCall) Fields(s ...googleapi.Field) *ProjectsMetricsGetCall {
27515	c.urlParams_.Set("fields", googleapi.CombineFields(s))
27516	return c
27517}
27518
27519// IfNoneMatch sets the optional parameter which makes the operation
27520// fail if the object's ETag matches the given value. This is useful for
27521// getting updates only after the object has changed since the last
27522// request. Use googleapi.IsNotModified to check whether the response
27523// error from Do is the result of In-None-Match.
27524func (c *ProjectsMetricsGetCall) IfNoneMatch(entityTag string) *ProjectsMetricsGetCall {
27525	c.ifNoneMatch_ = entityTag
27526	return c
27527}
27528
27529// Context sets the context to be used in this call's Do method. Any
27530// pending HTTP request will be aborted if the provided context is
27531// canceled.
27532func (c *ProjectsMetricsGetCall) Context(ctx context.Context) *ProjectsMetricsGetCall {
27533	c.ctx_ = ctx
27534	return c
27535}
27536
27537// Header returns an http.Header that can be modified by the caller to
27538// add HTTP headers to the request.
27539func (c *ProjectsMetricsGetCall) Header() http.Header {
27540	if c.header_ == nil {
27541		c.header_ = make(http.Header)
27542	}
27543	return c.header_
27544}
27545
27546func (c *ProjectsMetricsGetCall) doRequest(alt string) (*http.Response, error) {
27547	reqHeaders := make(http.Header)
27548	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
27549	for k, v := range c.header_ {
27550		reqHeaders[k] = v
27551	}
27552	reqHeaders.Set("User-Agent", c.s.userAgent())
27553	if c.ifNoneMatch_ != "" {
27554		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
27555	}
27556	var body io.Reader = nil
27557	c.urlParams_.Set("alt", alt)
27558	c.urlParams_.Set("prettyPrint", "false")
27559	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+metricName}")
27560	urls += "?" + c.urlParams_.Encode()
27561	req, err := http.NewRequest("GET", urls, body)
27562	if err != nil {
27563		return nil, err
27564	}
27565	req.Header = reqHeaders
27566	googleapi.Expand(req.URL, map[string]string{
27567		"metricName": c.metricName,
27568	})
27569	return gensupport.SendRequest(c.ctx_, c.s.client, req)
27570}
27571
27572// Do executes the "logging.projects.metrics.get" call.
27573// Exactly one of *LogMetric or error will be non-nil. Any non-2xx
27574// status code is an error. Response headers are in either
27575// *LogMetric.ServerResponse.Header or (if a response was returned at
27576// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
27577// to check whether the returned error was because
27578// http.StatusNotModified was returned.
27579func (c *ProjectsMetricsGetCall) Do(opts ...googleapi.CallOption) (*LogMetric, error) {
27580	gensupport.SetOptions(c.urlParams_, opts...)
27581	res, err := c.doRequest("json")
27582	if res != nil && res.StatusCode == http.StatusNotModified {
27583		if res.Body != nil {
27584			res.Body.Close()
27585		}
27586		return nil, &googleapi.Error{
27587			Code:   res.StatusCode,
27588			Header: res.Header,
27589		}
27590	}
27591	if err != nil {
27592		return nil, err
27593	}
27594	defer googleapi.CloseBody(res)
27595	if err := googleapi.CheckResponse(res); err != nil {
27596		return nil, err
27597	}
27598	ret := &LogMetric{
27599		ServerResponse: googleapi.ServerResponse{
27600			Header:         res.Header,
27601			HTTPStatusCode: res.StatusCode,
27602		},
27603	}
27604	target := &ret
27605	if err := gensupport.DecodeResponse(target, res); err != nil {
27606		return nil, err
27607	}
27608	return ret, nil
27609	// {
27610	//   "description": "Gets a logs-based metric.",
27611	//   "flatPath": "v2/projects/{projectsId}/metrics/{metricsId}",
27612	//   "httpMethod": "GET",
27613	//   "id": "logging.projects.metrics.get",
27614	//   "parameterOrder": [
27615	//     "metricName"
27616	//   ],
27617	//   "parameters": {
27618	//     "metricName": {
27619	//       "description": "Required. The resource name of the desired metric: \"projects/[PROJECT_ID]/metrics/[METRIC_ID]\" ",
27620	//       "location": "path",
27621	//       "pattern": "^projects/[^/]+/metrics/[^/]+$",
27622	//       "required": true,
27623	//       "type": "string"
27624	//     }
27625	//   },
27626	//   "path": "v2/{+metricName}",
27627	//   "response": {
27628	//     "$ref": "LogMetric"
27629	//   },
27630	//   "scopes": [
27631	//     "https://www.googleapis.com/auth/cloud-platform",
27632	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
27633	//     "https://www.googleapis.com/auth/logging.admin",
27634	//     "https://www.googleapis.com/auth/logging.read"
27635	//   ]
27636	// }
27637
27638}
27639
27640// method id "logging.projects.metrics.list":
27641
27642type ProjectsMetricsListCall struct {
27643	s            *Service
27644	parent       string
27645	urlParams_   gensupport.URLParams
27646	ifNoneMatch_ string
27647	ctx_         context.Context
27648	header_      http.Header
27649}
27650
27651// List: Lists logs-based metrics.
27652//
27653// - parent: The name of the project containing the metrics:
27654//   "projects/[PROJECT_ID]".
27655func (r *ProjectsMetricsService) List(parent string) *ProjectsMetricsListCall {
27656	c := &ProjectsMetricsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
27657	c.parent = parent
27658	return c
27659}
27660
27661// PageSize sets the optional parameter "pageSize": The maximum number
27662// of results to return from this request. Non-positive values are
27663// ignored. The presence of nextPageToken in the response indicates that
27664// more results might be available.
27665func (c *ProjectsMetricsListCall) PageSize(pageSize int64) *ProjectsMetricsListCall {
27666	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
27667	return c
27668}
27669
27670// PageToken sets the optional parameter "pageToken": If present, then
27671// retrieve the next batch of results from the preceding call to this
27672// method. pageToken must be the value of nextPageToken from the
27673// previous response. The values of other method parameters should be
27674// identical to those in the previous call.
27675func (c *ProjectsMetricsListCall) PageToken(pageToken string) *ProjectsMetricsListCall {
27676	c.urlParams_.Set("pageToken", pageToken)
27677	return c
27678}
27679
27680// Fields allows partial responses to be retrieved. See
27681// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
27682// for more information.
27683func (c *ProjectsMetricsListCall) Fields(s ...googleapi.Field) *ProjectsMetricsListCall {
27684	c.urlParams_.Set("fields", googleapi.CombineFields(s))
27685	return c
27686}
27687
27688// IfNoneMatch sets the optional parameter which makes the operation
27689// fail if the object's ETag matches the given value. This is useful for
27690// getting updates only after the object has changed since the last
27691// request. Use googleapi.IsNotModified to check whether the response
27692// error from Do is the result of In-None-Match.
27693func (c *ProjectsMetricsListCall) IfNoneMatch(entityTag string) *ProjectsMetricsListCall {
27694	c.ifNoneMatch_ = entityTag
27695	return c
27696}
27697
27698// Context sets the context to be used in this call's Do method. Any
27699// pending HTTP request will be aborted if the provided context is
27700// canceled.
27701func (c *ProjectsMetricsListCall) Context(ctx context.Context) *ProjectsMetricsListCall {
27702	c.ctx_ = ctx
27703	return c
27704}
27705
27706// Header returns an http.Header that can be modified by the caller to
27707// add HTTP headers to the request.
27708func (c *ProjectsMetricsListCall) Header() http.Header {
27709	if c.header_ == nil {
27710		c.header_ = make(http.Header)
27711	}
27712	return c.header_
27713}
27714
27715func (c *ProjectsMetricsListCall) doRequest(alt string) (*http.Response, error) {
27716	reqHeaders := make(http.Header)
27717	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
27718	for k, v := range c.header_ {
27719		reqHeaders[k] = v
27720	}
27721	reqHeaders.Set("User-Agent", c.s.userAgent())
27722	if c.ifNoneMatch_ != "" {
27723		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
27724	}
27725	var body io.Reader = nil
27726	c.urlParams_.Set("alt", alt)
27727	c.urlParams_.Set("prettyPrint", "false")
27728	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/metrics")
27729	urls += "?" + c.urlParams_.Encode()
27730	req, err := http.NewRequest("GET", urls, body)
27731	if err != nil {
27732		return nil, err
27733	}
27734	req.Header = reqHeaders
27735	googleapi.Expand(req.URL, map[string]string{
27736		"parent": c.parent,
27737	})
27738	return gensupport.SendRequest(c.ctx_, c.s.client, req)
27739}
27740
27741// Do executes the "logging.projects.metrics.list" call.
27742// Exactly one of *ListLogMetricsResponse or error will be non-nil. Any
27743// non-2xx status code is an error. Response headers are in either
27744// *ListLogMetricsResponse.ServerResponse.Header or (if a response was
27745// returned at all) in error.(*googleapi.Error).Header. Use
27746// googleapi.IsNotModified to check whether the returned error was
27747// because http.StatusNotModified was returned.
27748func (c *ProjectsMetricsListCall) Do(opts ...googleapi.CallOption) (*ListLogMetricsResponse, error) {
27749	gensupport.SetOptions(c.urlParams_, opts...)
27750	res, err := c.doRequest("json")
27751	if res != nil && res.StatusCode == http.StatusNotModified {
27752		if res.Body != nil {
27753			res.Body.Close()
27754		}
27755		return nil, &googleapi.Error{
27756			Code:   res.StatusCode,
27757			Header: res.Header,
27758		}
27759	}
27760	if err != nil {
27761		return nil, err
27762	}
27763	defer googleapi.CloseBody(res)
27764	if err := googleapi.CheckResponse(res); err != nil {
27765		return nil, err
27766	}
27767	ret := &ListLogMetricsResponse{
27768		ServerResponse: googleapi.ServerResponse{
27769			Header:         res.Header,
27770			HTTPStatusCode: res.StatusCode,
27771		},
27772	}
27773	target := &ret
27774	if err := gensupport.DecodeResponse(target, res); err != nil {
27775		return nil, err
27776	}
27777	return ret, nil
27778	// {
27779	//   "description": "Lists logs-based metrics.",
27780	//   "flatPath": "v2/projects/{projectsId}/metrics",
27781	//   "httpMethod": "GET",
27782	//   "id": "logging.projects.metrics.list",
27783	//   "parameterOrder": [
27784	//     "parent"
27785	//   ],
27786	//   "parameters": {
27787	//     "pageSize": {
27788	//       "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.",
27789	//       "format": "int32",
27790	//       "location": "query",
27791	//       "type": "integer"
27792	//     },
27793	//     "pageToken": {
27794	//       "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.",
27795	//       "location": "query",
27796	//       "type": "string"
27797	//     },
27798	//     "parent": {
27799	//       "description": "Required. The name of the project containing the metrics: \"projects/[PROJECT_ID]\" ",
27800	//       "location": "path",
27801	//       "pattern": "^projects/[^/]+$",
27802	//       "required": true,
27803	//       "type": "string"
27804	//     }
27805	//   },
27806	//   "path": "v2/{+parent}/metrics",
27807	//   "response": {
27808	//     "$ref": "ListLogMetricsResponse"
27809	//   },
27810	//   "scopes": [
27811	//     "https://www.googleapis.com/auth/cloud-platform",
27812	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
27813	//     "https://www.googleapis.com/auth/logging.admin",
27814	//     "https://www.googleapis.com/auth/logging.read"
27815	//   ]
27816	// }
27817
27818}
27819
27820// Pages invokes f for each page of results.
27821// A non-nil error returned from f will halt the iteration.
27822// The provided context supersedes any context provided to the Context method.
27823func (c *ProjectsMetricsListCall) Pages(ctx context.Context, f func(*ListLogMetricsResponse) error) error {
27824	c.ctx_ = ctx
27825	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
27826	for {
27827		x, err := c.Do()
27828		if err != nil {
27829			return err
27830		}
27831		if err := f(x); err != nil {
27832			return err
27833		}
27834		if x.NextPageToken == "" {
27835			return nil
27836		}
27837		c.PageToken(x.NextPageToken)
27838	}
27839}
27840
27841// method id "logging.projects.metrics.update":
27842
27843type ProjectsMetricsUpdateCall struct {
27844	s          *Service
27845	metricName string
27846	logmetric  *LogMetric
27847	urlParams_ gensupport.URLParams
27848	ctx_       context.Context
27849	header_    http.Header
27850}
27851
27852// Update: Creates or updates a logs-based metric.
27853//
27854// - metricName: The resource name of the metric to update:
27855//   "projects/[PROJECT_ID]/metrics/[METRIC_ID]" The updated metric must
27856//   be provided in the request and it's name field must be the same as
27857//   [METRIC_ID] If the metric does not exist in [PROJECT_ID], then a
27858//   new metric is created.
27859func (r *ProjectsMetricsService) Update(metricName string, logmetric *LogMetric) *ProjectsMetricsUpdateCall {
27860	c := &ProjectsMetricsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
27861	c.metricName = metricName
27862	c.logmetric = logmetric
27863	return c
27864}
27865
27866// Fields allows partial responses to be retrieved. See
27867// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
27868// for more information.
27869func (c *ProjectsMetricsUpdateCall) Fields(s ...googleapi.Field) *ProjectsMetricsUpdateCall {
27870	c.urlParams_.Set("fields", googleapi.CombineFields(s))
27871	return c
27872}
27873
27874// Context sets the context to be used in this call's Do method. Any
27875// pending HTTP request will be aborted if the provided context is
27876// canceled.
27877func (c *ProjectsMetricsUpdateCall) Context(ctx context.Context) *ProjectsMetricsUpdateCall {
27878	c.ctx_ = ctx
27879	return c
27880}
27881
27882// Header returns an http.Header that can be modified by the caller to
27883// add HTTP headers to the request.
27884func (c *ProjectsMetricsUpdateCall) Header() http.Header {
27885	if c.header_ == nil {
27886		c.header_ = make(http.Header)
27887	}
27888	return c.header_
27889}
27890
27891func (c *ProjectsMetricsUpdateCall) doRequest(alt string) (*http.Response, error) {
27892	reqHeaders := make(http.Header)
27893	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
27894	for k, v := range c.header_ {
27895		reqHeaders[k] = v
27896	}
27897	reqHeaders.Set("User-Agent", c.s.userAgent())
27898	var body io.Reader = nil
27899	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logmetric)
27900	if err != nil {
27901		return nil, err
27902	}
27903	reqHeaders.Set("Content-Type", "application/json")
27904	c.urlParams_.Set("alt", alt)
27905	c.urlParams_.Set("prettyPrint", "false")
27906	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+metricName}")
27907	urls += "?" + c.urlParams_.Encode()
27908	req, err := http.NewRequest("PUT", urls, body)
27909	if err != nil {
27910		return nil, err
27911	}
27912	req.Header = reqHeaders
27913	googleapi.Expand(req.URL, map[string]string{
27914		"metricName": c.metricName,
27915	})
27916	return gensupport.SendRequest(c.ctx_, c.s.client, req)
27917}
27918
27919// Do executes the "logging.projects.metrics.update" call.
27920// Exactly one of *LogMetric or error will be non-nil. Any non-2xx
27921// status code is an error. Response headers are in either
27922// *LogMetric.ServerResponse.Header or (if a response was returned at
27923// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
27924// to check whether the returned error was because
27925// http.StatusNotModified was returned.
27926func (c *ProjectsMetricsUpdateCall) Do(opts ...googleapi.CallOption) (*LogMetric, error) {
27927	gensupport.SetOptions(c.urlParams_, opts...)
27928	res, err := c.doRequest("json")
27929	if res != nil && res.StatusCode == http.StatusNotModified {
27930		if res.Body != nil {
27931			res.Body.Close()
27932		}
27933		return nil, &googleapi.Error{
27934			Code:   res.StatusCode,
27935			Header: res.Header,
27936		}
27937	}
27938	if err != nil {
27939		return nil, err
27940	}
27941	defer googleapi.CloseBody(res)
27942	if err := googleapi.CheckResponse(res); err != nil {
27943		return nil, err
27944	}
27945	ret := &LogMetric{
27946		ServerResponse: googleapi.ServerResponse{
27947			Header:         res.Header,
27948			HTTPStatusCode: res.StatusCode,
27949		},
27950	}
27951	target := &ret
27952	if err := gensupport.DecodeResponse(target, res); err != nil {
27953		return nil, err
27954	}
27955	return ret, nil
27956	// {
27957	//   "description": "Creates or updates a logs-based metric.",
27958	//   "flatPath": "v2/projects/{projectsId}/metrics/{metricsId}",
27959	//   "httpMethod": "PUT",
27960	//   "id": "logging.projects.metrics.update",
27961	//   "parameterOrder": [
27962	//     "metricName"
27963	//   ],
27964	//   "parameters": {
27965	//     "metricName": {
27966	//       "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.",
27967	//       "location": "path",
27968	//       "pattern": "^projects/[^/]+/metrics/[^/]+$",
27969	//       "required": true,
27970	//       "type": "string"
27971	//     }
27972	//   },
27973	//   "path": "v2/{+metricName}",
27974	//   "request": {
27975	//     "$ref": "LogMetric"
27976	//   },
27977	//   "response": {
27978	//     "$ref": "LogMetric"
27979	//   },
27980	//   "scopes": [
27981	//     "https://www.googleapis.com/auth/cloud-platform",
27982	//     "https://www.googleapis.com/auth/logging.admin",
27983	//     "https://www.googleapis.com/auth/logging.write"
27984	//   ]
27985	// }
27986
27987}
27988
27989// method id "logging.projects.sinks.create":
27990
27991type ProjectsSinksCreateCall struct {
27992	s          *Service
27993	parent     string
27994	logsink    *LogSink
27995	urlParams_ gensupport.URLParams
27996	ctx_       context.Context
27997	header_    http.Header
27998}
27999
28000// Create: Creates a sink that exports specified log entries to a
28001// destination. The export of newly-ingested log entries begins
28002// immediately, unless the sink's writer_identity is not permitted to
28003// write to the destination. A sink can export log entries only from the
28004// resource owning the sink.
28005//
28006// - parent: The resource in which to create the sink:
28007//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
28008//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For
28009//   examples:"projects/my-project" "organizations/123456789".
28010func (r *ProjectsSinksService) Create(parent string, logsink *LogSink) *ProjectsSinksCreateCall {
28011	c := &ProjectsSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
28012	c.parent = parent
28013	c.logsink = logsink
28014	return c
28015}
28016
28017// UniqueWriterIdentity sets the optional parameter
28018// "uniqueWriterIdentity": Determines the kind of IAM identity returned
28019// as writer_identity in the new sink. If this value is omitted or set
28020// to false, and if the sink's parent is a project, then the value
28021// returned as writer_identity is the same group or service account used
28022// by Cloud Logging before the addition of writer identities to this
28023// API. The sink's destination must be in the same project as the sink
28024// itself.If this field is set to true, or if the sink is owned by a
28025// non-project resource such as an organization, then the value of
28026// writer_identity will be a unique service account used only for
28027// exports from the new sink. For more information, see writer_identity
28028// in LogSink.
28029func (c *ProjectsSinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *ProjectsSinksCreateCall {
28030	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
28031	return c
28032}
28033
28034// Fields allows partial responses to be retrieved. See
28035// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
28036// for more information.
28037func (c *ProjectsSinksCreateCall) Fields(s ...googleapi.Field) *ProjectsSinksCreateCall {
28038	c.urlParams_.Set("fields", googleapi.CombineFields(s))
28039	return c
28040}
28041
28042// Context sets the context to be used in this call's Do method. Any
28043// pending HTTP request will be aborted if the provided context is
28044// canceled.
28045func (c *ProjectsSinksCreateCall) Context(ctx context.Context) *ProjectsSinksCreateCall {
28046	c.ctx_ = ctx
28047	return c
28048}
28049
28050// Header returns an http.Header that can be modified by the caller to
28051// add HTTP headers to the request.
28052func (c *ProjectsSinksCreateCall) Header() http.Header {
28053	if c.header_ == nil {
28054		c.header_ = make(http.Header)
28055	}
28056	return c.header_
28057}
28058
28059func (c *ProjectsSinksCreateCall) doRequest(alt string) (*http.Response, error) {
28060	reqHeaders := make(http.Header)
28061	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
28062	for k, v := range c.header_ {
28063		reqHeaders[k] = v
28064	}
28065	reqHeaders.Set("User-Agent", c.s.userAgent())
28066	var body io.Reader = nil
28067	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
28068	if err != nil {
28069		return nil, err
28070	}
28071	reqHeaders.Set("Content-Type", "application/json")
28072	c.urlParams_.Set("alt", alt)
28073	c.urlParams_.Set("prettyPrint", "false")
28074	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
28075	urls += "?" + c.urlParams_.Encode()
28076	req, err := http.NewRequest("POST", urls, body)
28077	if err != nil {
28078		return nil, err
28079	}
28080	req.Header = reqHeaders
28081	googleapi.Expand(req.URL, map[string]string{
28082		"parent": c.parent,
28083	})
28084	return gensupport.SendRequest(c.ctx_, c.s.client, req)
28085}
28086
28087// Do executes the "logging.projects.sinks.create" call.
28088// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
28089// code is an error. Response headers are in either
28090// *LogSink.ServerResponse.Header or (if a response was returned at all)
28091// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
28092// check whether the returned error was because http.StatusNotModified
28093// was returned.
28094func (c *ProjectsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
28095	gensupport.SetOptions(c.urlParams_, opts...)
28096	res, err := c.doRequest("json")
28097	if res != nil && res.StatusCode == http.StatusNotModified {
28098		if res.Body != nil {
28099			res.Body.Close()
28100		}
28101		return nil, &googleapi.Error{
28102			Code:   res.StatusCode,
28103			Header: res.Header,
28104		}
28105	}
28106	if err != nil {
28107		return nil, err
28108	}
28109	defer googleapi.CloseBody(res)
28110	if err := googleapi.CheckResponse(res); err != nil {
28111		return nil, err
28112	}
28113	ret := &LogSink{
28114		ServerResponse: googleapi.ServerResponse{
28115			Header:         res.Header,
28116			HTTPStatusCode: res.StatusCode,
28117		},
28118	}
28119	target := &ret
28120	if err := gensupport.DecodeResponse(target, res); err != nil {
28121		return nil, err
28122	}
28123	return ret, nil
28124	// {
28125	//   "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.",
28126	//   "flatPath": "v2/projects/{projectsId}/sinks",
28127	//   "httpMethod": "POST",
28128	//   "id": "logging.projects.sinks.create",
28129	//   "parameterOrder": [
28130	//     "parent"
28131	//   ],
28132	//   "parameters": {
28133	//     "parent": {
28134	//       "description": "Required. The resource in which to create the sink: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-project\" \"organizations/123456789\"",
28135	//       "location": "path",
28136	//       "pattern": "^projects/[^/]+$",
28137	//       "required": true,
28138	//       "type": "string"
28139	//     },
28140	//     "uniqueWriterIdentity": {
28141	//       "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 Cloud 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.",
28142	//       "location": "query",
28143	//       "type": "boolean"
28144	//     }
28145	//   },
28146	//   "path": "v2/{+parent}/sinks",
28147	//   "request": {
28148	//     "$ref": "LogSink"
28149	//   },
28150	//   "response": {
28151	//     "$ref": "LogSink"
28152	//   },
28153	//   "scopes": [
28154	//     "https://www.googleapis.com/auth/cloud-platform",
28155	//     "https://www.googleapis.com/auth/logging.admin"
28156	//   ]
28157	// }
28158
28159}
28160
28161// method id "logging.projects.sinks.delete":
28162
28163type ProjectsSinksDeleteCall struct {
28164	s          *Service
28165	sinkNameid string
28166	urlParams_ gensupport.URLParams
28167	ctx_       context.Context
28168	header_    http.Header
28169}
28170
28171// Delete: Deletes a sink. If the sink has a unique writer_identity,
28172// then that service account is also deleted.
28173//
28174// - sinkName: The full resource name of the sink to delete, including
28175//   the parent resource and the sink identifier:
28176//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
28177//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
28178//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
28179//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" For
28180//   example:"projects/my-project/sinks/my-sink".
28181func (r *ProjectsSinksService) Delete(sinkNameid string) *ProjectsSinksDeleteCall {
28182	c := &ProjectsSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
28183	c.sinkNameid = sinkNameid
28184	return c
28185}
28186
28187// Fields allows partial responses to be retrieved. See
28188// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
28189// for more information.
28190func (c *ProjectsSinksDeleteCall) Fields(s ...googleapi.Field) *ProjectsSinksDeleteCall {
28191	c.urlParams_.Set("fields", googleapi.CombineFields(s))
28192	return c
28193}
28194
28195// Context sets the context to be used in this call's Do method. Any
28196// pending HTTP request will be aborted if the provided context is
28197// canceled.
28198func (c *ProjectsSinksDeleteCall) Context(ctx context.Context) *ProjectsSinksDeleteCall {
28199	c.ctx_ = ctx
28200	return c
28201}
28202
28203// Header returns an http.Header that can be modified by the caller to
28204// add HTTP headers to the request.
28205func (c *ProjectsSinksDeleteCall) Header() http.Header {
28206	if c.header_ == nil {
28207		c.header_ = make(http.Header)
28208	}
28209	return c.header_
28210}
28211
28212func (c *ProjectsSinksDeleteCall) doRequest(alt string) (*http.Response, error) {
28213	reqHeaders := make(http.Header)
28214	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
28215	for k, v := range c.header_ {
28216		reqHeaders[k] = v
28217	}
28218	reqHeaders.Set("User-Agent", c.s.userAgent())
28219	var body io.Reader = nil
28220	c.urlParams_.Set("alt", alt)
28221	c.urlParams_.Set("prettyPrint", "false")
28222	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
28223	urls += "?" + c.urlParams_.Encode()
28224	req, err := http.NewRequest("DELETE", urls, body)
28225	if err != nil {
28226		return nil, err
28227	}
28228	req.Header = reqHeaders
28229	googleapi.Expand(req.URL, map[string]string{
28230		"sinkName": c.sinkNameid,
28231	})
28232	return gensupport.SendRequest(c.ctx_, c.s.client, req)
28233}
28234
28235// Do executes the "logging.projects.sinks.delete" call.
28236// Exactly one of *Empty or error will be non-nil. Any non-2xx status
28237// code is an error. Response headers are in either
28238// *Empty.ServerResponse.Header or (if a response was returned at all)
28239// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
28240// check whether the returned error was because http.StatusNotModified
28241// was returned.
28242func (c *ProjectsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
28243	gensupport.SetOptions(c.urlParams_, opts...)
28244	res, err := c.doRequest("json")
28245	if res != nil && res.StatusCode == http.StatusNotModified {
28246		if res.Body != nil {
28247			res.Body.Close()
28248		}
28249		return nil, &googleapi.Error{
28250			Code:   res.StatusCode,
28251			Header: res.Header,
28252		}
28253	}
28254	if err != nil {
28255		return nil, err
28256	}
28257	defer googleapi.CloseBody(res)
28258	if err := googleapi.CheckResponse(res); err != nil {
28259		return nil, err
28260	}
28261	ret := &Empty{
28262		ServerResponse: googleapi.ServerResponse{
28263			Header:         res.Header,
28264			HTTPStatusCode: res.StatusCode,
28265		},
28266	}
28267	target := &ret
28268	if err := gensupport.DecodeResponse(target, res); err != nil {
28269		return nil, err
28270	}
28271	return ret, nil
28272	// {
28273	//   "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.",
28274	//   "flatPath": "v2/projects/{projectsId}/sinks/{sinksId}",
28275	//   "httpMethod": "DELETE",
28276	//   "id": "logging.projects.sinks.delete",
28277	//   "parameterOrder": [
28278	//     "sinkName"
28279	//   ],
28280	//   "parameters": {
28281	//     "sinkName": {
28282	//       "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]\" For example:\"projects/my-project/sinks/my-sink\"",
28283	//       "location": "path",
28284	//       "pattern": "^projects/[^/]+/sinks/[^/]+$",
28285	//       "required": true,
28286	//       "type": "string"
28287	//     }
28288	//   },
28289	//   "path": "v2/{+sinkName}",
28290	//   "response": {
28291	//     "$ref": "Empty"
28292	//   },
28293	//   "scopes": [
28294	//     "https://www.googleapis.com/auth/cloud-platform",
28295	//     "https://www.googleapis.com/auth/logging.admin"
28296	//   ]
28297	// }
28298
28299}
28300
28301// method id "logging.projects.sinks.get":
28302
28303type ProjectsSinksGetCall struct {
28304	s            *Service
28305	sinkName     string
28306	urlParams_   gensupport.URLParams
28307	ifNoneMatch_ string
28308	ctx_         context.Context
28309	header_      http.Header
28310}
28311
28312// Get: Gets a sink.
28313//
28314// - sinkName: The resource name of the sink:
28315//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
28316//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
28317//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
28318//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" For
28319//   example:"projects/my-project/sinks/my-sink".
28320func (r *ProjectsSinksService) Get(sinkName string) *ProjectsSinksGetCall {
28321	c := &ProjectsSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
28322	c.sinkName = sinkName
28323	return c
28324}
28325
28326// Fields allows partial responses to be retrieved. See
28327// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
28328// for more information.
28329func (c *ProjectsSinksGetCall) Fields(s ...googleapi.Field) *ProjectsSinksGetCall {
28330	c.urlParams_.Set("fields", googleapi.CombineFields(s))
28331	return c
28332}
28333
28334// IfNoneMatch sets the optional parameter which makes the operation
28335// fail if the object's ETag matches the given value. This is useful for
28336// getting updates only after the object has changed since the last
28337// request. Use googleapi.IsNotModified to check whether the response
28338// error from Do is the result of In-None-Match.
28339func (c *ProjectsSinksGetCall) IfNoneMatch(entityTag string) *ProjectsSinksGetCall {
28340	c.ifNoneMatch_ = entityTag
28341	return c
28342}
28343
28344// Context sets the context to be used in this call's Do method. Any
28345// pending HTTP request will be aborted if the provided context is
28346// canceled.
28347func (c *ProjectsSinksGetCall) Context(ctx context.Context) *ProjectsSinksGetCall {
28348	c.ctx_ = ctx
28349	return c
28350}
28351
28352// Header returns an http.Header that can be modified by the caller to
28353// add HTTP headers to the request.
28354func (c *ProjectsSinksGetCall) Header() http.Header {
28355	if c.header_ == nil {
28356		c.header_ = make(http.Header)
28357	}
28358	return c.header_
28359}
28360
28361func (c *ProjectsSinksGetCall) doRequest(alt string) (*http.Response, error) {
28362	reqHeaders := make(http.Header)
28363	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
28364	for k, v := range c.header_ {
28365		reqHeaders[k] = v
28366	}
28367	reqHeaders.Set("User-Agent", c.s.userAgent())
28368	if c.ifNoneMatch_ != "" {
28369		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
28370	}
28371	var body io.Reader = nil
28372	c.urlParams_.Set("alt", alt)
28373	c.urlParams_.Set("prettyPrint", "false")
28374	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
28375	urls += "?" + c.urlParams_.Encode()
28376	req, err := http.NewRequest("GET", urls, body)
28377	if err != nil {
28378		return nil, err
28379	}
28380	req.Header = reqHeaders
28381	googleapi.Expand(req.URL, map[string]string{
28382		"sinkName": c.sinkName,
28383	})
28384	return gensupport.SendRequest(c.ctx_, c.s.client, req)
28385}
28386
28387// Do executes the "logging.projects.sinks.get" call.
28388// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
28389// code is an error. Response headers are in either
28390// *LogSink.ServerResponse.Header or (if a response was returned at all)
28391// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
28392// check whether the returned error was because http.StatusNotModified
28393// was returned.
28394func (c *ProjectsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
28395	gensupport.SetOptions(c.urlParams_, opts...)
28396	res, err := c.doRequest("json")
28397	if res != nil && res.StatusCode == http.StatusNotModified {
28398		if res.Body != nil {
28399			res.Body.Close()
28400		}
28401		return nil, &googleapi.Error{
28402			Code:   res.StatusCode,
28403			Header: res.Header,
28404		}
28405	}
28406	if err != nil {
28407		return nil, err
28408	}
28409	defer googleapi.CloseBody(res)
28410	if err := googleapi.CheckResponse(res); err != nil {
28411		return nil, err
28412	}
28413	ret := &LogSink{
28414		ServerResponse: googleapi.ServerResponse{
28415			Header:         res.Header,
28416			HTTPStatusCode: res.StatusCode,
28417		},
28418	}
28419	target := &ret
28420	if err := gensupport.DecodeResponse(target, res); err != nil {
28421		return nil, err
28422	}
28423	return ret, nil
28424	// {
28425	//   "description": "Gets a sink.",
28426	//   "flatPath": "v2/projects/{projectsId}/sinks/{sinksId}",
28427	//   "httpMethod": "GET",
28428	//   "id": "logging.projects.sinks.get",
28429	//   "parameterOrder": [
28430	//     "sinkName"
28431	//   ],
28432	//   "parameters": {
28433	//     "sinkName": {
28434	//       "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]\" For example:\"projects/my-project/sinks/my-sink\"",
28435	//       "location": "path",
28436	//       "pattern": "^projects/[^/]+/sinks/[^/]+$",
28437	//       "required": true,
28438	//       "type": "string"
28439	//     }
28440	//   },
28441	//   "path": "v2/{+sinkName}",
28442	//   "response": {
28443	//     "$ref": "LogSink"
28444	//   },
28445	//   "scopes": [
28446	//     "https://www.googleapis.com/auth/cloud-platform",
28447	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
28448	//     "https://www.googleapis.com/auth/logging.admin",
28449	//     "https://www.googleapis.com/auth/logging.read"
28450	//   ]
28451	// }
28452
28453}
28454
28455// method id "logging.projects.sinks.list":
28456
28457type ProjectsSinksListCall struct {
28458	s            *Service
28459	parent       string
28460	urlParams_   gensupport.URLParams
28461	ifNoneMatch_ string
28462	ctx_         context.Context
28463	header_      http.Header
28464}
28465
28466// List: Lists sinks.
28467//
28468// - parent: The parent resource whose sinks are to be listed:
28469//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
28470//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]".
28471func (r *ProjectsSinksService) List(parent string) *ProjectsSinksListCall {
28472	c := &ProjectsSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
28473	c.parent = parent
28474	return c
28475}
28476
28477// PageSize sets the optional parameter "pageSize": The maximum number
28478// of results to return from this request. Non-positive values are
28479// ignored. The presence of nextPageToken in the response indicates that
28480// more results might be available.
28481func (c *ProjectsSinksListCall) PageSize(pageSize int64) *ProjectsSinksListCall {
28482	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
28483	return c
28484}
28485
28486// PageToken sets the optional parameter "pageToken": If present, then
28487// retrieve the next batch of results from the preceding call to this
28488// method. pageToken must be the value of nextPageToken from the
28489// previous response. The values of other method parameters should be
28490// identical to those in the previous call.
28491func (c *ProjectsSinksListCall) PageToken(pageToken string) *ProjectsSinksListCall {
28492	c.urlParams_.Set("pageToken", pageToken)
28493	return c
28494}
28495
28496// Fields allows partial responses to be retrieved. See
28497// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
28498// for more information.
28499func (c *ProjectsSinksListCall) Fields(s ...googleapi.Field) *ProjectsSinksListCall {
28500	c.urlParams_.Set("fields", googleapi.CombineFields(s))
28501	return c
28502}
28503
28504// IfNoneMatch sets the optional parameter which makes the operation
28505// fail if the object's ETag matches the given value. This is useful for
28506// getting updates only after the object has changed since the last
28507// request. Use googleapi.IsNotModified to check whether the response
28508// error from Do is the result of In-None-Match.
28509func (c *ProjectsSinksListCall) IfNoneMatch(entityTag string) *ProjectsSinksListCall {
28510	c.ifNoneMatch_ = entityTag
28511	return c
28512}
28513
28514// Context sets the context to be used in this call's Do method. Any
28515// pending HTTP request will be aborted if the provided context is
28516// canceled.
28517func (c *ProjectsSinksListCall) Context(ctx context.Context) *ProjectsSinksListCall {
28518	c.ctx_ = ctx
28519	return c
28520}
28521
28522// Header returns an http.Header that can be modified by the caller to
28523// add HTTP headers to the request.
28524func (c *ProjectsSinksListCall) Header() http.Header {
28525	if c.header_ == nil {
28526		c.header_ = make(http.Header)
28527	}
28528	return c.header_
28529}
28530
28531func (c *ProjectsSinksListCall) doRequest(alt string) (*http.Response, error) {
28532	reqHeaders := make(http.Header)
28533	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
28534	for k, v := range c.header_ {
28535		reqHeaders[k] = v
28536	}
28537	reqHeaders.Set("User-Agent", c.s.userAgent())
28538	if c.ifNoneMatch_ != "" {
28539		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
28540	}
28541	var body io.Reader = nil
28542	c.urlParams_.Set("alt", alt)
28543	c.urlParams_.Set("prettyPrint", "false")
28544	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
28545	urls += "?" + c.urlParams_.Encode()
28546	req, err := http.NewRequest("GET", urls, body)
28547	if err != nil {
28548		return nil, err
28549	}
28550	req.Header = reqHeaders
28551	googleapi.Expand(req.URL, map[string]string{
28552		"parent": c.parent,
28553	})
28554	return gensupport.SendRequest(c.ctx_, c.s.client, req)
28555}
28556
28557// Do executes the "logging.projects.sinks.list" call.
28558// Exactly one of *ListSinksResponse or error will be non-nil. Any
28559// non-2xx status code is an error. Response headers are in either
28560// *ListSinksResponse.ServerResponse.Header or (if a response was
28561// returned at all) in error.(*googleapi.Error).Header. Use
28562// googleapi.IsNotModified to check whether the returned error was
28563// because http.StatusNotModified was returned.
28564func (c *ProjectsSinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) {
28565	gensupport.SetOptions(c.urlParams_, opts...)
28566	res, err := c.doRequest("json")
28567	if res != nil && res.StatusCode == http.StatusNotModified {
28568		if res.Body != nil {
28569			res.Body.Close()
28570		}
28571		return nil, &googleapi.Error{
28572			Code:   res.StatusCode,
28573			Header: res.Header,
28574		}
28575	}
28576	if err != nil {
28577		return nil, err
28578	}
28579	defer googleapi.CloseBody(res)
28580	if err := googleapi.CheckResponse(res); err != nil {
28581		return nil, err
28582	}
28583	ret := &ListSinksResponse{
28584		ServerResponse: googleapi.ServerResponse{
28585			Header:         res.Header,
28586			HTTPStatusCode: res.StatusCode,
28587		},
28588	}
28589	target := &ret
28590	if err := gensupport.DecodeResponse(target, res); err != nil {
28591		return nil, err
28592	}
28593	return ret, nil
28594	// {
28595	//   "description": "Lists sinks.",
28596	//   "flatPath": "v2/projects/{projectsId}/sinks",
28597	//   "httpMethod": "GET",
28598	//   "id": "logging.projects.sinks.list",
28599	//   "parameterOrder": [
28600	//     "parent"
28601	//   ],
28602	//   "parameters": {
28603	//     "pageSize": {
28604	//       "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.",
28605	//       "format": "int32",
28606	//       "location": "query",
28607	//       "type": "integer"
28608	//     },
28609	//     "pageToken": {
28610	//       "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.",
28611	//       "location": "query",
28612	//       "type": "string"
28613	//     },
28614	//     "parent": {
28615	//       "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
28616	//       "location": "path",
28617	//       "pattern": "^projects/[^/]+$",
28618	//       "required": true,
28619	//       "type": "string"
28620	//     }
28621	//   },
28622	//   "path": "v2/{+parent}/sinks",
28623	//   "response": {
28624	//     "$ref": "ListSinksResponse"
28625	//   },
28626	//   "scopes": [
28627	//     "https://www.googleapis.com/auth/cloud-platform",
28628	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
28629	//     "https://www.googleapis.com/auth/logging.admin",
28630	//     "https://www.googleapis.com/auth/logging.read"
28631	//   ]
28632	// }
28633
28634}
28635
28636// Pages invokes f for each page of results.
28637// A non-nil error returned from f will halt the iteration.
28638// The provided context supersedes any context provided to the Context method.
28639func (c *ProjectsSinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error {
28640	c.ctx_ = ctx
28641	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
28642	for {
28643		x, err := c.Do()
28644		if err != nil {
28645			return err
28646		}
28647		if err := f(x); err != nil {
28648			return err
28649		}
28650		if x.NextPageToken == "" {
28651			return nil
28652		}
28653		c.PageToken(x.NextPageToken)
28654	}
28655}
28656
28657// method id "logging.projects.sinks.patch":
28658
28659type ProjectsSinksPatchCall struct {
28660	s          *Service
28661	sinkNameid string
28662	logsink    *LogSink
28663	urlParams_ gensupport.URLParams
28664	ctx_       context.Context
28665	header_    http.Header
28666}
28667
28668// Patch: Updates a sink. This method replaces the following fields in
28669// the existing sink with values from the new sink: destination, and
28670// filter.The updated sink might also have a new writer_identity; see
28671// the unique_writer_identity field.
28672//
28673// - sinkName: The full resource name of the sink to update, including
28674//   the parent resource and the sink identifier:
28675//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
28676//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
28677//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
28678//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" For
28679//   example:"projects/my-project/sinks/my-sink".
28680func (r *ProjectsSinksService) Patch(sinkNameid string, logsink *LogSink) *ProjectsSinksPatchCall {
28681	c := &ProjectsSinksPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
28682	c.sinkNameid = sinkNameid
28683	c.logsink = logsink
28684	return c
28685}
28686
28687// UniqueWriterIdentity sets the optional parameter
28688// "uniqueWriterIdentity": See sinks.create for a description of this
28689// field. When updating a sink, the effect of this field on the value of
28690// writer_identity in the updated sink depends on both the old and new
28691// values of this field: If the old and new values of this field are
28692// both false or both true, then there is no change to the sink's
28693// writer_identity. If the old value is false and the new value is true,
28694// then writer_identity is changed to a unique service account. It is an
28695// error if the old value is true and the new value is set to false or
28696// defaulted to false.
28697func (c *ProjectsSinksPatchCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *ProjectsSinksPatchCall {
28698	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
28699	return c
28700}
28701
28702// UpdateMask sets the optional parameter "updateMask": Field mask that
28703// specifies the fields in sink that need an update. A sink field will
28704// be overwritten if, and only if, it is in the update mask. name and
28705// output only fields cannot be updated.An empty updateMask is
28706// temporarily treated as using the following mask for backwards
28707// compatibility purposes:destination,filter,includeChildrenAt some
28708// point in the future, behavior will be removed and specifying an empty
28709// updateMask will be an error.For a detailed FieldMask definition, see
28710// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor
28711// example: updateMask=filter
28712func (c *ProjectsSinksPatchCall) UpdateMask(updateMask string) *ProjectsSinksPatchCall {
28713	c.urlParams_.Set("updateMask", updateMask)
28714	return c
28715}
28716
28717// Fields allows partial responses to be retrieved. See
28718// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
28719// for more information.
28720func (c *ProjectsSinksPatchCall) Fields(s ...googleapi.Field) *ProjectsSinksPatchCall {
28721	c.urlParams_.Set("fields", googleapi.CombineFields(s))
28722	return c
28723}
28724
28725// Context sets the context to be used in this call's Do method. Any
28726// pending HTTP request will be aborted if the provided context is
28727// canceled.
28728func (c *ProjectsSinksPatchCall) Context(ctx context.Context) *ProjectsSinksPatchCall {
28729	c.ctx_ = ctx
28730	return c
28731}
28732
28733// Header returns an http.Header that can be modified by the caller to
28734// add HTTP headers to the request.
28735func (c *ProjectsSinksPatchCall) Header() http.Header {
28736	if c.header_ == nil {
28737		c.header_ = make(http.Header)
28738	}
28739	return c.header_
28740}
28741
28742func (c *ProjectsSinksPatchCall) doRequest(alt string) (*http.Response, error) {
28743	reqHeaders := make(http.Header)
28744	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
28745	for k, v := range c.header_ {
28746		reqHeaders[k] = v
28747	}
28748	reqHeaders.Set("User-Agent", c.s.userAgent())
28749	var body io.Reader = nil
28750	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
28751	if err != nil {
28752		return nil, err
28753	}
28754	reqHeaders.Set("Content-Type", "application/json")
28755	c.urlParams_.Set("alt", alt)
28756	c.urlParams_.Set("prettyPrint", "false")
28757	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
28758	urls += "?" + c.urlParams_.Encode()
28759	req, err := http.NewRequest("PATCH", urls, body)
28760	if err != nil {
28761		return nil, err
28762	}
28763	req.Header = reqHeaders
28764	googleapi.Expand(req.URL, map[string]string{
28765		"sinkName": c.sinkNameid,
28766	})
28767	return gensupport.SendRequest(c.ctx_, c.s.client, req)
28768}
28769
28770// Do executes the "logging.projects.sinks.patch" call.
28771// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
28772// code is an error. Response headers are in either
28773// *LogSink.ServerResponse.Header or (if a response was returned at all)
28774// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
28775// check whether the returned error was because http.StatusNotModified
28776// was returned.
28777func (c *ProjectsSinksPatchCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
28778	gensupport.SetOptions(c.urlParams_, opts...)
28779	res, err := c.doRequest("json")
28780	if res != nil && res.StatusCode == http.StatusNotModified {
28781		if res.Body != nil {
28782			res.Body.Close()
28783		}
28784		return nil, &googleapi.Error{
28785			Code:   res.StatusCode,
28786			Header: res.Header,
28787		}
28788	}
28789	if err != nil {
28790		return nil, err
28791	}
28792	defer googleapi.CloseBody(res)
28793	if err := googleapi.CheckResponse(res); err != nil {
28794		return nil, err
28795	}
28796	ret := &LogSink{
28797		ServerResponse: googleapi.ServerResponse{
28798			Header:         res.Header,
28799			HTTPStatusCode: res.StatusCode,
28800		},
28801	}
28802	target := &ret
28803	if err := gensupport.DecodeResponse(target, res); err != nil {
28804		return nil, err
28805	}
28806	return ret, nil
28807	// {
28808	//   "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.",
28809	//   "flatPath": "v2/projects/{projectsId}/sinks/{sinksId}",
28810	//   "httpMethod": "PATCH",
28811	//   "id": "logging.projects.sinks.patch",
28812	//   "parameterOrder": [
28813	//     "sinkName"
28814	//   ],
28815	//   "parameters": {
28816	//     "sinkName": {
28817	//       "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]\" For example:\"projects/my-project/sinks/my-sink\"",
28818	//       "location": "path",
28819	//       "pattern": "^projects/[^/]+/sinks/[^/]+$",
28820	//       "required": true,
28821	//       "type": "string"
28822	//     },
28823	//     "uniqueWriterIdentity": {
28824	//       "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.",
28825	//       "location": "query",
28826	//       "type": "boolean"
28827	//     },
28828	//     "updateMask": {
28829	//       "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,includeChildrenAt 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.FieldMaskFor example: updateMask=filter",
28830	//       "format": "google-fieldmask",
28831	//       "location": "query",
28832	//       "type": "string"
28833	//     }
28834	//   },
28835	//   "path": "v2/{+sinkName}",
28836	//   "request": {
28837	//     "$ref": "LogSink"
28838	//   },
28839	//   "response": {
28840	//     "$ref": "LogSink"
28841	//   },
28842	//   "scopes": [
28843	//     "https://www.googleapis.com/auth/cloud-platform",
28844	//     "https://www.googleapis.com/auth/logging.admin"
28845	//   ]
28846	// }
28847
28848}
28849
28850// method id "logging.projects.sinks.update":
28851
28852type ProjectsSinksUpdateCall struct {
28853	s          *Service
28854	sinkNameid string
28855	logsink    *LogSink
28856	urlParams_ gensupport.URLParams
28857	ctx_       context.Context
28858	header_    http.Header
28859}
28860
28861// Update: Updates a sink. This method replaces the following fields in
28862// the existing sink with values from the new sink: destination, and
28863// filter.The updated sink might also have a new writer_identity; see
28864// the unique_writer_identity field.
28865//
28866// - sinkName: The full resource name of the sink to update, including
28867//   the parent resource and the sink identifier:
28868//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
28869//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
28870//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
28871//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" For
28872//   example:"projects/my-project/sinks/my-sink".
28873func (r *ProjectsSinksService) Update(sinkNameid string, logsink *LogSink) *ProjectsSinksUpdateCall {
28874	c := &ProjectsSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
28875	c.sinkNameid = sinkNameid
28876	c.logsink = logsink
28877	return c
28878}
28879
28880// UniqueWriterIdentity sets the optional parameter
28881// "uniqueWriterIdentity": See sinks.create for a description of this
28882// field. When updating a sink, the effect of this field on the value of
28883// writer_identity in the updated sink depends on both the old and new
28884// values of this field: If the old and new values of this field are
28885// both false or both true, then there is no change to the sink's
28886// writer_identity. If the old value is false and the new value is true,
28887// then writer_identity is changed to a unique service account. It is an
28888// error if the old value is true and the new value is set to false or
28889// defaulted to false.
28890func (c *ProjectsSinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *ProjectsSinksUpdateCall {
28891	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
28892	return c
28893}
28894
28895// UpdateMask sets the optional parameter "updateMask": Field mask that
28896// specifies the fields in sink that need an update. A sink field will
28897// be overwritten if, and only if, it is in the update mask. name and
28898// output only fields cannot be updated.An empty updateMask is
28899// temporarily treated as using the following mask for backwards
28900// compatibility purposes:destination,filter,includeChildrenAt some
28901// point in the future, behavior will be removed and specifying an empty
28902// updateMask will be an error.For a detailed FieldMask definition, see
28903// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor
28904// example: updateMask=filter
28905func (c *ProjectsSinksUpdateCall) UpdateMask(updateMask string) *ProjectsSinksUpdateCall {
28906	c.urlParams_.Set("updateMask", updateMask)
28907	return c
28908}
28909
28910// Fields allows partial responses to be retrieved. See
28911// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
28912// for more information.
28913func (c *ProjectsSinksUpdateCall) Fields(s ...googleapi.Field) *ProjectsSinksUpdateCall {
28914	c.urlParams_.Set("fields", googleapi.CombineFields(s))
28915	return c
28916}
28917
28918// Context sets the context to be used in this call's Do method. Any
28919// pending HTTP request will be aborted if the provided context is
28920// canceled.
28921func (c *ProjectsSinksUpdateCall) Context(ctx context.Context) *ProjectsSinksUpdateCall {
28922	c.ctx_ = ctx
28923	return c
28924}
28925
28926// Header returns an http.Header that can be modified by the caller to
28927// add HTTP headers to the request.
28928func (c *ProjectsSinksUpdateCall) Header() http.Header {
28929	if c.header_ == nil {
28930		c.header_ = make(http.Header)
28931	}
28932	return c.header_
28933}
28934
28935func (c *ProjectsSinksUpdateCall) doRequest(alt string) (*http.Response, error) {
28936	reqHeaders := make(http.Header)
28937	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
28938	for k, v := range c.header_ {
28939		reqHeaders[k] = v
28940	}
28941	reqHeaders.Set("User-Agent", c.s.userAgent())
28942	var body io.Reader = nil
28943	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
28944	if err != nil {
28945		return nil, err
28946	}
28947	reqHeaders.Set("Content-Type", "application/json")
28948	c.urlParams_.Set("alt", alt)
28949	c.urlParams_.Set("prettyPrint", "false")
28950	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
28951	urls += "?" + c.urlParams_.Encode()
28952	req, err := http.NewRequest("PUT", urls, body)
28953	if err != nil {
28954		return nil, err
28955	}
28956	req.Header = reqHeaders
28957	googleapi.Expand(req.URL, map[string]string{
28958		"sinkName": c.sinkNameid,
28959	})
28960	return gensupport.SendRequest(c.ctx_, c.s.client, req)
28961}
28962
28963// Do executes the "logging.projects.sinks.update" call.
28964// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
28965// code is an error. Response headers are in either
28966// *LogSink.ServerResponse.Header or (if a response was returned at all)
28967// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
28968// check whether the returned error was because http.StatusNotModified
28969// was returned.
28970func (c *ProjectsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
28971	gensupport.SetOptions(c.urlParams_, opts...)
28972	res, err := c.doRequest("json")
28973	if res != nil && res.StatusCode == http.StatusNotModified {
28974		if res.Body != nil {
28975			res.Body.Close()
28976		}
28977		return nil, &googleapi.Error{
28978			Code:   res.StatusCode,
28979			Header: res.Header,
28980		}
28981	}
28982	if err != nil {
28983		return nil, err
28984	}
28985	defer googleapi.CloseBody(res)
28986	if err := googleapi.CheckResponse(res); err != nil {
28987		return nil, err
28988	}
28989	ret := &LogSink{
28990		ServerResponse: googleapi.ServerResponse{
28991			Header:         res.Header,
28992			HTTPStatusCode: res.StatusCode,
28993		},
28994	}
28995	target := &ret
28996	if err := gensupport.DecodeResponse(target, res); err != nil {
28997		return nil, err
28998	}
28999	return ret, nil
29000	// {
29001	//   "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.",
29002	//   "flatPath": "v2/projects/{projectsId}/sinks/{sinksId}",
29003	//   "httpMethod": "PUT",
29004	//   "id": "logging.projects.sinks.update",
29005	//   "parameterOrder": [
29006	//     "sinkName"
29007	//   ],
29008	//   "parameters": {
29009	//     "sinkName": {
29010	//       "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]\" For example:\"projects/my-project/sinks/my-sink\"",
29011	//       "location": "path",
29012	//       "pattern": "^projects/[^/]+/sinks/[^/]+$",
29013	//       "required": true,
29014	//       "type": "string"
29015	//     },
29016	//     "uniqueWriterIdentity": {
29017	//       "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.",
29018	//       "location": "query",
29019	//       "type": "boolean"
29020	//     },
29021	//     "updateMask": {
29022	//       "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,includeChildrenAt 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.FieldMaskFor example: updateMask=filter",
29023	//       "format": "google-fieldmask",
29024	//       "location": "query",
29025	//       "type": "string"
29026	//     }
29027	//   },
29028	//   "path": "v2/{+sinkName}",
29029	//   "request": {
29030	//     "$ref": "LogSink"
29031	//   },
29032	//   "response": {
29033	//     "$ref": "LogSink"
29034	//   },
29035	//   "scopes": [
29036	//     "https://www.googleapis.com/auth/cloud-platform",
29037	//     "https://www.googleapis.com/auth/logging.admin"
29038	//   ]
29039	// }
29040
29041}
29042
29043// method id "logging.sinks.create":
29044
29045type SinksCreateCall struct {
29046	s          *Service
29047	parent     string
29048	logsink    *LogSink
29049	urlParams_ gensupport.URLParams
29050	ctx_       context.Context
29051	header_    http.Header
29052}
29053
29054// Create: Creates a sink that exports specified log entries to a
29055// destination. The export of newly-ingested log entries begins
29056// immediately, unless the sink's writer_identity is not permitted to
29057// write to the destination. A sink can export log entries only from the
29058// resource owning the sink.
29059//
29060// - parent: The resource in which to create the sink:
29061//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
29062//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]" For
29063//   examples:"projects/my-project" "organizations/123456789".
29064func (r *SinksService) Create(parent string, logsink *LogSink) *SinksCreateCall {
29065	c := &SinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
29066	c.parent = parent
29067	c.logsink = logsink
29068	return c
29069}
29070
29071// UniqueWriterIdentity sets the optional parameter
29072// "uniqueWriterIdentity": Determines the kind of IAM identity returned
29073// as writer_identity in the new sink. If this value is omitted or set
29074// to false, and if the sink's parent is a project, then the value
29075// returned as writer_identity is the same group or service account used
29076// by Cloud Logging before the addition of writer identities to this
29077// API. The sink's destination must be in the same project as the sink
29078// itself.If this field is set to true, or if the sink is owned by a
29079// non-project resource such as an organization, then the value of
29080// writer_identity will be a unique service account used only for
29081// exports from the new sink. For more information, see writer_identity
29082// in LogSink.
29083func (c *SinksCreateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *SinksCreateCall {
29084	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
29085	return c
29086}
29087
29088// Fields allows partial responses to be retrieved. See
29089// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
29090// for more information.
29091func (c *SinksCreateCall) Fields(s ...googleapi.Field) *SinksCreateCall {
29092	c.urlParams_.Set("fields", googleapi.CombineFields(s))
29093	return c
29094}
29095
29096// Context sets the context to be used in this call's Do method. Any
29097// pending HTTP request will be aborted if the provided context is
29098// canceled.
29099func (c *SinksCreateCall) Context(ctx context.Context) *SinksCreateCall {
29100	c.ctx_ = ctx
29101	return c
29102}
29103
29104// Header returns an http.Header that can be modified by the caller to
29105// add HTTP headers to the request.
29106func (c *SinksCreateCall) Header() http.Header {
29107	if c.header_ == nil {
29108		c.header_ = make(http.Header)
29109	}
29110	return c.header_
29111}
29112
29113func (c *SinksCreateCall) doRequest(alt string) (*http.Response, error) {
29114	reqHeaders := make(http.Header)
29115	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
29116	for k, v := range c.header_ {
29117		reqHeaders[k] = v
29118	}
29119	reqHeaders.Set("User-Agent", c.s.userAgent())
29120	var body io.Reader = nil
29121	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
29122	if err != nil {
29123		return nil, err
29124	}
29125	reqHeaders.Set("Content-Type", "application/json")
29126	c.urlParams_.Set("alt", alt)
29127	c.urlParams_.Set("prettyPrint", "false")
29128	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
29129	urls += "?" + c.urlParams_.Encode()
29130	req, err := http.NewRequest("POST", urls, body)
29131	if err != nil {
29132		return nil, err
29133	}
29134	req.Header = reqHeaders
29135	googleapi.Expand(req.URL, map[string]string{
29136		"parent": c.parent,
29137	})
29138	return gensupport.SendRequest(c.ctx_, c.s.client, req)
29139}
29140
29141// Do executes the "logging.sinks.create" call.
29142// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
29143// code is an error. Response headers are in either
29144// *LogSink.ServerResponse.Header or (if a response was returned at all)
29145// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
29146// check whether the returned error was because http.StatusNotModified
29147// was returned.
29148func (c *SinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
29149	gensupport.SetOptions(c.urlParams_, opts...)
29150	res, err := c.doRequest("json")
29151	if res != nil && res.StatusCode == http.StatusNotModified {
29152		if res.Body != nil {
29153			res.Body.Close()
29154		}
29155		return nil, &googleapi.Error{
29156			Code:   res.StatusCode,
29157			Header: res.Header,
29158		}
29159	}
29160	if err != nil {
29161		return nil, err
29162	}
29163	defer googleapi.CloseBody(res)
29164	if err := googleapi.CheckResponse(res); err != nil {
29165		return nil, err
29166	}
29167	ret := &LogSink{
29168		ServerResponse: googleapi.ServerResponse{
29169			Header:         res.Header,
29170			HTTPStatusCode: res.StatusCode,
29171		},
29172	}
29173	target := &ret
29174	if err := gensupport.DecodeResponse(target, res); err != nil {
29175		return nil, err
29176	}
29177	return ret, nil
29178	// {
29179	//   "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.",
29180	//   "flatPath": "v2/{v2Id}/{v2Id1}/sinks",
29181	//   "httpMethod": "POST",
29182	//   "id": "logging.sinks.create",
29183	//   "parameterOrder": [
29184	//     "parent"
29185	//   ],
29186	//   "parameters": {
29187	//     "parent": {
29188	//       "description": "Required. The resource in which to create the sink: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" For examples:\"projects/my-project\" \"organizations/123456789\"",
29189	//       "location": "path",
29190	//       "pattern": "^[^/]+/[^/]+$",
29191	//       "required": true,
29192	//       "type": "string"
29193	//     },
29194	//     "uniqueWriterIdentity": {
29195	//       "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 Cloud 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.",
29196	//       "location": "query",
29197	//       "type": "boolean"
29198	//     }
29199	//   },
29200	//   "path": "v2/{+parent}/sinks",
29201	//   "request": {
29202	//     "$ref": "LogSink"
29203	//   },
29204	//   "response": {
29205	//     "$ref": "LogSink"
29206	//   },
29207	//   "scopes": [
29208	//     "https://www.googleapis.com/auth/cloud-platform",
29209	//     "https://www.googleapis.com/auth/logging.admin"
29210	//   ]
29211	// }
29212
29213}
29214
29215// method id "logging.sinks.delete":
29216
29217type SinksDeleteCall struct {
29218	s          *Service
29219	sinkNameid string
29220	urlParams_ gensupport.URLParams
29221	ctx_       context.Context
29222	header_    http.Header
29223}
29224
29225// Delete: Deletes a sink. If the sink has a unique writer_identity,
29226// then that service account is also deleted.
29227//
29228// - sinkName: The full resource name of the sink to delete, including
29229//   the parent resource and the sink identifier:
29230//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
29231//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
29232//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
29233//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" For
29234//   example:"projects/my-project/sinks/my-sink".
29235func (r *SinksService) Delete(sinkNameid string) *SinksDeleteCall {
29236	c := &SinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
29237	c.sinkNameid = sinkNameid
29238	return c
29239}
29240
29241// Fields allows partial responses to be retrieved. See
29242// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
29243// for more information.
29244func (c *SinksDeleteCall) Fields(s ...googleapi.Field) *SinksDeleteCall {
29245	c.urlParams_.Set("fields", googleapi.CombineFields(s))
29246	return c
29247}
29248
29249// Context sets the context to be used in this call's Do method. Any
29250// pending HTTP request will be aborted if the provided context is
29251// canceled.
29252func (c *SinksDeleteCall) Context(ctx context.Context) *SinksDeleteCall {
29253	c.ctx_ = ctx
29254	return c
29255}
29256
29257// Header returns an http.Header that can be modified by the caller to
29258// add HTTP headers to the request.
29259func (c *SinksDeleteCall) Header() http.Header {
29260	if c.header_ == nil {
29261		c.header_ = make(http.Header)
29262	}
29263	return c.header_
29264}
29265
29266func (c *SinksDeleteCall) doRequest(alt string) (*http.Response, error) {
29267	reqHeaders := make(http.Header)
29268	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
29269	for k, v := range c.header_ {
29270		reqHeaders[k] = v
29271	}
29272	reqHeaders.Set("User-Agent", c.s.userAgent())
29273	var body io.Reader = nil
29274	c.urlParams_.Set("alt", alt)
29275	c.urlParams_.Set("prettyPrint", "false")
29276	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
29277	urls += "?" + c.urlParams_.Encode()
29278	req, err := http.NewRequest("DELETE", urls, body)
29279	if err != nil {
29280		return nil, err
29281	}
29282	req.Header = reqHeaders
29283	googleapi.Expand(req.URL, map[string]string{
29284		"sinkName": c.sinkNameid,
29285	})
29286	return gensupport.SendRequest(c.ctx_, c.s.client, req)
29287}
29288
29289// Do executes the "logging.sinks.delete" call.
29290// Exactly one of *Empty or error will be non-nil. Any non-2xx status
29291// code is an error. Response headers are in either
29292// *Empty.ServerResponse.Header or (if a response was returned at all)
29293// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
29294// check whether the returned error was because http.StatusNotModified
29295// was returned.
29296func (c *SinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
29297	gensupport.SetOptions(c.urlParams_, opts...)
29298	res, err := c.doRequest("json")
29299	if res != nil && res.StatusCode == http.StatusNotModified {
29300		if res.Body != nil {
29301			res.Body.Close()
29302		}
29303		return nil, &googleapi.Error{
29304			Code:   res.StatusCode,
29305			Header: res.Header,
29306		}
29307	}
29308	if err != nil {
29309		return nil, err
29310	}
29311	defer googleapi.CloseBody(res)
29312	if err := googleapi.CheckResponse(res); err != nil {
29313		return nil, err
29314	}
29315	ret := &Empty{
29316		ServerResponse: googleapi.ServerResponse{
29317			Header:         res.Header,
29318			HTTPStatusCode: res.StatusCode,
29319		},
29320	}
29321	target := &ret
29322	if err := gensupport.DecodeResponse(target, res); err != nil {
29323		return nil, err
29324	}
29325	return ret, nil
29326	// {
29327	//   "description": "Deletes a sink. If the sink has a unique writer_identity, then that service account is also deleted.",
29328	//   "flatPath": "v2/{v2Id}/{v2Id1}/sinks/{sinksId}",
29329	//   "httpMethod": "DELETE",
29330	//   "id": "logging.sinks.delete",
29331	//   "parameterOrder": [
29332	//     "sinkName"
29333	//   ],
29334	//   "parameters": {
29335	//     "sinkName": {
29336	//       "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]\" For example:\"projects/my-project/sinks/my-sink\"",
29337	//       "location": "path",
29338	//       "pattern": "^[^/]+/[^/]+/sinks/[^/]+$",
29339	//       "required": true,
29340	//       "type": "string"
29341	//     }
29342	//   },
29343	//   "path": "v2/{+sinkName}",
29344	//   "response": {
29345	//     "$ref": "Empty"
29346	//   },
29347	//   "scopes": [
29348	//     "https://www.googleapis.com/auth/cloud-platform",
29349	//     "https://www.googleapis.com/auth/logging.admin"
29350	//   ]
29351	// }
29352
29353}
29354
29355// method id "logging.sinks.get":
29356
29357type SinksGetCall struct {
29358	s            *Service
29359	sinkName     string
29360	urlParams_   gensupport.URLParams
29361	ifNoneMatch_ string
29362	ctx_         context.Context
29363	header_      http.Header
29364}
29365
29366// Get: Gets a sink.
29367//
29368// - sinkName: The resource name of the sink:
29369//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
29370//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
29371//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
29372//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" For
29373//   example:"projects/my-project/sinks/my-sink".
29374func (r *SinksService) Get(sinkName string) *SinksGetCall {
29375	c := &SinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
29376	c.sinkName = sinkName
29377	return c
29378}
29379
29380// Fields allows partial responses to be retrieved. See
29381// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
29382// for more information.
29383func (c *SinksGetCall) Fields(s ...googleapi.Field) *SinksGetCall {
29384	c.urlParams_.Set("fields", googleapi.CombineFields(s))
29385	return c
29386}
29387
29388// IfNoneMatch sets the optional parameter which makes the operation
29389// fail if the object's ETag matches the given value. This is useful for
29390// getting updates only after the object has changed since the last
29391// request. Use googleapi.IsNotModified to check whether the response
29392// error from Do is the result of In-None-Match.
29393func (c *SinksGetCall) IfNoneMatch(entityTag string) *SinksGetCall {
29394	c.ifNoneMatch_ = entityTag
29395	return c
29396}
29397
29398// Context sets the context to be used in this call's Do method. Any
29399// pending HTTP request will be aborted if the provided context is
29400// canceled.
29401func (c *SinksGetCall) Context(ctx context.Context) *SinksGetCall {
29402	c.ctx_ = ctx
29403	return c
29404}
29405
29406// Header returns an http.Header that can be modified by the caller to
29407// add HTTP headers to the request.
29408func (c *SinksGetCall) Header() http.Header {
29409	if c.header_ == nil {
29410		c.header_ = make(http.Header)
29411	}
29412	return c.header_
29413}
29414
29415func (c *SinksGetCall) doRequest(alt string) (*http.Response, error) {
29416	reqHeaders := make(http.Header)
29417	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
29418	for k, v := range c.header_ {
29419		reqHeaders[k] = v
29420	}
29421	reqHeaders.Set("User-Agent", c.s.userAgent())
29422	if c.ifNoneMatch_ != "" {
29423		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
29424	}
29425	var body io.Reader = nil
29426	c.urlParams_.Set("alt", alt)
29427	c.urlParams_.Set("prettyPrint", "false")
29428	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
29429	urls += "?" + c.urlParams_.Encode()
29430	req, err := http.NewRequest("GET", urls, body)
29431	if err != nil {
29432		return nil, err
29433	}
29434	req.Header = reqHeaders
29435	googleapi.Expand(req.URL, map[string]string{
29436		"sinkName": c.sinkName,
29437	})
29438	return gensupport.SendRequest(c.ctx_, c.s.client, req)
29439}
29440
29441// Do executes the "logging.sinks.get" call.
29442// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
29443// code is an error. Response headers are in either
29444// *LogSink.ServerResponse.Header or (if a response was returned at all)
29445// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
29446// check whether the returned error was because http.StatusNotModified
29447// was returned.
29448func (c *SinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
29449	gensupport.SetOptions(c.urlParams_, opts...)
29450	res, err := c.doRequest("json")
29451	if res != nil && res.StatusCode == http.StatusNotModified {
29452		if res.Body != nil {
29453			res.Body.Close()
29454		}
29455		return nil, &googleapi.Error{
29456			Code:   res.StatusCode,
29457			Header: res.Header,
29458		}
29459	}
29460	if err != nil {
29461		return nil, err
29462	}
29463	defer googleapi.CloseBody(res)
29464	if err := googleapi.CheckResponse(res); err != nil {
29465		return nil, err
29466	}
29467	ret := &LogSink{
29468		ServerResponse: googleapi.ServerResponse{
29469			Header:         res.Header,
29470			HTTPStatusCode: res.StatusCode,
29471		},
29472	}
29473	target := &ret
29474	if err := gensupport.DecodeResponse(target, res); err != nil {
29475		return nil, err
29476	}
29477	return ret, nil
29478	// {
29479	//   "description": "Gets a sink.",
29480	//   "flatPath": "v2/{v2Id}/{v2Id1}/sinks/{sinksId}",
29481	//   "httpMethod": "GET",
29482	//   "id": "logging.sinks.get",
29483	//   "parameterOrder": [
29484	//     "sinkName"
29485	//   ],
29486	//   "parameters": {
29487	//     "sinkName": {
29488	//       "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]\" For example:\"projects/my-project/sinks/my-sink\"",
29489	//       "location": "path",
29490	//       "pattern": "^[^/]+/[^/]+/sinks/[^/]+$",
29491	//       "required": true,
29492	//       "type": "string"
29493	//     }
29494	//   },
29495	//   "path": "v2/{+sinkName}",
29496	//   "response": {
29497	//     "$ref": "LogSink"
29498	//   },
29499	//   "scopes": [
29500	//     "https://www.googleapis.com/auth/cloud-platform",
29501	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
29502	//     "https://www.googleapis.com/auth/logging.admin",
29503	//     "https://www.googleapis.com/auth/logging.read"
29504	//   ]
29505	// }
29506
29507}
29508
29509// method id "logging.sinks.list":
29510
29511type SinksListCall struct {
29512	s            *Service
29513	parent       string
29514	urlParams_   gensupport.URLParams
29515	ifNoneMatch_ string
29516	ctx_         context.Context
29517	header_      http.Header
29518}
29519
29520// List: Lists sinks.
29521//
29522// - parent: The parent resource whose sinks are to be listed:
29523//   "projects/[PROJECT_ID]" "organizations/[ORGANIZATION_ID]"
29524//   "billingAccounts/[BILLING_ACCOUNT_ID]" "folders/[FOLDER_ID]".
29525func (r *SinksService) List(parent string) *SinksListCall {
29526	c := &SinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
29527	c.parent = parent
29528	return c
29529}
29530
29531// PageSize sets the optional parameter "pageSize": The maximum number
29532// of results to return from this request. Non-positive values are
29533// ignored. The presence of nextPageToken in the response indicates that
29534// more results might be available.
29535func (c *SinksListCall) PageSize(pageSize int64) *SinksListCall {
29536	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
29537	return c
29538}
29539
29540// PageToken sets the optional parameter "pageToken": If present, then
29541// retrieve the next batch of results from the preceding call to this
29542// method. pageToken must be the value of nextPageToken from the
29543// previous response. The values of other method parameters should be
29544// identical to those in the previous call.
29545func (c *SinksListCall) PageToken(pageToken string) *SinksListCall {
29546	c.urlParams_.Set("pageToken", pageToken)
29547	return c
29548}
29549
29550// Fields allows partial responses to be retrieved. See
29551// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
29552// for more information.
29553func (c *SinksListCall) Fields(s ...googleapi.Field) *SinksListCall {
29554	c.urlParams_.Set("fields", googleapi.CombineFields(s))
29555	return c
29556}
29557
29558// IfNoneMatch sets the optional parameter which makes the operation
29559// fail if the object's ETag matches the given value. This is useful for
29560// getting updates only after the object has changed since the last
29561// request. Use googleapi.IsNotModified to check whether the response
29562// error from Do is the result of In-None-Match.
29563func (c *SinksListCall) IfNoneMatch(entityTag string) *SinksListCall {
29564	c.ifNoneMatch_ = entityTag
29565	return c
29566}
29567
29568// Context sets the context to be used in this call's Do method. Any
29569// pending HTTP request will be aborted if the provided context is
29570// canceled.
29571func (c *SinksListCall) Context(ctx context.Context) *SinksListCall {
29572	c.ctx_ = ctx
29573	return c
29574}
29575
29576// Header returns an http.Header that can be modified by the caller to
29577// add HTTP headers to the request.
29578func (c *SinksListCall) Header() http.Header {
29579	if c.header_ == nil {
29580		c.header_ = make(http.Header)
29581	}
29582	return c.header_
29583}
29584
29585func (c *SinksListCall) doRequest(alt string) (*http.Response, error) {
29586	reqHeaders := make(http.Header)
29587	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
29588	for k, v := range c.header_ {
29589		reqHeaders[k] = v
29590	}
29591	reqHeaders.Set("User-Agent", c.s.userAgent())
29592	if c.ifNoneMatch_ != "" {
29593		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
29594	}
29595	var body io.Reader = nil
29596	c.urlParams_.Set("alt", alt)
29597	c.urlParams_.Set("prettyPrint", "false")
29598	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+parent}/sinks")
29599	urls += "?" + c.urlParams_.Encode()
29600	req, err := http.NewRequest("GET", urls, body)
29601	if err != nil {
29602		return nil, err
29603	}
29604	req.Header = reqHeaders
29605	googleapi.Expand(req.URL, map[string]string{
29606		"parent": c.parent,
29607	})
29608	return gensupport.SendRequest(c.ctx_, c.s.client, req)
29609}
29610
29611// Do executes the "logging.sinks.list" call.
29612// Exactly one of *ListSinksResponse or error will be non-nil. Any
29613// non-2xx status code is an error. Response headers are in either
29614// *ListSinksResponse.ServerResponse.Header or (if a response was
29615// returned at all) in error.(*googleapi.Error).Header. Use
29616// googleapi.IsNotModified to check whether the returned error was
29617// because http.StatusNotModified was returned.
29618func (c *SinksListCall) Do(opts ...googleapi.CallOption) (*ListSinksResponse, error) {
29619	gensupport.SetOptions(c.urlParams_, opts...)
29620	res, err := c.doRequest("json")
29621	if res != nil && res.StatusCode == http.StatusNotModified {
29622		if res.Body != nil {
29623			res.Body.Close()
29624		}
29625		return nil, &googleapi.Error{
29626			Code:   res.StatusCode,
29627			Header: res.Header,
29628		}
29629	}
29630	if err != nil {
29631		return nil, err
29632	}
29633	defer googleapi.CloseBody(res)
29634	if err := googleapi.CheckResponse(res); err != nil {
29635		return nil, err
29636	}
29637	ret := &ListSinksResponse{
29638		ServerResponse: googleapi.ServerResponse{
29639			Header:         res.Header,
29640			HTTPStatusCode: res.StatusCode,
29641		},
29642	}
29643	target := &ret
29644	if err := gensupport.DecodeResponse(target, res); err != nil {
29645		return nil, err
29646	}
29647	return ret, nil
29648	// {
29649	//   "description": "Lists sinks.",
29650	//   "flatPath": "v2/{v2Id}/{v2Id1}/sinks",
29651	//   "httpMethod": "GET",
29652	//   "id": "logging.sinks.list",
29653	//   "parameterOrder": [
29654	//     "parent"
29655	//   ],
29656	//   "parameters": {
29657	//     "pageSize": {
29658	//       "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.",
29659	//       "format": "int32",
29660	//       "location": "query",
29661	//       "type": "integer"
29662	//     },
29663	//     "pageToken": {
29664	//       "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.",
29665	//       "location": "query",
29666	//       "type": "string"
29667	//     },
29668	//     "parent": {
29669	//       "description": "Required. The parent resource whose sinks are to be listed: \"projects/[PROJECT_ID]\" \"organizations/[ORGANIZATION_ID]\" \"billingAccounts/[BILLING_ACCOUNT_ID]\" \"folders/[FOLDER_ID]\" ",
29670	//       "location": "path",
29671	//       "pattern": "^[^/]+/[^/]+$",
29672	//       "required": true,
29673	//       "type": "string"
29674	//     }
29675	//   },
29676	//   "path": "v2/{+parent}/sinks",
29677	//   "response": {
29678	//     "$ref": "ListSinksResponse"
29679	//   },
29680	//   "scopes": [
29681	//     "https://www.googleapis.com/auth/cloud-platform",
29682	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
29683	//     "https://www.googleapis.com/auth/logging.admin",
29684	//     "https://www.googleapis.com/auth/logging.read"
29685	//   ]
29686	// }
29687
29688}
29689
29690// Pages invokes f for each page of results.
29691// A non-nil error returned from f will halt the iteration.
29692// The provided context supersedes any context provided to the Context method.
29693func (c *SinksListCall) Pages(ctx context.Context, f func(*ListSinksResponse) error) error {
29694	c.ctx_ = ctx
29695	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
29696	for {
29697		x, err := c.Do()
29698		if err != nil {
29699			return err
29700		}
29701		if err := f(x); err != nil {
29702			return err
29703		}
29704		if x.NextPageToken == "" {
29705			return nil
29706		}
29707		c.PageToken(x.NextPageToken)
29708	}
29709}
29710
29711// method id "logging.sinks.update":
29712
29713type SinksUpdateCall struct {
29714	s          *Service
29715	sinkNameid string
29716	logsink    *LogSink
29717	urlParams_ gensupport.URLParams
29718	ctx_       context.Context
29719	header_    http.Header
29720}
29721
29722// Update: Updates a sink. This method replaces the following fields in
29723// the existing sink with values from the new sink: destination, and
29724// filter.The updated sink might also have a new writer_identity; see
29725// the unique_writer_identity field.
29726//
29727// - sinkName: The full resource name of the sink to update, including
29728//   the parent resource and the sink identifier:
29729//   "projects/[PROJECT_ID]/sinks/[SINK_ID]"
29730//   "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
29731//   "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
29732//   "folders/[FOLDER_ID]/sinks/[SINK_ID]" For
29733//   example:"projects/my-project/sinks/my-sink".
29734func (r *SinksService) Update(sinkNameid string, logsink *LogSink) *SinksUpdateCall {
29735	c := &SinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
29736	c.sinkNameid = sinkNameid
29737	c.logsink = logsink
29738	return c
29739}
29740
29741// UniqueWriterIdentity sets the optional parameter
29742// "uniqueWriterIdentity": See sinks.create for a description of this
29743// field. When updating a sink, the effect of this field on the value of
29744// writer_identity in the updated sink depends on both the old and new
29745// values of this field: If the old and new values of this field are
29746// both false or both true, then there is no change to the sink's
29747// writer_identity. If the old value is false and the new value is true,
29748// then writer_identity is changed to a unique service account. It is an
29749// error if the old value is true and the new value is set to false or
29750// defaulted to false.
29751func (c *SinksUpdateCall) UniqueWriterIdentity(uniqueWriterIdentity bool) *SinksUpdateCall {
29752	c.urlParams_.Set("uniqueWriterIdentity", fmt.Sprint(uniqueWriterIdentity))
29753	return c
29754}
29755
29756// UpdateMask sets the optional parameter "updateMask": Field mask that
29757// specifies the fields in sink that need an update. A sink field will
29758// be overwritten if, and only if, it is in the update mask. name and
29759// output only fields cannot be updated.An empty updateMask is
29760// temporarily treated as using the following mask for backwards
29761// compatibility purposes:destination,filter,includeChildrenAt some
29762// point in the future, behavior will be removed and specifying an empty
29763// updateMask will be an error.For a detailed FieldMask definition, see
29764// https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMaskFor
29765// example: updateMask=filter
29766func (c *SinksUpdateCall) UpdateMask(updateMask string) *SinksUpdateCall {
29767	c.urlParams_.Set("updateMask", updateMask)
29768	return c
29769}
29770
29771// Fields allows partial responses to be retrieved. See
29772// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
29773// for more information.
29774func (c *SinksUpdateCall) Fields(s ...googleapi.Field) *SinksUpdateCall {
29775	c.urlParams_.Set("fields", googleapi.CombineFields(s))
29776	return c
29777}
29778
29779// Context sets the context to be used in this call's Do method. Any
29780// pending HTTP request will be aborted if the provided context is
29781// canceled.
29782func (c *SinksUpdateCall) Context(ctx context.Context) *SinksUpdateCall {
29783	c.ctx_ = ctx
29784	return c
29785}
29786
29787// Header returns an http.Header that can be modified by the caller to
29788// add HTTP headers to the request.
29789func (c *SinksUpdateCall) Header() http.Header {
29790	if c.header_ == nil {
29791		c.header_ = make(http.Header)
29792	}
29793	return c.header_
29794}
29795
29796func (c *SinksUpdateCall) doRequest(alt string) (*http.Response, error) {
29797	reqHeaders := make(http.Header)
29798	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
29799	for k, v := range c.header_ {
29800		reqHeaders[k] = v
29801	}
29802	reqHeaders.Set("User-Agent", c.s.userAgent())
29803	var body io.Reader = nil
29804	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
29805	if err != nil {
29806		return nil, err
29807	}
29808	reqHeaders.Set("Content-Type", "application/json")
29809	c.urlParams_.Set("alt", alt)
29810	c.urlParams_.Set("prettyPrint", "false")
29811	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+sinkName}")
29812	urls += "?" + c.urlParams_.Encode()
29813	req, err := http.NewRequest("PUT", urls, body)
29814	if err != nil {
29815		return nil, err
29816	}
29817	req.Header = reqHeaders
29818	googleapi.Expand(req.URL, map[string]string{
29819		"sinkName": c.sinkNameid,
29820	})
29821	return gensupport.SendRequest(c.ctx_, c.s.client, req)
29822}
29823
29824// Do executes the "logging.sinks.update" call.
29825// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
29826// code is an error. Response headers are in either
29827// *LogSink.ServerResponse.Header or (if a response was returned at all)
29828// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
29829// check whether the returned error was because http.StatusNotModified
29830// was returned.
29831func (c *SinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
29832	gensupport.SetOptions(c.urlParams_, opts...)
29833	res, err := c.doRequest("json")
29834	if res != nil && res.StatusCode == http.StatusNotModified {
29835		if res.Body != nil {
29836			res.Body.Close()
29837		}
29838		return nil, &googleapi.Error{
29839			Code:   res.StatusCode,
29840			Header: res.Header,
29841		}
29842	}
29843	if err != nil {
29844		return nil, err
29845	}
29846	defer googleapi.CloseBody(res)
29847	if err := googleapi.CheckResponse(res); err != nil {
29848		return nil, err
29849	}
29850	ret := &LogSink{
29851		ServerResponse: googleapi.ServerResponse{
29852			Header:         res.Header,
29853			HTTPStatusCode: res.StatusCode,
29854		},
29855	}
29856	target := &ret
29857	if err := gensupport.DecodeResponse(target, res); err != nil {
29858		return nil, err
29859	}
29860	return ret, nil
29861	// {
29862	//   "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.",
29863	//   "flatPath": "v2/{v2Id}/{v2Id1}/sinks/{sinksId}",
29864	//   "httpMethod": "PUT",
29865	//   "id": "logging.sinks.update",
29866	//   "parameterOrder": [
29867	//     "sinkName"
29868	//   ],
29869	//   "parameters": {
29870	//     "sinkName": {
29871	//       "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]\" For example:\"projects/my-project/sinks/my-sink\"",
29872	//       "location": "path",
29873	//       "pattern": "^[^/]+/[^/]+/sinks/[^/]+$",
29874	//       "required": true,
29875	//       "type": "string"
29876	//     },
29877	//     "uniqueWriterIdentity": {
29878	//       "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.",
29879	//       "location": "query",
29880	//       "type": "boolean"
29881	//     },
29882	//     "updateMask": {
29883	//       "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,includeChildrenAt 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.FieldMaskFor example: updateMask=filter",
29884	//       "format": "google-fieldmask",
29885	//       "location": "query",
29886	//       "type": "string"
29887	//     }
29888	//   },
29889	//   "path": "v2/{+sinkName}",
29890	//   "request": {
29891	//     "$ref": "LogSink"
29892	//   },
29893	//   "response": {
29894	//     "$ref": "LogSink"
29895	//   },
29896	//   "scopes": [
29897	//     "https://www.googleapis.com/auth/cloud-platform",
29898	//     "https://www.googleapis.com/auth/logging.admin"
29899	//   ]
29900	// }
29901
29902}
29903
29904// method id "logging.getCmekSettings":
29905
29906type V2GetCmekSettingsCall struct {
29907	s            *Service
29908	name         string
29909	urlParams_   gensupport.URLParams
29910	ifNoneMatch_ string
29911	ctx_         context.Context
29912	header_      http.Header
29913}
29914
29915// GetCmekSettings: Gets the Logs Router CMEK settings for the given
29916// resource.Note: CMEK for the Logs Router can currently only be
29917// configured for Google Cloud organizations. Once configured, it
29918// applies to all projects and folders in the Google Cloud
29919// organization.See Enabling CMEK for Logs Router
29920// (https://cloud.google.com/logging/docs/routing/managed-encryption)
29921// for more information.
29922//
29923// - name: The resource for which to retrieve CMEK settings.
29924//   "projects/[PROJECT_ID]/cmekSettings"
29925//   "organizations/[ORGANIZATION_ID]/cmekSettings"
29926//   "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
29927//   "folders/[FOLDER_ID]/cmekSettings" For
29928//   example:"organizations/12345/cmekSettings"Note: CMEK for the Logs
29929//   Router can currently only be configured for Google Cloud
29930//   organizations. Once configured, it applies to all projects and
29931//   folders in the Google Cloud organization.
29932func (r *V2Service) GetCmekSettings(name string) *V2GetCmekSettingsCall {
29933	c := &V2GetCmekSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
29934	c.name = name
29935	return c
29936}
29937
29938// Fields allows partial responses to be retrieved. See
29939// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
29940// for more information.
29941func (c *V2GetCmekSettingsCall) Fields(s ...googleapi.Field) *V2GetCmekSettingsCall {
29942	c.urlParams_.Set("fields", googleapi.CombineFields(s))
29943	return c
29944}
29945
29946// IfNoneMatch sets the optional parameter which makes the operation
29947// fail if the object's ETag matches the given value. This is useful for
29948// getting updates only after the object has changed since the last
29949// request. Use googleapi.IsNotModified to check whether the response
29950// error from Do is the result of In-None-Match.
29951func (c *V2GetCmekSettingsCall) IfNoneMatch(entityTag string) *V2GetCmekSettingsCall {
29952	c.ifNoneMatch_ = entityTag
29953	return c
29954}
29955
29956// Context sets the context to be used in this call's Do method. Any
29957// pending HTTP request will be aborted if the provided context is
29958// canceled.
29959func (c *V2GetCmekSettingsCall) Context(ctx context.Context) *V2GetCmekSettingsCall {
29960	c.ctx_ = ctx
29961	return c
29962}
29963
29964// Header returns an http.Header that can be modified by the caller to
29965// add HTTP headers to the request.
29966func (c *V2GetCmekSettingsCall) Header() http.Header {
29967	if c.header_ == nil {
29968		c.header_ = make(http.Header)
29969	}
29970	return c.header_
29971}
29972
29973func (c *V2GetCmekSettingsCall) doRequest(alt string) (*http.Response, error) {
29974	reqHeaders := make(http.Header)
29975	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
29976	for k, v := range c.header_ {
29977		reqHeaders[k] = v
29978	}
29979	reqHeaders.Set("User-Agent", c.s.userAgent())
29980	if c.ifNoneMatch_ != "" {
29981		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
29982	}
29983	var body io.Reader = nil
29984	c.urlParams_.Set("alt", alt)
29985	c.urlParams_.Set("prettyPrint", "false")
29986	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings")
29987	urls += "?" + c.urlParams_.Encode()
29988	req, err := http.NewRequest("GET", urls, body)
29989	if err != nil {
29990		return nil, err
29991	}
29992	req.Header = reqHeaders
29993	googleapi.Expand(req.URL, map[string]string{
29994		"name": c.name,
29995	})
29996	return gensupport.SendRequest(c.ctx_, c.s.client, req)
29997}
29998
29999// Do executes the "logging.getCmekSettings" call.
30000// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx
30001// status code is an error. Response headers are in either
30002// *CmekSettings.ServerResponse.Header or (if a response was returned at
30003// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
30004// to check whether the returned error was because
30005// http.StatusNotModified was returned.
30006func (c *V2GetCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) {
30007	gensupport.SetOptions(c.urlParams_, opts...)
30008	res, err := c.doRequest("json")
30009	if res != nil && res.StatusCode == http.StatusNotModified {
30010		if res.Body != nil {
30011			res.Body.Close()
30012		}
30013		return nil, &googleapi.Error{
30014			Code:   res.StatusCode,
30015			Header: res.Header,
30016		}
30017	}
30018	if err != nil {
30019		return nil, err
30020	}
30021	defer googleapi.CloseBody(res)
30022	if err := googleapi.CheckResponse(res); err != nil {
30023		return nil, err
30024	}
30025	ret := &CmekSettings{
30026		ServerResponse: googleapi.ServerResponse{
30027			Header:         res.Header,
30028			HTTPStatusCode: res.StatusCode,
30029		},
30030	}
30031	target := &ret
30032	if err := gensupport.DecodeResponse(target, res); err != nil {
30033		return nil, err
30034	}
30035	return ret, nil
30036	// {
30037	//   "description": "Gets the Logs Router CMEK settings for the given resource.Note: CMEK for the Logs Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.See Enabling CMEK for Logs Router (https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.",
30038	//   "flatPath": "v2/{v2Id}/{v2Id1}/cmekSettings",
30039	//   "httpMethod": "GET",
30040	//   "id": "logging.getCmekSettings",
30041	//   "parameterOrder": [
30042	//     "name"
30043	//   ],
30044	//   "parameters": {
30045	//     "name": {
30046	//       "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\" For example:\"organizations/12345/cmekSettings\"Note: CMEK for the Logs Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.",
30047	//       "location": "path",
30048	//       "pattern": "^[^/]+/[^/]+$",
30049	//       "required": true,
30050	//       "type": "string"
30051	//     }
30052	//   },
30053	//   "path": "v2/{+name}/cmekSettings",
30054	//   "response": {
30055	//     "$ref": "CmekSettings"
30056	//   },
30057	//   "scopes": [
30058	//     "https://www.googleapis.com/auth/cloud-platform",
30059	//     "https://www.googleapis.com/auth/cloud-platform.read-only",
30060	//     "https://www.googleapis.com/auth/logging.admin",
30061	//     "https://www.googleapis.com/auth/logging.read"
30062	//   ]
30063	// }
30064
30065}
30066
30067// method id "logging.updateCmekSettings":
30068
30069type V2UpdateCmekSettingsCall struct {
30070	s            *Service
30071	name         string
30072	cmeksettings *CmekSettings
30073	urlParams_   gensupport.URLParams
30074	ctx_         context.Context
30075	header_      http.Header
30076}
30077
30078// UpdateCmekSettings: Updates the Logs Router CMEK settings for the
30079// given resource.Note: CMEK for the Logs Router can currently only be
30080// configured for Google Cloud organizations. Once configured, it
30081// applies to all projects and folders in the Google Cloud
30082// organization.UpdateCmekSettings will fail if 1) kms_key_name is
30083// invalid, or 2) the associated service account does not have the
30084// required roles/cloudkms.cryptoKeyEncrypterDecrypter role assigned for
30085// the key, or 3) access to the key is disabled.See Enabling CMEK for
30086// Logs Router
30087// (https://cloud.google.com/logging/docs/routing/managed-encryption)
30088// for more information.
30089//
30090// - name: The resource name for the CMEK settings to update.
30091//   "projects/[PROJECT_ID]/cmekSettings"
30092//   "organizations/[ORGANIZATION_ID]/cmekSettings"
30093//   "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
30094//   "folders/[FOLDER_ID]/cmekSettings" For
30095//   example:"organizations/12345/cmekSettings"Note: CMEK for the Logs
30096//   Router can currently only be configured for Google Cloud
30097//   organizations. Once configured, it applies to all projects and
30098//   folders in the Google Cloud organization.
30099func (r *V2Service) UpdateCmekSettings(name string, cmeksettings *CmekSettings) *V2UpdateCmekSettingsCall {
30100	c := &V2UpdateCmekSettingsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
30101	c.name = name
30102	c.cmeksettings = cmeksettings
30103	return c
30104}
30105
30106// UpdateMask sets the optional parameter "updateMask": Field mask
30107// identifying which fields from cmek_settings should be updated. A
30108// field will be overwritten if and only if it is in the update mask.
30109// Output only fields cannot be updated.See FieldMask for more
30110// information.For example: "updateMask=kmsKeyName"
30111func (c *V2UpdateCmekSettingsCall) UpdateMask(updateMask string) *V2UpdateCmekSettingsCall {
30112	c.urlParams_.Set("updateMask", updateMask)
30113	return c
30114}
30115
30116// Fields allows partial responses to be retrieved. See
30117// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
30118// for more information.
30119func (c *V2UpdateCmekSettingsCall) Fields(s ...googleapi.Field) *V2UpdateCmekSettingsCall {
30120	c.urlParams_.Set("fields", googleapi.CombineFields(s))
30121	return c
30122}
30123
30124// Context sets the context to be used in this call's Do method. Any
30125// pending HTTP request will be aborted if the provided context is
30126// canceled.
30127func (c *V2UpdateCmekSettingsCall) Context(ctx context.Context) *V2UpdateCmekSettingsCall {
30128	c.ctx_ = ctx
30129	return c
30130}
30131
30132// Header returns an http.Header that can be modified by the caller to
30133// add HTTP headers to the request.
30134func (c *V2UpdateCmekSettingsCall) Header() http.Header {
30135	if c.header_ == nil {
30136		c.header_ = make(http.Header)
30137	}
30138	return c.header_
30139}
30140
30141func (c *V2UpdateCmekSettingsCall) doRequest(alt string) (*http.Response, error) {
30142	reqHeaders := make(http.Header)
30143	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20211027")
30144	for k, v := range c.header_ {
30145		reqHeaders[k] = v
30146	}
30147	reqHeaders.Set("User-Agent", c.s.userAgent())
30148	var body io.Reader = nil
30149	body, err := googleapi.WithoutDataWrapper.JSONReader(c.cmeksettings)
30150	if err != nil {
30151		return nil, err
30152	}
30153	reqHeaders.Set("Content-Type", "application/json")
30154	c.urlParams_.Set("alt", alt)
30155	c.urlParams_.Set("prettyPrint", "false")
30156	urls := googleapi.ResolveRelative(c.s.BasePath, "v2/{+name}/cmekSettings")
30157	urls += "?" + c.urlParams_.Encode()
30158	req, err := http.NewRequest("PATCH", urls, body)
30159	if err != nil {
30160		return nil, err
30161	}
30162	req.Header = reqHeaders
30163	googleapi.Expand(req.URL, map[string]string{
30164		"name": c.name,
30165	})
30166	return gensupport.SendRequest(c.ctx_, c.s.client, req)
30167}
30168
30169// Do executes the "logging.updateCmekSettings" call.
30170// Exactly one of *CmekSettings or error will be non-nil. Any non-2xx
30171// status code is an error. Response headers are in either
30172// *CmekSettings.ServerResponse.Header or (if a response was returned at
30173// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
30174// to check whether the returned error was because
30175// http.StatusNotModified was returned.
30176func (c *V2UpdateCmekSettingsCall) Do(opts ...googleapi.CallOption) (*CmekSettings, error) {
30177	gensupport.SetOptions(c.urlParams_, opts...)
30178	res, err := c.doRequest("json")
30179	if res != nil && res.StatusCode == http.StatusNotModified {
30180		if res.Body != nil {
30181			res.Body.Close()
30182		}
30183		return nil, &googleapi.Error{
30184			Code:   res.StatusCode,
30185			Header: res.Header,
30186		}
30187	}
30188	if err != nil {
30189		return nil, err
30190	}
30191	defer googleapi.CloseBody(res)
30192	if err := googleapi.CheckResponse(res); err != nil {
30193		return nil, err
30194	}
30195	ret := &CmekSettings{
30196		ServerResponse: googleapi.ServerResponse{
30197			Header:         res.Header,
30198			HTTPStatusCode: res.StatusCode,
30199		},
30200	}
30201	target := &ret
30202	if err := gensupport.DecodeResponse(target, res); err != nil {
30203		return nil, err
30204	}
30205	return ret, nil
30206	// {
30207	//   "description": "Updates the Logs Router CMEK settings for the given resource.Note: CMEK for the Logs Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud 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.",
30208	//   "flatPath": "v2/{v2Id}/{v2Id1}/cmekSettings",
30209	//   "httpMethod": "PATCH",
30210	//   "id": "logging.updateCmekSettings",
30211	//   "parameterOrder": [
30212	//     "name"
30213	//   ],
30214	//   "parameters": {
30215	//     "name": {
30216	//       "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\" For example:\"organizations/12345/cmekSettings\"Note: CMEK for the Logs Router can currently only be configured for Google Cloud organizations. Once configured, it applies to all projects and folders in the Google Cloud organization.",
30217	//       "location": "path",
30218	//       "pattern": "^[^/]+/[^/]+$",
30219	//       "required": true,
30220	//       "type": "string"
30221	//     },
30222	//     "updateMask": {
30223	//       "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.For example: \"updateMask=kmsKeyName\"",
30224	//       "format": "google-fieldmask",
30225	//       "location": "query",
30226	//       "type": "string"
30227	//     }
30228	//   },
30229	//   "path": "v2/{+name}/cmekSettings",
30230	//   "request": {
30231	//     "$ref": "CmekSettings"
30232	//   },
30233	//   "response": {
30234	//     "$ref": "CmekSettings"
30235	//   },
30236	//   "scopes": [
30237	//     "https://www.googleapis.com/auth/cloud-platform",
30238	//     "https://www.googleapis.com/auth/logging.admin"
30239	//   ]
30240	// }
30241
30242}
30243