1// Copyright YEAR 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 Google Cloud Logging API.
8//
9// This package is DEPRECATED. Use package cloud.google.com/go/logging instead.
10//
11// Creating a client
12//
13// Usage example:
14//
15//   import "google.golang.org/api/logging/v1beta3"
16//   ...
17//   ctx := context.Background()
18//   loggingService, err := logging.NewService(ctx)
19//
20// In this example, Google Application Default Credentials are used for authentication.
21//
22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
23//
24// Other authentication options
25//
26// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
27//
28//   loggingService, err := logging.NewService(ctx, option.WithAPIKey("AIza..."))
29//
30// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
31//
32//   config := &oauth2.Config{...}
33//   // ...
34//   token, err := config.Exchange(ctx, ...)
35//   loggingService, err := logging.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
36//
37// See https://godoc.org/google.golang.org/api/option/ for details on options.
38package logging // import "google.golang.org/api/logging/v1beta3"
39
40import (
41	"bytes"
42	"context"
43	"encoding/json"
44	"errors"
45	"fmt"
46	"io"
47	"net/http"
48	"net/url"
49	"strconv"
50	"strings"
51
52	googleapi "google.golang.org/api/googleapi"
53	gensupport "google.golang.org/api/internal/gensupport"
54	option "google.golang.org/api/option"
55	internaloption "google.golang.org/api/option/internaloption"
56	htransport "google.golang.org/api/transport/http"
57)
58
59// Always reference these packages, just in case the auto-generated code
60// below doesn't.
61var _ = bytes.NewBuffer
62var _ = strconv.Itoa
63var _ = fmt.Sprintf
64var _ = json.NewDecoder
65var _ = io.Copy
66var _ = url.Parse
67var _ = gensupport.MarshalJSON
68var _ = googleapi.Version
69var _ = errors.New
70var _ = strings.Replace
71var _ = context.Canceled
72var _ = internaloption.WithDefaultEndpoint
73
74const apiId = "logging:v1beta3"
75const apiName = "logging"
76const apiVersion = "v1beta3"
77const basePath = "https://logging.googleapis.com/"
78const mtlsBasePath = "https://logging.mtls.googleapis.com/"
79
80// OAuth2 scopes used by this API.
81const (
82	// View and manage your data across Google Cloud Platform services
83	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
84)
85
86// NewService creates a new Service.
87func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
88	scopesOption := option.WithScopes(
89		"https://www.googleapis.com/auth/cloud-platform",
90	)
91	// NOTE: prepend, so we don't override user-specified scopes.
92	opts = append([]option.ClientOption{scopesOption}, opts...)
93	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
94	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
95	client, endpoint, err := htransport.NewClient(ctx, opts...)
96	if err != nil {
97		return nil, err
98	}
99	s, err := New(client)
100	if err != nil {
101		return nil, err
102	}
103	if endpoint != "" {
104		s.BasePath = endpoint
105	}
106	return s, nil
107}
108
109// New creates a new Service. It uses the provided http.Client for requests.
110//
111// Deprecated: please use NewService instead.
112// To provide a custom HTTP client, use option.WithHTTPClient.
113// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
114func New(client *http.Client) (*Service, error) {
115	if client == nil {
116		return nil, errors.New("client is nil")
117	}
118	s := &Service{client: client, BasePath: basePath}
119	s.Projects = NewProjectsService(s)
120	return s, nil
121}
122
123type Service struct {
124	client    *http.Client
125	BasePath  string // API endpoint base URL
126	UserAgent string // optional additional User-Agent fragment
127
128	Projects *ProjectsService
129}
130
131func (s *Service) userAgent() string {
132	if s.UserAgent == "" {
133		return googleapi.UserAgent
134	}
135	return googleapi.UserAgent + " " + s.UserAgent
136}
137
138func NewProjectsService(s *Service) *ProjectsService {
139	rs := &ProjectsService{s: s}
140	rs.LogServices = NewProjectsLogServicesService(s)
141	rs.Logs = NewProjectsLogsService(s)
142	return rs
143}
144
145type ProjectsService struct {
146	s *Service
147
148	LogServices *ProjectsLogServicesService
149
150	Logs *ProjectsLogsService
151}
152
153func NewProjectsLogServicesService(s *Service) *ProjectsLogServicesService {
154	rs := &ProjectsLogServicesService{s: s}
155	rs.Indexes = NewProjectsLogServicesIndexesService(s)
156	rs.Sinks = NewProjectsLogServicesSinksService(s)
157	return rs
158}
159
160type ProjectsLogServicesService struct {
161	s *Service
162
163	Indexes *ProjectsLogServicesIndexesService
164
165	Sinks *ProjectsLogServicesSinksService
166}
167
168func NewProjectsLogServicesIndexesService(s *Service) *ProjectsLogServicesIndexesService {
169	rs := &ProjectsLogServicesIndexesService{s: s}
170	return rs
171}
172
173type ProjectsLogServicesIndexesService struct {
174	s *Service
175}
176
177func NewProjectsLogServicesSinksService(s *Service) *ProjectsLogServicesSinksService {
178	rs := &ProjectsLogServicesSinksService{s: s}
179	return rs
180}
181
182type ProjectsLogServicesSinksService struct {
183	s *Service
184}
185
186func NewProjectsLogsService(s *Service) *ProjectsLogsService {
187	rs := &ProjectsLogsService{s: s}
188	rs.Entries = NewProjectsLogsEntriesService(s)
189	rs.Sinks = NewProjectsLogsSinksService(s)
190	return rs
191}
192
193type ProjectsLogsService struct {
194	s *Service
195
196	Entries *ProjectsLogsEntriesService
197
198	Sinks *ProjectsLogsSinksService
199}
200
201func NewProjectsLogsEntriesService(s *Service) *ProjectsLogsEntriesService {
202	rs := &ProjectsLogsEntriesService{s: s}
203	return rs
204}
205
206type ProjectsLogsEntriesService struct {
207	s *Service
208}
209
210func NewProjectsLogsSinksService(s *Service) *ProjectsLogsSinksService {
211	rs := &ProjectsLogsSinksService{s: s}
212	return rs
213}
214
215type ProjectsLogsSinksService struct {
216	s *Service
217}
218
219// Empty: A generic empty message that you can re-use to avoid defining
220// duplicated empty messages in your APIs. A typical example is to use
221// it as the request or the response type of an API method. For
222// instance: service Foo { rpc Bar(google.protobuf.Empty) returns
223// (google.protobuf.Empty); }
224type Empty struct {
225	// ServerResponse contains the HTTP response code and headers from the
226	// server.
227	googleapi.ServerResponse `json:"-"`
228}
229
230// ListLogServiceIndexesResponse: Result returned from
231// ListLogServiceIndexesRequest.
232type ListLogServiceIndexesResponse struct {
233	// NextPageToken: If there are more results, then `nextPageToken` is
234	// returned in the response. To get the next batch of indexes, use the
235	// value of `nextPageToken` as `pageToken` in the next call of
236	// `ListLogServiceIndexess`. If `nextPageToken` is empty, then there are
237	// no more results.
238	NextPageToken string `json:"nextPageToken,omitempty"`
239
240	// ServiceIndexPrefixes: A list of log service index prefixes.
241	ServiceIndexPrefixes []string `json:"serviceIndexPrefixes,omitempty"`
242
243	// ServerResponse contains the HTTP response code and headers from the
244	// server.
245	googleapi.ServerResponse `json:"-"`
246
247	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
248	// unconditionally include in API requests. By default, fields with
249	// empty values are omitted from API requests. However, any non-pointer,
250	// non-interface field appearing in ForceSendFields will be sent to the
251	// server regardless of whether the field is empty or not. This may be
252	// used to include empty fields in Patch requests.
253	ForceSendFields []string `json:"-"`
254
255	// NullFields is a list of field names (e.g. "NextPageToken") to include
256	// in API requests with the JSON null value. By default, fields with
257	// empty values are omitted from API requests. However, any field with
258	// an empty value appearing in NullFields will be sent to the server as
259	// null. It is an error if a field in this list has a non-empty value.
260	// This may be used to include null fields in Patch requests.
261	NullFields []string `json:"-"`
262}
263
264func (s *ListLogServiceIndexesResponse) MarshalJSON() ([]byte, error) {
265	type NoMethod ListLogServiceIndexesResponse
266	raw := NoMethod(*s)
267	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
268}
269
270// ListLogServiceSinksResponse: Result returned from
271// `ListLogServiceSinks`.
272type ListLogServiceSinksResponse struct {
273	// Sinks: The requested log service sinks. If any of the returned
274	// `LogSink` objects have an empty `destination` field, then call
275	// `logServices.sinks.get` to retrieve the complete `LogSink` object.
276	Sinks []*LogSink `json:"sinks,omitempty"`
277
278	// ServerResponse contains the HTTP response code and headers from the
279	// server.
280	googleapi.ServerResponse `json:"-"`
281
282	// ForceSendFields is a list of field names (e.g. "Sinks") to
283	// unconditionally include in API requests. By default, fields with
284	// empty values are omitted from API requests. However, any non-pointer,
285	// non-interface field appearing in ForceSendFields will be sent to the
286	// server regardless of whether the field is empty or not. This may be
287	// used to include empty fields in Patch requests.
288	ForceSendFields []string `json:"-"`
289
290	// NullFields is a list of field names (e.g. "Sinks") to include in API
291	// requests with the JSON null value. By default, fields with empty
292	// values are omitted from API requests. However, any field with an
293	// empty value appearing in NullFields will be sent to the server as
294	// null. It is an error if a field in this list has a non-empty value.
295	// This may be used to include null fields in Patch requests.
296	NullFields []string `json:"-"`
297}
298
299func (s *ListLogServiceSinksResponse) MarshalJSON() ([]byte, error) {
300	type NoMethod ListLogServiceSinksResponse
301	raw := NoMethod(*s)
302	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
303}
304
305// ListLogServicesResponse: Result returned from
306// `ListLogServicesRequest`.
307type ListLogServicesResponse struct {
308	// LogServices: A list of log services.
309	LogServices []*LogService `json:"logServices,omitempty"`
310
311	// NextPageToken: If there are more results, then `nextPageToken` is
312	// returned in the response. To get the next batch of services, use the
313	// value of `nextPageToken` as `pageToken` in the next call of
314	// `ListLogServices`. If `nextPageToken` is empty, then there are no
315	// more results.
316	NextPageToken string `json:"nextPageToken,omitempty"`
317
318	// ServerResponse contains the HTTP response code and headers from the
319	// server.
320	googleapi.ServerResponse `json:"-"`
321
322	// ForceSendFields is a list of field names (e.g. "LogServices") to
323	// unconditionally include in API requests. By default, fields with
324	// empty values are omitted from API requests. However, any non-pointer,
325	// non-interface field appearing in ForceSendFields will be sent to the
326	// server regardless of whether the field is empty or not. This may be
327	// used to include empty fields in Patch requests.
328	ForceSendFields []string `json:"-"`
329
330	// NullFields is a list of field names (e.g. "LogServices") to include
331	// in API requests with the JSON null value. By default, fields with
332	// empty values are omitted from API requests. However, any field with
333	// an empty value appearing in NullFields will be sent to the server as
334	// null. It is an error if a field in this list has a non-empty value.
335	// This may be used to include null fields in Patch requests.
336	NullFields []string `json:"-"`
337}
338
339func (s *ListLogServicesResponse) MarshalJSON() ([]byte, error) {
340	type NoMethod ListLogServicesResponse
341	raw := NoMethod(*s)
342	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
343}
344
345// ListLogSinksResponse: Result returned from `ListLogSinks`.
346type ListLogSinksResponse struct {
347	// Sinks: The requested log sinks. If any of the returned `LogSink`
348	// objects have an empty `destination` field, then call
349	// `logServices.sinks.get` to retrieve the complete `LogSink` object.
350	Sinks []*LogSink `json:"sinks,omitempty"`
351
352	// ServerResponse contains the HTTP response code and headers from the
353	// server.
354	googleapi.ServerResponse `json:"-"`
355
356	// ForceSendFields is a list of field names (e.g. "Sinks") to
357	// unconditionally include in API requests. By default, fields with
358	// empty values are omitted from API requests. However, any non-pointer,
359	// non-interface field appearing in ForceSendFields will be sent to the
360	// server regardless of whether the field is empty or not. This may be
361	// used to include empty fields in Patch requests.
362	ForceSendFields []string `json:"-"`
363
364	// NullFields is a list of field names (e.g. "Sinks") to include in API
365	// requests with the JSON null value. By default, fields with empty
366	// values are omitted from API requests. However, any field with an
367	// empty value appearing in NullFields will be sent to the server as
368	// null. It is an error if a field in this list has a non-empty value.
369	// This may be used to include null fields in Patch requests.
370	NullFields []string `json:"-"`
371}
372
373func (s *ListLogSinksResponse) MarshalJSON() ([]byte, error) {
374	type NoMethod ListLogSinksResponse
375	raw := NoMethod(*s)
376	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
377}
378
379// ListLogsResponse: Result returned from ListLogs.
380type ListLogsResponse struct {
381	// Logs: A list of log resources.
382	Logs []*Log `json:"logs,omitempty"`
383
384	// NextPageToken: If there are more results, then `nextPageToken` is
385	// returned in the response. To get the next batch of logs, use the
386	// value of `nextPageToken` as `pageToken` in the next call of
387	// `ListLogs`. If `nextPageToken` is empty, then there are no more
388	// results.
389	NextPageToken string `json:"nextPageToken,omitempty"`
390
391	// ServerResponse contains the HTTP response code and headers from the
392	// server.
393	googleapi.ServerResponse `json:"-"`
394
395	// ForceSendFields is a list of field names (e.g. "Logs") to
396	// unconditionally include in API requests. By default, fields with
397	// empty values are omitted from API requests. However, any non-pointer,
398	// non-interface field appearing in ForceSendFields will be sent to the
399	// server regardless of whether the field is empty or not. This may be
400	// used to include empty fields in Patch requests.
401	ForceSendFields []string `json:"-"`
402
403	// NullFields is a list of field names (e.g. "Logs") to include in API
404	// requests with the JSON null value. By default, fields with empty
405	// values are omitted from API requests. However, any field with an
406	// empty value appearing in NullFields will be sent to the server as
407	// null. It is an error if a field in this list has a non-empty value.
408	// This may be used to include null fields in Patch requests.
409	NullFields []string `json:"-"`
410}
411
412func (s *ListLogsResponse) MarshalJSON() ([]byte, error) {
413	type NoMethod ListLogsResponse
414	raw := NoMethod(*s)
415	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
416}
417
418// Log: A log object.
419type Log struct {
420	// DisplayName: Name used when displaying the log to the user (for
421	// example, in a UI). Example: "activity_log"
422	DisplayName string `json:"displayName,omitempty"`
423
424	// Name: REQUIRED: The log's name name. Example:
425	// "compute.googleapis.com/activity_log".
426	Name string `json:"name,omitempty"`
427
428	// PayloadType: Type URL describing the expected payload type for the
429	// log.
430	PayloadType string `json:"payloadType,omitempty"`
431
432	// ForceSendFields is a list of field names (e.g. "DisplayName") to
433	// unconditionally include in API requests. By default, fields with
434	// empty values are omitted from API requests. However, any non-pointer,
435	// non-interface field appearing in ForceSendFields will be sent to the
436	// server regardless of whether the field is empty or not. This may be
437	// used to include empty fields in Patch requests.
438	ForceSendFields []string `json:"-"`
439
440	// NullFields is a list of field names (e.g. "DisplayName") to include
441	// in API requests with the JSON null value. By default, fields with
442	// empty values are omitted from API requests. However, any field with
443	// an empty value appearing in NullFields will be sent to the server as
444	// null. It is an error if a field in this list has a non-empty value.
445	// This may be used to include null fields in Patch requests.
446	NullFields []string `json:"-"`
447}
448
449func (s *Log) MarshalJSON() ([]byte, error) {
450	type NoMethod Log
451	raw := NoMethod(*s)
452	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
453}
454
455// LogEntry: An individual entry in a log.
456type LogEntry struct {
457	// InsertId: A unique ID for the log entry. If you provide this field,
458	// the logging service considers other log entries in the same log with
459	// the same ID as duplicates which can be removed.
460	InsertId string `json:"insertId,omitempty"`
461
462	// Log: The log to which this entry belongs. When a log entry is
463	// ingested, the value of this field is set by the logging system.
464	Log string `json:"log,omitempty"`
465
466	// Metadata: Information about the log entry.
467	Metadata *LogEntryMetadata `json:"metadata,omitempty"`
468
469	// ProtoPayload: The log entry payload, represented as a protocol buffer
470	// that is expressed as a JSON object. You can only pass `protoPayload`
471	// values that belong to a set of approved types.
472	ProtoPayload googleapi.RawMessage `json:"protoPayload,omitempty"`
473
474	// StructPayload: The log entry payload, represented as a structure that
475	// is expressed as a JSON object.
476	StructPayload googleapi.RawMessage `json:"structPayload,omitempty"`
477
478	// TextPayload: The log entry payload, represented as a text string.
479	TextPayload string `json:"textPayload,omitempty"`
480
481	// ForceSendFields is a list of field names (e.g. "InsertId") to
482	// unconditionally include in API requests. By default, fields with
483	// empty values are omitted from API requests. However, any non-pointer,
484	// non-interface field appearing in ForceSendFields will be sent to the
485	// server regardless of whether the field is empty or not. This may be
486	// used to include empty fields in Patch requests.
487	ForceSendFields []string `json:"-"`
488
489	// NullFields is a list of field names (e.g. "InsertId") to include in
490	// API requests with the JSON null value. By default, fields with empty
491	// values are omitted from API requests. However, any field with an
492	// empty value appearing in NullFields will be sent to the server as
493	// null. It is an error if a field in this list has a non-empty value.
494	// This may be used to include null fields in Patch requests.
495	NullFields []string `json:"-"`
496}
497
498func (s *LogEntry) MarshalJSON() ([]byte, error) {
499	type NoMethod LogEntry
500	raw := NoMethod(*s)
501	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
502}
503
504// LogEntryMetadata: Additional data that is associated with a log
505// entry, set by the service creating the log entry.
506type LogEntryMetadata struct {
507	// Labels: A set of (key, value) data that provides additional
508	// information about the log entry. If the log entry is from one of the
509	// Google Cloud Platform sources listed below, the indicated (key,
510	// value) information must be provided: Google App Engine, service_name
511	// `appengine.googleapis.com`: "appengine.googleapis.com/module_id",
512	// "appengine.googleapis.com/version_id",  and one of:
513	// "appengine.googleapis.com/replica_index",
514	// "appengine.googleapis.com/clone_id",  or else provide the following
515	// Compute Engine labels: Google Compute Engine, service_name
516	// `compute.googleapis.com`: "compute.googleapis.com/resource_type",
517	// "instance" "compute.googleapis.com/resource_id",
518	Labels map[string]string `json:"labels,omitempty"`
519
520	// ProjectId: The project ID of the Google Cloud Platform service that
521	// created the log entry.
522	ProjectId string `json:"projectId,omitempty"`
523
524	// Region: The region name of the Google Cloud Platform service that
525	// created the log entry. For example, "us-central1".
526	Region string `json:"region,omitempty"`
527
528	// ServiceName: The API name of the Google Cloud Platform service that
529	// created the log entry. For example, "compute.googleapis.com".
530	ServiceName string `json:"serviceName,omitempty"`
531
532	// Severity: The severity of the log entry.
533	//
534	// Possible values:
535	//   "DEFAULT" - This is the DEFAULT description
536	//   "DEBUG" - This is the DEBUG description
537	//   "INFO" - This is the INFO description
538	//   "NOTICE" - This is the NOTICE description
539	//   "WARNING" - This is the WARNING description
540	//   "ERROR" - This is the ERROR description
541	//   "CRITICAL" - This is the CRITICAL description
542	//   "ALERT" - This is the ALERT description
543	//   "EMERGENCY" (default) - This is the EMERGENCY description
544	Severity string `json:"severity,omitempty"`
545
546	// Timestamp: The time the event described by the log entry occurred.
547	// Timestamps must be later than January 1, 1970.
548	Timestamp string `json:"timestamp,omitempty"`
549
550	// UserId: The fully-qualified email address of the authenticated user
551	// that performed or requested the action represented by the log entry.
552	// If the log entry does not apply to an action taken by an
553	// authenticated user, then the field should be empty.
554	UserId string `json:"userId,omitempty"`
555
556	// Zone: The zone of the Google Cloud Platform service that created the
557	// log entry. For example, "us-central1-a".
558	Zone string `json:"zone,omitempty"`
559
560	// ForceSendFields is a list of field names (e.g. "Labels") to
561	// unconditionally include in API requests. By default, fields with
562	// empty values are omitted from API requests. However, any non-pointer,
563	// non-interface field appearing in ForceSendFields will be sent to the
564	// server regardless of whether the field is empty or not. This may be
565	// used to include empty fields in Patch requests.
566	ForceSendFields []string `json:"-"`
567
568	// NullFields is a list of field names (e.g. "Labels") to include in API
569	// requests with the JSON null value. By default, fields with empty
570	// values are omitted from API requests. However, any field with an
571	// empty value appearing in NullFields will be sent to the server as
572	// null. It is an error if a field in this list has a non-empty value.
573	// This may be used to include null fields in Patch requests.
574	NullFields []string `json:"-"`
575}
576
577func (s *LogEntryMetadata) MarshalJSON() ([]byte, error) {
578	type NoMethod LogEntryMetadata
579	raw := NoMethod(*s)
580	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
581}
582
583// LogError: A problem in a sink or the sink's configuration.
584type LogError struct {
585	// Resource: The resource associated with the error. It may be different
586	// from the sink destination. For example, the sink may point to a
587	// BigQuery dataset, but the error may refer to a table resource inside
588	// the dataset.
589	Resource string `json:"resource,omitempty"`
590
591	// Status: The description of the last error observed.
592	Status *Status `json:"status,omitempty"`
593
594	// TimeNanos: The last time the error was observed, in nanoseconds since
595	// the Unix epoch.
596	TimeNanos int64 `json:"timeNanos,omitempty,string"`
597
598	// ForceSendFields is a list of field names (e.g. "Resource") to
599	// unconditionally include in API requests. By default, fields with
600	// empty values are omitted from API requests. However, any non-pointer,
601	// non-interface field appearing in ForceSendFields will be sent to the
602	// server regardless of whether the field is empty or not. This may be
603	// used to include empty fields in Patch requests.
604	ForceSendFields []string `json:"-"`
605
606	// NullFields is a list of field names (e.g. "Resource") to include in
607	// API requests with the JSON null value. By default, fields with empty
608	// values are omitted from API requests. However, any field with an
609	// empty value appearing in NullFields will be sent to the server as
610	// null. It is an error if a field in this list has a non-empty value.
611	// This may be used to include null fields in Patch requests.
612	NullFields []string `json:"-"`
613}
614
615func (s *LogError) MarshalJSON() ([]byte, error) {
616	type NoMethod LogError
617	raw := NoMethod(*s)
618	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
619}
620
621// LogService: A log service object.
622type LogService struct {
623	// IndexKeys: Label keys used when labeling log entries for this
624	// service. The order of the keys is significant, with higher priority
625	// keys coming earlier in the list.
626	IndexKeys []string `json:"indexKeys,omitempty"`
627
628	// Name: The service's name.
629	Name string `json:"name,omitempty"`
630
631	// ForceSendFields is a list of field names (e.g. "IndexKeys") to
632	// unconditionally include in API requests. By default, fields with
633	// empty values are omitted from API requests. However, any non-pointer,
634	// non-interface field appearing in ForceSendFields will be sent to the
635	// server regardless of whether the field is empty or not. This may be
636	// used to include empty fields in Patch requests.
637	ForceSendFields []string `json:"-"`
638
639	// NullFields is a list of field names (e.g. "IndexKeys") to include in
640	// API requests with the JSON null value. By default, fields with empty
641	// values are omitted from API requests. However, any field with an
642	// empty value appearing in NullFields will be sent to the server as
643	// null. It is an error if a field in this list has a non-empty value.
644	// This may be used to include null fields in Patch requests.
645	NullFields []string `json:"-"`
646}
647
648func (s *LogService) MarshalJSON() ([]byte, error) {
649	type NoMethod LogService
650	raw := NoMethod(*s)
651	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
652}
653
654// LogSink: An object that describes where a log may be written.
655type LogSink struct {
656	// Destination: The resource to send log entries to. The supported sink
657	// resource types are: + Google Cloud Storage:
658	// `storage.googleapis.com/BUCKET` or `BUCKET.storage.googleapis.com/` +
659	// Google BigQuery:
660	// `bigquery.googleapis.com/projects/PROJECT/datasets/DATASET` Currently
661	// the Cloud Logging API supports at most one sink for each resource
662	// type per log or log service resource.
663	Destination string `json:"destination,omitempty"`
664
665	// Errors: _Output only._ All active errors found for this sink.
666	Errors []*LogError `json:"errors,omitempty"`
667
668	// Name: The name of this sink. This is a client-assigned identifier for
669	// the resource. This is ignored by UpdateLogSink and
670	// UpdateLogServicesSink.
671	Name string `json:"name,omitempty"`
672
673	// ServerResponse contains the HTTP response code and headers from the
674	// server.
675	googleapi.ServerResponse `json:"-"`
676
677	// ForceSendFields is a list of field names (e.g. "Destination") to
678	// unconditionally include in API requests. By default, fields with
679	// empty values are omitted from API requests. However, any non-pointer,
680	// non-interface field appearing in ForceSendFields will be sent to the
681	// server regardless of whether the field is empty or not. This may be
682	// used to include empty fields in Patch requests.
683	ForceSendFields []string `json:"-"`
684
685	// NullFields is a list of field names (e.g. "Destination") to include
686	// in API requests with the JSON null value. By default, fields with
687	// empty values are omitted from API requests. However, any field with
688	// an empty value appearing in NullFields will be sent to the server as
689	// null. It is an error if a field in this list has a non-empty value.
690	// This may be used to include null fields in Patch requests.
691	NullFields []string `json:"-"`
692}
693
694func (s *LogSink) MarshalJSON() ([]byte, error) {
695	type NoMethod LogSink
696	raw := NoMethod(*s)
697	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
698}
699
700// Status: Represents the RPC error status for Google APIs. See
701// http://go/errormodel for details.
702type Status struct {
703	// Code: The status code, which should be an enum value of
704	// [google.rpc.Code][].
705	Code int64 `json:"code,omitempty"`
706
707	// Details: A list of messages that carry the error details. There will
708	// be a common set of message types for APIs to use.
709	Details []googleapi.RawMessage `json:"details,omitempty"`
710
711	// Message: A developer-facing error message, which should be in
712	// English. The user-facing error message should be localized and stored
713	// in the [google.rpc.Status.details][google.rpc.Status.details] field.
714	Message string `json:"message,omitempty"`
715
716	// ForceSendFields is a list of field names (e.g. "Code") to
717	// unconditionally include in API requests. By default, fields with
718	// empty values are omitted from API requests. However, any non-pointer,
719	// non-interface field appearing in ForceSendFields will be sent to the
720	// server regardless of whether the field is empty or not. This may be
721	// used to include empty fields in Patch requests.
722	ForceSendFields []string `json:"-"`
723
724	// NullFields is a list of field names (e.g. "Code") to include in API
725	// requests with the JSON null value. By default, fields with empty
726	// values are omitted from API requests. However, any field with an
727	// empty value appearing in NullFields will be sent to the server as
728	// null. It is an error if a field in this list has a non-empty value.
729	// This may be used to include null fields in Patch requests.
730	NullFields []string `json:"-"`
731}
732
733func (s *Status) MarshalJSON() ([]byte, error) {
734	type NoMethod Status
735	raw := NoMethod(*s)
736	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
737}
738
739// WriteLogEntriesRequest: The parameters to WriteLogEntries.
740type WriteLogEntriesRequest struct {
741	// CommonLabels: Metadata labels that apply to all entries in this
742	// request. If one of the log entries contains a (key, value) with the
743	// same key that is in `commonLabels`, then the entry's (key, value)
744	// overrides the one in `commonLabels`.
745	CommonLabels map[string]string `json:"commonLabels,omitempty"`
746
747	// Entries: Log entries to insert.
748	Entries []*LogEntry `json:"entries,omitempty"`
749
750	// ForceSendFields is a list of field names (e.g. "CommonLabels") to
751	// unconditionally include in API requests. By default, fields with
752	// empty values are omitted from API requests. However, any non-pointer,
753	// non-interface field appearing in ForceSendFields will be sent to the
754	// server regardless of whether the field is empty or not. This may be
755	// used to include empty fields in Patch requests.
756	ForceSendFields []string `json:"-"`
757
758	// NullFields is a list of field names (e.g. "CommonLabels") to include
759	// in API requests with the JSON null value. By default, fields with
760	// empty values are omitted from API requests. However, any field with
761	// an empty value appearing in NullFields will be sent to the server as
762	// null. It is an error if a field in this list has a non-empty value.
763	// This may be used to include null fields in Patch requests.
764	NullFields []string `json:"-"`
765}
766
767func (s *WriteLogEntriesRequest) MarshalJSON() ([]byte, error) {
768	type NoMethod WriteLogEntriesRequest
769	raw := NoMethod(*s)
770	return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
771}
772
773// WriteLogEntriesResponse: Result returned from WriteLogEntries. empty
774type WriteLogEntriesResponse struct {
775	// ServerResponse contains the HTTP response code and headers from the
776	// server.
777	googleapi.ServerResponse `json:"-"`
778}
779
780// method id "logging.projects.logServices.list":
781
782type ProjectsLogServicesListCall struct {
783	s            *Service
784	projectsId   string
785	urlParams_   gensupport.URLParams
786	ifNoneMatch_ string
787	ctx_         context.Context
788	header_      http.Header
789}
790
791// List: Lists log services associated with log entries ingested for a
792// project.
793//
794// - projectsId: Part of `projectName`. The project resource whose
795//   services are to be listed.
796func (r *ProjectsLogServicesService) List(projectsId string) *ProjectsLogServicesListCall {
797	c := &ProjectsLogServicesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
798	c.projectsId = projectsId
799	return c
800}
801
802// Log sets the optional parameter "log": The name of the log resource
803// whose services are to be listed. log for which to list services. When
804// empty, all services are listed.
805func (c *ProjectsLogServicesListCall) Log(log string) *ProjectsLogServicesListCall {
806	c.urlParams_.Set("log", log)
807	return c
808}
809
810// PageSize sets the optional parameter "pageSize": The maximum number
811// of `LogService` objects to return in one operation.
812func (c *ProjectsLogServicesListCall) PageSize(pageSize int64) *ProjectsLogServicesListCall {
813	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
814	return c
815}
816
817// PageToken sets the optional parameter "pageToken": An opaque token,
818// returned as `nextPageToken` by a prior `ListLogServices` operation.
819// If `pageToken` is supplied, then the other fields of this request are
820// ignored, and instead the previous `ListLogServices` operation is
821// continued.
822func (c *ProjectsLogServicesListCall) PageToken(pageToken string) *ProjectsLogServicesListCall {
823	c.urlParams_.Set("pageToken", pageToken)
824	return c
825}
826
827// Fields allows partial responses to be retrieved. See
828// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
829// for more information.
830func (c *ProjectsLogServicesListCall) Fields(s ...googleapi.Field) *ProjectsLogServicesListCall {
831	c.urlParams_.Set("fields", googleapi.CombineFields(s))
832	return c
833}
834
835// IfNoneMatch sets the optional parameter which makes the operation
836// fail if the object's ETag matches the given value. This is useful for
837// getting updates only after the object has changed since the last
838// request. Use googleapi.IsNotModified to check whether the response
839// error from Do is the result of In-None-Match.
840func (c *ProjectsLogServicesListCall) IfNoneMatch(entityTag string) *ProjectsLogServicesListCall {
841	c.ifNoneMatch_ = entityTag
842	return c
843}
844
845// Context sets the context to be used in this call's Do method. Any
846// pending HTTP request will be aborted if the provided context is
847// canceled.
848func (c *ProjectsLogServicesListCall) Context(ctx context.Context) *ProjectsLogServicesListCall {
849	c.ctx_ = ctx
850	return c
851}
852
853// Header returns an http.Header that can be modified by the caller to
854// add HTTP headers to the request.
855func (c *ProjectsLogServicesListCall) Header() http.Header {
856	if c.header_ == nil {
857		c.header_ = make(http.Header)
858	}
859	return c.header_
860}
861
862func (c *ProjectsLogServicesListCall) doRequest(alt string) (*http.Response, error) {
863	reqHeaders := make(http.Header)
864	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/00000000")
865	for k, v := range c.header_ {
866		reqHeaders[k] = v
867	}
868	reqHeaders.Set("User-Agent", c.s.userAgent())
869	if c.ifNoneMatch_ != "" {
870		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
871	}
872	var body io.Reader = nil
873	c.urlParams_.Set("alt", alt)
874	c.urlParams_.Set("prettyPrint", "false")
875	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices")
876	urls += "?" + c.urlParams_.Encode()
877	req, err := http.NewRequest("GET", urls, body)
878	if err != nil {
879		return nil, err
880	}
881	req.Header = reqHeaders
882	googleapi.Expand(req.URL, map[string]string{
883		"projectsId": c.projectsId,
884	})
885	return gensupport.SendRequest(c.ctx_, c.s.client, req)
886}
887
888// Do executes the "logging.projects.logServices.list" call.
889// Exactly one of *ListLogServicesResponse or error will be non-nil. Any
890// non-2xx status code is an error. Response headers are in either
891// *ListLogServicesResponse.ServerResponse.Header or (if a response was
892// returned at all) in error.(*googleapi.Error).Header. Use
893// googleapi.IsNotModified to check whether the returned error was
894// because http.StatusNotModified was returned.
895func (c *ProjectsLogServicesListCall) Do(opts ...googleapi.CallOption) (*ListLogServicesResponse, error) {
896	gensupport.SetOptions(c.urlParams_, opts...)
897	res, err := c.doRequest("json")
898	if res != nil && res.StatusCode == http.StatusNotModified {
899		if res.Body != nil {
900			res.Body.Close()
901		}
902		return nil, &googleapi.Error{
903			Code:   res.StatusCode,
904			Header: res.Header,
905		}
906	}
907	if err != nil {
908		return nil, err
909	}
910	defer googleapi.CloseBody(res)
911	if err := googleapi.CheckResponse(res); err != nil {
912		return nil, err
913	}
914	ret := &ListLogServicesResponse{
915		ServerResponse: googleapi.ServerResponse{
916			Header:         res.Header,
917			HTTPStatusCode: res.StatusCode,
918		},
919	}
920	target := &ret
921	if err := gensupport.DecodeResponse(target, res); err != nil {
922		return nil, err
923	}
924	return ret, nil
925	// {
926	//   "description": "Lists log services associated with log entries ingested for a project.",
927	//   "httpMethod": "GET",
928	//   "id": "logging.projects.logServices.list",
929	//   "parameterOrder": [
930	//     "projectsId"
931	//   ],
932	//   "parameters": {
933	//     "log": {
934	//       "description": "The name of the log resource whose services are to be listed. log for which to list services. When empty, all services are listed.",
935	//       "location": "query",
936	//       "type": "string"
937	//     },
938	//     "pageSize": {
939	//       "description": "The maximum number of `LogService` objects to return in one operation.",
940	//       "format": "int32",
941	//       "location": "query",
942	//       "type": "integer"
943	//     },
944	//     "pageToken": {
945	//       "description": "An opaque token, returned as `nextPageToken` by a prior `ListLogServices` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogServices` operation is continued.",
946	//       "location": "query",
947	//       "type": "string"
948	//     },
949	//     "projectsId": {
950	//       "description": "Part of `projectName`. The project resource whose services are to be listed.",
951	//       "location": "path",
952	//       "required": true,
953	//       "type": "string"
954	//     }
955	//   },
956	//   "path": "v1beta3/projects/{projectsId}/logServices",
957	//   "response": {
958	//     "$ref": "ListLogServicesResponse"
959	//   },
960	//   "scopes": [
961	//     "https://www.googleapis.com/auth/cloud-platform"
962	//   ]
963	// }
964
965}
966
967// Pages invokes f for each page of results.
968// A non-nil error returned from f will halt the iteration.
969// The provided context supersedes any context provided to the Context method.
970func (c *ProjectsLogServicesListCall) Pages(ctx context.Context, f func(*ListLogServicesResponse) error) error {
971	c.ctx_ = ctx
972	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
973	for {
974		x, err := c.Do()
975		if err != nil {
976			return err
977		}
978		if err := f(x); err != nil {
979			return err
980		}
981		if x.NextPageToken == "" {
982			return nil
983		}
984		c.PageToken(x.NextPageToken)
985	}
986}
987
988// method id "logging.projects.logServices.indexes.list":
989
990type ProjectsLogServicesIndexesListCall struct {
991	s             *Service
992	projectsId    string
993	logServicesId string
994	urlParams_    gensupport.URLParams
995	ifNoneMatch_  string
996	ctx_          context.Context
997	header_       http.Header
998}
999
1000// List: Lists log service indexes associated with a log service.
1001//
1002// - logServicesId: Part of `serviceName`. See documentation of
1003//   `projectsId`.
1004// - projectsId: Part of `serviceName`. A log service resource of the
1005//   form `/projects/*/logServices/*`. The service indexes of the log
1006//   service are returned. Example:
1007//   "/projects/myProj/logServices/appengine.googleapis.com".
1008func (r *ProjectsLogServicesIndexesService) List(projectsId string, logServicesId string) *ProjectsLogServicesIndexesListCall {
1009	c := &ProjectsLogServicesIndexesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1010	c.projectsId = projectsId
1011	c.logServicesId = logServicesId
1012	return c
1013}
1014
1015// Depth sets the optional parameter "depth": A limit to the number of
1016// levels of the index hierarchy that are expanded. If `depth` is 0, it
1017// defaults to the level specified by the prefix field (the number of
1018// slash separators). The default empty prefix implies a `depth` of 1.
1019// It is an error for `depth` to be any non-zero value less than the
1020// number of components in `indexPrefix`.
1021func (c *ProjectsLogServicesIndexesListCall) Depth(depth int64) *ProjectsLogServicesIndexesListCall {
1022	c.urlParams_.Set("depth", fmt.Sprint(depth))
1023	return c
1024}
1025
1026// IndexPrefix sets the optional parameter "indexPrefix": Restricts the
1027// indexes returned to be those with a specified prefix. The prefix has
1028// the form "/label_value/label_value/...", in order corresponding to
1029// the [`LogService
1030// indexKeys`][google.logging.v1.LogService.index_keys]. Non-empty
1031// prefixes must begin with `/` . Example prefixes: + "/myModule/"
1032// retrieves App Engine versions associated with `myModule`. The
1033// trailing slash terminates the value. + "/myModule" retrieves App
1034// Engine modules with names beginning with `myModule`. + "" retrieves
1035// all indexes.
1036func (c *ProjectsLogServicesIndexesListCall) IndexPrefix(indexPrefix string) *ProjectsLogServicesIndexesListCall {
1037	c.urlParams_.Set("indexPrefix", indexPrefix)
1038	return c
1039}
1040
1041// Log sets the optional parameter "log": A log resource like
1042// `/projects/project_id/logs/log_name`, identifying the log for which
1043// to list service indexes.
1044func (c *ProjectsLogServicesIndexesListCall) Log(log string) *ProjectsLogServicesIndexesListCall {
1045	c.urlParams_.Set("log", log)
1046	return c
1047}
1048
1049// PageSize sets the optional parameter "pageSize": The maximum number
1050// of log service index resources to return in one operation.
1051func (c *ProjectsLogServicesIndexesListCall) PageSize(pageSize int64) *ProjectsLogServicesIndexesListCall {
1052	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
1053	return c
1054}
1055
1056// PageToken sets the optional parameter "pageToken": An opaque token,
1057// returned as `nextPageToken` by a prior `ListLogServiceIndexes`
1058// operation. If `pageToken` is supplied, then the other fields of this
1059// request are ignored, and instead the previous `ListLogServiceIndexes`
1060// operation is continued.
1061func (c *ProjectsLogServicesIndexesListCall) PageToken(pageToken string) *ProjectsLogServicesIndexesListCall {
1062	c.urlParams_.Set("pageToken", pageToken)
1063	return c
1064}
1065
1066// Fields allows partial responses to be retrieved. See
1067// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1068// for more information.
1069func (c *ProjectsLogServicesIndexesListCall) Fields(s ...googleapi.Field) *ProjectsLogServicesIndexesListCall {
1070	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1071	return c
1072}
1073
1074// IfNoneMatch sets the optional parameter which makes the operation
1075// fail if the object's ETag matches the given value. This is useful for
1076// getting updates only after the object has changed since the last
1077// request. Use googleapi.IsNotModified to check whether the response
1078// error from Do is the result of In-None-Match.
1079func (c *ProjectsLogServicesIndexesListCall) IfNoneMatch(entityTag string) *ProjectsLogServicesIndexesListCall {
1080	c.ifNoneMatch_ = entityTag
1081	return c
1082}
1083
1084// Context sets the context to be used in this call's Do method. Any
1085// pending HTTP request will be aborted if the provided context is
1086// canceled.
1087func (c *ProjectsLogServicesIndexesListCall) Context(ctx context.Context) *ProjectsLogServicesIndexesListCall {
1088	c.ctx_ = ctx
1089	return c
1090}
1091
1092// Header returns an http.Header that can be modified by the caller to
1093// add HTTP headers to the request.
1094func (c *ProjectsLogServicesIndexesListCall) Header() http.Header {
1095	if c.header_ == nil {
1096		c.header_ = make(http.Header)
1097	}
1098	return c.header_
1099}
1100
1101func (c *ProjectsLogServicesIndexesListCall) doRequest(alt string) (*http.Response, error) {
1102	reqHeaders := make(http.Header)
1103	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/00000000")
1104	for k, v := range c.header_ {
1105		reqHeaders[k] = v
1106	}
1107	reqHeaders.Set("User-Agent", c.s.userAgent())
1108	if c.ifNoneMatch_ != "" {
1109		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1110	}
1111	var body io.Reader = nil
1112	c.urlParams_.Set("alt", alt)
1113	c.urlParams_.Set("prettyPrint", "false")
1114	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/indexes")
1115	urls += "?" + c.urlParams_.Encode()
1116	req, err := http.NewRequest("GET", urls, body)
1117	if err != nil {
1118		return nil, err
1119	}
1120	req.Header = reqHeaders
1121	googleapi.Expand(req.URL, map[string]string{
1122		"projectsId":    c.projectsId,
1123		"logServicesId": c.logServicesId,
1124	})
1125	return gensupport.SendRequest(c.ctx_, c.s.client, req)
1126}
1127
1128// Do executes the "logging.projects.logServices.indexes.list" call.
1129// Exactly one of *ListLogServiceIndexesResponse or error will be
1130// non-nil. Any non-2xx status code is an error. Response headers are in
1131// either *ListLogServiceIndexesResponse.ServerResponse.Header or (if a
1132// response was returned at all) in error.(*googleapi.Error).Header. Use
1133// googleapi.IsNotModified to check whether the returned error was
1134// because http.StatusNotModified was returned.
1135func (c *ProjectsLogServicesIndexesListCall) Do(opts ...googleapi.CallOption) (*ListLogServiceIndexesResponse, error) {
1136	gensupport.SetOptions(c.urlParams_, opts...)
1137	res, err := c.doRequest("json")
1138	if res != nil && res.StatusCode == http.StatusNotModified {
1139		if res.Body != nil {
1140			res.Body.Close()
1141		}
1142		return nil, &googleapi.Error{
1143			Code:   res.StatusCode,
1144			Header: res.Header,
1145		}
1146	}
1147	if err != nil {
1148		return nil, err
1149	}
1150	defer googleapi.CloseBody(res)
1151	if err := googleapi.CheckResponse(res); err != nil {
1152		return nil, err
1153	}
1154	ret := &ListLogServiceIndexesResponse{
1155		ServerResponse: googleapi.ServerResponse{
1156			Header:         res.Header,
1157			HTTPStatusCode: res.StatusCode,
1158		},
1159	}
1160	target := &ret
1161	if err := gensupport.DecodeResponse(target, res); err != nil {
1162		return nil, err
1163	}
1164	return ret, nil
1165	// {
1166	//   "description": "Lists log service indexes associated with a log service.",
1167	//   "httpMethod": "GET",
1168	//   "id": "logging.projects.logServices.indexes.list",
1169	//   "parameterOrder": [
1170	//     "projectsId",
1171	//     "logServicesId"
1172	//   ],
1173	//   "parameters": {
1174	//     "depth": {
1175	//       "description": "A limit to the number of levels of the index hierarchy that are expanded. If `depth` is 0, it defaults to the level specified by the prefix field (the number of slash separators). The default empty prefix implies a `depth` of 1. It is an error for `depth` to be any non-zero value less than the number of components in `indexPrefix`.",
1176	//       "format": "int32",
1177	//       "location": "query",
1178	//       "type": "integer"
1179	//     },
1180	//     "indexPrefix": {
1181	//       "description": "Restricts the indexes returned to be those with a specified prefix. The prefix has the form `\"/label_value/label_value/...\"`, in order corresponding to the [`LogService indexKeys`][google.logging.v1.LogService.index_keys]. Non-empty prefixes must begin with `/` . Example prefixes: + `\"/myModule/\"` retrieves App Engine versions associated with `myModule`. The trailing slash terminates the value. + `\"/myModule\"` retrieves App Engine modules with names beginning with `myModule`. + `\"\"` retrieves all indexes.",
1182	//       "location": "query",
1183	//       "type": "string"
1184	//     },
1185	//     "log": {
1186	//       "description": "A log resource like `/projects/project_id/logs/log_name`, identifying the log for which to list service indexes.",
1187	//       "location": "query",
1188	//       "type": "string"
1189	//     },
1190	//     "logServicesId": {
1191	//       "description": "Part of `serviceName`. See documentation of `projectsId`.",
1192	//       "location": "path",
1193	//       "required": true,
1194	//       "type": "string"
1195	//     },
1196	//     "pageSize": {
1197	//       "description": "The maximum number of log service index resources to return in one operation.",
1198	//       "format": "int32",
1199	//       "location": "query",
1200	//       "type": "integer"
1201	//     },
1202	//     "pageToken": {
1203	//       "description": "An opaque token, returned as `nextPageToken` by a prior `ListLogServiceIndexes` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogServiceIndexes` operation is continued.",
1204	//       "location": "query",
1205	//       "type": "string"
1206	//     },
1207	//     "projectsId": {
1208	//       "description": "Part of `serviceName`. A log service resource of the form `/projects/*/logServices/*`. The service indexes of the log service are returned. Example: `\"/projects/myProj/logServices/appengine.googleapis.com\"`.",
1209	//       "location": "path",
1210	//       "required": true,
1211	//       "type": "string"
1212	//     }
1213	//   },
1214	//   "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/indexes",
1215	//   "response": {
1216	//     "$ref": "ListLogServiceIndexesResponse"
1217	//   },
1218	//   "scopes": [
1219	//     "https://www.googleapis.com/auth/cloud-platform"
1220	//   ]
1221	// }
1222
1223}
1224
1225// Pages invokes f for each page of results.
1226// A non-nil error returned from f will halt the iteration.
1227// The provided context supersedes any context provided to the Context method.
1228func (c *ProjectsLogServicesIndexesListCall) Pages(ctx context.Context, f func(*ListLogServiceIndexesResponse) error) error {
1229	c.ctx_ = ctx
1230	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
1231	for {
1232		x, err := c.Do()
1233		if err != nil {
1234			return err
1235		}
1236		if err := f(x); err != nil {
1237			return err
1238		}
1239		if x.NextPageToken == "" {
1240			return nil
1241		}
1242		c.PageToken(x.NextPageToken)
1243	}
1244}
1245
1246// method id "logging.projects.logServices.sinks.create":
1247
1248type ProjectsLogServicesSinksCreateCall struct {
1249	s             *Service
1250	projectsId    string
1251	logServicesId string
1252	logsink       *LogSink
1253	urlParams_    gensupport.URLParams
1254	ctx_          context.Context
1255	header_       http.Header
1256}
1257
1258// Create: Creates the specified log service sink resource.
1259//
1260// - logServicesId: Part of `serviceName`. See documentation of
1261//   `projectsId`.
1262// - projectsId: Part of `serviceName`. The name of the service in which
1263//   to create a sink.
1264func (r *ProjectsLogServicesSinksService) Create(projectsId string, logServicesId string, logsink *LogSink) *ProjectsLogServicesSinksCreateCall {
1265	c := &ProjectsLogServicesSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1266	c.projectsId = projectsId
1267	c.logServicesId = logServicesId
1268	c.logsink = logsink
1269	return c
1270}
1271
1272// Fields allows partial responses to be retrieved. See
1273// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1274// for more information.
1275func (c *ProjectsLogServicesSinksCreateCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksCreateCall {
1276	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1277	return c
1278}
1279
1280// Context sets the context to be used in this call's Do method. Any
1281// pending HTTP request will be aborted if the provided context is
1282// canceled.
1283func (c *ProjectsLogServicesSinksCreateCall) Context(ctx context.Context) *ProjectsLogServicesSinksCreateCall {
1284	c.ctx_ = ctx
1285	return c
1286}
1287
1288// Header returns an http.Header that can be modified by the caller to
1289// add HTTP headers to the request.
1290func (c *ProjectsLogServicesSinksCreateCall) Header() http.Header {
1291	if c.header_ == nil {
1292		c.header_ = make(http.Header)
1293	}
1294	return c.header_
1295}
1296
1297func (c *ProjectsLogServicesSinksCreateCall) doRequest(alt string) (*http.Response, error) {
1298	reqHeaders := make(http.Header)
1299	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/00000000")
1300	for k, v := range c.header_ {
1301		reqHeaders[k] = v
1302	}
1303	reqHeaders.Set("User-Agent", c.s.userAgent())
1304	var body io.Reader = nil
1305	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
1306	if err != nil {
1307		return nil, err
1308	}
1309	reqHeaders.Set("Content-Type", "application/json")
1310	c.urlParams_.Set("alt", alt)
1311	c.urlParams_.Set("prettyPrint", "false")
1312	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks")
1313	urls += "?" + c.urlParams_.Encode()
1314	req, err := http.NewRequest("POST", urls, body)
1315	if err != nil {
1316		return nil, err
1317	}
1318	req.Header = reqHeaders
1319	googleapi.Expand(req.URL, map[string]string{
1320		"projectsId":    c.projectsId,
1321		"logServicesId": c.logServicesId,
1322	})
1323	return gensupport.SendRequest(c.ctx_, c.s.client, req)
1324}
1325
1326// Do executes the "logging.projects.logServices.sinks.create" call.
1327// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
1328// code is an error. Response headers are in either
1329// *LogSink.ServerResponse.Header or (if a response was returned at all)
1330// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
1331// check whether the returned error was because http.StatusNotModified
1332// was returned.
1333func (c *ProjectsLogServicesSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
1334	gensupport.SetOptions(c.urlParams_, opts...)
1335	res, err := c.doRequest("json")
1336	if res != nil && res.StatusCode == http.StatusNotModified {
1337		if res.Body != nil {
1338			res.Body.Close()
1339		}
1340		return nil, &googleapi.Error{
1341			Code:   res.StatusCode,
1342			Header: res.Header,
1343		}
1344	}
1345	if err != nil {
1346		return nil, err
1347	}
1348	defer googleapi.CloseBody(res)
1349	if err := googleapi.CheckResponse(res); err != nil {
1350		return nil, err
1351	}
1352	ret := &LogSink{
1353		ServerResponse: googleapi.ServerResponse{
1354			Header:         res.Header,
1355			HTTPStatusCode: res.StatusCode,
1356		},
1357	}
1358	target := &ret
1359	if err := gensupport.DecodeResponse(target, res); err != nil {
1360		return nil, err
1361	}
1362	return ret, nil
1363	// {
1364	//   "description": "Creates the specified log service sink resource.",
1365	//   "httpMethod": "POST",
1366	//   "id": "logging.projects.logServices.sinks.create",
1367	//   "parameterOrder": [
1368	//     "projectsId",
1369	//     "logServicesId"
1370	//   ],
1371	//   "parameters": {
1372	//     "logServicesId": {
1373	//       "description": "Part of `serviceName`. See documentation of `projectsId`.",
1374	//       "location": "path",
1375	//       "required": true,
1376	//       "type": "string"
1377	//     },
1378	//     "projectsId": {
1379	//       "description": "Part of `serviceName`. The name of the service in which to create a sink.",
1380	//       "location": "path",
1381	//       "required": true,
1382	//       "type": "string"
1383	//     }
1384	//   },
1385	//   "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks",
1386	//   "request": {
1387	//     "$ref": "LogSink"
1388	//   },
1389	//   "response": {
1390	//     "$ref": "LogSink"
1391	//   },
1392	//   "scopes": [
1393	//     "https://www.googleapis.com/auth/cloud-platform"
1394	//   ]
1395	// }
1396
1397}
1398
1399// method id "logging.projects.logServices.sinks.delete":
1400
1401type ProjectsLogServicesSinksDeleteCall struct {
1402	s             *Service
1403	projectsId    string
1404	logServicesId string
1405	sinksId       string
1406	urlParams_    gensupport.URLParams
1407	ctx_          context.Context
1408	header_       http.Header
1409}
1410
1411// Delete: Deletes the specified log service sink.
1412//
1413// - logServicesId: Part of `sinkName`. See documentation of
1414//   `projectsId`.
1415// - projectsId: Part of `sinkName`. The name of the sink to delete.
1416// - sinksId: Part of `sinkName`. See documentation of `projectsId`.
1417func (r *ProjectsLogServicesSinksService) Delete(projectsId string, logServicesId string, sinksId string) *ProjectsLogServicesSinksDeleteCall {
1418	c := &ProjectsLogServicesSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1419	c.projectsId = projectsId
1420	c.logServicesId = logServicesId
1421	c.sinksId = sinksId
1422	return c
1423}
1424
1425// Fields allows partial responses to be retrieved. See
1426// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1427// for more information.
1428func (c *ProjectsLogServicesSinksDeleteCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksDeleteCall {
1429	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1430	return c
1431}
1432
1433// Context sets the context to be used in this call's Do method. Any
1434// pending HTTP request will be aborted if the provided context is
1435// canceled.
1436func (c *ProjectsLogServicesSinksDeleteCall) Context(ctx context.Context) *ProjectsLogServicesSinksDeleteCall {
1437	c.ctx_ = ctx
1438	return c
1439}
1440
1441// Header returns an http.Header that can be modified by the caller to
1442// add HTTP headers to the request.
1443func (c *ProjectsLogServicesSinksDeleteCall) Header() http.Header {
1444	if c.header_ == nil {
1445		c.header_ = make(http.Header)
1446	}
1447	return c.header_
1448}
1449
1450func (c *ProjectsLogServicesSinksDeleteCall) doRequest(alt string) (*http.Response, error) {
1451	reqHeaders := make(http.Header)
1452	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/00000000")
1453	for k, v := range c.header_ {
1454		reqHeaders[k] = v
1455	}
1456	reqHeaders.Set("User-Agent", c.s.userAgent())
1457	var body io.Reader = nil
1458	c.urlParams_.Set("alt", alt)
1459	c.urlParams_.Set("prettyPrint", "false")
1460	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}")
1461	urls += "?" + c.urlParams_.Encode()
1462	req, err := http.NewRequest("DELETE", urls, body)
1463	if err != nil {
1464		return nil, err
1465	}
1466	req.Header = reqHeaders
1467	googleapi.Expand(req.URL, map[string]string{
1468		"projectsId":    c.projectsId,
1469		"logServicesId": c.logServicesId,
1470		"sinksId":       c.sinksId,
1471	})
1472	return gensupport.SendRequest(c.ctx_, c.s.client, req)
1473}
1474
1475// Do executes the "logging.projects.logServices.sinks.delete" call.
1476// Exactly one of *Empty or error will be non-nil. Any non-2xx status
1477// code is an error. Response headers are in either
1478// *Empty.ServerResponse.Header or (if a response was returned at all)
1479// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
1480// check whether the returned error was because http.StatusNotModified
1481// was returned.
1482func (c *ProjectsLogServicesSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
1483	gensupport.SetOptions(c.urlParams_, opts...)
1484	res, err := c.doRequest("json")
1485	if res != nil && res.StatusCode == http.StatusNotModified {
1486		if res.Body != nil {
1487			res.Body.Close()
1488		}
1489		return nil, &googleapi.Error{
1490			Code:   res.StatusCode,
1491			Header: res.Header,
1492		}
1493	}
1494	if err != nil {
1495		return nil, err
1496	}
1497	defer googleapi.CloseBody(res)
1498	if err := googleapi.CheckResponse(res); err != nil {
1499		return nil, err
1500	}
1501	ret := &Empty{
1502		ServerResponse: googleapi.ServerResponse{
1503			Header:         res.Header,
1504			HTTPStatusCode: res.StatusCode,
1505		},
1506	}
1507	target := &ret
1508	if err := gensupport.DecodeResponse(target, res); err != nil {
1509		return nil, err
1510	}
1511	return ret, nil
1512	// {
1513	//   "description": "Deletes the specified log service sink.",
1514	//   "httpMethod": "DELETE",
1515	//   "id": "logging.projects.logServices.sinks.delete",
1516	//   "parameterOrder": [
1517	//     "projectsId",
1518	//     "logServicesId",
1519	//     "sinksId"
1520	//   ],
1521	//   "parameters": {
1522	//     "logServicesId": {
1523	//       "description": "Part of `sinkName`. See documentation of `projectsId`.",
1524	//       "location": "path",
1525	//       "required": true,
1526	//       "type": "string"
1527	//     },
1528	//     "projectsId": {
1529	//       "description": "Part of `sinkName`. The name of the sink to delete.",
1530	//       "location": "path",
1531	//       "required": true,
1532	//       "type": "string"
1533	//     },
1534	//     "sinksId": {
1535	//       "description": "Part of `sinkName`. See documentation of `projectsId`.",
1536	//       "location": "path",
1537	//       "required": true,
1538	//       "type": "string"
1539	//     }
1540	//   },
1541	//   "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}",
1542	//   "response": {
1543	//     "$ref": "Empty"
1544	//   },
1545	//   "scopes": [
1546	//     "https://www.googleapis.com/auth/cloud-platform"
1547	//   ]
1548	// }
1549
1550}
1551
1552// method id "logging.projects.logServices.sinks.get":
1553
1554type ProjectsLogServicesSinksGetCall struct {
1555	s             *Service
1556	projectsId    string
1557	logServicesId string
1558	sinksId       string
1559	urlParams_    gensupport.URLParams
1560	ifNoneMatch_  string
1561	ctx_          context.Context
1562	header_       http.Header
1563}
1564
1565// Get: Gets the specified log service sink resource.
1566//
1567// - logServicesId: Part of `sinkName`. See documentation of
1568//   `projectsId`.
1569// - projectsId: Part of `sinkName`. The name of the sink to return.
1570// - sinksId: Part of `sinkName`. See documentation of `projectsId`.
1571func (r *ProjectsLogServicesSinksService) Get(projectsId string, logServicesId string, sinksId string) *ProjectsLogServicesSinksGetCall {
1572	c := &ProjectsLogServicesSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1573	c.projectsId = projectsId
1574	c.logServicesId = logServicesId
1575	c.sinksId = sinksId
1576	return c
1577}
1578
1579// Fields allows partial responses to be retrieved. See
1580// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1581// for more information.
1582func (c *ProjectsLogServicesSinksGetCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksGetCall {
1583	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1584	return c
1585}
1586
1587// IfNoneMatch sets the optional parameter which makes the operation
1588// fail if the object's ETag matches the given value. This is useful for
1589// getting updates only after the object has changed since the last
1590// request. Use googleapi.IsNotModified to check whether the response
1591// error from Do is the result of In-None-Match.
1592func (c *ProjectsLogServicesSinksGetCall) IfNoneMatch(entityTag string) *ProjectsLogServicesSinksGetCall {
1593	c.ifNoneMatch_ = entityTag
1594	return c
1595}
1596
1597// Context sets the context to be used in this call's Do method. Any
1598// pending HTTP request will be aborted if the provided context is
1599// canceled.
1600func (c *ProjectsLogServicesSinksGetCall) Context(ctx context.Context) *ProjectsLogServicesSinksGetCall {
1601	c.ctx_ = ctx
1602	return c
1603}
1604
1605// Header returns an http.Header that can be modified by the caller to
1606// add HTTP headers to the request.
1607func (c *ProjectsLogServicesSinksGetCall) Header() http.Header {
1608	if c.header_ == nil {
1609		c.header_ = make(http.Header)
1610	}
1611	return c.header_
1612}
1613
1614func (c *ProjectsLogServicesSinksGetCall) doRequest(alt string) (*http.Response, error) {
1615	reqHeaders := make(http.Header)
1616	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/00000000")
1617	for k, v := range c.header_ {
1618		reqHeaders[k] = v
1619	}
1620	reqHeaders.Set("User-Agent", c.s.userAgent())
1621	if c.ifNoneMatch_ != "" {
1622		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1623	}
1624	var body io.Reader = nil
1625	c.urlParams_.Set("alt", alt)
1626	c.urlParams_.Set("prettyPrint", "false")
1627	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}")
1628	urls += "?" + c.urlParams_.Encode()
1629	req, err := http.NewRequest("GET", urls, body)
1630	if err != nil {
1631		return nil, err
1632	}
1633	req.Header = reqHeaders
1634	googleapi.Expand(req.URL, map[string]string{
1635		"projectsId":    c.projectsId,
1636		"logServicesId": c.logServicesId,
1637		"sinksId":       c.sinksId,
1638	})
1639	return gensupport.SendRequest(c.ctx_, c.s.client, req)
1640}
1641
1642// Do executes the "logging.projects.logServices.sinks.get" call.
1643// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
1644// code is an error. Response headers are in either
1645// *LogSink.ServerResponse.Header or (if a response was returned at all)
1646// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
1647// check whether the returned error was because http.StatusNotModified
1648// was returned.
1649func (c *ProjectsLogServicesSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
1650	gensupport.SetOptions(c.urlParams_, opts...)
1651	res, err := c.doRequest("json")
1652	if res != nil && res.StatusCode == http.StatusNotModified {
1653		if res.Body != nil {
1654			res.Body.Close()
1655		}
1656		return nil, &googleapi.Error{
1657			Code:   res.StatusCode,
1658			Header: res.Header,
1659		}
1660	}
1661	if err != nil {
1662		return nil, err
1663	}
1664	defer googleapi.CloseBody(res)
1665	if err := googleapi.CheckResponse(res); err != nil {
1666		return nil, err
1667	}
1668	ret := &LogSink{
1669		ServerResponse: googleapi.ServerResponse{
1670			Header:         res.Header,
1671			HTTPStatusCode: res.StatusCode,
1672		},
1673	}
1674	target := &ret
1675	if err := gensupport.DecodeResponse(target, res); err != nil {
1676		return nil, err
1677	}
1678	return ret, nil
1679	// {
1680	//   "description": "Gets the specified log service sink resource.",
1681	//   "httpMethod": "GET",
1682	//   "id": "logging.projects.logServices.sinks.get",
1683	//   "parameterOrder": [
1684	//     "projectsId",
1685	//     "logServicesId",
1686	//     "sinksId"
1687	//   ],
1688	//   "parameters": {
1689	//     "logServicesId": {
1690	//       "description": "Part of `sinkName`. See documentation of `projectsId`.",
1691	//       "location": "path",
1692	//       "required": true,
1693	//       "type": "string"
1694	//     },
1695	//     "projectsId": {
1696	//       "description": "Part of `sinkName`. The name of the sink to return.",
1697	//       "location": "path",
1698	//       "required": true,
1699	//       "type": "string"
1700	//     },
1701	//     "sinksId": {
1702	//       "description": "Part of `sinkName`. See documentation of `projectsId`.",
1703	//       "location": "path",
1704	//       "required": true,
1705	//       "type": "string"
1706	//     }
1707	//   },
1708	//   "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}",
1709	//   "response": {
1710	//     "$ref": "LogSink"
1711	//   },
1712	//   "scopes": [
1713	//     "https://www.googleapis.com/auth/cloud-platform"
1714	//   ]
1715	// }
1716
1717}
1718
1719// method id "logging.projects.logServices.sinks.list":
1720
1721type ProjectsLogServicesSinksListCall struct {
1722	s             *Service
1723	projectsId    string
1724	logServicesId string
1725	urlParams_    gensupport.URLParams
1726	ifNoneMatch_  string
1727	ctx_          context.Context
1728	header_       http.Header
1729}
1730
1731// List: Lists log service sinks associated with the specified service.
1732//
1733// - logServicesId: Part of `serviceName`. See documentation of
1734//   `projectsId`.
1735// - projectsId: Part of `serviceName`. The name of the service for
1736//   which to list sinks.
1737func (r *ProjectsLogServicesSinksService) List(projectsId string, logServicesId string) *ProjectsLogServicesSinksListCall {
1738	c := &ProjectsLogServicesSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1739	c.projectsId = projectsId
1740	c.logServicesId = logServicesId
1741	return c
1742}
1743
1744// Fields allows partial responses to be retrieved. See
1745// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1746// for more information.
1747func (c *ProjectsLogServicesSinksListCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksListCall {
1748	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1749	return c
1750}
1751
1752// IfNoneMatch sets the optional parameter which makes the operation
1753// fail if the object's ETag matches the given value. This is useful for
1754// getting updates only after the object has changed since the last
1755// request. Use googleapi.IsNotModified to check whether the response
1756// error from Do is the result of In-None-Match.
1757func (c *ProjectsLogServicesSinksListCall) IfNoneMatch(entityTag string) *ProjectsLogServicesSinksListCall {
1758	c.ifNoneMatch_ = entityTag
1759	return c
1760}
1761
1762// Context sets the context to be used in this call's Do method. Any
1763// pending HTTP request will be aborted if the provided context is
1764// canceled.
1765func (c *ProjectsLogServicesSinksListCall) Context(ctx context.Context) *ProjectsLogServicesSinksListCall {
1766	c.ctx_ = ctx
1767	return c
1768}
1769
1770// Header returns an http.Header that can be modified by the caller to
1771// add HTTP headers to the request.
1772func (c *ProjectsLogServicesSinksListCall) Header() http.Header {
1773	if c.header_ == nil {
1774		c.header_ = make(http.Header)
1775	}
1776	return c.header_
1777}
1778
1779func (c *ProjectsLogServicesSinksListCall) doRequest(alt string) (*http.Response, error) {
1780	reqHeaders := make(http.Header)
1781	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/00000000")
1782	for k, v := range c.header_ {
1783		reqHeaders[k] = v
1784	}
1785	reqHeaders.Set("User-Agent", c.s.userAgent())
1786	if c.ifNoneMatch_ != "" {
1787		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
1788	}
1789	var body io.Reader = nil
1790	c.urlParams_.Set("alt", alt)
1791	c.urlParams_.Set("prettyPrint", "false")
1792	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks")
1793	urls += "?" + c.urlParams_.Encode()
1794	req, err := http.NewRequest("GET", urls, body)
1795	if err != nil {
1796		return nil, err
1797	}
1798	req.Header = reqHeaders
1799	googleapi.Expand(req.URL, map[string]string{
1800		"projectsId":    c.projectsId,
1801		"logServicesId": c.logServicesId,
1802	})
1803	return gensupport.SendRequest(c.ctx_, c.s.client, req)
1804}
1805
1806// Do executes the "logging.projects.logServices.sinks.list" call.
1807// Exactly one of *ListLogServiceSinksResponse or error will be non-nil.
1808// Any non-2xx status code is an error. Response headers are in either
1809// *ListLogServiceSinksResponse.ServerResponse.Header or (if a response
1810// was returned at all) in error.(*googleapi.Error).Header. Use
1811// googleapi.IsNotModified to check whether the returned error was
1812// because http.StatusNotModified was returned.
1813func (c *ProjectsLogServicesSinksListCall) Do(opts ...googleapi.CallOption) (*ListLogServiceSinksResponse, error) {
1814	gensupport.SetOptions(c.urlParams_, opts...)
1815	res, err := c.doRequest("json")
1816	if res != nil && res.StatusCode == http.StatusNotModified {
1817		if res.Body != nil {
1818			res.Body.Close()
1819		}
1820		return nil, &googleapi.Error{
1821			Code:   res.StatusCode,
1822			Header: res.Header,
1823		}
1824	}
1825	if err != nil {
1826		return nil, err
1827	}
1828	defer googleapi.CloseBody(res)
1829	if err := googleapi.CheckResponse(res); err != nil {
1830		return nil, err
1831	}
1832	ret := &ListLogServiceSinksResponse{
1833		ServerResponse: googleapi.ServerResponse{
1834			Header:         res.Header,
1835			HTTPStatusCode: res.StatusCode,
1836		},
1837	}
1838	target := &ret
1839	if err := gensupport.DecodeResponse(target, res); err != nil {
1840		return nil, err
1841	}
1842	return ret, nil
1843	// {
1844	//   "description": "Lists log service sinks associated with the specified service.",
1845	//   "httpMethod": "GET",
1846	//   "id": "logging.projects.logServices.sinks.list",
1847	//   "parameterOrder": [
1848	//     "projectsId",
1849	//     "logServicesId"
1850	//   ],
1851	//   "parameters": {
1852	//     "logServicesId": {
1853	//       "description": "Part of `serviceName`. See documentation of `projectsId`.",
1854	//       "location": "path",
1855	//       "required": true,
1856	//       "type": "string"
1857	//     },
1858	//     "projectsId": {
1859	//       "description": "Part of `serviceName`. The name of the service for which to list sinks.",
1860	//       "location": "path",
1861	//       "required": true,
1862	//       "type": "string"
1863	//     }
1864	//   },
1865	//   "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks",
1866	//   "response": {
1867	//     "$ref": "ListLogServiceSinksResponse"
1868	//   },
1869	//   "scopes": [
1870	//     "https://www.googleapis.com/auth/cloud-platform"
1871	//   ]
1872	// }
1873
1874}
1875
1876// method id "logging.projects.logServices.sinks.update":
1877
1878type ProjectsLogServicesSinksUpdateCall struct {
1879	s             *Service
1880	projectsId    string
1881	logServicesId string
1882	sinksId       string
1883	logsink       *LogSink
1884	urlParams_    gensupport.URLParams
1885	ctx_          context.Context
1886	header_       http.Header
1887}
1888
1889// Update: Creates or update the specified log service sink resource.
1890//
1891// - logServicesId: Part of `sinkName`. See documentation of
1892//   `projectsId`.
1893// - projectsId: Part of `sinkName`. The name of the sink to update.
1894// - sinksId: Part of `sinkName`. See documentation of `projectsId`.
1895func (r *ProjectsLogServicesSinksService) Update(projectsId string, logServicesId string, sinksId string, logsink *LogSink) *ProjectsLogServicesSinksUpdateCall {
1896	c := &ProjectsLogServicesSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
1897	c.projectsId = projectsId
1898	c.logServicesId = logServicesId
1899	c.sinksId = sinksId
1900	c.logsink = logsink
1901	return c
1902}
1903
1904// Fields allows partial responses to be retrieved. See
1905// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1906// for more information.
1907func (c *ProjectsLogServicesSinksUpdateCall) Fields(s ...googleapi.Field) *ProjectsLogServicesSinksUpdateCall {
1908	c.urlParams_.Set("fields", googleapi.CombineFields(s))
1909	return c
1910}
1911
1912// Context sets the context to be used in this call's Do method. Any
1913// pending HTTP request will be aborted if the provided context is
1914// canceled.
1915func (c *ProjectsLogServicesSinksUpdateCall) Context(ctx context.Context) *ProjectsLogServicesSinksUpdateCall {
1916	c.ctx_ = ctx
1917	return c
1918}
1919
1920// Header returns an http.Header that can be modified by the caller to
1921// add HTTP headers to the request.
1922func (c *ProjectsLogServicesSinksUpdateCall) Header() http.Header {
1923	if c.header_ == nil {
1924		c.header_ = make(http.Header)
1925	}
1926	return c.header_
1927}
1928
1929func (c *ProjectsLogServicesSinksUpdateCall) doRequest(alt string) (*http.Response, error) {
1930	reqHeaders := make(http.Header)
1931	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/00000000")
1932	for k, v := range c.header_ {
1933		reqHeaders[k] = v
1934	}
1935	reqHeaders.Set("User-Agent", c.s.userAgent())
1936	var body io.Reader = nil
1937	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
1938	if err != nil {
1939		return nil, err
1940	}
1941	reqHeaders.Set("Content-Type", "application/json")
1942	c.urlParams_.Set("alt", alt)
1943	c.urlParams_.Set("prettyPrint", "false")
1944	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}")
1945	urls += "?" + c.urlParams_.Encode()
1946	req, err := http.NewRequest("PUT", urls, body)
1947	if err != nil {
1948		return nil, err
1949	}
1950	req.Header = reqHeaders
1951	googleapi.Expand(req.URL, map[string]string{
1952		"projectsId":    c.projectsId,
1953		"logServicesId": c.logServicesId,
1954		"sinksId":       c.sinksId,
1955	})
1956	return gensupport.SendRequest(c.ctx_, c.s.client, req)
1957}
1958
1959// Do executes the "logging.projects.logServices.sinks.update" call.
1960// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
1961// code is an error. Response headers are in either
1962// *LogSink.ServerResponse.Header or (if a response was returned at all)
1963// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
1964// check whether the returned error was because http.StatusNotModified
1965// was returned.
1966func (c *ProjectsLogServicesSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
1967	gensupport.SetOptions(c.urlParams_, opts...)
1968	res, err := c.doRequest("json")
1969	if res != nil && res.StatusCode == http.StatusNotModified {
1970		if res.Body != nil {
1971			res.Body.Close()
1972		}
1973		return nil, &googleapi.Error{
1974			Code:   res.StatusCode,
1975			Header: res.Header,
1976		}
1977	}
1978	if err != nil {
1979		return nil, err
1980	}
1981	defer googleapi.CloseBody(res)
1982	if err := googleapi.CheckResponse(res); err != nil {
1983		return nil, err
1984	}
1985	ret := &LogSink{
1986		ServerResponse: googleapi.ServerResponse{
1987			Header:         res.Header,
1988			HTTPStatusCode: res.StatusCode,
1989		},
1990	}
1991	target := &ret
1992	if err := gensupport.DecodeResponse(target, res); err != nil {
1993		return nil, err
1994	}
1995	return ret, nil
1996	// {
1997	//   "description": "Creates or update the specified log service sink resource.",
1998	//   "httpMethod": "PUT",
1999	//   "id": "logging.projects.logServices.sinks.update",
2000	//   "parameterOrder": [
2001	//     "projectsId",
2002	//     "logServicesId",
2003	//     "sinksId"
2004	//   ],
2005	//   "parameters": {
2006	//     "logServicesId": {
2007	//       "description": "Part of `sinkName`. See documentation of `projectsId`.",
2008	//       "location": "path",
2009	//       "required": true,
2010	//       "type": "string"
2011	//     },
2012	//     "projectsId": {
2013	//       "description": "Part of `sinkName`. The name of the sink to update.",
2014	//       "location": "path",
2015	//       "required": true,
2016	//       "type": "string"
2017	//     },
2018	//     "sinksId": {
2019	//       "description": "Part of `sinkName`. See documentation of `projectsId`.",
2020	//       "location": "path",
2021	//       "required": true,
2022	//       "type": "string"
2023	//     }
2024	//   },
2025	//   "path": "v1beta3/projects/{projectsId}/logServices/{logServicesId}/sinks/{sinksId}",
2026	//   "request": {
2027	//     "$ref": "LogSink"
2028	//   },
2029	//   "response": {
2030	//     "$ref": "LogSink"
2031	//   },
2032	//   "scopes": [
2033	//     "https://www.googleapis.com/auth/cloud-platform"
2034	//   ]
2035	// }
2036
2037}
2038
2039// method id "logging.projects.logs.delete":
2040
2041type ProjectsLogsDeleteCall struct {
2042	s          *Service
2043	projectsId string
2044	logsId     string
2045	urlParams_ gensupport.URLParams
2046	ctx_       context.Context
2047	header_    http.Header
2048}
2049
2050// Delete: Deletes the specified log resource and all log entries
2051// contained in it.
2052//
2053// - logsId: Part of `logName`. See documentation of `projectsId`.
2054// - projectsId: Part of `logName`. The log resource to delete.
2055func (r *ProjectsLogsService) Delete(projectsId string, logsId string) *ProjectsLogsDeleteCall {
2056	c := &ProjectsLogsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2057	c.projectsId = projectsId
2058	c.logsId = logsId
2059	return c
2060}
2061
2062// Fields allows partial responses to be retrieved. See
2063// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2064// for more information.
2065func (c *ProjectsLogsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLogsDeleteCall {
2066	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2067	return c
2068}
2069
2070// Context sets the context to be used in this call's Do method. Any
2071// pending HTTP request will be aborted if the provided context is
2072// canceled.
2073func (c *ProjectsLogsDeleteCall) Context(ctx context.Context) *ProjectsLogsDeleteCall {
2074	c.ctx_ = ctx
2075	return c
2076}
2077
2078// Header returns an http.Header that can be modified by the caller to
2079// add HTTP headers to the request.
2080func (c *ProjectsLogsDeleteCall) Header() http.Header {
2081	if c.header_ == nil {
2082		c.header_ = make(http.Header)
2083	}
2084	return c.header_
2085}
2086
2087func (c *ProjectsLogsDeleteCall) doRequest(alt string) (*http.Response, error) {
2088	reqHeaders := make(http.Header)
2089	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/00000000")
2090	for k, v := range c.header_ {
2091		reqHeaders[k] = v
2092	}
2093	reqHeaders.Set("User-Agent", c.s.userAgent())
2094	var body io.Reader = nil
2095	c.urlParams_.Set("alt", alt)
2096	c.urlParams_.Set("prettyPrint", "false")
2097	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}")
2098	urls += "?" + c.urlParams_.Encode()
2099	req, err := http.NewRequest("DELETE", urls, body)
2100	if err != nil {
2101		return nil, err
2102	}
2103	req.Header = reqHeaders
2104	googleapi.Expand(req.URL, map[string]string{
2105		"projectsId": c.projectsId,
2106		"logsId":     c.logsId,
2107	})
2108	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2109}
2110
2111// Do executes the "logging.projects.logs.delete" call.
2112// Exactly one of *Empty or error will be non-nil. Any non-2xx status
2113// code is an error. Response headers are in either
2114// *Empty.ServerResponse.Header or (if a response was returned at all)
2115// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2116// check whether the returned error was because http.StatusNotModified
2117// was returned.
2118func (c *ProjectsLogsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
2119	gensupport.SetOptions(c.urlParams_, opts...)
2120	res, err := c.doRequest("json")
2121	if res != nil && res.StatusCode == http.StatusNotModified {
2122		if res.Body != nil {
2123			res.Body.Close()
2124		}
2125		return nil, &googleapi.Error{
2126			Code:   res.StatusCode,
2127			Header: res.Header,
2128		}
2129	}
2130	if err != nil {
2131		return nil, err
2132	}
2133	defer googleapi.CloseBody(res)
2134	if err := googleapi.CheckResponse(res); err != nil {
2135		return nil, err
2136	}
2137	ret := &Empty{
2138		ServerResponse: googleapi.ServerResponse{
2139			Header:         res.Header,
2140			HTTPStatusCode: res.StatusCode,
2141		},
2142	}
2143	target := &ret
2144	if err := gensupport.DecodeResponse(target, res); err != nil {
2145		return nil, err
2146	}
2147	return ret, nil
2148	// {
2149	//   "description": "Deletes the specified log resource and all log entries contained in it.",
2150	//   "httpMethod": "DELETE",
2151	//   "id": "logging.projects.logs.delete",
2152	//   "parameterOrder": [
2153	//     "projectsId",
2154	//     "logsId"
2155	//   ],
2156	//   "parameters": {
2157	//     "logsId": {
2158	//       "description": "Part of `logName`. See documentation of `projectsId`.",
2159	//       "location": "path",
2160	//       "required": true,
2161	//       "type": "string"
2162	//     },
2163	//     "projectsId": {
2164	//       "description": "Part of `logName`. The log resource to delete.",
2165	//       "location": "path",
2166	//       "required": true,
2167	//       "type": "string"
2168	//     }
2169	//   },
2170	//   "path": "v1beta3/projects/{projectsId}/logs/{logsId}",
2171	//   "response": {
2172	//     "$ref": "Empty"
2173	//   },
2174	//   "scopes": [
2175	//     "https://www.googleapis.com/auth/cloud-platform"
2176	//   ]
2177	// }
2178
2179}
2180
2181// method id "logging.projects.logs.list":
2182
2183type ProjectsLogsListCall struct {
2184	s            *Service
2185	projectsId   string
2186	urlParams_   gensupport.URLParams
2187	ifNoneMatch_ string
2188	ctx_         context.Context
2189	header_      http.Header
2190}
2191
2192// List: Lists log resources belonging to the specified project.
2193//
2194// - projectsId: Part of `projectName`. The project name for which to
2195//   list the log resources.
2196func (r *ProjectsLogsService) List(projectsId string) *ProjectsLogsListCall {
2197	c := &ProjectsLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2198	c.projectsId = projectsId
2199	return c
2200}
2201
2202// PageSize sets the optional parameter "pageSize": The maximum number
2203// of results to return.
2204func (c *ProjectsLogsListCall) PageSize(pageSize int64) *ProjectsLogsListCall {
2205	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
2206	return c
2207}
2208
2209// PageToken sets the optional parameter "pageToken": An opaque token,
2210// returned as `nextPageToken` by a prior `ListLogs` operation. If
2211// `pageToken` is supplied, then the other fields of this request are
2212// ignored, and instead the previous `ListLogs` operation is continued.
2213func (c *ProjectsLogsListCall) PageToken(pageToken string) *ProjectsLogsListCall {
2214	c.urlParams_.Set("pageToken", pageToken)
2215	return c
2216}
2217
2218// ServiceIndexPrefix sets the optional parameter "serviceIndexPrefix":
2219// A log service index prefix for which to list logs. Only logs
2220// containing entries whose metadata that includes these label values
2221// (associated with index keys) are returned. The prefix is a slash
2222// separated list of values, and need not specify all index labels. An
2223// empty index (or a single slash) matches all log service indexes.
2224func (c *ProjectsLogsListCall) ServiceIndexPrefix(serviceIndexPrefix string) *ProjectsLogsListCall {
2225	c.urlParams_.Set("serviceIndexPrefix", serviceIndexPrefix)
2226	return c
2227}
2228
2229// ServiceName sets the optional parameter "serviceName": A service name
2230// for which to list logs. Only logs containing entries whose metadata
2231// includes this service name are returned. If `serviceName` and
2232// `serviceIndexPrefix` are both empty, then all log names are returned.
2233// To list all log names, regardless of service, leave both the
2234// `serviceName` and `serviceIndexPrefix` empty. To list log names
2235// containing entries with a particular service name (or explicitly
2236// empty service name) set `serviceName` to the desired value and
2237// `serviceIndexPrefix` to "/".
2238func (c *ProjectsLogsListCall) ServiceName(serviceName string) *ProjectsLogsListCall {
2239	c.urlParams_.Set("serviceName", serviceName)
2240	return c
2241}
2242
2243// Fields allows partial responses to be retrieved. See
2244// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2245// for more information.
2246func (c *ProjectsLogsListCall) Fields(s ...googleapi.Field) *ProjectsLogsListCall {
2247	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2248	return c
2249}
2250
2251// IfNoneMatch sets the optional parameter which makes the operation
2252// fail if the object's ETag matches the given value. This is useful for
2253// getting updates only after the object has changed since the last
2254// request. Use googleapi.IsNotModified to check whether the response
2255// error from Do is the result of In-None-Match.
2256func (c *ProjectsLogsListCall) IfNoneMatch(entityTag string) *ProjectsLogsListCall {
2257	c.ifNoneMatch_ = entityTag
2258	return c
2259}
2260
2261// Context sets the context to be used in this call's Do method. Any
2262// pending HTTP request will be aborted if the provided context is
2263// canceled.
2264func (c *ProjectsLogsListCall) Context(ctx context.Context) *ProjectsLogsListCall {
2265	c.ctx_ = ctx
2266	return c
2267}
2268
2269// Header returns an http.Header that can be modified by the caller to
2270// add HTTP headers to the request.
2271func (c *ProjectsLogsListCall) Header() http.Header {
2272	if c.header_ == nil {
2273		c.header_ = make(http.Header)
2274	}
2275	return c.header_
2276}
2277
2278func (c *ProjectsLogsListCall) doRequest(alt string) (*http.Response, error) {
2279	reqHeaders := make(http.Header)
2280	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/00000000")
2281	for k, v := range c.header_ {
2282		reqHeaders[k] = v
2283	}
2284	reqHeaders.Set("User-Agent", c.s.userAgent())
2285	if c.ifNoneMatch_ != "" {
2286		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2287	}
2288	var body io.Reader = nil
2289	c.urlParams_.Set("alt", alt)
2290	c.urlParams_.Set("prettyPrint", "false")
2291	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs")
2292	urls += "?" + c.urlParams_.Encode()
2293	req, err := http.NewRequest("GET", urls, body)
2294	if err != nil {
2295		return nil, err
2296	}
2297	req.Header = reqHeaders
2298	googleapi.Expand(req.URL, map[string]string{
2299		"projectsId": c.projectsId,
2300	})
2301	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2302}
2303
2304// Do executes the "logging.projects.logs.list" call.
2305// Exactly one of *ListLogsResponse or error will be non-nil. Any
2306// non-2xx status code is an error. Response headers are in either
2307// *ListLogsResponse.ServerResponse.Header or (if a response was
2308// returned at all) in error.(*googleapi.Error).Header. Use
2309// googleapi.IsNotModified to check whether the returned error was
2310// because http.StatusNotModified was returned.
2311func (c *ProjectsLogsListCall) Do(opts ...googleapi.CallOption) (*ListLogsResponse, error) {
2312	gensupport.SetOptions(c.urlParams_, opts...)
2313	res, err := c.doRequest("json")
2314	if res != nil && res.StatusCode == http.StatusNotModified {
2315		if res.Body != nil {
2316			res.Body.Close()
2317		}
2318		return nil, &googleapi.Error{
2319			Code:   res.StatusCode,
2320			Header: res.Header,
2321		}
2322	}
2323	if err != nil {
2324		return nil, err
2325	}
2326	defer googleapi.CloseBody(res)
2327	if err := googleapi.CheckResponse(res); err != nil {
2328		return nil, err
2329	}
2330	ret := &ListLogsResponse{
2331		ServerResponse: googleapi.ServerResponse{
2332			Header:         res.Header,
2333			HTTPStatusCode: res.StatusCode,
2334		},
2335	}
2336	target := &ret
2337	if err := gensupport.DecodeResponse(target, res); err != nil {
2338		return nil, err
2339	}
2340	return ret, nil
2341	// {
2342	//   "description": "Lists log resources belonging to the specified project.",
2343	//   "httpMethod": "GET",
2344	//   "id": "logging.projects.logs.list",
2345	//   "parameterOrder": [
2346	//     "projectsId"
2347	//   ],
2348	//   "parameters": {
2349	//     "pageSize": {
2350	//       "description": "The maximum number of results to return.",
2351	//       "format": "int32",
2352	//       "location": "query",
2353	//       "type": "integer"
2354	//     },
2355	//     "pageToken": {
2356	//       "description": "An opaque token, returned as `nextPageToken` by a prior `ListLogs` operation. If `pageToken` is supplied, then the other fields of this request are ignored, and instead the previous `ListLogs` operation is continued.",
2357	//       "location": "query",
2358	//       "type": "string"
2359	//     },
2360	//     "projectsId": {
2361	//       "description": "Part of `projectName`. The project name for which to list the log resources.",
2362	//       "location": "path",
2363	//       "required": true,
2364	//       "type": "string"
2365	//     },
2366	//     "serviceIndexPrefix": {
2367	//       "description": "A log service index prefix for which to list logs. Only logs containing entries whose metadata that includes these label values (associated with index keys) are returned. The prefix is a slash separated list of values, and need not specify all index labels. An empty index (or a single slash) matches all log service indexes.",
2368	//       "location": "query",
2369	//       "type": "string"
2370	//     },
2371	//     "serviceName": {
2372	//       "description": "A service name for which to list logs. Only logs containing entries whose metadata includes this service name are returned. If `serviceName` and `serviceIndexPrefix` are both empty, then all log names are returned. To list all log names, regardless of service, leave both the `serviceName` and `serviceIndexPrefix` empty. To list log names containing entries with a particular service name (or explicitly empty service name) set `serviceName` to the desired value and `serviceIndexPrefix` to `\"/\"`.",
2373	//       "location": "query",
2374	//       "type": "string"
2375	//     }
2376	//   },
2377	//   "path": "v1beta3/projects/{projectsId}/logs",
2378	//   "response": {
2379	//     "$ref": "ListLogsResponse"
2380	//   },
2381	//   "scopes": [
2382	//     "https://www.googleapis.com/auth/cloud-platform"
2383	//   ]
2384	// }
2385
2386}
2387
2388// Pages invokes f for each page of results.
2389// A non-nil error returned from f will halt the iteration.
2390// The provided context supersedes any context provided to the Context method.
2391func (c *ProjectsLogsListCall) Pages(ctx context.Context, f func(*ListLogsResponse) error) error {
2392	c.ctx_ = ctx
2393	defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
2394	for {
2395		x, err := c.Do()
2396		if err != nil {
2397			return err
2398		}
2399		if err := f(x); err != nil {
2400			return err
2401		}
2402		if x.NextPageToken == "" {
2403			return nil
2404		}
2405		c.PageToken(x.NextPageToken)
2406	}
2407}
2408
2409// method id "logging.projects.logs.entries.write":
2410
2411type ProjectsLogsEntriesWriteCall struct {
2412	s                      *Service
2413	projectsId             string
2414	logsId                 string
2415	writelogentriesrequest *WriteLogEntriesRequest
2416	urlParams_             gensupport.URLParams
2417	ctx_                   context.Context
2418	header_                http.Header
2419}
2420
2421// Write: Creates one or more log entries in a log. You must supply a
2422// list of `LogEntry` objects, named `entries`. Each `LogEntry` object
2423// must contain a payload object and a `LogEntryMetadata` object that
2424// describes the entry. You must fill in all the fields of the entry,
2425// metadata, and payload. You can also supply a map, `commonLabels`,
2426// that supplies default (key, value) data for the
2427// `entries[].metadata.labels` maps, saving you the trouble of creating
2428// identical copies for each entry.
2429//
2430// - logsId: Part of `logName`. See documentation of `projectsId`.
2431// - projectsId: Part of `logName`. The name of the log resource into
2432//   which to insert the log entries.
2433func (r *ProjectsLogsEntriesService) Write(projectsId string, logsId string, writelogentriesrequest *WriteLogEntriesRequest) *ProjectsLogsEntriesWriteCall {
2434	c := &ProjectsLogsEntriesWriteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2435	c.projectsId = projectsId
2436	c.logsId = logsId
2437	c.writelogentriesrequest = writelogentriesrequest
2438	return c
2439}
2440
2441// Fields allows partial responses to be retrieved. See
2442// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2443// for more information.
2444func (c *ProjectsLogsEntriesWriteCall) Fields(s ...googleapi.Field) *ProjectsLogsEntriesWriteCall {
2445	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2446	return c
2447}
2448
2449// Context sets the context to be used in this call's Do method. Any
2450// pending HTTP request will be aborted if the provided context is
2451// canceled.
2452func (c *ProjectsLogsEntriesWriteCall) Context(ctx context.Context) *ProjectsLogsEntriesWriteCall {
2453	c.ctx_ = ctx
2454	return c
2455}
2456
2457// Header returns an http.Header that can be modified by the caller to
2458// add HTTP headers to the request.
2459func (c *ProjectsLogsEntriesWriteCall) Header() http.Header {
2460	if c.header_ == nil {
2461		c.header_ = make(http.Header)
2462	}
2463	return c.header_
2464}
2465
2466func (c *ProjectsLogsEntriesWriteCall) doRequest(alt string) (*http.Response, error) {
2467	reqHeaders := make(http.Header)
2468	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/00000000")
2469	for k, v := range c.header_ {
2470		reqHeaders[k] = v
2471	}
2472	reqHeaders.Set("User-Agent", c.s.userAgent())
2473	var body io.Reader = nil
2474	body, err := googleapi.WithoutDataWrapper.JSONReader(c.writelogentriesrequest)
2475	if err != nil {
2476		return nil, err
2477	}
2478	reqHeaders.Set("Content-Type", "application/json")
2479	c.urlParams_.Set("alt", alt)
2480	c.urlParams_.Set("prettyPrint", "false")
2481	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/entries:write")
2482	urls += "?" + c.urlParams_.Encode()
2483	req, err := http.NewRequest("POST", urls, body)
2484	if err != nil {
2485		return nil, err
2486	}
2487	req.Header = reqHeaders
2488	googleapi.Expand(req.URL, map[string]string{
2489		"projectsId": c.projectsId,
2490		"logsId":     c.logsId,
2491	})
2492	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2493}
2494
2495// Do executes the "logging.projects.logs.entries.write" call.
2496// Exactly one of *WriteLogEntriesResponse or error will be non-nil. Any
2497// non-2xx status code is an error. Response headers are in either
2498// *WriteLogEntriesResponse.ServerResponse.Header or (if a response was
2499// returned at all) in error.(*googleapi.Error).Header. Use
2500// googleapi.IsNotModified to check whether the returned error was
2501// because http.StatusNotModified was returned.
2502func (c *ProjectsLogsEntriesWriteCall) Do(opts ...googleapi.CallOption) (*WriteLogEntriesResponse, error) {
2503	gensupport.SetOptions(c.urlParams_, opts...)
2504	res, err := c.doRequest("json")
2505	if res != nil && res.StatusCode == http.StatusNotModified {
2506		if res.Body != nil {
2507			res.Body.Close()
2508		}
2509		return nil, &googleapi.Error{
2510			Code:   res.StatusCode,
2511			Header: res.Header,
2512		}
2513	}
2514	if err != nil {
2515		return nil, err
2516	}
2517	defer googleapi.CloseBody(res)
2518	if err := googleapi.CheckResponse(res); err != nil {
2519		return nil, err
2520	}
2521	ret := &WriteLogEntriesResponse{
2522		ServerResponse: googleapi.ServerResponse{
2523			Header:         res.Header,
2524			HTTPStatusCode: res.StatusCode,
2525		},
2526	}
2527	target := &ret
2528	if err := gensupport.DecodeResponse(target, res); err != nil {
2529		return nil, err
2530	}
2531	return ret, nil
2532	// {
2533	//   "description": "Creates one or more log entries in a log. You must supply a list of `LogEntry` objects, named `entries`. Each `LogEntry` object must contain a payload object and a `LogEntryMetadata` object that describes the entry. You must fill in all the fields of the entry, metadata, and payload. You can also supply a map, `commonLabels`, that supplies default (key, value) data for the `entries[].metadata.labels` maps, saving you the trouble of creating identical copies for each entry.",
2534	//   "httpMethod": "POST",
2535	//   "id": "logging.projects.logs.entries.write",
2536	//   "parameterOrder": [
2537	//     "projectsId",
2538	//     "logsId"
2539	//   ],
2540	//   "parameters": {
2541	//     "logsId": {
2542	//       "description": "Part of `logName`. See documentation of `projectsId`.",
2543	//       "location": "path",
2544	//       "required": true,
2545	//       "type": "string"
2546	//     },
2547	//     "projectsId": {
2548	//       "description": "Part of `logName`. The name of the log resource into which to insert the log entries.",
2549	//       "location": "path",
2550	//       "required": true,
2551	//       "type": "string"
2552	//     }
2553	//   },
2554	//   "path": "v1beta3/projects/{projectsId}/logs/{logsId}/entries:write",
2555	//   "request": {
2556	//     "$ref": "WriteLogEntriesRequest"
2557	//   },
2558	//   "response": {
2559	//     "$ref": "WriteLogEntriesResponse"
2560	//   },
2561	//   "scopes": [
2562	//     "https://www.googleapis.com/auth/cloud-platform"
2563	//   ]
2564	// }
2565
2566}
2567
2568// method id "logging.projects.logs.sinks.create":
2569
2570type ProjectsLogsSinksCreateCall struct {
2571	s          *Service
2572	projectsId string
2573	logsId     string
2574	logsink    *LogSink
2575	urlParams_ gensupport.URLParams
2576	ctx_       context.Context
2577	header_    http.Header
2578}
2579
2580// Create: Creates the specified log sink resource.
2581//
2582// - logsId: Part of `logName`. See documentation of `projectsId`.
2583// - projectsId: Part of `logName`. The log in which to create a sink
2584//   resource.
2585func (r *ProjectsLogsSinksService) Create(projectsId string, logsId string, logsink *LogSink) *ProjectsLogsSinksCreateCall {
2586	c := &ProjectsLogsSinksCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2587	c.projectsId = projectsId
2588	c.logsId = logsId
2589	c.logsink = logsink
2590	return c
2591}
2592
2593// Fields allows partial responses to be retrieved. See
2594// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2595// for more information.
2596func (c *ProjectsLogsSinksCreateCall) Fields(s ...googleapi.Field) *ProjectsLogsSinksCreateCall {
2597	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2598	return c
2599}
2600
2601// Context sets the context to be used in this call's Do method. Any
2602// pending HTTP request will be aborted if the provided context is
2603// canceled.
2604func (c *ProjectsLogsSinksCreateCall) Context(ctx context.Context) *ProjectsLogsSinksCreateCall {
2605	c.ctx_ = ctx
2606	return c
2607}
2608
2609// Header returns an http.Header that can be modified by the caller to
2610// add HTTP headers to the request.
2611func (c *ProjectsLogsSinksCreateCall) Header() http.Header {
2612	if c.header_ == nil {
2613		c.header_ = make(http.Header)
2614	}
2615	return c.header_
2616}
2617
2618func (c *ProjectsLogsSinksCreateCall) doRequest(alt string) (*http.Response, error) {
2619	reqHeaders := make(http.Header)
2620	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/00000000")
2621	for k, v := range c.header_ {
2622		reqHeaders[k] = v
2623	}
2624	reqHeaders.Set("User-Agent", c.s.userAgent())
2625	var body io.Reader = nil
2626	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
2627	if err != nil {
2628		return nil, err
2629	}
2630	reqHeaders.Set("Content-Type", "application/json")
2631	c.urlParams_.Set("alt", alt)
2632	c.urlParams_.Set("prettyPrint", "false")
2633	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks")
2634	urls += "?" + c.urlParams_.Encode()
2635	req, err := http.NewRequest("POST", urls, body)
2636	if err != nil {
2637		return nil, err
2638	}
2639	req.Header = reqHeaders
2640	googleapi.Expand(req.URL, map[string]string{
2641		"projectsId": c.projectsId,
2642		"logsId":     c.logsId,
2643	})
2644	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2645}
2646
2647// Do executes the "logging.projects.logs.sinks.create" call.
2648// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
2649// code is an error. Response headers are in either
2650// *LogSink.ServerResponse.Header or (if a response was returned at all)
2651// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2652// check whether the returned error was because http.StatusNotModified
2653// was returned.
2654func (c *ProjectsLogsSinksCreateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
2655	gensupport.SetOptions(c.urlParams_, opts...)
2656	res, err := c.doRequest("json")
2657	if res != nil && res.StatusCode == http.StatusNotModified {
2658		if res.Body != nil {
2659			res.Body.Close()
2660		}
2661		return nil, &googleapi.Error{
2662			Code:   res.StatusCode,
2663			Header: res.Header,
2664		}
2665	}
2666	if err != nil {
2667		return nil, err
2668	}
2669	defer googleapi.CloseBody(res)
2670	if err := googleapi.CheckResponse(res); err != nil {
2671		return nil, err
2672	}
2673	ret := &LogSink{
2674		ServerResponse: googleapi.ServerResponse{
2675			Header:         res.Header,
2676			HTTPStatusCode: res.StatusCode,
2677		},
2678	}
2679	target := &ret
2680	if err := gensupport.DecodeResponse(target, res); err != nil {
2681		return nil, err
2682	}
2683	return ret, nil
2684	// {
2685	//   "description": "Creates the specified log sink resource.",
2686	//   "httpMethod": "POST",
2687	//   "id": "logging.projects.logs.sinks.create",
2688	//   "parameterOrder": [
2689	//     "projectsId",
2690	//     "logsId"
2691	//   ],
2692	//   "parameters": {
2693	//     "logsId": {
2694	//       "description": "Part of `logName`. See documentation of `projectsId`.",
2695	//       "location": "path",
2696	//       "required": true,
2697	//       "type": "string"
2698	//     },
2699	//     "projectsId": {
2700	//       "description": "Part of `logName`. The log in which to create a sink resource.",
2701	//       "location": "path",
2702	//       "required": true,
2703	//       "type": "string"
2704	//     }
2705	//   },
2706	//   "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks",
2707	//   "request": {
2708	//     "$ref": "LogSink"
2709	//   },
2710	//   "response": {
2711	//     "$ref": "LogSink"
2712	//   },
2713	//   "scopes": [
2714	//     "https://www.googleapis.com/auth/cloud-platform"
2715	//   ]
2716	// }
2717
2718}
2719
2720// method id "logging.projects.logs.sinks.delete":
2721
2722type ProjectsLogsSinksDeleteCall struct {
2723	s          *Service
2724	projectsId string
2725	logsId     string
2726	sinksId    string
2727	urlParams_ gensupport.URLParams
2728	ctx_       context.Context
2729	header_    http.Header
2730}
2731
2732// Delete: Deletes the specified log sink resource.
2733//
2734// - logsId: Part of `sinkName`. See documentation of `projectsId`.
2735// - projectsId: Part of `sinkName`. The name of the sink to delete.
2736// - sinksId: Part of `sinkName`. See documentation of `projectsId`.
2737func (r *ProjectsLogsSinksService) Delete(projectsId string, logsId string, sinksId string) *ProjectsLogsSinksDeleteCall {
2738	c := &ProjectsLogsSinksDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2739	c.projectsId = projectsId
2740	c.logsId = logsId
2741	c.sinksId = sinksId
2742	return c
2743}
2744
2745// Fields allows partial responses to be retrieved. See
2746// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2747// for more information.
2748func (c *ProjectsLogsSinksDeleteCall) Fields(s ...googleapi.Field) *ProjectsLogsSinksDeleteCall {
2749	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2750	return c
2751}
2752
2753// Context sets the context to be used in this call's Do method. Any
2754// pending HTTP request will be aborted if the provided context is
2755// canceled.
2756func (c *ProjectsLogsSinksDeleteCall) Context(ctx context.Context) *ProjectsLogsSinksDeleteCall {
2757	c.ctx_ = ctx
2758	return c
2759}
2760
2761// Header returns an http.Header that can be modified by the caller to
2762// add HTTP headers to the request.
2763func (c *ProjectsLogsSinksDeleteCall) Header() http.Header {
2764	if c.header_ == nil {
2765		c.header_ = make(http.Header)
2766	}
2767	return c.header_
2768}
2769
2770func (c *ProjectsLogsSinksDeleteCall) doRequest(alt string) (*http.Response, error) {
2771	reqHeaders := make(http.Header)
2772	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/00000000")
2773	for k, v := range c.header_ {
2774		reqHeaders[k] = v
2775	}
2776	reqHeaders.Set("User-Agent", c.s.userAgent())
2777	var body io.Reader = nil
2778	c.urlParams_.Set("alt", alt)
2779	c.urlParams_.Set("prettyPrint", "false")
2780	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}")
2781	urls += "?" + c.urlParams_.Encode()
2782	req, err := http.NewRequest("DELETE", urls, body)
2783	if err != nil {
2784		return nil, err
2785	}
2786	req.Header = reqHeaders
2787	googleapi.Expand(req.URL, map[string]string{
2788		"projectsId": c.projectsId,
2789		"logsId":     c.logsId,
2790		"sinksId":    c.sinksId,
2791	})
2792	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2793}
2794
2795// Do executes the "logging.projects.logs.sinks.delete" call.
2796// Exactly one of *Empty or error will be non-nil. Any non-2xx status
2797// code is an error. Response headers are in either
2798// *Empty.ServerResponse.Header or (if a response was returned at all)
2799// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2800// check whether the returned error was because http.StatusNotModified
2801// was returned.
2802func (c *ProjectsLogsSinksDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
2803	gensupport.SetOptions(c.urlParams_, opts...)
2804	res, err := c.doRequest("json")
2805	if res != nil && res.StatusCode == http.StatusNotModified {
2806		if res.Body != nil {
2807			res.Body.Close()
2808		}
2809		return nil, &googleapi.Error{
2810			Code:   res.StatusCode,
2811			Header: res.Header,
2812		}
2813	}
2814	if err != nil {
2815		return nil, err
2816	}
2817	defer googleapi.CloseBody(res)
2818	if err := googleapi.CheckResponse(res); err != nil {
2819		return nil, err
2820	}
2821	ret := &Empty{
2822		ServerResponse: googleapi.ServerResponse{
2823			Header:         res.Header,
2824			HTTPStatusCode: res.StatusCode,
2825		},
2826	}
2827	target := &ret
2828	if err := gensupport.DecodeResponse(target, res); err != nil {
2829		return nil, err
2830	}
2831	return ret, nil
2832	// {
2833	//   "description": "Deletes the specified log sink resource.",
2834	//   "httpMethod": "DELETE",
2835	//   "id": "logging.projects.logs.sinks.delete",
2836	//   "parameterOrder": [
2837	//     "projectsId",
2838	//     "logsId",
2839	//     "sinksId"
2840	//   ],
2841	//   "parameters": {
2842	//     "logsId": {
2843	//       "description": "Part of `sinkName`. See documentation of `projectsId`.",
2844	//       "location": "path",
2845	//       "required": true,
2846	//       "type": "string"
2847	//     },
2848	//     "projectsId": {
2849	//       "description": "Part of `sinkName`. The name of the sink to delete.",
2850	//       "location": "path",
2851	//       "required": true,
2852	//       "type": "string"
2853	//     },
2854	//     "sinksId": {
2855	//       "description": "Part of `sinkName`. See documentation of `projectsId`.",
2856	//       "location": "path",
2857	//       "required": true,
2858	//       "type": "string"
2859	//     }
2860	//   },
2861	//   "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}",
2862	//   "response": {
2863	//     "$ref": "Empty"
2864	//   },
2865	//   "scopes": [
2866	//     "https://www.googleapis.com/auth/cloud-platform"
2867	//   ]
2868	// }
2869
2870}
2871
2872// method id "logging.projects.logs.sinks.get":
2873
2874type ProjectsLogsSinksGetCall struct {
2875	s            *Service
2876	projectsId   string
2877	logsId       string
2878	sinksId      string
2879	urlParams_   gensupport.URLParams
2880	ifNoneMatch_ string
2881	ctx_         context.Context
2882	header_      http.Header
2883}
2884
2885// Get: Gets the specified log sink resource.
2886//
2887// - logsId: Part of `sinkName`. See documentation of `projectsId`.
2888// - projectsId: Part of `sinkName`. The name of the sink resource to
2889//   return.
2890// - sinksId: Part of `sinkName`. See documentation of `projectsId`.
2891func (r *ProjectsLogsSinksService) Get(projectsId string, logsId string, sinksId string) *ProjectsLogsSinksGetCall {
2892	c := &ProjectsLogsSinksGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2893	c.projectsId = projectsId
2894	c.logsId = logsId
2895	c.sinksId = sinksId
2896	return c
2897}
2898
2899// Fields allows partial responses to be retrieved. See
2900// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
2901// for more information.
2902func (c *ProjectsLogsSinksGetCall) Fields(s ...googleapi.Field) *ProjectsLogsSinksGetCall {
2903	c.urlParams_.Set("fields", googleapi.CombineFields(s))
2904	return c
2905}
2906
2907// IfNoneMatch sets the optional parameter which makes the operation
2908// fail if the object's ETag matches the given value. This is useful for
2909// getting updates only after the object has changed since the last
2910// request. Use googleapi.IsNotModified to check whether the response
2911// error from Do is the result of In-None-Match.
2912func (c *ProjectsLogsSinksGetCall) IfNoneMatch(entityTag string) *ProjectsLogsSinksGetCall {
2913	c.ifNoneMatch_ = entityTag
2914	return c
2915}
2916
2917// Context sets the context to be used in this call's Do method. Any
2918// pending HTTP request will be aborted if the provided context is
2919// canceled.
2920func (c *ProjectsLogsSinksGetCall) Context(ctx context.Context) *ProjectsLogsSinksGetCall {
2921	c.ctx_ = ctx
2922	return c
2923}
2924
2925// Header returns an http.Header that can be modified by the caller to
2926// add HTTP headers to the request.
2927func (c *ProjectsLogsSinksGetCall) Header() http.Header {
2928	if c.header_ == nil {
2929		c.header_ = make(http.Header)
2930	}
2931	return c.header_
2932}
2933
2934func (c *ProjectsLogsSinksGetCall) doRequest(alt string) (*http.Response, error) {
2935	reqHeaders := make(http.Header)
2936	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/00000000")
2937	for k, v := range c.header_ {
2938		reqHeaders[k] = v
2939	}
2940	reqHeaders.Set("User-Agent", c.s.userAgent())
2941	if c.ifNoneMatch_ != "" {
2942		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
2943	}
2944	var body io.Reader = nil
2945	c.urlParams_.Set("alt", alt)
2946	c.urlParams_.Set("prettyPrint", "false")
2947	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}")
2948	urls += "?" + c.urlParams_.Encode()
2949	req, err := http.NewRequest("GET", urls, body)
2950	if err != nil {
2951		return nil, err
2952	}
2953	req.Header = reqHeaders
2954	googleapi.Expand(req.URL, map[string]string{
2955		"projectsId": c.projectsId,
2956		"logsId":     c.logsId,
2957		"sinksId":    c.sinksId,
2958	})
2959	return gensupport.SendRequest(c.ctx_, c.s.client, req)
2960}
2961
2962// Do executes the "logging.projects.logs.sinks.get" call.
2963// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
2964// code is an error. Response headers are in either
2965// *LogSink.ServerResponse.Header or (if a response was returned at all)
2966// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
2967// check whether the returned error was because http.StatusNotModified
2968// was returned.
2969func (c *ProjectsLogsSinksGetCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
2970	gensupport.SetOptions(c.urlParams_, opts...)
2971	res, err := c.doRequest("json")
2972	if res != nil && res.StatusCode == http.StatusNotModified {
2973		if res.Body != nil {
2974			res.Body.Close()
2975		}
2976		return nil, &googleapi.Error{
2977			Code:   res.StatusCode,
2978			Header: res.Header,
2979		}
2980	}
2981	if err != nil {
2982		return nil, err
2983	}
2984	defer googleapi.CloseBody(res)
2985	if err := googleapi.CheckResponse(res); err != nil {
2986		return nil, err
2987	}
2988	ret := &LogSink{
2989		ServerResponse: googleapi.ServerResponse{
2990			Header:         res.Header,
2991			HTTPStatusCode: res.StatusCode,
2992		},
2993	}
2994	target := &ret
2995	if err := gensupport.DecodeResponse(target, res); err != nil {
2996		return nil, err
2997	}
2998	return ret, nil
2999	// {
3000	//   "description": "Gets the specified log sink resource.",
3001	//   "httpMethod": "GET",
3002	//   "id": "logging.projects.logs.sinks.get",
3003	//   "parameterOrder": [
3004	//     "projectsId",
3005	//     "logsId",
3006	//     "sinksId"
3007	//   ],
3008	//   "parameters": {
3009	//     "logsId": {
3010	//       "description": "Part of `sinkName`. See documentation of `projectsId`.",
3011	//       "location": "path",
3012	//       "required": true,
3013	//       "type": "string"
3014	//     },
3015	//     "projectsId": {
3016	//       "description": "Part of `sinkName`. The name of the sink resource to return.",
3017	//       "location": "path",
3018	//       "required": true,
3019	//       "type": "string"
3020	//     },
3021	//     "sinksId": {
3022	//       "description": "Part of `sinkName`. See documentation of `projectsId`.",
3023	//       "location": "path",
3024	//       "required": true,
3025	//       "type": "string"
3026	//     }
3027	//   },
3028	//   "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}",
3029	//   "response": {
3030	//     "$ref": "LogSink"
3031	//   },
3032	//   "scopes": [
3033	//     "https://www.googleapis.com/auth/cloud-platform"
3034	//   ]
3035	// }
3036
3037}
3038
3039// method id "logging.projects.logs.sinks.list":
3040
3041type ProjectsLogsSinksListCall struct {
3042	s            *Service
3043	projectsId   string
3044	logsId       string
3045	urlParams_   gensupport.URLParams
3046	ifNoneMatch_ string
3047	ctx_         context.Context
3048	header_      http.Header
3049}
3050
3051// List: Lists log sinks associated with the specified log.
3052//
3053// - logsId: Part of `logName`. See documentation of `projectsId`.
3054// - projectsId: Part of `logName`. The log for which to list sinks.
3055func (r *ProjectsLogsSinksService) List(projectsId string, logsId string) *ProjectsLogsSinksListCall {
3056	c := &ProjectsLogsSinksListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3057	c.projectsId = projectsId
3058	c.logsId = logsId
3059	return c
3060}
3061
3062// Fields allows partial responses to be retrieved. See
3063// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3064// for more information.
3065func (c *ProjectsLogsSinksListCall) Fields(s ...googleapi.Field) *ProjectsLogsSinksListCall {
3066	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3067	return c
3068}
3069
3070// IfNoneMatch sets the optional parameter which makes the operation
3071// fail if the object's ETag matches the given value. This is useful for
3072// getting updates only after the object has changed since the last
3073// request. Use googleapi.IsNotModified to check whether the response
3074// error from Do is the result of In-None-Match.
3075func (c *ProjectsLogsSinksListCall) IfNoneMatch(entityTag string) *ProjectsLogsSinksListCall {
3076	c.ifNoneMatch_ = entityTag
3077	return c
3078}
3079
3080// Context sets the context to be used in this call's Do method. Any
3081// pending HTTP request will be aborted if the provided context is
3082// canceled.
3083func (c *ProjectsLogsSinksListCall) Context(ctx context.Context) *ProjectsLogsSinksListCall {
3084	c.ctx_ = ctx
3085	return c
3086}
3087
3088// Header returns an http.Header that can be modified by the caller to
3089// add HTTP headers to the request.
3090func (c *ProjectsLogsSinksListCall) Header() http.Header {
3091	if c.header_ == nil {
3092		c.header_ = make(http.Header)
3093	}
3094	return c.header_
3095}
3096
3097func (c *ProjectsLogsSinksListCall) doRequest(alt string) (*http.Response, error) {
3098	reqHeaders := make(http.Header)
3099	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/00000000")
3100	for k, v := range c.header_ {
3101		reqHeaders[k] = v
3102	}
3103	reqHeaders.Set("User-Agent", c.s.userAgent())
3104	if c.ifNoneMatch_ != "" {
3105		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
3106	}
3107	var body io.Reader = nil
3108	c.urlParams_.Set("alt", alt)
3109	c.urlParams_.Set("prettyPrint", "false")
3110	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks")
3111	urls += "?" + c.urlParams_.Encode()
3112	req, err := http.NewRequest("GET", urls, body)
3113	if err != nil {
3114		return nil, err
3115	}
3116	req.Header = reqHeaders
3117	googleapi.Expand(req.URL, map[string]string{
3118		"projectsId": c.projectsId,
3119		"logsId":     c.logsId,
3120	})
3121	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3122}
3123
3124// Do executes the "logging.projects.logs.sinks.list" call.
3125// Exactly one of *ListLogSinksResponse or error will be non-nil. Any
3126// non-2xx status code is an error. Response headers are in either
3127// *ListLogSinksResponse.ServerResponse.Header or (if a response was
3128// returned at all) in error.(*googleapi.Error).Header. Use
3129// googleapi.IsNotModified to check whether the returned error was
3130// because http.StatusNotModified was returned.
3131func (c *ProjectsLogsSinksListCall) Do(opts ...googleapi.CallOption) (*ListLogSinksResponse, error) {
3132	gensupport.SetOptions(c.urlParams_, opts...)
3133	res, err := c.doRequest("json")
3134	if res != nil && res.StatusCode == http.StatusNotModified {
3135		if res.Body != nil {
3136			res.Body.Close()
3137		}
3138		return nil, &googleapi.Error{
3139			Code:   res.StatusCode,
3140			Header: res.Header,
3141		}
3142	}
3143	if err != nil {
3144		return nil, err
3145	}
3146	defer googleapi.CloseBody(res)
3147	if err := googleapi.CheckResponse(res); err != nil {
3148		return nil, err
3149	}
3150	ret := &ListLogSinksResponse{
3151		ServerResponse: googleapi.ServerResponse{
3152			Header:         res.Header,
3153			HTTPStatusCode: res.StatusCode,
3154		},
3155	}
3156	target := &ret
3157	if err := gensupport.DecodeResponse(target, res); err != nil {
3158		return nil, err
3159	}
3160	return ret, nil
3161	// {
3162	//   "description": "Lists log sinks associated with the specified log.",
3163	//   "httpMethod": "GET",
3164	//   "id": "logging.projects.logs.sinks.list",
3165	//   "parameterOrder": [
3166	//     "projectsId",
3167	//     "logsId"
3168	//   ],
3169	//   "parameters": {
3170	//     "logsId": {
3171	//       "description": "Part of `logName`. See documentation of `projectsId`.",
3172	//       "location": "path",
3173	//       "required": true,
3174	//       "type": "string"
3175	//     },
3176	//     "projectsId": {
3177	//       "description": "Part of `logName`. The log for which to list sinks.",
3178	//       "location": "path",
3179	//       "required": true,
3180	//       "type": "string"
3181	//     }
3182	//   },
3183	//   "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks",
3184	//   "response": {
3185	//     "$ref": "ListLogSinksResponse"
3186	//   },
3187	//   "scopes": [
3188	//     "https://www.googleapis.com/auth/cloud-platform"
3189	//   ]
3190	// }
3191
3192}
3193
3194// method id "logging.projects.logs.sinks.update":
3195
3196type ProjectsLogsSinksUpdateCall struct {
3197	s          *Service
3198	projectsId string
3199	logsId     string
3200	sinksId    string
3201	logsink    *LogSink
3202	urlParams_ gensupport.URLParams
3203	ctx_       context.Context
3204	header_    http.Header
3205}
3206
3207// Update: Creates or updates the specified log sink resource.
3208//
3209// - logsId: Part of `sinkName`. See documentation of `projectsId`.
3210// - projectsId: Part of `sinkName`. The name of the sink to update.
3211// - sinksId: Part of `sinkName`. See documentation of `projectsId`.
3212func (r *ProjectsLogsSinksService) Update(projectsId string, logsId string, sinksId string, logsink *LogSink) *ProjectsLogsSinksUpdateCall {
3213	c := &ProjectsLogsSinksUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
3214	c.projectsId = projectsId
3215	c.logsId = logsId
3216	c.sinksId = sinksId
3217	c.logsink = logsink
3218	return c
3219}
3220
3221// Fields allows partial responses to be retrieved. See
3222// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
3223// for more information.
3224func (c *ProjectsLogsSinksUpdateCall) Fields(s ...googleapi.Field) *ProjectsLogsSinksUpdateCall {
3225	c.urlParams_.Set("fields", googleapi.CombineFields(s))
3226	return c
3227}
3228
3229// Context sets the context to be used in this call's Do method. Any
3230// pending HTTP request will be aborted if the provided context is
3231// canceled.
3232func (c *ProjectsLogsSinksUpdateCall) Context(ctx context.Context) *ProjectsLogsSinksUpdateCall {
3233	c.ctx_ = ctx
3234	return c
3235}
3236
3237// Header returns an http.Header that can be modified by the caller to
3238// add HTTP headers to the request.
3239func (c *ProjectsLogsSinksUpdateCall) Header() http.Header {
3240	if c.header_ == nil {
3241		c.header_ = make(http.Header)
3242	}
3243	return c.header_
3244}
3245
3246func (c *ProjectsLogsSinksUpdateCall) doRequest(alt string) (*http.Response, error) {
3247	reqHeaders := make(http.Header)
3248	reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/00000000")
3249	for k, v := range c.header_ {
3250		reqHeaders[k] = v
3251	}
3252	reqHeaders.Set("User-Agent", c.s.userAgent())
3253	var body io.Reader = nil
3254	body, err := googleapi.WithoutDataWrapper.JSONReader(c.logsink)
3255	if err != nil {
3256		return nil, err
3257	}
3258	reqHeaders.Set("Content-Type", "application/json")
3259	c.urlParams_.Set("alt", alt)
3260	c.urlParams_.Set("prettyPrint", "false")
3261	urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}")
3262	urls += "?" + c.urlParams_.Encode()
3263	req, err := http.NewRequest("PUT", urls, body)
3264	if err != nil {
3265		return nil, err
3266	}
3267	req.Header = reqHeaders
3268	googleapi.Expand(req.URL, map[string]string{
3269		"projectsId": c.projectsId,
3270		"logsId":     c.logsId,
3271		"sinksId":    c.sinksId,
3272	})
3273	return gensupport.SendRequest(c.ctx_, c.s.client, req)
3274}
3275
3276// Do executes the "logging.projects.logs.sinks.update" call.
3277// Exactly one of *LogSink or error will be non-nil. Any non-2xx status
3278// code is an error. Response headers are in either
3279// *LogSink.ServerResponse.Header or (if a response was returned at all)
3280// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
3281// check whether the returned error was because http.StatusNotModified
3282// was returned.
3283func (c *ProjectsLogsSinksUpdateCall) Do(opts ...googleapi.CallOption) (*LogSink, error) {
3284	gensupport.SetOptions(c.urlParams_, opts...)
3285	res, err := c.doRequest("json")
3286	if res != nil && res.StatusCode == http.StatusNotModified {
3287		if res.Body != nil {
3288			res.Body.Close()
3289		}
3290		return nil, &googleapi.Error{
3291			Code:   res.StatusCode,
3292			Header: res.Header,
3293		}
3294	}
3295	if err != nil {
3296		return nil, err
3297	}
3298	defer googleapi.CloseBody(res)
3299	if err := googleapi.CheckResponse(res); err != nil {
3300		return nil, err
3301	}
3302	ret := &LogSink{
3303		ServerResponse: googleapi.ServerResponse{
3304			Header:         res.Header,
3305			HTTPStatusCode: res.StatusCode,
3306		},
3307	}
3308	target := &ret
3309	if err := gensupport.DecodeResponse(target, res); err != nil {
3310		return nil, err
3311	}
3312	return ret, nil
3313	// {
3314	//   "description": "Creates or updates the specified log sink resource.",
3315	//   "httpMethod": "PUT",
3316	//   "id": "logging.projects.logs.sinks.update",
3317	//   "parameterOrder": [
3318	//     "projectsId",
3319	//     "logsId",
3320	//     "sinksId"
3321	//   ],
3322	//   "parameters": {
3323	//     "logsId": {
3324	//       "description": "Part of `sinkName`. See documentation of `projectsId`.",
3325	//       "location": "path",
3326	//       "required": true,
3327	//       "type": "string"
3328	//     },
3329	//     "projectsId": {
3330	//       "description": "Part of `sinkName`. The name of the sink to update.",
3331	//       "location": "path",
3332	//       "required": true,
3333	//       "type": "string"
3334	//     },
3335	//     "sinksId": {
3336	//       "description": "Part of `sinkName`. See documentation of `projectsId`.",
3337	//       "location": "path",
3338	//       "required": true,
3339	//       "type": "string"
3340	//     }
3341	//   },
3342	//   "path": "v1beta3/projects/{projectsId}/logs/{logsId}/sinks/{sinksId}",
3343	//   "request": {
3344	//     "$ref": "LogSink"
3345	//   },
3346	//   "response": {
3347	//     "$ref": "LogSink"
3348	//   },
3349	//   "scopes": [
3350	//     "https://www.googleapis.com/auth/cloud-platform"
3351	//   ]
3352	// }
3353
3354}
3355