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