google_cloud_logging_v2/model.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate api;
21extern crate async_trait;
22extern crate bytes;
23extern crate gax;
24extern crate gaxi;
25extern crate lazy_static;
26extern crate logging_type;
27extern crate longrunning;
28extern crate lro;
29extern crate reqwest;
30extern crate rpc;
31extern crate serde;
32extern crate serde_json;
33extern crate serde_with;
34extern crate std;
35extern crate tracing;
36extern crate wkt;
37
38mod debug;
39mod deserialize;
40mod serialize;
41
42/// An individual entry in a log.
43#[derive(Clone, Default, PartialEq)]
44#[non_exhaustive]
45pub struct LogEntry {
46 /// Required. The resource name of the log to which this log entry belongs:
47 ///
48 /// ```norust
49 /// "projects/[PROJECT_ID]/logs/[LOG_ID]"
50 /// "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
51 /// "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
52 /// "folders/[FOLDER_ID]/logs/[LOG_ID]"
53 /// ```
54 ///
55 /// A project number may be used in place of PROJECT_ID. The project number is
56 /// translated to its corresponding PROJECT_ID internally and the `log_name`
57 /// field will contain PROJECT_ID in queries and exports.
58 ///
59 /// `[LOG_ID]` must be URL-encoded within `log_name`. Example:
60 /// `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
61 ///
62 /// `[LOG_ID]` must be less than 512 characters long and can only include the
63 /// following characters: upper and lower case alphanumeric characters,
64 /// forward-slash, underscore, hyphen, and period.
65 ///
66 /// For backward compatibility, if `log_name` begins with a forward-slash, such
67 /// as `/projects/...`, then the log entry is ingested as usual, but the
68 /// forward-slash is removed. Listing the log entry will not show the leading
69 /// slash and filtering for a log name with a leading slash will never return
70 /// any results.
71 pub log_name: std::string::String,
72
73 /// Required. The monitored resource that produced this log entry.
74 ///
75 /// Example: a log entry that reports a database error would be associated with
76 /// the monitored resource designating the particular database that reported
77 /// the error.
78 pub resource: std::option::Option<api::model::MonitoredResource>,
79
80 /// Optional. The time the event described by the log entry occurred. This time
81 /// is used to compute the log entry's age and to enforce the logs retention
82 /// period. If this field is omitted in a new log entry, then Logging assigns
83 /// it the current time. Timestamps have nanosecond accuracy, but trailing
84 /// zeros in the fractional seconds might be omitted when the timestamp is
85 /// displayed.
86 ///
87 /// Incoming log entries must have timestamps that don't exceed the
88 /// [logs retention
89 /// period](https://cloud.google.com/logging/quotas#logs_retention_periods) in
90 /// the past, and that don't exceed 24 hours in the future. Log entries outside
91 /// those time boundaries aren't ingested by Logging.
92 pub timestamp: std::option::Option<wkt::Timestamp>,
93
94 /// Output only. The time the log entry was received by Logging.
95 pub receive_timestamp: std::option::Option<wkt::Timestamp>,
96
97 /// Optional. The severity of the log entry. The default value is
98 /// `LogSeverity.DEFAULT`.
99 pub severity: logging_type::model::LogSeverity,
100
101 /// Optional. A unique identifier for the log entry. If you provide a value,
102 /// then Logging considers other log entries in the same project, with the same
103 /// `timestamp`, and with the same `insert_id` to be duplicates which are
104 /// removed in a single query result. However, there are no guarantees of
105 /// de-duplication in the export of logs.
106 ///
107 /// If the `insert_id` is omitted when writing a log entry, the Logging API
108 /// assigns its own unique identifier in this field.
109 ///
110 /// In queries, the `insert_id` is also used to order log entries that have
111 /// the same `log_name` and `timestamp` values.
112 pub insert_id: std::string::String,
113
114 /// Optional. Information about the HTTP request associated with this log
115 /// entry, if applicable.
116 pub http_request: std::option::Option<logging_type::model::HttpRequest>,
117
118 /// Optional. A map of key, value pairs that provides additional information
119 /// about the log entry. The labels can be user-defined or system-defined.
120 ///
121 /// User-defined labels are arbitrary key, value pairs that you can use to
122 /// classify logs.
123 ///
124 /// System-defined labels are defined by GCP services for platform logs.
125 /// They have two components - a service namespace component and the
126 /// attribute name. For example: `compute.googleapis.com/resource_name`.
127 ///
128 /// Cloud Logging truncates label keys that exceed 512 B and label
129 /// values that exceed 64 KB upon their associated log entry being
130 /// written. The truncation is indicated by an ellipsis at the
131 /// end of the character string.
132 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
133
134 /// Optional. Information about an operation associated with the log entry, if
135 /// applicable.
136 pub operation: std::option::Option<crate::model::LogEntryOperation>,
137
138 /// Optional. The REST resource name of the trace being written to
139 /// [Cloud Trace](https://cloud.google.com/trace) in
140 /// association with this log entry. For example, if your trace data is stored
141 /// in the Cloud project "my-trace-project" and if the service that is creating
142 /// the log entry receives a trace header that includes the trace ID "12345",
143 /// then the service should use "projects/my-tracing-project/traces/12345".
144 ///
145 /// The `trace` field provides the link between logs and traces. By using
146 /// this field, you can navigate from a log entry to a trace.
147 pub trace: std::string::String,
148
149 /// Optional. The ID of the [Cloud Trace](https://cloud.google.com/trace) span
150 /// associated with the current operation in which the log is being written.
151 /// For example, if a span has the REST resource name of
152 /// "projects/some-project/traces/some-trace/spans/some-span-id", then the
153 /// `span_id` field is "some-span-id".
154 ///
155 /// A
156 /// [Span](https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span)
157 /// represents a single operation within a trace. Whereas a trace may involve
158 /// multiple different microservices running on multiple different machines,
159 /// a span generally corresponds to a single logical operation being performed
160 /// in a single instance of a microservice on one specific machine. Spans
161 /// are the nodes within the tree that is a trace.
162 ///
163 /// Applications that are [instrumented for
164 /// tracing](https://cloud.google.com/trace/docs/setup) will generally assign a
165 /// new, unique span ID on each incoming request. It is also common to create
166 /// and record additional spans corresponding to internal processing elements
167 /// as well as issuing requests to dependencies.
168 ///
169 /// The span ID is expected to be a 16-character, hexadecimal encoding of an
170 /// 8-byte array and should not be zero. It should be unique within the trace
171 /// and should, ideally, be generated in a manner that is uniformly random.
172 ///
173 /// Example values:
174 ///
175 /// - `000000000000004a`
176 /// - `7a2190356c3fc94b`
177 /// - `0000f00300090021`
178 /// - `d39223e101960076`
179 pub span_id: std::string::String,
180
181 /// Optional. The sampling decision of the trace associated with the log entry.
182 ///
183 /// True means that the trace resource name in the `trace` field was sampled
184 /// for storage in a trace backend. False means that the trace was not sampled
185 /// for storage when this log entry was written, or the sampling decision was
186 /// unknown at the time. A non-sampled `trace` value is still useful as a
187 /// request correlation identifier. The default is False.
188 pub trace_sampled: bool,
189
190 /// Optional. Source code location information associated with the log entry,
191 /// if any.
192 pub source_location: std::option::Option<crate::model::LogEntrySourceLocation>,
193
194 /// Optional. Information indicating this LogEntry is part of a sequence of
195 /// multiple log entries split from a single LogEntry.
196 pub split: std::option::Option<crate::model::LogSplit>,
197
198 /// The log entry payload, which can be one of multiple types.
199 pub payload: std::option::Option<crate::model::log_entry::Payload>,
200
201 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
202}
203
204impl LogEntry {
205 pub fn new() -> Self {
206 std::default::Default::default()
207 }
208
209 /// Sets the value of [log_name][crate::model::LogEntry::log_name].
210 pub fn set_log_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
211 self.log_name = v.into();
212 self
213 }
214
215 /// Sets the value of [resource][crate::model::LogEntry::resource].
216 pub fn set_resource<T>(mut self, v: T) -> Self
217 where
218 T: std::convert::Into<api::model::MonitoredResource>,
219 {
220 self.resource = std::option::Option::Some(v.into());
221 self
222 }
223
224 /// Sets or clears the value of [resource][crate::model::LogEntry::resource].
225 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
226 where
227 T: std::convert::Into<api::model::MonitoredResource>,
228 {
229 self.resource = v.map(|x| x.into());
230 self
231 }
232
233 /// Sets the value of [timestamp][crate::model::LogEntry::timestamp].
234 pub fn set_timestamp<T>(mut self, v: T) -> Self
235 where
236 T: std::convert::Into<wkt::Timestamp>,
237 {
238 self.timestamp = std::option::Option::Some(v.into());
239 self
240 }
241
242 /// Sets or clears the value of [timestamp][crate::model::LogEntry::timestamp].
243 pub fn set_or_clear_timestamp<T>(mut self, v: std::option::Option<T>) -> Self
244 where
245 T: std::convert::Into<wkt::Timestamp>,
246 {
247 self.timestamp = v.map(|x| x.into());
248 self
249 }
250
251 /// Sets the value of [receive_timestamp][crate::model::LogEntry::receive_timestamp].
252 pub fn set_receive_timestamp<T>(mut self, v: T) -> Self
253 where
254 T: std::convert::Into<wkt::Timestamp>,
255 {
256 self.receive_timestamp = std::option::Option::Some(v.into());
257 self
258 }
259
260 /// Sets or clears the value of [receive_timestamp][crate::model::LogEntry::receive_timestamp].
261 pub fn set_or_clear_receive_timestamp<T>(mut self, v: std::option::Option<T>) -> Self
262 where
263 T: std::convert::Into<wkt::Timestamp>,
264 {
265 self.receive_timestamp = v.map(|x| x.into());
266 self
267 }
268
269 /// Sets the value of [severity][crate::model::LogEntry::severity].
270 pub fn set_severity<T: std::convert::Into<logging_type::model::LogSeverity>>(
271 mut self,
272 v: T,
273 ) -> Self {
274 self.severity = v.into();
275 self
276 }
277
278 /// Sets the value of [insert_id][crate::model::LogEntry::insert_id].
279 pub fn set_insert_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
280 self.insert_id = v.into();
281 self
282 }
283
284 /// Sets the value of [http_request][crate::model::LogEntry::http_request].
285 pub fn set_http_request<T>(mut self, v: T) -> Self
286 where
287 T: std::convert::Into<logging_type::model::HttpRequest>,
288 {
289 self.http_request = std::option::Option::Some(v.into());
290 self
291 }
292
293 /// Sets or clears the value of [http_request][crate::model::LogEntry::http_request].
294 pub fn set_or_clear_http_request<T>(mut self, v: std::option::Option<T>) -> Self
295 where
296 T: std::convert::Into<logging_type::model::HttpRequest>,
297 {
298 self.http_request = v.map(|x| x.into());
299 self
300 }
301
302 /// Sets the value of [labels][crate::model::LogEntry::labels].
303 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
304 where
305 T: std::iter::IntoIterator<Item = (K, V)>,
306 K: std::convert::Into<std::string::String>,
307 V: std::convert::Into<std::string::String>,
308 {
309 use std::iter::Iterator;
310 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
311 self
312 }
313
314 /// Sets the value of [operation][crate::model::LogEntry::operation].
315 pub fn set_operation<T>(mut self, v: T) -> Self
316 where
317 T: std::convert::Into<crate::model::LogEntryOperation>,
318 {
319 self.operation = std::option::Option::Some(v.into());
320 self
321 }
322
323 /// Sets or clears the value of [operation][crate::model::LogEntry::operation].
324 pub fn set_or_clear_operation<T>(mut self, v: std::option::Option<T>) -> Self
325 where
326 T: std::convert::Into<crate::model::LogEntryOperation>,
327 {
328 self.operation = v.map(|x| x.into());
329 self
330 }
331
332 /// Sets the value of [trace][crate::model::LogEntry::trace].
333 pub fn set_trace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
334 self.trace = v.into();
335 self
336 }
337
338 /// Sets the value of [span_id][crate::model::LogEntry::span_id].
339 pub fn set_span_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
340 self.span_id = v.into();
341 self
342 }
343
344 /// Sets the value of [trace_sampled][crate::model::LogEntry::trace_sampled].
345 pub fn set_trace_sampled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
346 self.trace_sampled = v.into();
347 self
348 }
349
350 /// Sets the value of [source_location][crate::model::LogEntry::source_location].
351 pub fn set_source_location<T>(mut self, v: T) -> Self
352 where
353 T: std::convert::Into<crate::model::LogEntrySourceLocation>,
354 {
355 self.source_location = std::option::Option::Some(v.into());
356 self
357 }
358
359 /// Sets or clears the value of [source_location][crate::model::LogEntry::source_location].
360 pub fn set_or_clear_source_location<T>(mut self, v: std::option::Option<T>) -> Self
361 where
362 T: std::convert::Into<crate::model::LogEntrySourceLocation>,
363 {
364 self.source_location = v.map(|x| x.into());
365 self
366 }
367
368 /// Sets the value of [split][crate::model::LogEntry::split].
369 pub fn set_split<T>(mut self, v: T) -> Self
370 where
371 T: std::convert::Into<crate::model::LogSplit>,
372 {
373 self.split = std::option::Option::Some(v.into());
374 self
375 }
376
377 /// Sets or clears the value of [split][crate::model::LogEntry::split].
378 pub fn set_or_clear_split<T>(mut self, v: std::option::Option<T>) -> Self
379 where
380 T: std::convert::Into<crate::model::LogSplit>,
381 {
382 self.split = v.map(|x| x.into());
383 self
384 }
385
386 /// Sets the value of [payload][crate::model::LogEntry::payload].
387 ///
388 /// Note that all the setters affecting `payload` are mutually
389 /// exclusive.
390 pub fn set_payload<
391 T: std::convert::Into<std::option::Option<crate::model::log_entry::Payload>>,
392 >(
393 mut self,
394 v: T,
395 ) -> Self {
396 self.payload = v.into();
397 self
398 }
399
400 /// The value of [payload][crate::model::LogEntry::payload]
401 /// if it holds a `ProtoPayload`, `None` if the field is not set or
402 /// holds a different branch.
403 pub fn proto_payload(&self) -> std::option::Option<&std::boxed::Box<wkt::Any>> {
404 #[allow(unreachable_patterns)]
405 self.payload.as_ref().and_then(|v| match v {
406 crate::model::log_entry::Payload::ProtoPayload(v) => std::option::Option::Some(v),
407 _ => std::option::Option::None,
408 })
409 }
410
411 /// Sets the value of [payload][crate::model::LogEntry::payload]
412 /// to hold a `ProtoPayload`.
413 ///
414 /// Note that all the setters affecting `payload` are
415 /// mutually exclusive.
416 pub fn set_proto_payload<T: std::convert::Into<std::boxed::Box<wkt::Any>>>(
417 mut self,
418 v: T,
419 ) -> Self {
420 self.payload =
421 std::option::Option::Some(crate::model::log_entry::Payload::ProtoPayload(v.into()));
422 self
423 }
424
425 /// The value of [payload][crate::model::LogEntry::payload]
426 /// if it holds a `TextPayload`, `None` if the field is not set or
427 /// holds a different branch.
428 pub fn text_payload(&self) -> std::option::Option<&std::string::String> {
429 #[allow(unreachable_patterns)]
430 self.payload.as_ref().and_then(|v| match v {
431 crate::model::log_entry::Payload::TextPayload(v) => std::option::Option::Some(v),
432 _ => std::option::Option::None,
433 })
434 }
435
436 /// Sets the value of [payload][crate::model::LogEntry::payload]
437 /// to hold a `TextPayload`.
438 ///
439 /// Note that all the setters affecting `payload` are
440 /// mutually exclusive.
441 pub fn set_text_payload<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
442 self.payload =
443 std::option::Option::Some(crate::model::log_entry::Payload::TextPayload(v.into()));
444 self
445 }
446
447 /// The value of [payload][crate::model::LogEntry::payload]
448 /// if it holds a `JsonPayload`, `None` if the field is not set or
449 /// holds a different branch.
450 pub fn json_payload(&self) -> std::option::Option<&std::boxed::Box<wkt::Struct>> {
451 #[allow(unreachable_patterns)]
452 self.payload.as_ref().and_then(|v| match v {
453 crate::model::log_entry::Payload::JsonPayload(v) => std::option::Option::Some(v),
454 _ => std::option::Option::None,
455 })
456 }
457
458 /// Sets the value of [payload][crate::model::LogEntry::payload]
459 /// to hold a `JsonPayload`.
460 ///
461 /// Note that all the setters affecting `payload` are
462 /// mutually exclusive.
463 pub fn set_json_payload<T: std::convert::Into<std::boxed::Box<wkt::Struct>>>(
464 mut self,
465 v: T,
466 ) -> Self {
467 self.payload =
468 std::option::Option::Some(crate::model::log_entry::Payload::JsonPayload(v.into()));
469 self
470 }
471}
472
473impl wkt::message::Message for LogEntry {
474 fn typename() -> &'static str {
475 "type.googleapis.com/google.logging.v2.LogEntry"
476 }
477}
478
479/// Defines additional types related to [LogEntry].
480pub mod log_entry {
481 #[allow(unused_imports)]
482 use super::*;
483
484 /// The log entry payload, which can be one of multiple types.
485 #[derive(Clone, Debug, PartialEq)]
486 #[non_exhaustive]
487 pub enum Payload {
488 /// The log entry payload, represented as a protocol buffer. Some Google
489 /// Cloud Platform services use this field for their log entry payloads.
490 ///
491 /// The following protocol buffer types are supported; user-defined types
492 /// are not supported:
493 ///
494 /// "type.googleapis.com/google.cloud.audit.AuditLog"
495 /// "type.googleapis.com/google.appengine.logging.v1.RequestLog"
496 ProtoPayload(std::boxed::Box<wkt::Any>),
497 /// The log entry payload, represented as a Unicode string (UTF-8).
498 TextPayload(std::string::String),
499 /// The log entry payload, represented as a structure that is
500 /// expressed as a JSON object.
501 JsonPayload(std::boxed::Box<wkt::Struct>),
502 }
503}
504
505/// Additional information about a potentially long-running operation with which
506/// a log entry is associated.
507#[derive(Clone, Default, PartialEq)]
508#[non_exhaustive]
509pub struct LogEntryOperation {
510 /// Optional. An arbitrary operation identifier. Log entries with the same
511 /// identifier are assumed to be part of the same operation.
512 pub id: std::string::String,
513
514 /// Optional. An arbitrary producer identifier. The combination of `id` and
515 /// `producer` must be globally unique. Examples for `producer`:
516 /// `"MyDivision.MyBigCompany.com"`, `"github.com/MyProject/MyApplication"`.
517 pub producer: std::string::String,
518
519 /// Optional. Set this to True if this is the first log entry in the operation.
520 pub first: bool,
521
522 /// Optional. Set this to True if this is the last log entry in the operation.
523 pub last: bool,
524
525 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
526}
527
528impl LogEntryOperation {
529 pub fn new() -> Self {
530 std::default::Default::default()
531 }
532
533 /// Sets the value of [id][crate::model::LogEntryOperation::id].
534 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
535 self.id = v.into();
536 self
537 }
538
539 /// Sets the value of [producer][crate::model::LogEntryOperation::producer].
540 pub fn set_producer<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
541 self.producer = v.into();
542 self
543 }
544
545 /// Sets the value of [first][crate::model::LogEntryOperation::first].
546 pub fn set_first<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
547 self.first = v.into();
548 self
549 }
550
551 /// Sets the value of [last][crate::model::LogEntryOperation::last].
552 pub fn set_last<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
553 self.last = v.into();
554 self
555 }
556}
557
558impl wkt::message::Message for LogEntryOperation {
559 fn typename() -> &'static str {
560 "type.googleapis.com/google.logging.v2.LogEntryOperation"
561 }
562}
563
564/// Additional information about the source code location that produced the log
565/// entry.
566#[derive(Clone, Default, PartialEq)]
567#[non_exhaustive]
568pub struct LogEntrySourceLocation {
569 /// Optional. Source file name. Depending on the runtime environment, this
570 /// might be a simple name or a fully-qualified name.
571 pub file: std::string::String,
572
573 /// Optional. Line within the source file. 1-based; 0 indicates no line number
574 /// available.
575 pub line: i64,
576
577 /// Optional. Human-readable name of the function or method being invoked, with
578 /// optional context such as the class or package name. This information may be
579 /// used in contexts such as the logs viewer, where a file and line number are
580 /// less meaningful. The format can vary by language. For example:
581 /// `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
582 /// (Python).
583 pub function: std::string::String,
584
585 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
586}
587
588impl LogEntrySourceLocation {
589 pub fn new() -> Self {
590 std::default::Default::default()
591 }
592
593 /// Sets the value of [file][crate::model::LogEntrySourceLocation::file].
594 pub fn set_file<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
595 self.file = v.into();
596 self
597 }
598
599 /// Sets the value of [line][crate::model::LogEntrySourceLocation::line].
600 pub fn set_line<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
601 self.line = v.into();
602 self
603 }
604
605 /// Sets the value of [function][crate::model::LogEntrySourceLocation::function].
606 pub fn set_function<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
607 self.function = v.into();
608 self
609 }
610}
611
612impl wkt::message::Message for LogEntrySourceLocation {
613 fn typename() -> &'static str {
614 "type.googleapis.com/google.logging.v2.LogEntrySourceLocation"
615 }
616}
617
618/// Additional information used to correlate multiple log entries. Used when a
619/// single LogEntry would exceed the Google Cloud Logging size limit and is
620/// split across multiple log entries.
621#[derive(Clone, Default, PartialEq)]
622#[non_exhaustive]
623pub struct LogSplit {
624 /// A globally unique identifier for all log entries in a sequence of split log
625 /// entries. All log entries with the same |LogSplit.uid| are assumed to be
626 /// part of the same sequence of split log entries.
627 pub uid: std::string::String,
628
629 /// The index of this LogEntry in the sequence of split log entries. Log
630 /// entries are given |index| values 0, 1, ..., n-1 for a sequence of n log
631 /// entries.
632 pub index: i32,
633
634 /// The total number of log entries that the original LogEntry was split into.
635 pub total_splits: i32,
636
637 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
638}
639
640impl LogSplit {
641 pub fn new() -> Self {
642 std::default::Default::default()
643 }
644
645 /// Sets the value of [uid][crate::model::LogSplit::uid].
646 pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
647 self.uid = v.into();
648 self
649 }
650
651 /// Sets the value of [index][crate::model::LogSplit::index].
652 pub fn set_index<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
653 self.index = v.into();
654 self
655 }
656
657 /// Sets the value of [total_splits][crate::model::LogSplit::total_splits].
658 pub fn set_total_splits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
659 self.total_splits = v.into();
660 self
661 }
662}
663
664impl wkt::message::Message for LogSplit {
665 fn typename() -> &'static str {
666 "type.googleapis.com/google.logging.v2.LogSplit"
667 }
668}
669
670/// The parameters to DeleteLog.
671#[derive(Clone, Default, PartialEq)]
672#[non_exhaustive]
673pub struct DeleteLogRequest {
674 /// Required. The resource name of the log to delete:
675 ///
676 /// * `projects/[PROJECT_ID]/logs/[LOG_ID]`
677 /// * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]`
678 /// * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]`
679 /// * `folders/[FOLDER_ID]/logs/[LOG_ID]`
680 ///
681 /// `[LOG_ID]` must be URL-encoded. For example,
682 /// `"projects/my-project-id/logs/syslog"`,
683 /// `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`.
684 ///
685 /// For more information about log names, see
686 /// [LogEntry][google.logging.v2.LogEntry].
687 ///
688 /// [google.logging.v2.LogEntry]: crate::model::LogEntry
689 pub log_name: std::string::String,
690
691 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
692}
693
694impl DeleteLogRequest {
695 pub fn new() -> Self {
696 std::default::Default::default()
697 }
698
699 /// Sets the value of [log_name][crate::model::DeleteLogRequest::log_name].
700 pub fn set_log_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
701 self.log_name = v.into();
702 self
703 }
704}
705
706impl wkt::message::Message for DeleteLogRequest {
707 fn typename() -> &'static str {
708 "type.googleapis.com/google.logging.v2.DeleteLogRequest"
709 }
710}
711
712/// The parameters to WriteLogEntries.
713#[derive(Clone, Default, PartialEq)]
714#[non_exhaustive]
715pub struct WriteLogEntriesRequest {
716 /// Optional. A default log resource name that is assigned to all log entries
717 /// in `entries` that do not specify a value for `log_name`:
718 ///
719 /// * `projects/[PROJECT_ID]/logs/[LOG_ID]`
720 /// * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]`
721 /// * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]`
722 /// * `folders/[FOLDER_ID]/logs/[LOG_ID]`
723 ///
724 /// `[LOG_ID]` must be URL-encoded. For example:
725 ///
726 /// ```norust
727 /// "projects/my-project-id/logs/syslog"
728 /// "organizations/123/logs/cloudaudit.googleapis.com%2Factivity"
729 /// ```
730 ///
731 /// The permission `logging.logEntries.create` is needed on each project,
732 /// organization, billing account, or folder that is receiving new log
733 /// entries, whether the resource is specified in `logName` or in an
734 /// individual log entry.
735 pub log_name: std::string::String,
736
737 /// Optional. A default monitored resource object that is assigned to all log
738 /// entries in `entries` that do not specify a value for `resource`. Example:
739 ///
740 /// ```norust
741 /// { "type": "gce_instance",
742 /// "labels": {
743 /// "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
744 /// ```
745 ///
746 /// See [LogEntry][google.logging.v2.LogEntry].
747 ///
748 /// [google.logging.v2.LogEntry]: crate::model::LogEntry
749 pub resource: std::option::Option<api::model::MonitoredResource>,
750
751 /// Optional. Default labels that are added to the `labels` field of all log
752 /// entries in `entries`. If a log entry already has a label with the same key
753 /// as a label in this parameter, then the log entry's label is not changed.
754 /// See [LogEntry][google.logging.v2.LogEntry].
755 ///
756 /// [google.logging.v2.LogEntry]: crate::model::LogEntry
757 pub labels: std::collections::HashMap<std::string::String, std::string::String>,
758
759 /// Required. The log entries to send to Logging. The order of log
760 /// entries in this list does not matter. Values supplied in this method's
761 /// `log_name`, `resource`, and `labels` fields are copied into those log
762 /// entries in this list that do not include values for their corresponding
763 /// fields. For more information, see the
764 /// [LogEntry][google.logging.v2.LogEntry] type.
765 ///
766 /// If the `timestamp` or `insert_id` fields are missing in log entries, then
767 /// this method supplies the current time or a unique identifier, respectively.
768 /// The supplied values are chosen so that, among the log entries that did not
769 /// supply their own values, the entries earlier in the list will sort before
770 /// the entries later in the list. See the `entries.list` method.
771 ///
772 /// Log entries with timestamps that are more than the
773 /// [logs retention period](https://cloud.google.com/logging/quotas) in
774 /// the past or more than 24 hours in the future will not be available when
775 /// calling `entries.list`. However, those log entries can still be [exported
776 /// with
777 /// LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
778 ///
779 /// To improve throughput and to avoid exceeding the
780 /// [quota limit](https://cloud.google.com/logging/quotas) for calls to
781 /// `entries.write`, you should try to include several log entries in this
782 /// list, rather than calling this method for each individual log entry.
783 ///
784 /// [google.logging.v2.LogEntry]: crate::model::LogEntry
785 pub entries: std::vec::Vec<crate::model::LogEntry>,
786
787 /// Optional. Whether a batch's valid entries should be written even if some
788 /// other entry failed due to a permanent error such as INVALID_ARGUMENT or
789 /// PERMISSION_DENIED. If any entry failed, then the response status is the
790 /// response status of one of the failed entries. The response will include
791 /// error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by
792 /// the entries' zero-based index in the `entries`. Failed requests for which
793 /// no entries are written will not include per-entry errors.
794 pub partial_success: bool,
795
796 /// Optional. If true, the request should expect normal response, but the
797 /// entries won't be persisted nor exported. Useful for checking whether the
798 /// logging API endpoints are working properly before sending valuable data.
799 pub dry_run: bool,
800
801 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
802}
803
804impl WriteLogEntriesRequest {
805 pub fn new() -> Self {
806 std::default::Default::default()
807 }
808
809 /// Sets the value of [log_name][crate::model::WriteLogEntriesRequest::log_name].
810 pub fn set_log_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
811 self.log_name = v.into();
812 self
813 }
814
815 /// Sets the value of [resource][crate::model::WriteLogEntriesRequest::resource].
816 pub fn set_resource<T>(mut self, v: T) -> Self
817 where
818 T: std::convert::Into<api::model::MonitoredResource>,
819 {
820 self.resource = std::option::Option::Some(v.into());
821 self
822 }
823
824 /// Sets or clears the value of [resource][crate::model::WriteLogEntriesRequest::resource].
825 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
826 where
827 T: std::convert::Into<api::model::MonitoredResource>,
828 {
829 self.resource = v.map(|x| x.into());
830 self
831 }
832
833 /// Sets the value of [labels][crate::model::WriteLogEntriesRequest::labels].
834 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
835 where
836 T: std::iter::IntoIterator<Item = (K, V)>,
837 K: std::convert::Into<std::string::String>,
838 V: std::convert::Into<std::string::String>,
839 {
840 use std::iter::Iterator;
841 self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
842 self
843 }
844
845 /// Sets the value of [entries][crate::model::WriteLogEntriesRequest::entries].
846 pub fn set_entries<T, V>(mut self, v: T) -> Self
847 where
848 T: std::iter::IntoIterator<Item = V>,
849 V: std::convert::Into<crate::model::LogEntry>,
850 {
851 use std::iter::Iterator;
852 self.entries = v.into_iter().map(|i| i.into()).collect();
853 self
854 }
855
856 /// Sets the value of [partial_success][crate::model::WriteLogEntriesRequest::partial_success].
857 pub fn set_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
858 self.partial_success = v.into();
859 self
860 }
861
862 /// Sets the value of [dry_run][crate::model::WriteLogEntriesRequest::dry_run].
863 pub fn set_dry_run<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
864 self.dry_run = v.into();
865 self
866 }
867}
868
869impl wkt::message::Message for WriteLogEntriesRequest {
870 fn typename() -> &'static str {
871 "type.googleapis.com/google.logging.v2.WriteLogEntriesRequest"
872 }
873}
874
875/// Result returned from WriteLogEntries.
876#[derive(Clone, Default, PartialEq)]
877#[non_exhaustive]
878pub struct WriteLogEntriesResponse {
879 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
880}
881
882impl WriteLogEntriesResponse {
883 pub fn new() -> Self {
884 std::default::Default::default()
885 }
886}
887
888impl wkt::message::Message for WriteLogEntriesResponse {
889 fn typename() -> &'static str {
890 "type.googleapis.com/google.logging.v2.WriteLogEntriesResponse"
891 }
892}
893
894/// Error details for WriteLogEntries with partial success.
895#[derive(Clone, Default, PartialEq)]
896#[non_exhaustive]
897pub struct WriteLogEntriesPartialErrors {
898 /// When `WriteLogEntriesRequest.partial_success` is true, records the error
899 /// status for entries that were not written due to a permanent error, keyed
900 /// by the entry's zero-based index in `WriteLogEntriesRequest.entries`.
901 ///
902 /// Failed requests for which no entries are written will not include
903 /// per-entry errors.
904 pub log_entry_errors: std::collections::HashMap<i32, rpc::model::Status>,
905
906 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
907}
908
909impl WriteLogEntriesPartialErrors {
910 pub fn new() -> Self {
911 std::default::Default::default()
912 }
913
914 /// Sets the value of [log_entry_errors][crate::model::WriteLogEntriesPartialErrors::log_entry_errors].
915 pub fn set_log_entry_errors<T, K, V>(mut self, v: T) -> Self
916 where
917 T: std::iter::IntoIterator<Item = (K, V)>,
918 K: std::convert::Into<i32>,
919 V: std::convert::Into<rpc::model::Status>,
920 {
921 use std::iter::Iterator;
922 self.log_entry_errors = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
923 self
924 }
925}
926
927impl wkt::message::Message for WriteLogEntriesPartialErrors {
928 fn typename() -> &'static str {
929 "type.googleapis.com/google.logging.v2.WriteLogEntriesPartialErrors"
930 }
931}
932
933/// The parameters to `ListLogEntries`.
934#[derive(Clone, Default, PartialEq)]
935#[non_exhaustive]
936pub struct ListLogEntriesRequest {
937 /// Required. Names of one or more parent resources from which to
938 /// retrieve log entries:
939 ///
940 /// * `projects/[PROJECT_ID]`
941 /// * `organizations/[ORGANIZATION_ID]`
942 /// * `billingAccounts/[BILLING_ACCOUNT_ID]`
943 /// * `folders/[FOLDER_ID]`
944 ///
945 /// May alternatively be one or more views:
946 ///
947 /// * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
948 /// * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
949 /// * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
950 /// * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
951 ///
952 /// Projects listed in the `project_ids` field are added to this list.
953 /// A maximum of 100 resources may be specified in a single request.
954 pub resource_names: std::vec::Vec<std::string::String>,
955
956 /// Optional. Only log entries that match the filter are returned. An empty
957 /// filter matches all log entries in the resources listed in `resource_names`.
958 /// Referencing a parent resource that is not listed in `resource_names` will
959 /// cause the filter to return no results. The maximum length of a filter is
960 /// 20,000 characters.
961 pub filter: std::string::String,
962
963 /// Optional. How the results should be sorted. Presently, the only permitted
964 /// values are `"timestamp asc"` (default) and `"timestamp desc"`. The first
965 /// option returns entries in order of increasing values of
966 /// `LogEntry.timestamp` (oldest first), and the second option returns entries
967 /// in order of decreasing timestamps (newest first). Entries with equal
968 /// timestamps are returned in order of their `insert_id` values.
969 pub order_by: std::string::String,
970
971 /// Optional. The maximum number of results to return from this request.
972 /// Default is 50. If the value is negative or exceeds 1000, the request is
973 /// rejected. The presence of `next_page_token` in the response indicates that
974 /// more results might be available.
975 pub page_size: i32,
976
977 /// Optional. If present, then retrieve the next batch of results from the
978 /// preceding call to this method. `page_token` must be the value of
979 /// `next_page_token` from the previous response. The values of other method
980 /// parameters should be identical to those in the previous call.
981 pub page_token: std::string::String,
982
983 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
984}
985
986impl ListLogEntriesRequest {
987 pub fn new() -> Self {
988 std::default::Default::default()
989 }
990
991 /// Sets the value of [resource_names][crate::model::ListLogEntriesRequest::resource_names].
992 pub fn set_resource_names<T, V>(mut self, v: T) -> Self
993 where
994 T: std::iter::IntoIterator<Item = V>,
995 V: std::convert::Into<std::string::String>,
996 {
997 use std::iter::Iterator;
998 self.resource_names = v.into_iter().map(|i| i.into()).collect();
999 self
1000 }
1001
1002 /// Sets the value of [filter][crate::model::ListLogEntriesRequest::filter].
1003 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1004 self.filter = v.into();
1005 self
1006 }
1007
1008 /// Sets the value of [order_by][crate::model::ListLogEntriesRequest::order_by].
1009 pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1010 self.order_by = v.into();
1011 self
1012 }
1013
1014 /// Sets the value of [page_size][crate::model::ListLogEntriesRequest::page_size].
1015 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1016 self.page_size = v.into();
1017 self
1018 }
1019
1020 /// Sets the value of [page_token][crate::model::ListLogEntriesRequest::page_token].
1021 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1022 self.page_token = v.into();
1023 self
1024 }
1025}
1026
1027impl wkt::message::Message for ListLogEntriesRequest {
1028 fn typename() -> &'static str {
1029 "type.googleapis.com/google.logging.v2.ListLogEntriesRequest"
1030 }
1031}
1032
1033/// Result returned from `ListLogEntries`.
1034#[derive(Clone, Default, PartialEq)]
1035#[non_exhaustive]
1036pub struct ListLogEntriesResponse {
1037 /// A list of log entries. If `entries` is empty, `nextPageToken` may still be
1038 /// returned, indicating that more entries may exist. See `nextPageToken` for
1039 /// more information.
1040 pub entries: std::vec::Vec<crate::model::LogEntry>,
1041
1042 /// If there might be more results than those appearing in this response, then
1043 /// `nextPageToken` is included. To get the next set of results, call this
1044 /// method again using the value of `nextPageToken` as `pageToken`.
1045 ///
1046 /// If a value for `next_page_token` appears and the `entries` field is empty,
1047 /// it means that the search found no log entries so far but it did not have
1048 /// time to search all the possible log entries. Retry the method with this
1049 /// value for `page_token` to continue the search. Alternatively, consider
1050 /// speeding up the search by changing your filter to specify a single log name
1051 /// or resource type, or to narrow the time range of the search.
1052 pub next_page_token: std::string::String,
1053
1054 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1055}
1056
1057impl ListLogEntriesResponse {
1058 pub fn new() -> Self {
1059 std::default::Default::default()
1060 }
1061
1062 /// Sets the value of [entries][crate::model::ListLogEntriesResponse::entries].
1063 pub fn set_entries<T, V>(mut self, v: T) -> Self
1064 where
1065 T: std::iter::IntoIterator<Item = V>,
1066 V: std::convert::Into<crate::model::LogEntry>,
1067 {
1068 use std::iter::Iterator;
1069 self.entries = v.into_iter().map(|i| i.into()).collect();
1070 self
1071 }
1072
1073 /// Sets the value of [next_page_token][crate::model::ListLogEntriesResponse::next_page_token].
1074 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1075 self.next_page_token = v.into();
1076 self
1077 }
1078}
1079
1080impl wkt::message::Message for ListLogEntriesResponse {
1081 fn typename() -> &'static str {
1082 "type.googleapis.com/google.logging.v2.ListLogEntriesResponse"
1083 }
1084}
1085
1086#[doc(hidden)]
1087impl gax::paginator::internal::PageableResponse for ListLogEntriesResponse {
1088 type PageItem = crate::model::LogEntry;
1089
1090 fn items(self) -> std::vec::Vec<Self::PageItem> {
1091 self.entries
1092 }
1093
1094 fn next_page_token(&self) -> std::string::String {
1095 use std::clone::Clone;
1096 self.next_page_token.clone()
1097 }
1098}
1099
1100/// The parameters to ListMonitoredResourceDescriptors
1101#[derive(Clone, Default, PartialEq)]
1102#[non_exhaustive]
1103pub struct ListMonitoredResourceDescriptorsRequest {
1104 /// Optional. The maximum number of results to return from this request.
1105 /// Non-positive values are ignored. The presence of `nextPageToken` in the
1106 /// response indicates that more results might be available.
1107 pub page_size: i32,
1108
1109 /// Optional. If present, then retrieve the next batch of results from the
1110 /// preceding call to this method. `pageToken` must be the value of
1111 /// `nextPageToken` from the previous response. The values of other method
1112 /// parameters should be identical to those in the previous call.
1113 pub page_token: std::string::String,
1114
1115 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1116}
1117
1118impl ListMonitoredResourceDescriptorsRequest {
1119 pub fn new() -> Self {
1120 std::default::Default::default()
1121 }
1122
1123 /// Sets the value of [page_size][crate::model::ListMonitoredResourceDescriptorsRequest::page_size].
1124 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1125 self.page_size = v.into();
1126 self
1127 }
1128
1129 /// Sets the value of [page_token][crate::model::ListMonitoredResourceDescriptorsRequest::page_token].
1130 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1131 self.page_token = v.into();
1132 self
1133 }
1134}
1135
1136impl wkt::message::Message for ListMonitoredResourceDescriptorsRequest {
1137 fn typename() -> &'static str {
1138 "type.googleapis.com/google.logging.v2.ListMonitoredResourceDescriptorsRequest"
1139 }
1140}
1141
1142/// Result returned from ListMonitoredResourceDescriptors.
1143#[derive(Clone, Default, PartialEq)]
1144#[non_exhaustive]
1145pub struct ListMonitoredResourceDescriptorsResponse {
1146 /// A list of resource descriptors.
1147 pub resource_descriptors: std::vec::Vec<api::model::MonitoredResourceDescriptor>,
1148
1149 /// If there might be more results than those appearing in this response, then
1150 /// `nextPageToken` is included. To get the next set of results, call this
1151 /// method again using the value of `nextPageToken` as `pageToken`.
1152 pub next_page_token: std::string::String,
1153
1154 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1155}
1156
1157impl ListMonitoredResourceDescriptorsResponse {
1158 pub fn new() -> Self {
1159 std::default::Default::default()
1160 }
1161
1162 /// Sets the value of [resource_descriptors][crate::model::ListMonitoredResourceDescriptorsResponse::resource_descriptors].
1163 pub fn set_resource_descriptors<T, V>(mut self, v: T) -> Self
1164 where
1165 T: std::iter::IntoIterator<Item = V>,
1166 V: std::convert::Into<api::model::MonitoredResourceDescriptor>,
1167 {
1168 use std::iter::Iterator;
1169 self.resource_descriptors = v.into_iter().map(|i| i.into()).collect();
1170 self
1171 }
1172
1173 /// Sets the value of [next_page_token][crate::model::ListMonitoredResourceDescriptorsResponse::next_page_token].
1174 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1175 self.next_page_token = v.into();
1176 self
1177 }
1178}
1179
1180impl wkt::message::Message for ListMonitoredResourceDescriptorsResponse {
1181 fn typename() -> &'static str {
1182 "type.googleapis.com/google.logging.v2.ListMonitoredResourceDescriptorsResponse"
1183 }
1184}
1185
1186#[doc(hidden)]
1187impl gax::paginator::internal::PageableResponse for ListMonitoredResourceDescriptorsResponse {
1188 type PageItem = api::model::MonitoredResourceDescriptor;
1189
1190 fn items(self) -> std::vec::Vec<Self::PageItem> {
1191 self.resource_descriptors
1192 }
1193
1194 fn next_page_token(&self) -> std::string::String {
1195 use std::clone::Clone;
1196 self.next_page_token.clone()
1197 }
1198}
1199
1200/// The parameters to ListLogs.
1201#[derive(Clone, Default, PartialEq)]
1202#[non_exhaustive]
1203pub struct ListLogsRequest {
1204 /// Required. The resource name to list logs for:
1205 ///
1206 /// * `projects/[PROJECT_ID]`
1207 /// * `organizations/[ORGANIZATION_ID]`
1208 /// * `billingAccounts/[BILLING_ACCOUNT_ID]`
1209 /// * `folders/[FOLDER_ID]`
1210 pub parent: std::string::String,
1211
1212 /// Optional. List of resource names to list logs for:
1213 ///
1214 /// * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
1215 /// * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
1216 /// * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
1217 /// * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
1218 ///
1219 /// To support legacy queries, it could also be:
1220 ///
1221 /// * `projects/[PROJECT_ID]`
1222 /// * `organizations/[ORGANIZATION_ID]`
1223 /// * `billingAccounts/[BILLING_ACCOUNT_ID]`
1224 /// * `folders/[FOLDER_ID]`
1225 ///
1226 /// The resource name in the `parent` field is added to this list.
1227 pub resource_names: std::vec::Vec<std::string::String>,
1228
1229 /// Optional. The maximum number of results to return from this request.
1230 /// Non-positive values are ignored. The presence of `nextPageToken` in the
1231 /// response indicates that more results might be available.
1232 pub page_size: i32,
1233
1234 /// Optional. If present, then retrieve the next batch of results from the
1235 /// preceding call to this method. `pageToken` must be the value of
1236 /// `nextPageToken` from the previous response. The values of other method
1237 /// parameters should be identical to those in the previous call.
1238 pub page_token: std::string::String,
1239
1240 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1241}
1242
1243impl ListLogsRequest {
1244 pub fn new() -> Self {
1245 std::default::Default::default()
1246 }
1247
1248 /// Sets the value of [parent][crate::model::ListLogsRequest::parent].
1249 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1250 self.parent = v.into();
1251 self
1252 }
1253
1254 /// Sets the value of [resource_names][crate::model::ListLogsRequest::resource_names].
1255 pub fn set_resource_names<T, V>(mut self, v: T) -> Self
1256 where
1257 T: std::iter::IntoIterator<Item = V>,
1258 V: std::convert::Into<std::string::String>,
1259 {
1260 use std::iter::Iterator;
1261 self.resource_names = v.into_iter().map(|i| i.into()).collect();
1262 self
1263 }
1264
1265 /// Sets the value of [page_size][crate::model::ListLogsRequest::page_size].
1266 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1267 self.page_size = v.into();
1268 self
1269 }
1270
1271 /// Sets the value of [page_token][crate::model::ListLogsRequest::page_token].
1272 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1273 self.page_token = v.into();
1274 self
1275 }
1276}
1277
1278impl wkt::message::Message for ListLogsRequest {
1279 fn typename() -> &'static str {
1280 "type.googleapis.com/google.logging.v2.ListLogsRequest"
1281 }
1282}
1283
1284/// Result returned from ListLogs.
1285#[derive(Clone, Default, PartialEq)]
1286#[non_exhaustive]
1287pub struct ListLogsResponse {
1288 /// A list of log names. For example,
1289 /// `"projects/my-project/logs/syslog"` or
1290 /// `"organizations/123/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
1291 pub log_names: std::vec::Vec<std::string::String>,
1292
1293 /// If there might be more results than those appearing in this response, then
1294 /// `nextPageToken` is included. To get the next set of results, call this
1295 /// method again using the value of `nextPageToken` as `pageToken`.
1296 pub next_page_token: std::string::String,
1297
1298 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1299}
1300
1301impl ListLogsResponse {
1302 pub fn new() -> Self {
1303 std::default::Default::default()
1304 }
1305
1306 /// Sets the value of [log_names][crate::model::ListLogsResponse::log_names].
1307 pub fn set_log_names<T, V>(mut self, v: T) -> Self
1308 where
1309 T: std::iter::IntoIterator<Item = V>,
1310 V: std::convert::Into<std::string::String>,
1311 {
1312 use std::iter::Iterator;
1313 self.log_names = v.into_iter().map(|i| i.into()).collect();
1314 self
1315 }
1316
1317 /// Sets the value of [next_page_token][crate::model::ListLogsResponse::next_page_token].
1318 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1319 self.next_page_token = v.into();
1320 self
1321 }
1322}
1323
1324impl wkt::message::Message for ListLogsResponse {
1325 fn typename() -> &'static str {
1326 "type.googleapis.com/google.logging.v2.ListLogsResponse"
1327 }
1328}
1329
1330/// The parameters to `TailLogEntries`.
1331#[derive(Clone, Default, PartialEq)]
1332#[non_exhaustive]
1333pub struct TailLogEntriesRequest {
1334 /// Required. Name of a parent resource from which to retrieve log entries:
1335 ///
1336 /// * `projects/[PROJECT_ID]`
1337 /// * `organizations/[ORGANIZATION_ID]`
1338 /// * `billingAccounts/[BILLING_ACCOUNT_ID]`
1339 /// * `folders/[FOLDER_ID]`
1340 ///
1341 /// May alternatively be one or more views:
1342 ///
1343 /// * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
1344 /// * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
1345 /// * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
1346 /// * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
1347 pub resource_names: std::vec::Vec<std::string::String>,
1348
1349 /// Optional. Only log entries that match the filter are returned. An empty
1350 /// filter matches all log entries in the resources listed in `resource_names`.
1351 /// Referencing a parent resource that is not listed in `resource_names` will
1352 /// cause the filter to return no results. The maximum length of a filter is
1353 /// 20,000 characters.
1354 pub filter: std::string::String,
1355
1356 /// Optional. The amount of time to buffer log entries at the server before
1357 /// being returned to prevent out of order results due to late arriving log
1358 /// entries. Valid values are between 0-60000 milliseconds. Defaults to 2000
1359 /// milliseconds.
1360 pub buffer_window: std::option::Option<wkt::Duration>,
1361
1362 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1363}
1364
1365impl TailLogEntriesRequest {
1366 pub fn new() -> Self {
1367 std::default::Default::default()
1368 }
1369
1370 /// Sets the value of [resource_names][crate::model::TailLogEntriesRequest::resource_names].
1371 pub fn set_resource_names<T, V>(mut self, v: T) -> Self
1372 where
1373 T: std::iter::IntoIterator<Item = V>,
1374 V: std::convert::Into<std::string::String>,
1375 {
1376 use std::iter::Iterator;
1377 self.resource_names = v.into_iter().map(|i| i.into()).collect();
1378 self
1379 }
1380
1381 /// Sets the value of [filter][crate::model::TailLogEntriesRequest::filter].
1382 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1383 self.filter = v.into();
1384 self
1385 }
1386
1387 /// Sets the value of [buffer_window][crate::model::TailLogEntriesRequest::buffer_window].
1388 pub fn set_buffer_window<T>(mut self, v: T) -> Self
1389 where
1390 T: std::convert::Into<wkt::Duration>,
1391 {
1392 self.buffer_window = std::option::Option::Some(v.into());
1393 self
1394 }
1395
1396 /// Sets or clears the value of [buffer_window][crate::model::TailLogEntriesRequest::buffer_window].
1397 pub fn set_or_clear_buffer_window<T>(mut self, v: std::option::Option<T>) -> Self
1398 where
1399 T: std::convert::Into<wkt::Duration>,
1400 {
1401 self.buffer_window = v.map(|x| x.into());
1402 self
1403 }
1404}
1405
1406impl wkt::message::Message for TailLogEntriesRequest {
1407 fn typename() -> &'static str {
1408 "type.googleapis.com/google.logging.v2.TailLogEntriesRequest"
1409 }
1410}
1411
1412/// Result returned from `TailLogEntries`.
1413#[derive(Clone, Default, PartialEq)]
1414#[non_exhaustive]
1415pub struct TailLogEntriesResponse {
1416 /// A list of log entries. Each response in the stream will order entries with
1417 /// increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
1418 /// between separate responses.
1419 pub entries: std::vec::Vec<crate::model::LogEntry>,
1420
1421 /// If entries that otherwise would have been included in the session were not
1422 /// sent back to the client, counts of relevant entries omitted from the
1423 /// session with the reason that they were not included. There will be at most
1424 /// one of each reason per response. The counts represent the number of
1425 /// suppressed entries since the last streamed response.
1426 pub suppression_info: std::vec::Vec<crate::model::tail_log_entries_response::SuppressionInfo>,
1427
1428 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1429}
1430
1431impl TailLogEntriesResponse {
1432 pub fn new() -> Self {
1433 std::default::Default::default()
1434 }
1435
1436 /// Sets the value of [entries][crate::model::TailLogEntriesResponse::entries].
1437 pub fn set_entries<T, V>(mut self, v: T) -> Self
1438 where
1439 T: std::iter::IntoIterator<Item = V>,
1440 V: std::convert::Into<crate::model::LogEntry>,
1441 {
1442 use std::iter::Iterator;
1443 self.entries = v.into_iter().map(|i| i.into()).collect();
1444 self
1445 }
1446
1447 /// Sets the value of [suppression_info][crate::model::TailLogEntriesResponse::suppression_info].
1448 pub fn set_suppression_info<T, V>(mut self, v: T) -> Self
1449 where
1450 T: std::iter::IntoIterator<Item = V>,
1451 V: std::convert::Into<crate::model::tail_log_entries_response::SuppressionInfo>,
1452 {
1453 use std::iter::Iterator;
1454 self.suppression_info = v.into_iter().map(|i| i.into()).collect();
1455 self
1456 }
1457}
1458
1459impl wkt::message::Message for TailLogEntriesResponse {
1460 fn typename() -> &'static str {
1461 "type.googleapis.com/google.logging.v2.TailLogEntriesResponse"
1462 }
1463}
1464
1465/// Defines additional types related to [TailLogEntriesResponse].
1466pub mod tail_log_entries_response {
1467 #[allow(unused_imports)]
1468 use super::*;
1469
1470 /// Information about entries that were omitted from the session.
1471 #[derive(Clone, Default, PartialEq)]
1472 #[non_exhaustive]
1473 pub struct SuppressionInfo {
1474 /// The reason that entries were omitted from the session.
1475 pub reason: crate::model::tail_log_entries_response::suppression_info::Reason,
1476
1477 /// A lower bound on the count of entries omitted due to `reason`.
1478 pub suppressed_count: i32,
1479
1480 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1481 }
1482
1483 impl SuppressionInfo {
1484 pub fn new() -> Self {
1485 std::default::Default::default()
1486 }
1487
1488 /// Sets the value of [reason][crate::model::tail_log_entries_response::SuppressionInfo::reason].
1489 pub fn set_reason<
1490 T: std::convert::Into<crate::model::tail_log_entries_response::suppression_info::Reason>,
1491 >(
1492 mut self,
1493 v: T,
1494 ) -> Self {
1495 self.reason = v.into();
1496 self
1497 }
1498
1499 /// Sets the value of [suppressed_count][crate::model::tail_log_entries_response::SuppressionInfo::suppressed_count].
1500 pub fn set_suppressed_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1501 self.suppressed_count = v.into();
1502 self
1503 }
1504 }
1505
1506 impl wkt::message::Message for SuppressionInfo {
1507 fn typename() -> &'static str {
1508 "type.googleapis.com/google.logging.v2.TailLogEntriesResponse.SuppressionInfo"
1509 }
1510 }
1511
1512 /// Defines additional types related to [SuppressionInfo].
1513 pub mod suppression_info {
1514 #[allow(unused_imports)]
1515 use super::*;
1516
1517 /// An indicator of why entries were omitted.
1518 ///
1519 /// # Working with unknown values
1520 ///
1521 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1522 /// additional enum variants at any time. Adding new variants is not considered
1523 /// a breaking change. Applications should write their code in anticipation of:
1524 ///
1525 /// - New values appearing in future releases of the client library, **and**
1526 /// - New values received dynamically, without application changes.
1527 ///
1528 /// Please consult the [Working with enums] section in the user guide for some
1529 /// guidelines.
1530 ///
1531 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
1532 #[derive(Clone, Debug, PartialEq)]
1533 #[non_exhaustive]
1534 pub enum Reason {
1535 /// Unexpected default.
1536 Unspecified,
1537 /// Indicates suppression occurred due to relevant entries being
1538 /// received in excess of rate limits. For quotas and limits, see
1539 /// [Logging API quotas and
1540 /// limits](https://cloud.google.com/logging/quotas#api-limits).
1541 RateLimit,
1542 /// Indicates suppression occurred due to the client not consuming
1543 /// responses quickly enough.
1544 NotConsumed,
1545 /// If set, the enum was initialized with an unknown value.
1546 ///
1547 /// Applications can examine the value using [Reason::value] or
1548 /// [Reason::name].
1549 UnknownValue(reason::UnknownValue),
1550 }
1551
1552 #[doc(hidden)]
1553 pub mod reason {
1554 #[allow(unused_imports)]
1555 use super::*;
1556 #[derive(Clone, Debug, PartialEq)]
1557 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1558 }
1559
1560 impl Reason {
1561 /// Gets the enum value.
1562 ///
1563 /// Returns `None` if the enum contains an unknown value deserialized from
1564 /// the string representation of enums.
1565 pub fn value(&self) -> std::option::Option<i32> {
1566 match self {
1567 Self::Unspecified => std::option::Option::Some(0),
1568 Self::RateLimit => std::option::Option::Some(1),
1569 Self::NotConsumed => std::option::Option::Some(2),
1570 Self::UnknownValue(u) => u.0.value(),
1571 }
1572 }
1573
1574 /// Gets the enum value as a string.
1575 ///
1576 /// Returns `None` if the enum contains an unknown value deserialized from
1577 /// the integer representation of enums.
1578 pub fn name(&self) -> std::option::Option<&str> {
1579 match self {
1580 Self::Unspecified => std::option::Option::Some("REASON_UNSPECIFIED"),
1581 Self::RateLimit => std::option::Option::Some("RATE_LIMIT"),
1582 Self::NotConsumed => std::option::Option::Some("NOT_CONSUMED"),
1583 Self::UnknownValue(u) => u.0.name(),
1584 }
1585 }
1586 }
1587
1588 impl std::default::Default for Reason {
1589 fn default() -> Self {
1590 use std::convert::From;
1591 Self::from(0)
1592 }
1593 }
1594
1595 impl std::fmt::Display for Reason {
1596 fn fmt(
1597 &self,
1598 f: &mut std::fmt::Formatter<'_>,
1599 ) -> std::result::Result<(), std::fmt::Error> {
1600 wkt::internal::display_enum(f, self.name(), self.value())
1601 }
1602 }
1603
1604 impl std::convert::From<i32> for Reason {
1605 fn from(value: i32) -> Self {
1606 match value {
1607 0 => Self::Unspecified,
1608 1 => Self::RateLimit,
1609 2 => Self::NotConsumed,
1610 _ => Self::UnknownValue(reason::UnknownValue(
1611 wkt::internal::UnknownEnumValue::Integer(value),
1612 )),
1613 }
1614 }
1615 }
1616
1617 impl std::convert::From<&str> for Reason {
1618 fn from(value: &str) -> Self {
1619 use std::string::ToString;
1620 match value {
1621 "REASON_UNSPECIFIED" => Self::Unspecified,
1622 "RATE_LIMIT" => Self::RateLimit,
1623 "NOT_CONSUMED" => Self::NotConsumed,
1624 _ => Self::UnknownValue(reason::UnknownValue(
1625 wkt::internal::UnknownEnumValue::String(value.to_string()),
1626 )),
1627 }
1628 }
1629 }
1630
1631 impl serde::ser::Serialize for Reason {
1632 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1633 where
1634 S: serde::Serializer,
1635 {
1636 match self {
1637 Self::Unspecified => serializer.serialize_i32(0),
1638 Self::RateLimit => serializer.serialize_i32(1),
1639 Self::NotConsumed => serializer.serialize_i32(2),
1640 Self::UnknownValue(u) => u.0.serialize(serializer),
1641 }
1642 }
1643 }
1644
1645 impl<'de> serde::de::Deserialize<'de> for Reason {
1646 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1647 where
1648 D: serde::Deserializer<'de>,
1649 {
1650 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Reason>::new(
1651 ".google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason",
1652 ))
1653 }
1654 }
1655 }
1656}
1657
1658/// Configuration for an indexed field.
1659#[derive(Clone, Default, PartialEq)]
1660#[non_exhaustive]
1661pub struct IndexConfig {
1662 /// Required. The LogEntry field path to index.
1663 ///
1664 /// Note that some paths are automatically indexed, and other paths are not
1665 /// eligible for indexing. See [indexing documentation](
1666 /// <https://cloud.google.com/logging/docs/view/advanced-queries#indexed-fields>)
1667 /// for details.
1668 ///
1669 /// For example: `jsonPayload.request.status`
1670 pub field_path: std::string::String,
1671
1672 /// Required. The type of data in this index.
1673 pub r#type: crate::model::IndexType,
1674
1675 /// Output only. The timestamp when the index was last modified.
1676 ///
1677 /// This is used to return the timestamp, and will be ignored if supplied
1678 /// during update.
1679 pub create_time: std::option::Option<wkt::Timestamp>,
1680
1681 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1682}
1683
1684impl IndexConfig {
1685 pub fn new() -> Self {
1686 std::default::Default::default()
1687 }
1688
1689 /// Sets the value of [field_path][crate::model::IndexConfig::field_path].
1690 pub fn set_field_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1691 self.field_path = v.into();
1692 self
1693 }
1694
1695 /// Sets the value of [r#type][crate::model::IndexConfig::type].
1696 pub fn set_type<T: std::convert::Into<crate::model::IndexType>>(mut self, v: T) -> Self {
1697 self.r#type = v.into();
1698 self
1699 }
1700
1701 /// Sets the value of [create_time][crate::model::IndexConfig::create_time].
1702 pub fn set_create_time<T>(mut self, v: T) -> Self
1703 where
1704 T: std::convert::Into<wkt::Timestamp>,
1705 {
1706 self.create_time = std::option::Option::Some(v.into());
1707 self
1708 }
1709
1710 /// Sets or clears the value of [create_time][crate::model::IndexConfig::create_time].
1711 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1712 where
1713 T: std::convert::Into<wkt::Timestamp>,
1714 {
1715 self.create_time = v.map(|x| x.into());
1716 self
1717 }
1718}
1719
1720impl wkt::message::Message for IndexConfig {
1721 fn typename() -> &'static str {
1722 "type.googleapis.com/google.logging.v2.IndexConfig"
1723 }
1724}
1725
1726/// Describes a repository in which log entries are stored.
1727#[derive(Clone, Default, PartialEq)]
1728#[non_exhaustive]
1729pub struct LogBucket {
1730 /// Output only. The resource name of the bucket.
1731 ///
1732 /// For example:
1733 ///
1734 /// `projects/my-project/locations/global/buckets/my-bucket`
1735 ///
1736 /// For a list of supported locations, see [Supported
1737 /// Regions](https://cloud.google.com/logging/docs/region-support)
1738 ///
1739 /// For the location of `global` it is unspecified where log entries are
1740 /// actually stored.
1741 ///
1742 /// After a bucket has been created, the location cannot be changed.
1743 pub name: std::string::String,
1744
1745 /// Describes this bucket.
1746 pub description: std::string::String,
1747
1748 /// Output only. The creation timestamp of the bucket. This is not set for any
1749 /// of the default buckets.
1750 pub create_time: std::option::Option<wkt::Timestamp>,
1751
1752 /// Output only. The last update timestamp of the bucket.
1753 pub update_time: std::option::Option<wkt::Timestamp>,
1754
1755 /// Logs will be retained by default for this amount of time, after which they
1756 /// will automatically be deleted. The minimum retention period is 1 day. If
1757 /// this value is set to zero at bucket creation time, the default time of 30
1758 /// days will be used.
1759 pub retention_days: i32,
1760
1761 /// Whether the bucket is locked.
1762 ///
1763 /// The retention period on a locked bucket cannot be changed. Locked buckets
1764 /// may only be deleted if they are empty.
1765 pub locked: bool,
1766
1767 /// Output only. The bucket lifecycle state.
1768 pub lifecycle_state: crate::model::LifecycleState,
1769
1770 /// Whether log analytics is enabled for this bucket.
1771 ///
1772 /// Once enabled, log analytics features cannot be disabled.
1773 pub analytics_enabled: bool,
1774
1775 /// Log entry field paths that are denied access in this bucket.
1776 ///
1777 /// The following fields and their children are eligible: `textPayload`,
1778 /// `jsonPayload`, `protoPayload`, `httpRequest`, `labels`, `sourceLocation`.
1779 ///
1780 /// Restricting a repeated field will restrict all values. Adding a parent will
1781 /// block all child fields. (e.g. `foo.bar` will block `foo.bar.baz`)
1782 pub restricted_fields: std::vec::Vec<std::string::String>,
1783
1784 /// A list of indexed fields and related configuration data.
1785 pub index_configs: std::vec::Vec<crate::model::IndexConfig>,
1786
1787 /// The CMEK settings of the log bucket. If present, new log entries written to
1788 /// this log bucket are encrypted using the CMEK key provided in this
1789 /// configuration. If a log bucket has CMEK settings, the CMEK settings cannot
1790 /// be disabled later by updating the log bucket. Changing the KMS key is
1791 /// allowed.
1792 pub cmek_settings: std::option::Option<crate::model::CmekSettings>,
1793
1794 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1795}
1796
1797impl LogBucket {
1798 pub fn new() -> Self {
1799 std::default::Default::default()
1800 }
1801
1802 /// Sets the value of [name][crate::model::LogBucket::name].
1803 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1804 self.name = v.into();
1805 self
1806 }
1807
1808 /// Sets the value of [description][crate::model::LogBucket::description].
1809 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1810 self.description = v.into();
1811 self
1812 }
1813
1814 /// Sets the value of [create_time][crate::model::LogBucket::create_time].
1815 pub fn set_create_time<T>(mut self, v: T) -> Self
1816 where
1817 T: std::convert::Into<wkt::Timestamp>,
1818 {
1819 self.create_time = std::option::Option::Some(v.into());
1820 self
1821 }
1822
1823 /// Sets or clears the value of [create_time][crate::model::LogBucket::create_time].
1824 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1825 where
1826 T: std::convert::Into<wkt::Timestamp>,
1827 {
1828 self.create_time = v.map(|x| x.into());
1829 self
1830 }
1831
1832 /// Sets the value of [update_time][crate::model::LogBucket::update_time].
1833 pub fn set_update_time<T>(mut self, v: T) -> Self
1834 where
1835 T: std::convert::Into<wkt::Timestamp>,
1836 {
1837 self.update_time = std::option::Option::Some(v.into());
1838 self
1839 }
1840
1841 /// Sets or clears the value of [update_time][crate::model::LogBucket::update_time].
1842 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1843 where
1844 T: std::convert::Into<wkt::Timestamp>,
1845 {
1846 self.update_time = v.map(|x| x.into());
1847 self
1848 }
1849
1850 /// Sets the value of [retention_days][crate::model::LogBucket::retention_days].
1851 pub fn set_retention_days<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1852 self.retention_days = v.into();
1853 self
1854 }
1855
1856 /// Sets the value of [locked][crate::model::LogBucket::locked].
1857 pub fn set_locked<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1858 self.locked = v.into();
1859 self
1860 }
1861
1862 /// Sets the value of [lifecycle_state][crate::model::LogBucket::lifecycle_state].
1863 pub fn set_lifecycle_state<T: std::convert::Into<crate::model::LifecycleState>>(
1864 mut self,
1865 v: T,
1866 ) -> Self {
1867 self.lifecycle_state = v.into();
1868 self
1869 }
1870
1871 /// Sets the value of [analytics_enabled][crate::model::LogBucket::analytics_enabled].
1872 pub fn set_analytics_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1873 self.analytics_enabled = v.into();
1874 self
1875 }
1876
1877 /// Sets the value of [restricted_fields][crate::model::LogBucket::restricted_fields].
1878 pub fn set_restricted_fields<T, V>(mut self, v: T) -> Self
1879 where
1880 T: std::iter::IntoIterator<Item = V>,
1881 V: std::convert::Into<std::string::String>,
1882 {
1883 use std::iter::Iterator;
1884 self.restricted_fields = v.into_iter().map(|i| i.into()).collect();
1885 self
1886 }
1887
1888 /// Sets the value of [index_configs][crate::model::LogBucket::index_configs].
1889 pub fn set_index_configs<T, V>(mut self, v: T) -> Self
1890 where
1891 T: std::iter::IntoIterator<Item = V>,
1892 V: std::convert::Into<crate::model::IndexConfig>,
1893 {
1894 use std::iter::Iterator;
1895 self.index_configs = v.into_iter().map(|i| i.into()).collect();
1896 self
1897 }
1898
1899 /// Sets the value of [cmek_settings][crate::model::LogBucket::cmek_settings].
1900 pub fn set_cmek_settings<T>(mut self, v: T) -> Self
1901 where
1902 T: std::convert::Into<crate::model::CmekSettings>,
1903 {
1904 self.cmek_settings = std::option::Option::Some(v.into());
1905 self
1906 }
1907
1908 /// Sets or clears the value of [cmek_settings][crate::model::LogBucket::cmek_settings].
1909 pub fn set_or_clear_cmek_settings<T>(mut self, v: std::option::Option<T>) -> Self
1910 where
1911 T: std::convert::Into<crate::model::CmekSettings>,
1912 {
1913 self.cmek_settings = v.map(|x| x.into());
1914 self
1915 }
1916}
1917
1918impl wkt::message::Message for LogBucket {
1919 fn typename() -> &'static str {
1920 "type.googleapis.com/google.logging.v2.LogBucket"
1921 }
1922}
1923
1924/// Describes a view over log entries in a bucket.
1925#[derive(Clone, Default, PartialEq)]
1926#[non_exhaustive]
1927pub struct LogView {
1928 /// The resource name of the view.
1929 ///
1930 /// For example:
1931 ///
1932 /// `projects/my-project/locations/global/buckets/my-bucket/views/my-view`
1933 pub name: std::string::String,
1934
1935 /// Describes this view.
1936 pub description: std::string::String,
1937
1938 /// Output only. The creation timestamp of the view.
1939 pub create_time: std::option::Option<wkt::Timestamp>,
1940
1941 /// Output only. The last update timestamp of the view.
1942 pub update_time: std::option::Option<wkt::Timestamp>,
1943
1944 /// Filter that restricts which log entries in a bucket are visible in this
1945 /// view.
1946 ///
1947 /// Filters are restricted to be a logical AND of ==/!= of any of the
1948 /// following:
1949 ///
1950 /// - originating project/folder/organization/billing account.
1951 /// - resource type
1952 /// - log id
1953 ///
1954 /// For example:
1955 ///
1956 /// SOURCE("projects/myproject") AND resource.type = "gce_instance"
1957 /// AND LOG_ID("stdout")
1958 pub filter: std::string::String,
1959
1960 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1961}
1962
1963impl LogView {
1964 pub fn new() -> Self {
1965 std::default::Default::default()
1966 }
1967
1968 /// Sets the value of [name][crate::model::LogView::name].
1969 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1970 self.name = v.into();
1971 self
1972 }
1973
1974 /// Sets the value of [description][crate::model::LogView::description].
1975 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1976 self.description = v.into();
1977 self
1978 }
1979
1980 /// Sets the value of [create_time][crate::model::LogView::create_time].
1981 pub fn set_create_time<T>(mut self, v: T) -> Self
1982 where
1983 T: std::convert::Into<wkt::Timestamp>,
1984 {
1985 self.create_time = std::option::Option::Some(v.into());
1986 self
1987 }
1988
1989 /// Sets or clears the value of [create_time][crate::model::LogView::create_time].
1990 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1991 where
1992 T: std::convert::Into<wkt::Timestamp>,
1993 {
1994 self.create_time = v.map(|x| x.into());
1995 self
1996 }
1997
1998 /// Sets the value of [update_time][crate::model::LogView::update_time].
1999 pub fn set_update_time<T>(mut self, v: T) -> Self
2000 where
2001 T: std::convert::Into<wkt::Timestamp>,
2002 {
2003 self.update_time = std::option::Option::Some(v.into());
2004 self
2005 }
2006
2007 /// Sets or clears the value of [update_time][crate::model::LogView::update_time].
2008 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2009 where
2010 T: std::convert::Into<wkt::Timestamp>,
2011 {
2012 self.update_time = v.map(|x| x.into());
2013 self
2014 }
2015
2016 /// Sets the value of [filter][crate::model::LogView::filter].
2017 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2018 self.filter = v.into();
2019 self
2020 }
2021}
2022
2023impl wkt::message::Message for LogView {
2024 fn typename() -> &'static str {
2025 "type.googleapis.com/google.logging.v2.LogView"
2026 }
2027}
2028
2029/// Describes a sink used to export log entries to one of the following
2030/// destinations in any project: a Cloud Storage bucket, a BigQuery dataset, a
2031/// Pub/Sub topic or a Cloud Logging log bucket. A logs filter controls which log
2032/// entries are exported. The sink must be created within a project,
2033/// organization, billing account, or folder.
2034#[derive(Clone, Default, PartialEq)]
2035#[non_exhaustive]
2036pub struct LogSink {
2037 /// Required. The client-assigned sink identifier, unique within the project.
2038 ///
2039 /// For example: `"my-syslog-errors-to-pubsub"`. Sink identifiers are limited
2040 /// to 100 characters and can include only the following characters: upper and
2041 /// lower-case alphanumeric characters, underscores, hyphens, and periods.
2042 /// First character has to be alphanumeric.
2043 pub name: std::string::String,
2044
2045 /// Required. The export destination:
2046 ///
2047 /// ```norust
2048 /// "storage.googleapis.com/[GCS_BUCKET]"
2049 /// "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
2050 /// "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
2051 /// ```
2052 ///
2053 /// The sink's `writer_identity`, set when the sink is created, must have
2054 /// permission to write to the destination or else the log entries are not
2055 /// exported. For more information, see
2056 /// [Exporting Logs with
2057 /// Sinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
2058 pub destination: std::string::String,
2059
2060 /// Optional. An [advanced logs
2061 /// filter](https://cloud.google.com/logging/docs/view/advanced-queries). The
2062 /// only exported log entries are those that are in the resource owning the
2063 /// sink and that match the filter.
2064 ///
2065 /// For example:
2066 ///
2067 /// `logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR`
2068 pub filter: std::string::String,
2069
2070 /// Optional. A description of this sink.
2071 ///
2072 /// The maximum length of the description is 8000 characters.
2073 pub description: std::string::String,
2074
2075 /// Optional. If set to true, then this sink is disabled and it does not export
2076 /// any log entries.
2077 pub disabled: bool,
2078
2079 /// Optional. Log entries that match any of these exclusion filters will not be
2080 /// exported.
2081 ///
2082 /// If a log entry is matched by both `filter` and one of `exclusion_filters`
2083 /// it will not be exported.
2084 pub exclusions: std::vec::Vec<crate::model::LogExclusion>,
2085
2086 /// Deprecated. This field is unused.
2087 #[deprecated]
2088 pub output_version_format: crate::model::log_sink::VersionFormat,
2089
2090 /// Output only. An IAM identity—a service account or group—under
2091 /// which Cloud Logging writes the exported log entries to the sink's
2092 /// destination. This field is either set by specifying
2093 /// `custom_writer_identity` or set automatically by
2094 /// [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink] and
2095 /// [sinks.update][google.logging.v2.ConfigServiceV2.UpdateSink] based on the
2096 /// value of `unique_writer_identity` in those methods.
2097 ///
2098 /// Until you grant this identity write-access to the destination, log entry
2099 /// exports from this sink will fail. For more information, see [Granting
2100 /// Access for a
2101 /// Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
2102 /// Consult the destination service's documentation to determine the
2103 /// appropriate IAM roles to assign to the identity.
2104 ///
2105 /// Sinks that have a destination that is a log bucket in the same project as
2106 /// the sink cannot have a writer_identity and no additional permissions are
2107 /// required.
2108 ///
2109 /// [google.logging.v2.ConfigServiceV2.CreateSink]: crate::client::ConfigServiceV2::create_sink
2110 /// [google.logging.v2.ConfigServiceV2.UpdateSink]: crate::client::ConfigServiceV2::update_sink
2111 pub writer_identity: std::string::String,
2112
2113 /// Optional. This field applies only to sinks owned by organizations and
2114 /// folders. If the field is false, the default, only the logs owned by the
2115 /// sink's parent resource are available for export. If the field is true, then
2116 /// log entries from all the projects, folders, and billing accounts contained
2117 /// in the sink's parent resource are also available for export. Whether a
2118 /// particular log entry from the children is exported depends on the sink's
2119 /// filter expression.
2120 ///
2121 /// For example, if this field is true, then the filter
2122 /// `resource.type=gce_instance` would export all Compute Engine VM instance
2123 /// log entries from all projects in the sink's parent.
2124 ///
2125 /// To only export entries from certain child projects, filter on the project
2126 /// part of the log name:
2127 ///
2128 /// logName:("projects/test-project1/" OR "projects/test-project2/") AND
2129 /// resource.type=gce_instance
2130 pub include_children: bool,
2131
2132 /// Output only. The creation timestamp of the sink.
2133 ///
2134 /// This field may not be present for older sinks.
2135 pub create_time: std::option::Option<wkt::Timestamp>,
2136
2137 /// Output only. The last update timestamp of the sink.
2138 ///
2139 /// This field may not be present for older sinks.
2140 pub update_time: std::option::Option<wkt::Timestamp>,
2141
2142 /// Destination dependent options.
2143 pub options: std::option::Option<crate::model::log_sink::Options>,
2144
2145 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2146}
2147
2148impl LogSink {
2149 pub fn new() -> Self {
2150 std::default::Default::default()
2151 }
2152
2153 /// Sets the value of [name][crate::model::LogSink::name].
2154 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2155 self.name = v.into();
2156 self
2157 }
2158
2159 /// Sets the value of [destination][crate::model::LogSink::destination].
2160 pub fn set_destination<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2161 self.destination = v.into();
2162 self
2163 }
2164
2165 /// Sets the value of [filter][crate::model::LogSink::filter].
2166 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2167 self.filter = v.into();
2168 self
2169 }
2170
2171 /// Sets the value of [description][crate::model::LogSink::description].
2172 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2173 self.description = v.into();
2174 self
2175 }
2176
2177 /// Sets the value of [disabled][crate::model::LogSink::disabled].
2178 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2179 self.disabled = v.into();
2180 self
2181 }
2182
2183 /// Sets the value of [exclusions][crate::model::LogSink::exclusions].
2184 pub fn set_exclusions<T, V>(mut self, v: T) -> Self
2185 where
2186 T: std::iter::IntoIterator<Item = V>,
2187 V: std::convert::Into<crate::model::LogExclusion>,
2188 {
2189 use std::iter::Iterator;
2190 self.exclusions = v.into_iter().map(|i| i.into()).collect();
2191 self
2192 }
2193
2194 /// Sets the value of [output_version_format][crate::model::LogSink::output_version_format].
2195 #[deprecated]
2196 pub fn set_output_version_format<
2197 T: std::convert::Into<crate::model::log_sink::VersionFormat>,
2198 >(
2199 mut self,
2200 v: T,
2201 ) -> Self {
2202 self.output_version_format = v.into();
2203 self
2204 }
2205
2206 /// Sets the value of [writer_identity][crate::model::LogSink::writer_identity].
2207 pub fn set_writer_identity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2208 self.writer_identity = v.into();
2209 self
2210 }
2211
2212 /// Sets the value of [include_children][crate::model::LogSink::include_children].
2213 pub fn set_include_children<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2214 self.include_children = v.into();
2215 self
2216 }
2217
2218 /// Sets the value of [create_time][crate::model::LogSink::create_time].
2219 pub fn set_create_time<T>(mut self, v: T) -> Self
2220 where
2221 T: std::convert::Into<wkt::Timestamp>,
2222 {
2223 self.create_time = std::option::Option::Some(v.into());
2224 self
2225 }
2226
2227 /// Sets or clears the value of [create_time][crate::model::LogSink::create_time].
2228 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2229 where
2230 T: std::convert::Into<wkt::Timestamp>,
2231 {
2232 self.create_time = v.map(|x| x.into());
2233 self
2234 }
2235
2236 /// Sets the value of [update_time][crate::model::LogSink::update_time].
2237 pub fn set_update_time<T>(mut self, v: T) -> Self
2238 where
2239 T: std::convert::Into<wkt::Timestamp>,
2240 {
2241 self.update_time = std::option::Option::Some(v.into());
2242 self
2243 }
2244
2245 /// Sets or clears the value of [update_time][crate::model::LogSink::update_time].
2246 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2247 where
2248 T: std::convert::Into<wkt::Timestamp>,
2249 {
2250 self.update_time = v.map(|x| x.into());
2251 self
2252 }
2253
2254 /// Sets the value of [options][crate::model::LogSink::options].
2255 ///
2256 /// Note that all the setters affecting `options` are mutually
2257 /// exclusive.
2258 pub fn set_options<
2259 T: std::convert::Into<std::option::Option<crate::model::log_sink::Options>>,
2260 >(
2261 mut self,
2262 v: T,
2263 ) -> Self {
2264 self.options = v.into();
2265 self
2266 }
2267
2268 /// The value of [options][crate::model::LogSink::options]
2269 /// if it holds a `BigqueryOptions`, `None` if the field is not set or
2270 /// holds a different branch.
2271 pub fn bigquery_options(
2272 &self,
2273 ) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryOptions>> {
2274 #[allow(unreachable_patterns)]
2275 self.options.as_ref().and_then(|v| match v {
2276 crate::model::log_sink::Options::BigqueryOptions(v) => std::option::Option::Some(v),
2277 _ => std::option::Option::None,
2278 })
2279 }
2280
2281 /// Sets the value of [options][crate::model::LogSink::options]
2282 /// to hold a `BigqueryOptions`.
2283 ///
2284 /// Note that all the setters affecting `options` are
2285 /// mutually exclusive.
2286 pub fn set_bigquery_options<
2287 T: std::convert::Into<std::boxed::Box<crate::model::BigQueryOptions>>,
2288 >(
2289 mut self,
2290 v: T,
2291 ) -> Self {
2292 self.options =
2293 std::option::Option::Some(crate::model::log_sink::Options::BigqueryOptions(v.into()));
2294 self
2295 }
2296}
2297
2298impl wkt::message::Message for LogSink {
2299 fn typename() -> &'static str {
2300 "type.googleapis.com/google.logging.v2.LogSink"
2301 }
2302}
2303
2304/// Defines additional types related to [LogSink].
2305pub mod log_sink {
2306 #[allow(unused_imports)]
2307 use super::*;
2308
2309 /// Deprecated. This is unused.
2310 ///
2311 /// # Working with unknown values
2312 ///
2313 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2314 /// additional enum variants at any time. Adding new variants is not considered
2315 /// a breaking change. Applications should write their code in anticipation of:
2316 ///
2317 /// - New values appearing in future releases of the client library, **and**
2318 /// - New values received dynamically, without application changes.
2319 ///
2320 /// Please consult the [Working with enums] section in the user guide for some
2321 /// guidelines.
2322 ///
2323 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2324 #[derive(Clone, Debug, PartialEq)]
2325 #[non_exhaustive]
2326 pub enum VersionFormat {
2327 /// An unspecified format version that will default to V2.
2328 Unspecified,
2329 /// `LogEntry` version 2 format.
2330 V2,
2331 /// `LogEntry` version 1 format.
2332 V1,
2333 /// If set, the enum was initialized with an unknown value.
2334 ///
2335 /// Applications can examine the value using [VersionFormat::value] or
2336 /// [VersionFormat::name].
2337 UnknownValue(version_format::UnknownValue),
2338 }
2339
2340 #[doc(hidden)]
2341 pub mod version_format {
2342 #[allow(unused_imports)]
2343 use super::*;
2344 #[derive(Clone, Debug, PartialEq)]
2345 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2346 }
2347
2348 impl VersionFormat {
2349 /// Gets the enum value.
2350 ///
2351 /// Returns `None` if the enum contains an unknown value deserialized from
2352 /// the string representation of enums.
2353 pub fn value(&self) -> std::option::Option<i32> {
2354 match self {
2355 Self::Unspecified => std::option::Option::Some(0),
2356 Self::V2 => std::option::Option::Some(1),
2357 Self::V1 => std::option::Option::Some(2),
2358 Self::UnknownValue(u) => u.0.value(),
2359 }
2360 }
2361
2362 /// Gets the enum value as a string.
2363 ///
2364 /// Returns `None` if the enum contains an unknown value deserialized from
2365 /// the integer representation of enums.
2366 pub fn name(&self) -> std::option::Option<&str> {
2367 match self {
2368 Self::Unspecified => std::option::Option::Some("VERSION_FORMAT_UNSPECIFIED"),
2369 Self::V2 => std::option::Option::Some("V2"),
2370 Self::V1 => std::option::Option::Some("V1"),
2371 Self::UnknownValue(u) => u.0.name(),
2372 }
2373 }
2374 }
2375
2376 impl std::default::Default for VersionFormat {
2377 fn default() -> Self {
2378 use std::convert::From;
2379 Self::from(0)
2380 }
2381 }
2382
2383 impl std::fmt::Display for VersionFormat {
2384 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2385 wkt::internal::display_enum(f, self.name(), self.value())
2386 }
2387 }
2388
2389 impl std::convert::From<i32> for VersionFormat {
2390 fn from(value: i32) -> Self {
2391 match value {
2392 0 => Self::Unspecified,
2393 1 => Self::V2,
2394 2 => Self::V1,
2395 _ => Self::UnknownValue(version_format::UnknownValue(
2396 wkt::internal::UnknownEnumValue::Integer(value),
2397 )),
2398 }
2399 }
2400 }
2401
2402 impl std::convert::From<&str> for VersionFormat {
2403 fn from(value: &str) -> Self {
2404 use std::string::ToString;
2405 match value {
2406 "VERSION_FORMAT_UNSPECIFIED" => Self::Unspecified,
2407 "V2" => Self::V2,
2408 "V1" => Self::V1,
2409 _ => Self::UnknownValue(version_format::UnknownValue(
2410 wkt::internal::UnknownEnumValue::String(value.to_string()),
2411 )),
2412 }
2413 }
2414 }
2415
2416 impl serde::ser::Serialize for VersionFormat {
2417 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2418 where
2419 S: serde::Serializer,
2420 {
2421 match self {
2422 Self::Unspecified => serializer.serialize_i32(0),
2423 Self::V2 => serializer.serialize_i32(1),
2424 Self::V1 => serializer.serialize_i32(2),
2425 Self::UnknownValue(u) => u.0.serialize(serializer),
2426 }
2427 }
2428 }
2429
2430 impl<'de> serde::de::Deserialize<'de> for VersionFormat {
2431 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2432 where
2433 D: serde::Deserializer<'de>,
2434 {
2435 deserializer.deserialize_any(wkt::internal::EnumVisitor::<VersionFormat>::new(
2436 ".google.logging.v2.LogSink.VersionFormat",
2437 ))
2438 }
2439 }
2440
2441 /// Destination dependent options.
2442 #[derive(Clone, Debug, PartialEq)]
2443 #[non_exhaustive]
2444 pub enum Options {
2445 /// Optional. Options that affect sinks exporting data to BigQuery.
2446 BigqueryOptions(std::boxed::Box<crate::model::BigQueryOptions>),
2447 }
2448}
2449
2450/// Describes a BigQuery dataset that was created by a link.
2451#[derive(Clone, Default, PartialEq)]
2452#[non_exhaustive]
2453pub struct BigQueryDataset {
2454 /// Output only. The full resource name of the BigQuery dataset. The DATASET_ID
2455 /// will match the ID of the link, so the link must match the naming
2456 /// restrictions of BigQuery datasets (alphanumeric characters and underscores
2457 /// only).
2458 ///
2459 /// The dataset will have a resource path of
2460 /// "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET_ID]"
2461 pub dataset_id: std::string::String,
2462
2463 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2464}
2465
2466impl BigQueryDataset {
2467 pub fn new() -> Self {
2468 std::default::Default::default()
2469 }
2470
2471 /// Sets the value of [dataset_id][crate::model::BigQueryDataset::dataset_id].
2472 pub fn set_dataset_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2473 self.dataset_id = v.into();
2474 self
2475 }
2476}
2477
2478impl wkt::message::Message for BigQueryDataset {
2479 fn typename() -> &'static str {
2480 "type.googleapis.com/google.logging.v2.BigQueryDataset"
2481 }
2482}
2483
2484/// Describes a link connected to an analytics enabled bucket.
2485#[derive(Clone, Default, PartialEq)]
2486#[non_exhaustive]
2487pub struct Link {
2488 /// The resource name of the link. The name can have up to 100 characters.
2489 /// A valid link id (at the end of the link name) must only have alphanumeric
2490 /// characters and underscores within it.
2491 ///
2492 /// ```norust
2493 /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
2494 /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
2495 /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
2496 /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
2497 /// ```
2498 ///
2499 /// For example:
2500 ///
2501 /// `projects/my-project/locations/global/buckets/my-bucket/links/my_link
2502 pub name: std::string::String,
2503
2504 /// Describes this link.
2505 ///
2506 /// The maximum length of the description is 8000 characters.
2507 pub description: std::string::String,
2508
2509 /// Output only. The creation timestamp of the link.
2510 pub create_time: std::option::Option<wkt::Timestamp>,
2511
2512 /// Output only. The resource lifecycle state.
2513 pub lifecycle_state: crate::model::LifecycleState,
2514
2515 /// The information of a BigQuery Dataset. When a link is created, a BigQuery
2516 /// dataset is created along with it, in the same project as the LogBucket it's
2517 /// linked to. This dataset will also have BigQuery Views corresponding to the
2518 /// LogViews in the bucket.
2519 pub bigquery_dataset: std::option::Option<crate::model::BigQueryDataset>,
2520
2521 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2522}
2523
2524impl Link {
2525 pub fn new() -> Self {
2526 std::default::Default::default()
2527 }
2528
2529 /// Sets the value of [name][crate::model::Link::name].
2530 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2531 self.name = v.into();
2532 self
2533 }
2534
2535 /// Sets the value of [description][crate::model::Link::description].
2536 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2537 self.description = v.into();
2538 self
2539 }
2540
2541 /// Sets the value of [create_time][crate::model::Link::create_time].
2542 pub fn set_create_time<T>(mut self, v: T) -> Self
2543 where
2544 T: std::convert::Into<wkt::Timestamp>,
2545 {
2546 self.create_time = std::option::Option::Some(v.into());
2547 self
2548 }
2549
2550 /// Sets or clears the value of [create_time][crate::model::Link::create_time].
2551 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2552 where
2553 T: std::convert::Into<wkt::Timestamp>,
2554 {
2555 self.create_time = v.map(|x| x.into());
2556 self
2557 }
2558
2559 /// Sets the value of [lifecycle_state][crate::model::Link::lifecycle_state].
2560 pub fn set_lifecycle_state<T: std::convert::Into<crate::model::LifecycleState>>(
2561 mut self,
2562 v: T,
2563 ) -> Self {
2564 self.lifecycle_state = v.into();
2565 self
2566 }
2567
2568 /// Sets the value of [bigquery_dataset][crate::model::Link::bigquery_dataset].
2569 pub fn set_bigquery_dataset<T>(mut self, v: T) -> Self
2570 where
2571 T: std::convert::Into<crate::model::BigQueryDataset>,
2572 {
2573 self.bigquery_dataset = std::option::Option::Some(v.into());
2574 self
2575 }
2576
2577 /// Sets or clears the value of [bigquery_dataset][crate::model::Link::bigquery_dataset].
2578 pub fn set_or_clear_bigquery_dataset<T>(mut self, v: std::option::Option<T>) -> Self
2579 where
2580 T: std::convert::Into<crate::model::BigQueryDataset>,
2581 {
2582 self.bigquery_dataset = v.map(|x| x.into());
2583 self
2584 }
2585}
2586
2587impl wkt::message::Message for Link {
2588 fn typename() -> &'static str {
2589 "type.googleapis.com/google.logging.v2.Link"
2590 }
2591}
2592
2593/// Options that change functionality of a sink exporting data to BigQuery.
2594#[derive(Clone, Default, PartialEq)]
2595#[non_exhaustive]
2596pub struct BigQueryOptions {
2597 /// Optional. Whether to use [BigQuery's partition
2598 /// tables](https://cloud.google.com/bigquery/docs/partitioned-tables). By
2599 /// default, Cloud Logging creates dated tables based on the log entries'
2600 /// timestamps, e.g. syslog_20170523. With partitioned tables the date suffix
2601 /// is no longer present and [special query
2602 /// syntax](https://cloud.google.com/bigquery/docs/querying-partitioned-tables)
2603 /// has to be used instead. In both cases, tables are sharded based on UTC
2604 /// timezone.
2605 pub use_partitioned_tables: bool,
2606
2607 /// Output only. True if new timestamp column based partitioning is in use,
2608 /// false if legacy ingestion-time partitioning is in use.
2609 ///
2610 /// All new sinks will have this field set true and will use timestamp column
2611 /// based partitioning. If use_partitioned_tables is false, this value has no
2612 /// meaning and will be false. Legacy sinks using partitioned tables will have
2613 /// this field set to false.
2614 pub uses_timestamp_column_partitioning: bool,
2615
2616 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2617}
2618
2619impl BigQueryOptions {
2620 pub fn new() -> Self {
2621 std::default::Default::default()
2622 }
2623
2624 /// Sets the value of [use_partitioned_tables][crate::model::BigQueryOptions::use_partitioned_tables].
2625 pub fn set_use_partitioned_tables<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2626 self.use_partitioned_tables = v.into();
2627 self
2628 }
2629
2630 /// Sets the value of [uses_timestamp_column_partitioning][crate::model::BigQueryOptions::uses_timestamp_column_partitioning].
2631 pub fn set_uses_timestamp_column_partitioning<T: std::convert::Into<bool>>(
2632 mut self,
2633 v: T,
2634 ) -> Self {
2635 self.uses_timestamp_column_partitioning = v.into();
2636 self
2637 }
2638}
2639
2640impl wkt::message::Message for BigQueryOptions {
2641 fn typename() -> &'static str {
2642 "type.googleapis.com/google.logging.v2.BigQueryOptions"
2643 }
2644}
2645
2646/// The parameters to `ListBuckets`.
2647#[derive(Clone, Default, PartialEq)]
2648#[non_exhaustive]
2649pub struct ListBucketsRequest {
2650 /// Required. The parent resource whose buckets are to be listed:
2651 ///
2652 /// ```norust
2653 /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
2654 /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]"
2655 /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]"
2656 /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]"
2657 /// ```
2658 ///
2659 /// Note: The locations portion of the resource must be specified, but
2660 /// supplying the character `-` in place of [LOCATION_ID] will return all
2661 /// buckets.
2662 pub parent: std::string::String,
2663
2664 /// Optional. If present, then retrieve the next batch of results from the
2665 /// preceding call to this method. `pageToken` must be the value of
2666 /// `nextPageToken` from the previous response. The values of other method
2667 /// parameters should be identical to those in the previous call.
2668 pub page_token: std::string::String,
2669
2670 /// Optional. The maximum number of results to return from this request.
2671 /// Non-positive values are ignored. The presence of `nextPageToken` in the
2672 /// response indicates that more results might be available.
2673 pub page_size: i32,
2674
2675 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2676}
2677
2678impl ListBucketsRequest {
2679 pub fn new() -> Self {
2680 std::default::Default::default()
2681 }
2682
2683 /// Sets the value of [parent][crate::model::ListBucketsRequest::parent].
2684 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2685 self.parent = v.into();
2686 self
2687 }
2688
2689 /// Sets the value of [page_token][crate::model::ListBucketsRequest::page_token].
2690 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2691 self.page_token = v.into();
2692 self
2693 }
2694
2695 /// Sets the value of [page_size][crate::model::ListBucketsRequest::page_size].
2696 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2697 self.page_size = v.into();
2698 self
2699 }
2700}
2701
2702impl wkt::message::Message for ListBucketsRequest {
2703 fn typename() -> &'static str {
2704 "type.googleapis.com/google.logging.v2.ListBucketsRequest"
2705 }
2706}
2707
2708/// The response from ListBuckets.
2709#[derive(Clone, Default, PartialEq)]
2710#[non_exhaustive]
2711pub struct ListBucketsResponse {
2712 /// A list of buckets.
2713 pub buckets: std::vec::Vec<crate::model::LogBucket>,
2714
2715 /// If there might be more results than appear in this response, then
2716 /// `nextPageToken` is included. To get the next set of results, call the same
2717 /// method again using the value of `nextPageToken` as `pageToken`.
2718 pub next_page_token: std::string::String,
2719
2720 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2721}
2722
2723impl ListBucketsResponse {
2724 pub fn new() -> Self {
2725 std::default::Default::default()
2726 }
2727
2728 /// Sets the value of [buckets][crate::model::ListBucketsResponse::buckets].
2729 pub fn set_buckets<T, V>(mut self, v: T) -> Self
2730 where
2731 T: std::iter::IntoIterator<Item = V>,
2732 V: std::convert::Into<crate::model::LogBucket>,
2733 {
2734 use std::iter::Iterator;
2735 self.buckets = v.into_iter().map(|i| i.into()).collect();
2736 self
2737 }
2738
2739 /// Sets the value of [next_page_token][crate::model::ListBucketsResponse::next_page_token].
2740 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2741 self.next_page_token = v.into();
2742 self
2743 }
2744}
2745
2746impl wkt::message::Message for ListBucketsResponse {
2747 fn typename() -> &'static str {
2748 "type.googleapis.com/google.logging.v2.ListBucketsResponse"
2749 }
2750}
2751
2752#[doc(hidden)]
2753impl gax::paginator::internal::PageableResponse for ListBucketsResponse {
2754 type PageItem = crate::model::LogBucket;
2755
2756 fn items(self) -> std::vec::Vec<Self::PageItem> {
2757 self.buckets
2758 }
2759
2760 fn next_page_token(&self) -> std::string::String {
2761 use std::clone::Clone;
2762 self.next_page_token.clone()
2763 }
2764}
2765
2766/// The parameters to `CreateBucket`.
2767#[derive(Clone, Default, PartialEq)]
2768#[non_exhaustive]
2769pub struct CreateBucketRequest {
2770 /// Required. The resource in which to create the log bucket:
2771 ///
2772 /// ```norust
2773 /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
2774 /// ```
2775 ///
2776 /// For example:
2777 ///
2778 /// `"projects/my-project/locations/global"`
2779 pub parent: std::string::String,
2780
2781 /// Required. A client-assigned identifier such as `"my-bucket"`. Identifiers
2782 /// are limited to 100 characters and can include only letters, digits,
2783 /// underscores, hyphens, and periods.
2784 pub bucket_id: std::string::String,
2785
2786 /// Required. The new bucket. The region specified in the new bucket must be
2787 /// compliant with any Location Restriction Org Policy. The name field in the
2788 /// bucket is ignored.
2789 pub bucket: std::option::Option<crate::model::LogBucket>,
2790
2791 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2792}
2793
2794impl CreateBucketRequest {
2795 pub fn new() -> Self {
2796 std::default::Default::default()
2797 }
2798
2799 /// Sets the value of [parent][crate::model::CreateBucketRequest::parent].
2800 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2801 self.parent = v.into();
2802 self
2803 }
2804
2805 /// Sets the value of [bucket_id][crate::model::CreateBucketRequest::bucket_id].
2806 pub fn set_bucket_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2807 self.bucket_id = v.into();
2808 self
2809 }
2810
2811 /// Sets the value of [bucket][crate::model::CreateBucketRequest::bucket].
2812 pub fn set_bucket<T>(mut self, v: T) -> Self
2813 where
2814 T: std::convert::Into<crate::model::LogBucket>,
2815 {
2816 self.bucket = std::option::Option::Some(v.into());
2817 self
2818 }
2819
2820 /// Sets or clears the value of [bucket][crate::model::CreateBucketRequest::bucket].
2821 pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
2822 where
2823 T: std::convert::Into<crate::model::LogBucket>,
2824 {
2825 self.bucket = v.map(|x| x.into());
2826 self
2827 }
2828}
2829
2830impl wkt::message::Message for CreateBucketRequest {
2831 fn typename() -> &'static str {
2832 "type.googleapis.com/google.logging.v2.CreateBucketRequest"
2833 }
2834}
2835
2836/// The parameters to `UpdateBucket`.
2837#[derive(Clone, Default, PartialEq)]
2838#[non_exhaustive]
2839pub struct UpdateBucketRequest {
2840 /// Required. The full resource name of the bucket to update.
2841 ///
2842 /// ```norust
2843 /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
2844 /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
2845 /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
2846 /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
2847 /// ```
2848 ///
2849 /// For example:
2850 ///
2851 /// `"projects/my-project/locations/global/buckets/my-bucket"`
2852 pub name: std::string::String,
2853
2854 /// Required. The updated bucket.
2855 pub bucket: std::option::Option<crate::model::LogBucket>,
2856
2857 /// Required. Field mask that specifies the fields in `bucket` that need an
2858 /// update. A bucket field will be overwritten if, and only if, it is in the
2859 /// update mask. `name` and output only fields cannot be updated.
2860 ///
2861 /// For a detailed `FieldMask` definition, see:
2862 /// <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask>
2863 ///
2864 /// For example: `updateMask=retention_days`
2865 pub update_mask: std::option::Option<wkt::FieldMask>,
2866
2867 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2868}
2869
2870impl UpdateBucketRequest {
2871 pub fn new() -> Self {
2872 std::default::Default::default()
2873 }
2874
2875 /// Sets the value of [name][crate::model::UpdateBucketRequest::name].
2876 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2877 self.name = v.into();
2878 self
2879 }
2880
2881 /// Sets the value of [bucket][crate::model::UpdateBucketRequest::bucket].
2882 pub fn set_bucket<T>(mut self, v: T) -> Self
2883 where
2884 T: std::convert::Into<crate::model::LogBucket>,
2885 {
2886 self.bucket = std::option::Option::Some(v.into());
2887 self
2888 }
2889
2890 /// Sets or clears the value of [bucket][crate::model::UpdateBucketRequest::bucket].
2891 pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
2892 where
2893 T: std::convert::Into<crate::model::LogBucket>,
2894 {
2895 self.bucket = v.map(|x| x.into());
2896 self
2897 }
2898
2899 /// Sets the value of [update_mask][crate::model::UpdateBucketRequest::update_mask].
2900 pub fn set_update_mask<T>(mut self, v: T) -> Self
2901 where
2902 T: std::convert::Into<wkt::FieldMask>,
2903 {
2904 self.update_mask = std::option::Option::Some(v.into());
2905 self
2906 }
2907
2908 /// Sets or clears the value of [update_mask][crate::model::UpdateBucketRequest::update_mask].
2909 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2910 where
2911 T: std::convert::Into<wkt::FieldMask>,
2912 {
2913 self.update_mask = v.map(|x| x.into());
2914 self
2915 }
2916}
2917
2918impl wkt::message::Message for UpdateBucketRequest {
2919 fn typename() -> &'static str {
2920 "type.googleapis.com/google.logging.v2.UpdateBucketRequest"
2921 }
2922}
2923
2924/// The parameters to `GetBucket`.
2925#[derive(Clone, Default, PartialEq)]
2926#[non_exhaustive]
2927pub struct GetBucketRequest {
2928 /// Required. The resource name of the bucket:
2929 ///
2930 /// ```norust
2931 /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
2932 /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
2933 /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
2934 /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
2935 /// ```
2936 ///
2937 /// For example:
2938 ///
2939 /// `"projects/my-project/locations/global/buckets/my-bucket"`
2940 pub name: std::string::String,
2941
2942 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2943}
2944
2945impl GetBucketRequest {
2946 pub fn new() -> Self {
2947 std::default::Default::default()
2948 }
2949
2950 /// Sets the value of [name][crate::model::GetBucketRequest::name].
2951 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2952 self.name = v.into();
2953 self
2954 }
2955}
2956
2957impl wkt::message::Message for GetBucketRequest {
2958 fn typename() -> &'static str {
2959 "type.googleapis.com/google.logging.v2.GetBucketRequest"
2960 }
2961}
2962
2963/// The parameters to `DeleteBucket`.
2964#[derive(Clone, Default, PartialEq)]
2965#[non_exhaustive]
2966pub struct DeleteBucketRequest {
2967 /// Required. The full resource name of the bucket to delete.
2968 ///
2969 /// ```norust
2970 /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
2971 /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
2972 /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
2973 /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
2974 /// ```
2975 ///
2976 /// For example:
2977 ///
2978 /// `"projects/my-project/locations/global/buckets/my-bucket"`
2979 pub name: std::string::String,
2980
2981 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2982}
2983
2984impl DeleteBucketRequest {
2985 pub fn new() -> Self {
2986 std::default::Default::default()
2987 }
2988
2989 /// Sets the value of [name][crate::model::DeleteBucketRequest::name].
2990 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2991 self.name = v.into();
2992 self
2993 }
2994}
2995
2996impl wkt::message::Message for DeleteBucketRequest {
2997 fn typename() -> &'static str {
2998 "type.googleapis.com/google.logging.v2.DeleteBucketRequest"
2999 }
3000}
3001
3002/// The parameters to `UndeleteBucket`.
3003#[derive(Clone, Default, PartialEq)]
3004#[non_exhaustive]
3005pub struct UndeleteBucketRequest {
3006 /// Required. The full resource name of the bucket to undelete.
3007 ///
3008 /// ```norust
3009 /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
3010 /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
3011 /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
3012 /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
3013 /// ```
3014 ///
3015 /// For example:
3016 ///
3017 /// `"projects/my-project/locations/global/buckets/my-bucket"`
3018 pub name: std::string::String,
3019
3020 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3021}
3022
3023impl UndeleteBucketRequest {
3024 pub fn new() -> Self {
3025 std::default::Default::default()
3026 }
3027
3028 /// Sets the value of [name][crate::model::UndeleteBucketRequest::name].
3029 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3030 self.name = v.into();
3031 self
3032 }
3033}
3034
3035impl wkt::message::Message for UndeleteBucketRequest {
3036 fn typename() -> &'static str {
3037 "type.googleapis.com/google.logging.v2.UndeleteBucketRequest"
3038 }
3039}
3040
3041/// The parameters to `ListViews`.
3042#[derive(Clone, Default, PartialEq)]
3043#[non_exhaustive]
3044pub struct ListViewsRequest {
3045 /// Required. The bucket whose views are to be listed:
3046 ///
3047 /// ```norust
3048 /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
3049 /// ```
3050 pub parent: std::string::String,
3051
3052 /// Optional. If present, then retrieve the next batch of results from the
3053 /// preceding call to this method. `pageToken` must be the value of
3054 /// `nextPageToken` from the previous response. The values of other method
3055 /// parameters should be identical to those in the previous call.
3056 pub page_token: std::string::String,
3057
3058 /// Optional. The maximum number of results to return from this request.
3059 ///
3060 /// Non-positive values are ignored. The presence of `nextPageToken` in the
3061 /// response indicates that more results might be available.
3062 pub page_size: i32,
3063
3064 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3065}
3066
3067impl ListViewsRequest {
3068 pub fn new() -> Self {
3069 std::default::Default::default()
3070 }
3071
3072 /// Sets the value of [parent][crate::model::ListViewsRequest::parent].
3073 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3074 self.parent = v.into();
3075 self
3076 }
3077
3078 /// Sets the value of [page_token][crate::model::ListViewsRequest::page_token].
3079 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3080 self.page_token = v.into();
3081 self
3082 }
3083
3084 /// Sets the value of [page_size][crate::model::ListViewsRequest::page_size].
3085 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3086 self.page_size = v.into();
3087 self
3088 }
3089}
3090
3091impl wkt::message::Message for ListViewsRequest {
3092 fn typename() -> &'static str {
3093 "type.googleapis.com/google.logging.v2.ListViewsRequest"
3094 }
3095}
3096
3097/// The response from ListViews.
3098#[derive(Clone, Default, PartialEq)]
3099#[non_exhaustive]
3100pub struct ListViewsResponse {
3101 /// A list of views.
3102 pub views: std::vec::Vec<crate::model::LogView>,
3103
3104 /// If there might be more results than appear in this response, then
3105 /// `nextPageToken` is included. To get the next set of results, call the same
3106 /// method again using the value of `nextPageToken` as `pageToken`.
3107 pub next_page_token: std::string::String,
3108
3109 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3110}
3111
3112impl ListViewsResponse {
3113 pub fn new() -> Self {
3114 std::default::Default::default()
3115 }
3116
3117 /// Sets the value of [views][crate::model::ListViewsResponse::views].
3118 pub fn set_views<T, V>(mut self, v: T) -> Self
3119 where
3120 T: std::iter::IntoIterator<Item = V>,
3121 V: std::convert::Into<crate::model::LogView>,
3122 {
3123 use std::iter::Iterator;
3124 self.views = v.into_iter().map(|i| i.into()).collect();
3125 self
3126 }
3127
3128 /// Sets the value of [next_page_token][crate::model::ListViewsResponse::next_page_token].
3129 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3130 self.next_page_token = v.into();
3131 self
3132 }
3133}
3134
3135impl wkt::message::Message for ListViewsResponse {
3136 fn typename() -> &'static str {
3137 "type.googleapis.com/google.logging.v2.ListViewsResponse"
3138 }
3139}
3140
3141#[doc(hidden)]
3142impl gax::paginator::internal::PageableResponse for ListViewsResponse {
3143 type PageItem = crate::model::LogView;
3144
3145 fn items(self) -> std::vec::Vec<Self::PageItem> {
3146 self.views
3147 }
3148
3149 fn next_page_token(&self) -> std::string::String {
3150 use std::clone::Clone;
3151 self.next_page_token.clone()
3152 }
3153}
3154
3155/// The parameters to `CreateView`.
3156#[derive(Clone, Default, PartialEq)]
3157#[non_exhaustive]
3158pub struct CreateViewRequest {
3159 /// Required. The bucket in which to create the view
3160 ///
3161 /// ```norust
3162 /// `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"`
3163 /// ```
3164 ///
3165 /// For example:
3166 ///
3167 /// `"projects/my-project/locations/global/buckets/my-bucket"`
3168 pub parent: std::string::String,
3169
3170 /// Required. A client-assigned identifier such as `"my-view"`. Identifiers are
3171 /// limited to 100 characters and can include only letters, digits,
3172 /// underscores, hyphens, and periods.
3173 pub view_id: std::string::String,
3174
3175 /// Required. The new view.
3176 pub view: std::option::Option<crate::model::LogView>,
3177
3178 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3179}
3180
3181impl CreateViewRequest {
3182 pub fn new() -> Self {
3183 std::default::Default::default()
3184 }
3185
3186 /// Sets the value of [parent][crate::model::CreateViewRequest::parent].
3187 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3188 self.parent = v.into();
3189 self
3190 }
3191
3192 /// Sets the value of [view_id][crate::model::CreateViewRequest::view_id].
3193 pub fn set_view_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3194 self.view_id = v.into();
3195 self
3196 }
3197
3198 /// Sets the value of [view][crate::model::CreateViewRequest::view].
3199 pub fn set_view<T>(mut self, v: T) -> Self
3200 where
3201 T: std::convert::Into<crate::model::LogView>,
3202 {
3203 self.view = std::option::Option::Some(v.into());
3204 self
3205 }
3206
3207 /// Sets or clears the value of [view][crate::model::CreateViewRequest::view].
3208 pub fn set_or_clear_view<T>(mut self, v: std::option::Option<T>) -> Self
3209 where
3210 T: std::convert::Into<crate::model::LogView>,
3211 {
3212 self.view = v.map(|x| x.into());
3213 self
3214 }
3215}
3216
3217impl wkt::message::Message for CreateViewRequest {
3218 fn typename() -> &'static str {
3219 "type.googleapis.com/google.logging.v2.CreateViewRequest"
3220 }
3221}
3222
3223/// The parameters to `UpdateView`.
3224#[derive(Clone, Default, PartialEq)]
3225#[non_exhaustive]
3226pub struct UpdateViewRequest {
3227 /// Required. The full resource name of the view to update
3228 ///
3229 /// ```norust
3230 /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
3231 /// ```
3232 ///
3233 /// For example:
3234 ///
3235 /// `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
3236 pub name: std::string::String,
3237
3238 /// Required. The updated view.
3239 pub view: std::option::Option<crate::model::LogView>,
3240
3241 /// Optional. Field mask that specifies the fields in `view` that need
3242 /// an update. A field will be overwritten if, and only if, it is
3243 /// in the update mask. `name` and output only fields cannot be updated.
3244 ///
3245 /// For a detailed `FieldMask` definition, see
3246 /// <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask>
3247 ///
3248 /// For example: `updateMask=filter`
3249 pub update_mask: std::option::Option<wkt::FieldMask>,
3250
3251 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3252}
3253
3254impl UpdateViewRequest {
3255 pub fn new() -> Self {
3256 std::default::Default::default()
3257 }
3258
3259 /// Sets the value of [name][crate::model::UpdateViewRequest::name].
3260 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3261 self.name = v.into();
3262 self
3263 }
3264
3265 /// Sets the value of [view][crate::model::UpdateViewRequest::view].
3266 pub fn set_view<T>(mut self, v: T) -> Self
3267 where
3268 T: std::convert::Into<crate::model::LogView>,
3269 {
3270 self.view = std::option::Option::Some(v.into());
3271 self
3272 }
3273
3274 /// Sets or clears the value of [view][crate::model::UpdateViewRequest::view].
3275 pub fn set_or_clear_view<T>(mut self, v: std::option::Option<T>) -> Self
3276 where
3277 T: std::convert::Into<crate::model::LogView>,
3278 {
3279 self.view = v.map(|x| x.into());
3280 self
3281 }
3282
3283 /// Sets the value of [update_mask][crate::model::UpdateViewRequest::update_mask].
3284 pub fn set_update_mask<T>(mut self, v: T) -> Self
3285 where
3286 T: std::convert::Into<wkt::FieldMask>,
3287 {
3288 self.update_mask = std::option::Option::Some(v.into());
3289 self
3290 }
3291
3292 /// Sets or clears the value of [update_mask][crate::model::UpdateViewRequest::update_mask].
3293 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3294 where
3295 T: std::convert::Into<wkt::FieldMask>,
3296 {
3297 self.update_mask = v.map(|x| x.into());
3298 self
3299 }
3300}
3301
3302impl wkt::message::Message for UpdateViewRequest {
3303 fn typename() -> &'static str {
3304 "type.googleapis.com/google.logging.v2.UpdateViewRequest"
3305 }
3306}
3307
3308/// The parameters to `GetView`.
3309#[derive(Clone, Default, PartialEq)]
3310#[non_exhaustive]
3311pub struct GetViewRequest {
3312 /// Required. The resource name of the policy:
3313 ///
3314 /// ```norust
3315 /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
3316 /// ```
3317 ///
3318 /// For example:
3319 ///
3320 /// `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
3321 pub name: std::string::String,
3322
3323 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3324}
3325
3326impl GetViewRequest {
3327 pub fn new() -> Self {
3328 std::default::Default::default()
3329 }
3330
3331 /// Sets the value of [name][crate::model::GetViewRequest::name].
3332 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3333 self.name = v.into();
3334 self
3335 }
3336}
3337
3338impl wkt::message::Message for GetViewRequest {
3339 fn typename() -> &'static str {
3340 "type.googleapis.com/google.logging.v2.GetViewRequest"
3341 }
3342}
3343
3344/// The parameters to `DeleteView`.
3345#[derive(Clone, Default, PartialEq)]
3346#[non_exhaustive]
3347pub struct DeleteViewRequest {
3348 /// Required. The full resource name of the view to delete:
3349 ///
3350 /// ```norust
3351 /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
3352 /// ```
3353 ///
3354 /// For example:
3355 ///
3356 /// `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
3357 pub name: std::string::String,
3358
3359 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3360}
3361
3362impl DeleteViewRequest {
3363 pub fn new() -> Self {
3364 std::default::Default::default()
3365 }
3366
3367 /// Sets the value of [name][crate::model::DeleteViewRequest::name].
3368 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3369 self.name = v.into();
3370 self
3371 }
3372}
3373
3374impl wkt::message::Message for DeleteViewRequest {
3375 fn typename() -> &'static str {
3376 "type.googleapis.com/google.logging.v2.DeleteViewRequest"
3377 }
3378}
3379
3380/// The parameters to `ListSinks`.
3381#[derive(Clone, Default, PartialEq)]
3382#[non_exhaustive]
3383pub struct ListSinksRequest {
3384 /// Required. The parent resource whose sinks are to be listed:
3385 ///
3386 /// ```norust
3387 /// "projects/[PROJECT_ID]"
3388 /// "organizations/[ORGANIZATION_ID]"
3389 /// "billingAccounts/[BILLING_ACCOUNT_ID]"
3390 /// "folders/[FOLDER_ID]"
3391 /// ```
3392 pub parent: std::string::String,
3393
3394 /// Optional. If present, then retrieve the next batch of results from the
3395 /// preceding call to this method. `pageToken` must be the value of
3396 /// `nextPageToken` from the previous response. The values of other method
3397 /// parameters should be identical to those in the previous call.
3398 pub page_token: std::string::String,
3399
3400 /// Optional. The maximum number of results to return from this request.
3401 /// Non-positive values are ignored. The presence of `nextPageToken` in the
3402 /// response indicates that more results might be available.
3403 pub page_size: i32,
3404
3405 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3406}
3407
3408impl ListSinksRequest {
3409 pub fn new() -> Self {
3410 std::default::Default::default()
3411 }
3412
3413 /// Sets the value of [parent][crate::model::ListSinksRequest::parent].
3414 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3415 self.parent = v.into();
3416 self
3417 }
3418
3419 /// Sets the value of [page_token][crate::model::ListSinksRequest::page_token].
3420 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3421 self.page_token = v.into();
3422 self
3423 }
3424
3425 /// Sets the value of [page_size][crate::model::ListSinksRequest::page_size].
3426 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3427 self.page_size = v.into();
3428 self
3429 }
3430}
3431
3432impl wkt::message::Message for ListSinksRequest {
3433 fn typename() -> &'static str {
3434 "type.googleapis.com/google.logging.v2.ListSinksRequest"
3435 }
3436}
3437
3438/// Result returned from `ListSinks`.
3439#[derive(Clone, Default, PartialEq)]
3440#[non_exhaustive]
3441pub struct ListSinksResponse {
3442 /// A list of sinks.
3443 pub sinks: std::vec::Vec<crate::model::LogSink>,
3444
3445 /// If there might be more results than appear in this response, then
3446 /// `nextPageToken` is included. To get the next set of results, call the same
3447 /// method again using the value of `nextPageToken` as `pageToken`.
3448 pub next_page_token: std::string::String,
3449
3450 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3451}
3452
3453impl ListSinksResponse {
3454 pub fn new() -> Self {
3455 std::default::Default::default()
3456 }
3457
3458 /// Sets the value of [sinks][crate::model::ListSinksResponse::sinks].
3459 pub fn set_sinks<T, V>(mut self, v: T) -> Self
3460 where
3461 T: std::iter::IntoIterator<Item = V>,
3462 V: std::convert::Into<crate::model::LogSink>,
3463 {
3464 use std::iter::Iterator;
3465 self.sinks = v.into_iter().map(|i| i.into()).collect();
3466 self
3467 }
3468
3469 /// Sets the value of [next_page_token][crate::model::ListSinksResponse::next_page_token].
3470 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3471 self.next_page_token = v.into();
3472 self
3473 }
3474}
3475
3476impl wkt::message::Message for ListSinksResponse {
3477 fn typename() -> &'static str {
3478 "type.googleapis.com/google.logging.v2.ListSinksResponse"
3479 }
3480}
3481
3482#[doc(hidden)]
3483impl gax::paginator::internal::PageableResponse for ListSinksResponse {
3484 type PageItem = crate::model::LogSink;
3485
3486 fn items(self) -> std::vec::Vec<Self::PageItem> {
3487 self.sinks
3488 }
3489
3490 fn next_page_token(&self) -> std::string::String {
3491 use std::clone::Clone;
3492 self.next_page_token.clone()
3493 }
3494}
3495
3496/// The parameters to `GetSink`.
3497#[derive(Clone, Default, PartialEq)]
3498#[non_exhaustive]
3499pub struct GetSinkRequest {
3500 /// Required. The resource name of the sink:
3501 ///
3502 /// ```norust
3503 /// "projects/[PROJECT_ID]/sinks/[SINK_ID]"
3504 /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
3505 /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
3506 /// "folders/[FOLDER_ID]/sinks/[SINK_ID]"
3507 /// ```
3508 ///
3509 /// For example:
3510 ///
3511 /// `"projects/my-project/sinks/my-sink"`
3512 pub sink_name: std::string::String,
3513
3514 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3515}
3516
3517impl GetSinkRequest {
3518 pub fn new() -> Self {
3519 std::default::Default::default()
3520 }
3521
3522 /// Sets the value of [sink_name][crate::model::GetSinkRequest::sink_name].
3523 pub fn set_sink_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3524 self.sink_name = v.into();
3525 self
3526 }
3527}
3528
3529impl wkt::message::Message for GetSinkRequest {
3530 fn typename() -> &'static str {
3531 "type.googleapis.com/google.logging.v2.GetSinkRequest"
3532 }
3533}
3534
3535/// The parameters to `CreateSink`.
3536#[derive(Clone, Default, PartialEq)]
3537#[non_exhaustive]
3538pub struct CreateSinkRequest {
3539 /// Required. The resource in which to create the sink:
3540 ///
3541 /// ```norust
3542 /// "projects/[PROJECT_ID]"
3543 /// "organizations/[ORGANIZATION_ID]"
3544 /// "billingAccounts/[BILLING_ACCOUNT_ID]"
3545 /// "folders/[FOLDER_ID]"
3546 /// ```
3547 ///
3548 /// For examples:
3549 ///
3550 /// `"projects/my-project"`
3551 /// `"organizations/123456789"`
3552 pub parent: std::string::String,
3553
3554 /// Required. The new sink, whose `name` parameter is a sink identifier that
3555 /// is not already in use.
3556 pub sink: std::option::Option<crate::model::LogSink>,
3557
3558 /// Optional. Determines the kind of IAM identity returned as `writer_identity`
3559 /// in the new sink. If this value is omitted or set to false, and if the
3560 /// sink's parent is a project, then the value returned as `writer_identity` is
3561 /// the same group or service account used by Cloud Logging before the addition
3562 /// of writer identities to this API. The sink's destination must be in the
3563 /// same project as the sink itself.
3564 ///
3565 /// If this field is set to true, or if the sink is owned by a non-project
3566 /// resource such as an organization, then the value of `writer_identity` will
3567 /// be a unique service account used only for exports from the new sink. For
3568 /// more information, see `writer_identity` in
3569 /// [LogSink][google.logging.v2.LogSink].
3570 ///
3571 /// [google.logging.v2.LogSink]: crate::model::LogSink
3572 pub unique_writer_identity: bool,
3573
3574 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3575}
3576
3577impl CreateSinkRequest {
3578 pub fn new() -> Self {
3579 std::default::Default::default()
3580 }
3581
3582 /// Sets the value of [parent][crate::model::CreateSinkRequest::parent].
3583 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3584 self.parent = v.into();
3585 self
3586 }
3587
3588 /// Sets the value of [sink][crate::model::CreateSinkRequest::sink].
3589 pub fn set_sink<T>(mut self, v: T) -> Self
3590 where
3591 T: std::convert::Into<crate::model::LogSink>,
3592 {
3593 self.sink = std::option::Option::Some(v.into());
3594 self
3595 }
3596
3597 /// Sets or clears the value of [sink][crate::model::CreateSinkRequest::sink].
3598 pub fn set_or_clear_sink<T>(mut self, v: std::option::Option<T>) -> Self
3599 where
3600 T: std::convert::Into<crate::model::LogSink>,
3601 {
3602 self.sink = v.map(|x| x.into());
3603 self
3604 }
3605
3606 /// Sets the value of [unique_writer_identity][crate::model::CreateSinkRequest::unique_writer_identity].
3607 pub fn set_unique_writer_identity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3608 self.unique_writer_identity = v.into();
3609 self
3610 }
3611}
3612
3613impl wkt::message::Message for CreateSinkRequest {
3614 fn typename() -> &'static str {
3615 "type.googleapis.com/google.logging.v2.CreateSinkRequest"
3616 }
3617}
3618
3619/// The parameters to `UpdateSink`.
3620#[derive(Clone, Default, PartialEq)]
3621#[non_exhaustive]
3622pub struct UpdateSinkRequest {
3623 /// Required. The full resource name of the sink to update, including the
3624 /// parent resource and the sink identifier:
3625 ///
3626 /// ```norust
3627 /// "projects/[PROJECT_ID]/sinks/[SINK_ID]"
3628 /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
3629 /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
3630 /// "folders/[FOLDER_ID]/sinks/[SINK_ID]"
3631 /// ```
3632 ///
3633 /// For example:
3634 ///
3635 /// `"projects/my-project/sinks/my-sink"`
3636 pub sink_name: std::string::String,
3637
3638 /// Required. The updated sink, whose name is the same identifier that appears
3639 /// as part of `sink_name`.
3640 pub sink: std::option::Option<crate::model::LogSink>,
3641
3642 /// Optional. See [sinks.create][google.logging.v2.ConfigServiceV2.CreateSink]
3643 /// for a description of this field. When updating a sink, the effect of this
3644 /// field on the value of `writer_identity` in the updated sink depends on both
3645 /// the old and new values of this field:
3646 ///
3647 /// + If the old and new values of this field are both false or both true,
3648 /// then there is no change to the sink's `writer_identity`.
3649 /// + If the old value is false and the new value is true, then
3650 /// `writer_identity` is changed to a unique service account.
3651 /// + It is an error if the old value is true and the new value is
3652 /// set to false or defaulted to false.
3653 ///
3654 /// [google.logging.v2.ConfigServiceV2.CreateSink]: crate::client::ConfigServiceV2::create_sink
3655 pub unique_writer_identity: bool,
3656
3657 /// Optional. Field mask that specifies the fields in `sink` that need
3658 /// an update. A sink field will be overwritten if, and only if, it is
3659 /// in the update mask. `name` and output only fields cannot be updated.
3660 ///
3661 /// An empty `updateMask` is temporarily treated as using the following mask
3662 /// for backwards compatibility purposes:
3663 ///
3664 /// `destination,filter,includeChildren`
3665 ///
3666 /// At some point in the future, behavior will be removed and specifying an
3667 /// empty `updateMask` will be an error.
3668 ///
3669 /// For a detailed `FieldMask` definition, see
3670 /// <https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask>
3671 ///
3672 /// For example: `updateMask=filter`
3673 pub update_mask: std::option::Option<wkt::FieldMask>,
3674
3675 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3676}
3677
3678impl UpdateSinkRequest {
3679 pub fn new() -> Self {
3680 std::default::Default::default()
3681 }
3682
3683 /// Sets the value of [sink_name][crate::model::UpdateSinkRequest::sink_name].
3684 pub fn set_sink_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3685 self.sink_name = v.into();
3686 self
3687 }
3688
3689 /// Sets the value of [sink][crate::model::UpdateSinkRequest::sink].
3690 pub fn set_sink<T>(mut self, v: T) -> Self
3691 where
3692 T: std::convert::Into<crate::model::LogSink>,
3693 {
3694 self.sink = std::option::Option::Some(v.into());
3695 self
3696 }
3697
3698 /// Sets or clears the value of [sink][crate::model::UpdateSinkRequest::sink].
3699 pub fn set_or_clear_sink<T>(mut self, v: std::option::Option<T>) -> Self
3700 where
3701 T: std::convert::Into<crate::model::LogSink>,
3702 {
3703 self.sink = v.map(|x| x.into());
3704 self
3705 }
3706
3707 /// Sets the value of [unique_writer_identity][crate::model::UpdateSinkRequest::unique_writer_identity].
3708 pub fn set_unique_writer_identity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3709 self.unique_writer_identity = v.into();
3710 self
3711 }
3712
3713 /// Sets the value of [update_mask][crate::model::UpdateSinkRequest::update_mask].
3714 pub fn set_update_mask<T>(mut self, v: T) -> Self
3715 where
3716 T: std::convert::Into<wkt::FieldMask>,
3717 {
3718 self.update_mask = std::option::Option::Some(v.into());
3719 self
3720 }
3721
3722 /// Sets or clears the value of [update_mask][crate::model::UpdateSinkRequest::update_mask].
3723 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3724 where
3725 T: std::convert::Into<wkt::FieldMask>,
3726 {
3727 self.update_mask = v.map(|x| x.into());
3728 self
3729 }
3730}
3731
3732impl wkt::message::Message for UpdateSinkRequest {
3733 fn typename() -> &'static str {
3734 "type.googleapis.com/google.logging.v2.UpdateSinkRequest"
3735 }
3736}
3737
3738/// The parameters to `DeleteSink`.
3739#[derive(Clone, Default, PartialEq)]
3740#[non_exhaustive]
3741pub struct DeleteSinkRequest {
3742 /// Required. The full resource name of the sink to delete, including the
3743 /// parent resource and the sink identifier:
3744 ///
3745 /// ```norust
3746 /// "projects/[PROJECT_ID]/sinks/[SINK_ID]"
3747 /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
3748 /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
3749 /// "folders/[FOLDER_ID]/sinks/[SINK_ID]"
3750 /// ```
3751 ///
3752 /// For example:
3753 ///
3754 /// `"projects/my-project/sinks/my-sink"`
3755 pub sink_name: std::string::String,
3756
3757 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3758}
3759
3760impl DeleteSinkRequest {
3761 pub fn new() -> Self {
3762 std::default::Default::default()
3763 }
3764
3765 /// Sets the value of [sink_name][crate::model::DeleteSinkRequest::sink_name].
3766 pub fn set_sink_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3767 self.sink_name = v.into();
3768 self
3769 }
3770}
3771
3772impl wkt::message::Message for DeleteSinkRequest {
3773 fn typename() -> &'static str {
3774 "type.googleapis.com/google.logging.v2.DeleteSinkRequest"
3775 }
3776}
3777
3778/// The parameters to CreateLink.
3779#[derive(Clone, Default, PartialEq)]
3780#[non_exhaustive]
3781pub struct CreateLinkRequest {
3782 /// Required. The full resource name of the bucket to create a link for.
3783 ///
3784 /// ```norust
3785 /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
3786 /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
3787 /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
3788 /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
3789 /// ```
3790 pub parent: std::string::String,
3791
3792 /// Required. The new link.
3793 pub link: std::option::Option<crate::model::Link>,
3794
3795 /// Required. The ID to use for the link. The link_id can have up to 100
3796 /// characters. A valid link_id must only have alphanumeric characters and
3797 /// underscores within it.
3798 pub link_id: std::string::String,
3799
3800 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3801}
3802
3803impl CreateLinkRequest {
3804 pub fn new() -> Self {
3805 std::default::Default::default()
3806 }
3807
3808 /// Sets the value of [parent][crate::model::CreateLinkRequest::parent].
3809 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3810 self.parent = v.into();
3811 self
3812 }
3813
3814 /// Sets the value of [link][crate::model::CreateLinkRequest::link].
3815 pub fn set_link<T>(mut self, v: T) -> Self
3816 where
3817 T: std::convert::Into<crate::model::Link>,
3818 {
3819 self.link = std::option::Option::Some(v.into());
3820 self
3821 }
3822
3823 /// Sets or clears the value of [link][crate::model::CreateLinkRequest::link].
3824 pub fn set_or_clear_link<T>(mut self, v: std::option::Option<T>) -> Self
3825 where
3826 T: std::convert::Into<crate::model::Link>,
3827 {
3828 self.link = v.map(|x| x.into());
3829 self
3830 }
3831
3832 /// Sets the value of [link_id][crate::model::CreateLinkRequest::link_id].
3833 pub fn set_link_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3834 self.link_id = v.into();
3835 self
3836 }
3837}
3838
3839impl wkt::message::Message for CreateLinkRequest {
3840 fn typename() -> &'static str {
3841 "type.googleapis.com/google.logging.v2.CreateLinkRequest"
3842 }
3843}
3844
3845/// The parameters to DeleteLink.
3846#[derive(Clone, Default, PartialEq)]
3847#[non_exhaustive]
3848pub struct DeleteLinkRequest {
3849 /// Required. The full resource name of the link to delete.
3850 ///
3851 /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
3852 /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
3853 /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
3854 /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
3855 pub name: std::string::String,
3856
3857 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3858}
3859
3860impl DeleteLinkRequest {
3861 pub fn new() -> Self {
3862 std::default::Default::default()
3863 }
3864
3865 /// Sets the value of [name][crate::model::DeleteLinkRequest::name].
3866 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3867 self.name = v.into();
3868 self
3869 }
3870}
3871
3872impl wkt::message::Message for DeleteLinkRequest {
3873 fn typename() -> &'static str {
3874 "type.googleapis.com/google.logging.v2.DeleteLinkRequest"
3875 }
3876}
3877
3878/// The parameters to ListLinks.
3879#[derive(Clone, Default, PartialEq)]
3880#[non_exhaustive]
3881pub struct ListLinksRequest {
3882 /// Required. The parent resource whose links are to be listed:
3883 ///
3884 /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/"
3885 /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/"
3886 /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/"
3887 /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/
3888 pub parent: std::string::String,
3889
3890 /// Optional. If present, then retrieve the next batch of results from the
3891 /// preceding call to this method. `pageToken` must be the value of
3892 /// `nextPageToken` from the previous response.
3893 pub page_token: std::string::String,
3894
3895 /// Optional. The maximum number of results to return from this request.
3896 pub page_size: i32,
3897
3898 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3899}
3900
3901impl ListLinksRequest {
3902 pub fn new() -> Self {
3903 std::default::Default::default()
3904 }
3905
3906 /// Sets the value of [parent][crate::model::ListLinksRequest::parent].
3907 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3908 self.parent = v.into();
3909 self
3910 }
3911
3912 /// Sets the value of [page_token][crate::model::ListLinksRequest::page_token].
3913 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3914 self.page_token = v.into();
3915 self
3916 }
3917
3918 /// Sets the value of [page_size][crate::model::ListLinksRequest::page_size].
3919 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3920 self.page_size = v.into();
3921 self
3922 }
3923}
3924
3925impl wkt::message::Message for ListLinksRequest {
3926 fn typename() -> &'static str {
3927 "type.googleapis.com/google.logging.v2.ListLinksRequest"
3928 }
3929}
3930
3931/// The response from ListLinks.
3932#[derive(Clone, Default, PartialEq)]
3933#[non_exhaustive]
3934pub struct ListLinksResponse {
3935 /// A list of links.
3936 pub links: std::vec::Vec<crate::model::Link>,
3937
3938 /// If there might be more results than those appearing in this response, then
3939 /// `nextPageToken` is included. To get the next set of results, call the same
3940 /// method again using the value of `nextPageToken` as `pageToken`.
3941 pub next_page_token: std::string::String,
3942
3943 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3944}
3945
3946impl ListLinksResponse {
3947 pub fn new() -> Self {
3948 std::default::Default::default()
3949 }
3950
3951 /// Sets the value of [links][crate::model::ListLinksResponse::links].
3952 pub fn set_links<T, V>(mut self, v: T) -> Self
3953 where
3954 T: std::iter::IntoIterator<Item = V>,
3955 V: std::convert::Into<crate::model::Link>,
3956 {
3957 use std::iter::Iterator;
3958 self.links = v.into_iter().map(|i| i.into()).collect();
3959 self
3960 }
3961
3962 /// Sets the value of [next_page_token][crate::model::ListLinksResponse::next_page_token].
3963 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3964 self.next_page_token = v.into();
3965 self
3966 }
3967}
3968
3969impl wkt::message::Message for ListLinksResponse {
3970 fn typename() -> &'static str {
3971 "type.googleapis.com/google.logging.v2.ListLinksResponse"
3972 }
3973}
3974
3975#[doc(hidden)]
3976impl gax::paginator::internal::PageableResponse for ListLinksResponse {
3977 type PageItem = crate::model::Link;
3978
3979 fn items(self) -> std::vec::Vec<Self::PageItem> {
3980 self.links
3981 }
3982
3983 fn next_page_token(&self) -> std::string::String {
3984 use std::clone::Clone;
3985 self.next_page_token.clone()
3986 }
3987}
3988
3989/// The parameters to GetLink.
3990#[derive(Clone, Default, PartialEq)]
3991#[non_exhaustive]
3992pub struct GetLinkRequest {
3993 /// Required. The resource name of the link:
3994 ///
3995 /// "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
3996 /// "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
3997 /// "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
3998 /// "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]
3999 pub name: std::string::String,
4000
4001 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4002}
4003
4004impl GetLinkRequest {
4005 pub fn new() -> Self {
4006 std::default::Default::default()
4007 }
4008
4009 /// Sets the value of [name][crate::model::GetLinkRequest::name].
4010 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4011 self.name = v.into();
4012 self
4013 }
4014}
4015
4016impl wkt::message::Message for GetLinkRequest {
4017 fn typename() -> &'static str {
4018 "type.googleapis.com/google.logging.v2.GetLinkRequest"
4019 }
4020}
4021
4022/// Specifies a set of log entries that are filtered out by a sink. If
4023/// your Google Cloud resource receives a large volume of log entries, you can
4024/// use exclusions to reduce your chargeable logs. Note that exclusions on
4025/// organization-level and folder-level sinks don't apply to child resources.
4026/// Note also that you cannot modify the _Required sink or exclude logs from it.
4027#[derive(Clone, Default, PartialEq)]
4028#[non_exhaustive]
4029pub struct LogExclusion {
4030 /// Required. A client-assigned identifier, such as
4031 /// `"load-balancer-exclusion"`. Identifiers are limited to 100 characters and
4032 /// can include only letters, digits, underscores, hyphens, and periods. First
4033 /// character has to be alphanumeric.
4034 pub name: std::string::String,
4035
4036 /// Optional. A description of this exclusion.
4037 pub description: std::string::String,
4038
4039 /// Required. An [advanced logs
4040 /// filter](https://cloud.google.com/logging/docs/view/advanced-queries) that
4041 /// matches the log entries to be excluded. By using the [sample
4042 /// function](https://cloud.google.com/logging/docs/view/advanced-queries#sample),
4043 /// you can exclude less than 100% of the matching log entries.
4044 ///
4045 /// For example, the following query matches 99% of low-severity log entries
4046 /// from Google Cloud Storage buckets:
4047 ///
4048 /// `resource.type=gcs_bucket severity<ERROR sample(insertId, 0.99)`
4049 pub filter: std::string::String,
4050
4051 /// Optional. If set to True, then this exclusion is disabled and it does not
4052 /// exclude any log entries. You can [update an
4053 /// exclusion][google.logging.v2.ConfigServiceV2.UpdateExclusion] to change the
4054 /// value of this field.
4055 ///
4056 /// [google.logging.v2.ConfigServiceV2.UpdateExclusion]: crate::client::ConfigServiceV2::update_exclusion
4057 pub disabled: bool,
4058
4059 /// Output only. The creation timestamp of the exclusion.
4060 ///
4061 /// This field may not be present for older exclusions.
4062 pub create_time: std::option::Option<wkt::Timestamp>,
4063
4064 /// Output only. The last update timestamp of the exclusion.
4065 ///
4066 /// This field may not be present for older exclusions.
4067 pub update_time: std::option::Option<wkt::Timestamp>,
4068
4069 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4070}
4071
4072impl LogExclusion {
4073 pub fn new() -> Self {
4074 std::default::Default::default()
4075 }
4076
4077 /// Sets the value of [name][crate::model::LogExclusion::name].
4078 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4079 self.name = v.into();
4080 self
4081 }
4082
4083 /// Sets the value of [description][crate::model::LogExclusion::description].
4084 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4085 self.description = v.into();
4086 self
4087 }
4088
4089 /// Sets the value of [filter][crate::model::LogExclusion::filter].
4090 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4091 self.filter = v.into();
4092 self
4093 }
4094
4095 /// Sets the value of [disabled][crate::model::LogExclusion::disabled].
4096 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4097 self.disabled = v.into();
4098 self
4099 }
4100
4101 /// Sets the value of [create_time][crate::model::LogExclusion::create_time].
4102 pub fn set_create_time<T>(mut self, v: T) -> Self
4103 where
4104 T: std::convert::Into<wkt::Timestamp>,
4105 {
4106 self.create_time = std::option::Option::Some(v.into());
4107 self
4108 }
4109
4110 /// Sets or clears the value of [create_time][crate::model::LogExclusion::create_time].
4111 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4112 where
4113 T: std::convert::Into<wkt::Timestamp>,
4114 {
4115 self.create_time = v.map(|x| x.into());
4116 self
4117 }
4118
4119 /// Sets the value of [update_time][crate::model::LogExclusion::update_time].
4120 pub fn set_update_time<T>(mut self, v: T) -> Self
4121 where
4122 T: std::convert::Into<wkt::Timestamp>,
4123 {
4124 self.update_time = std::option::Option::Some(v.into());
4125 self
4126 }
4127
4128 /// Sets or clears the value of [update_time][crate::model::LogExclusion::update_time].
4129 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4130 where
4131 T: std::convert::Into<wkt::Timestamp>,
4132 {
4133 self.update_time = v.map(|x| x.into());
4134 self
4135 }
4136}
4137
4138impl wkt::message::Message for LogExclusion {
4139 fn typename() -> &'static str {
4140 "type.googleapis.com/google.logging.v2.LogExclusion"
4141 }
4142}
4143
4144/// The parameters to `ListExclusions`.
4145#[derive(Clone, Default, PartialEq)]
4146#[non_exhaustive]
4147pub struct ListExclusionsRequest {
4148 /// Required. The parent resource whose exclusions are to be listed.
4149 ///
4150 /// ```norust
4151 /// "projects/[PROJECT_ID]"
4152 /// "organizations/[ORGANIZATION_ID]"
4153 /// "billingAccounts/[BILLING_ACCOUNT_ID]"
4154 /// "folders/[FOLDER_ID]"
4155 /// ```
4156 pub parent: std::string::String,
4157
4158 /// Optional. If present, then retrieve the next batch of results from the
4159 /// preceding call to this method. `pageToken` must be the value of
4160 /// `nextPageToken` from the previous response. The values of other method
4161 /// parameters should be identical to those in the previous call.
4162 pub page_token: std::string::String,
4163
4164 /// Optional. The maximum number of results to return from this request.
4165 /// Non-positive values are ignored. The presence of `nextPageToken` in the
4166 /// response indicates that more results might be available.
4167 pub page_size: i32,
4168
4169 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4170}
4171
4172impl ListExclusionsRequest {
4173 pub fn new() -> Self {
4174 std::default::Default::default()
4175 }
4176
4177 /// Sets the value of [parent][crate::model::ListExclusionsRequest::parent].
4178 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4179 self.parent = v.into();
4180 self
4181 }
4182
4183 /// Sets the value of [page_token][crate::model::ListExclusionsRequest::page_token].
4184 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4185 self.page_token = v.into();
4186 self
4187 }
4188
4189 /// Sets the value of [page_size][crate::model::ListExclusionsRequest::page_size].
4190 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4191 self.page_size = v.into();
4192 self
4193 }
4194}
4195
4196impl wkt::message::Message for ListExclusionsRequest {
4197 fn typename() -> &'static str {
4198 "type.googleapis.com/google.logging.v2.ListExclusionsRequest"
4199 }
4200}
4201
4202/// Result returned from `ListExclusions`.
4203#[derive(Clone, Default, PartialEq)]
4204#[non_exhaustive]
4205pub struct ListExclusionsResponse {
4206 /// A list of exclusions.
4207 pub exclusions: std::vec::Vec<crate::model::LogExclusion>,
4208
4209 /// If there might be more results than appear in this response, then
4210 /// `nextPageToken` is included. To get the next set of results, call the same
4211 /// method again using the value of `nextPageToken` as `pageToken`.
4212 pub next_page_token: std::string::String,
4213
4214 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4215}
4216
4217impl ListExclusionsResponse {
4218 pub fn new() -> Self {
4219 std::default::Default::default()
4220 }
4221
4222 /// Sets the value of [exclusions][crate::model::ListExclusionsResponse::exclusions].
4223 pub fn set_exclusions<T, V>(mut self, v: T) -> Self
4224 where
4225 T: std::iter::IntoIterator<Item = V>,
4226 V: std::convert::Into<crate::model::LogExclusion>,
4227 {
4228 use std::iter::Iterator;
4229 self.exclusions = v.into_iter().map(|i| i.into()).collect();
4230 self
4231 }
4232
4233 /// Sets the value of [next_page_token][crate::model::ListExclusionsResponse::next_page_token].
4234 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4235 self.next_page_token = v.into();
4236 self
4237 }
4238}
4239
4240impl wkt::message::Message for ListExclusionsResponse {
4241 fn typename() -> &'static str {
4242 "type.googleapis.com/google.logging.v2.ListExclusionsResponse"
4243 }
4244}
4245
4246#[doc(hidden)]
4247impl gax::paginator::internal::PageableResponse for ListExclusionsResponse {
4248 type PageItem = crate::model::LogExclusion;
4249
4250 fn items(self) -> std::vec::Vec<Self::PageItem> {
4251 self.exclusions
4252 }
4253
4254 fn next_page_token(&self) -> std::string::String {
4255 use std::clone::Clone;
4256 self.next_page_token.clone()
4257 }
4258}
4259
4260/// The parameters to `GetExclusion`.
4261#[derive(Clone, Default, PartialEq)]
4262#[non_exhaustive]
4263pub struct GetExclusionRequest {
4264 /// Required. The resource name of an existing exclusion:
4265 ///
4266 /// ```norust
4267 /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
4268 /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
4269 /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
4270 /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
4271 /// ```
4272 ///
4273 /// For example:
4274 ///
4275 /// `"projects/my-project/exclusions/my-exclusion"`
4276 pub name: std::string::String,
4277
4278 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4279}
4280
4281impl GetExclusionRequest {
4282 pub fn new() -> Self {
4283 std::default::Default::default()
4284 }
4285
4286 /// Sets the value of [name][crate::model::GetExclusionRequest::name].
4287 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4288 self.name = v.into();
4289 self
4290 }
4291}
4292
4293impl wkt::message::Message for GetExclusionRequest {
4294 fn typename() -> &'static str {
4295 "type.googleapis.com/google.logging.v2.GetExclusionRequest"
4296 }
4297}
4298
4299/// The parameters to `CreateExclusion`.
4300#[derive(Clone, Default, PartialEq)]
4301#[non_exhaustive]
4302pub struct CreateExclusionRequest {
4303 /// Required. The parent resource in which to create the exclusion:
4304 ///
4305 /// ```norust
4306 /// "projects/[PROJECT_ID]"
4307 /// "organizations/[ORGANIZATION_ID]"
4308 /// "billingAccounts/[BILLING_ACCOUNT_ID]"
4309 /// "folders/[FOLDER_ID]"
4310 /// ```
4311 ///
4312 /// For examples:
4313 ///
4314 /// `"projects/my-logging-project"`
4315 /// `"organizations/123456789"`
4316 pub parent: std::string::String,
4317
4318 /// Required. The new exclusion, whose `name` parameter is an exclusion name
4319 /// that is not already used in the parent resource.
4320 pub exclusion: std::option::Option<crate::model::LogExclusion>,
4321
4322 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4323}
4324
4325impl CreateExclusionRequest {
4326 pub fn new() -> Self {
4327 std::default::Default::default()
4328 }
4329
4330 /// Sets the value of [parent][crate::model::CreateExclusionRequest::parent].
4331 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4332 self.parent = v.into();
4333 self
4334 }
4335
4336 /// Sets the value of [exclusion][crate::model::CreateExclusionRequest::exclusion].
4337 pub fn set_exclusion<T>(mut self, v: T) -> Self
4338 where
4339 T: std::convert::Into<crate::model::LogExclusion>,
4340 {
4341 self.exclusion = std::option::Option::Some(v.into());
4342 self
4343 }
4344
4345 /// Sets or clears the value of [exclusion][crate::model::CreateExclusionRequest::exclusion].
4346 pub fn set_or_clear_exclusion<T>(mut self, v: std::option::Option<T>) -> Self
4347 where
4348 T: std::convert::Into<crate::model::LogExclusion>,
4349 {
4350 self.exclusion = v.map(|x| x.into());
4351 self
4352 }
4353}
4354
4355impl wkt::message::Message for CreateExclusionRequest {
4356 fn typename() -> &'static str {
4357 "type.googleapis.com/google.logging.v2.CreateExclusionRequest"
4358 }
4359}
4360
4361/// The parameters to `UpdateExclusion`.
4362#[derive(Clone, Default, PartialEq)]
4363#[non_exhaustive]
4364pub struct UpdateExclusionRequest {
4365 /// Required. The resource name of the exclusion to update:
4366 ///
4367 /// ```norust
4368 /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
4369 /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
4370 /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
4371 /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
4372 /// ```
4373 ///
4374 /// For example:
4375 ///
4376 /// `"projects/my-project/exclusions/my-exclusion"`
4377 pub name: std::string::String,
4378
4379 /// Required. New values for the existing exclusion. Only the fields specified
4380 /// in `update_mask` are relevant.
4381 pub exclusion: std::option::Option<crate::model::LogExclusion>,
4382
4383 /// Required. A non-empty list of fields to change in the existing exclusion.
4384 /// New values for the fields are taken from the corresponding fields in the
4385 /// [LogExclusion][google.logging.v2.LogExclusion] included in this request.
4386 /// Fields not mentioned in `update_mask` are not changed and are ignored in
4387 /// the request.
4388 ///
4389 /// For example, to change the filter and description of an exclusion,
4390 /// specify an `update_mask` of `"filter,description"`.
4391 ///
4392 /// [google.logging.v2.LogExclusion]: crate::model::LogExclusion
4393 pub update_mask: std::option::Option<wkt::FieldMask>,
4394
4395 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4396}
4397
4398impl UpdateExclusionRequest {
4399 pub fn new() -> Self {
4400 std::default::Default::default()
4401 }
4402
4403 /// Sets the value of [name][crate::model::UpdateExclusionRequest::name].
4404 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4405 self.name = v.into();
4406 self
4407 }
4408
4409 /// Sets the value of [exclusion][crate::model::UpdateExclusionRequest::exclusion].
4410 pub fn set_exclusion<T>(mut self, v: T) -> Self
4411 where
4412 T: std::convert::Into<crate::model::LogExclusion>,
4413 {
4414 self.exclusion = std::option::Option::Some(v.into());
4415 self
4416 }
4417
4418 /// Sets or clears the value of [exclusion][crate::model::UpdateExclusionRequest::exclusion].
4419 pub fn set_or_clear_exclusion<T>(mut self, v: std::option::Option<T>) -> Self
4420 where
4421 T: std::convert::Into<crate::model::LogExclusion>,
4422 {
4423 self.exclusion = v.map(|x| x.into());
4424 self
4425 }
4426
4427 /// Sets the value of [update_mask][crate::model::UpdateExclusionRequest::update_mask].
4428 pub fn set_update_mask<T>(mut self, v: T) -> Self
4429 where
4430 T: std::convert::Into<wkt::FieldMask>,
4431 {
4432 self.update_mask = std::option::Option::Some(v.into());
4433 self
4434 }
4435
4436 /// Sets or clears the value of [update_mask][crate::model::UpdateExclusionRequest::update_mask].
4437 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4438 where
4439 T: std::convert::Into<wkt::FieldMask>,
4440 {
4441 self.update_mask = v.map(|x| x.into());
4442 self
4443 }
4444}
4445
4446impl wkt::message::Message for UpdateExclusionRequest {
4447 fn typename() -> &'static str {
4448 "type.googleapis.com/google.logging.v2.UpdateExclusionRequest"
4449 }
4450}
4451
4452/// The parameters to `DeleteExclusion`.
4453#[derive(Clone, Default, PartialEq)]
4454#[non_exhaustive]
4455pub struct DeleteExclusionRequest {
4456 /// Required. The resource name of an existing exclusion to delete:
4457 ///
4458 /// ```norust
4459 /// "projects/[PROJECT_ID]/exclusions/[EXCLUSION_ID]"
4460 /// "organizations/[ORGANIZATION_ID]/exclusions/[EXCLUSION_ID]"
4461 /// "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
4462 /// "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
4463 /// ```
4464 ///
4465 /// For example:
4466 ///
4467 /// `"projects/my-project/exclusions/my-exclusion"`
4468 pub name: std::string::String,
4469
4470 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4471}
4472
4473impl DeleteExclusionRequest {
4474 pub fn new() -> Self {
4475 std::default::Default::default()
4476 }
4477
4478 /// Sets the value of [name][crate::model::DeleteExclusionRequest::name].
4479 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4480 self.name = v.into();
4481 self
4482 }
4483}
4484
4485impl wkt::message::Message for DeleteExclusionRequest {
4486 fn typename() -> &'static str {
4487 "type.googleapis.com/google.logging.v2.DeleteExclusionRequest"
4488 }
4489}
4490
4491/// The parameters to
4492/// [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings].
4493///
4494/// See [Enabling CMEK for Log
4495/// Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for
4496/// more information.
4497///
4498/// [google.logging.v2.ConfigServiceV2.GetCmekSettings]: crate::client::ConfigServiceV2::get_cmek_settings
4499#[derive(Clone, Default, PartialEq)]
4500#[non_exhaustive]
4501pub struct GetCmekSettingsRequest {
4502 /// Required. The resource for which to retrieve CMEK settings.
4503 ///
4504 /// ```norust
4505 /// "projects/[PROJECT_ID]/cmekSettings"
4506 /// "organizations/[ORGANIZATION_ID]/cmekSettings"
4507 /// "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
4508 /// "folders/[FOLDER_ID]/cmekSettings"
4509 /// ```
4510 ///
4511 /// For example:
4512 ///
4513 /// `"organizations/12345/cmekSettings"`
4514 ///
4515 /// Note: CMEK for the Log Router can be configured for Google Cloud projects,
4516 /// folders, organizations and billing accounts. Once configured for an
4517 /// organization, it applies to all projects and folders in the Google Cloud
4518 /// organization.
4519 pub name: std::string::String,
4520
4521 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4522}
4523
4524impl GetCmekSettingsRequest {
4525 pub fn new() -> Self {
4526 std::default::Default::default()
4527 }
4528
4529 /// Sets the value of [name][crate::model::GetCmekSettingsRequest::name].
4530 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4531 self.name = v.into();
4532 self
4533 }
4534}
4535
4536impl wkt::message::Message for GetCmekSettingsRequest {
4537 fn typename() -> &'static str {
4538 "type.googleapis.com/google.logging.v2.GetCmekSettingsRequest"
4539 }
4540}
4541
4542/// The parameters to
4543/// [UpdateCmekSettings][google.logging.v2.ConfigServiceV2.UpdateCmekSettings].
4544///
4545/// See [Enabling CMEK for Log
4546/// Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for
4547/// more information.
4548///
4549/// [google.logging.v2.ConfigServiceV2.UpdateCmekSettings]: crate::client::ConfigServiceV2::update_cmek_settings
4550#[derive(Clone, Default, PartialEq)]
4551#[non_exhaustive]
4552pub struct UpdateCmekSettingsRequest {
4553 /// Required. The resource name for the CMEK settings to update.
4554 ///
4555 /// ```norust
4556 /// "projects/[PROJECT_ID]/cmekSettings"
4557 /// "organizations/[ORGANIZATION_ID]/cmekSettings"
4558 /// "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
4559 /// "folders/[FOLDER_ID]/cmekSettings"
4560 /// ```
4561 ///
4562 /// For example:
4563 ///
4564 /// `"organizations/12345/cmekSettings"`
4565 ///
4566 /// Note: CMEK for the Log Router can currently only be configured for Google
4567 /// Cloud organizations. Once configured, it applies to all projects and
4568 /// folders in the Google Cloud organization.
4569 pub name: std::string::String,
4570
4571 /// Required. The CMEK settings to update.
4572 ///
4573 /// See [Enabling CMEK for Log
4574 /// Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
4575 /// for more information.
4576 pub cmek_settings: std::option::Option<crate::model::CmekSettings>,
4577
4578 /// Optional. Field mask identifying which fields from `cmek_settings` should
4579 /// be updated. A field will be overwritten if and only if it is in the update
4580 /// mask. Output only fields cannot be updated.
4581 ///
4582 /// See [FieldMask][google.protobuf.FieldMask] for more information.
4583 ///
4584 /// For example: `"updateMask=kmsKeyName"`
4585 ///
4586 /// [google.protobuf.FieldMask]: wkt::FieldMask
4587 pub update_mask: std::option::Option<wkt::FieldMask>,
4588
4589 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4590}
4591
4592impl UpdateCmekSettingsRequest {
4593 pub fn new() -> Self {
4594 std::default::Default::default()
4595 }
4596
4597 /// Sets the value of [name][crate::model::UpdateCmekSettingsRequest::name].
4598 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4599 self.name = v.into();
4600 self
4601 }
4602
4603 /// Sets the value of [cmek_settings][crate::model::UpdateCmekSettingsRequest::cmek_settings].
4604 pub fn set_cmek_settings<T>(mut self, v: T) -> Self
4605 where
4606 T: std::convert::Into<crate::model::CmekSettings>,
4607 {
4608 self.cmek_settings = std::option::Option::Some(v.into());
4609 self
4610 }
4611
4612 /// Sets or clears the value of [cmek_settings][crate::model::UpdateCmekSettingsRequest::cmek_settings].
4613 pub fn set_or_clear_cmek_settings<T>(mut self, v: std::option::Option<T>) -> Self
4614 where
4615 T: std::convert::Into<crate::model::CmekSettings>,
4616 {
4617 self.cmek_settings = v.map(|x| x.into());
4618 self
4619 }
4620
4621 /// Sets the value of [update_mask][crate::model::UpdateCmekSettingsRequest::update_mask].
4622 pub fn set_update_mask<T>(mut self, v: T) -> Self
4623 where
4624 T: std::convert::Into<wkt::FieldMask>,
4625 {
4626 self.update_mask = std::option::Option::Some(v.into());
4627 self
4628 }
4629
4630 /// Sets or clears the value of [update_mask][crate::model::UpdateCmekSettingsRequest::update_mask].
4631 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4632 where
4633 T: std::convert::Into<wkt::FieldMask>,
4634 {
4635 self.update_mask = v.map(|x| x.into());
4636 self
4637 }
4638}
4639
4640impl wkt::message::Message for UpdateCmekSettingsRequest {
4641 fn typename() -> &'static str {
4642 "type.googleapis.com/google.logging.v2.UpdateCmekSettingsRequest"
4643 }
4644}
4645
4646/// Describes the customer-managed encryption key (CMEK) settings associated with
4647/// a project, folder, organization, billing account, or flexible resource.
4648///
4649/// Note: CMEK for the Log Router can currently only be configured for Google
4650/// Cloud organizations. Once configured, it applies to all projects and folders
4651/// in the Google Cloud organization.
4652///
4653/// See [Enabling CMEK for Log
4654/// Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for
4655/// more information.
4656#[derive(Clone, Default, PartialEq)]
4657#[non_exhaustive]
4658pub struct CmekSettings {
4659 /// Output only. The resource name of the CMEK settings.
4660 pub name: std::string::String,
4661
4662 /// The resource name for the configured Cloud KMS key.
4663 ///
4664 /// KMS key name format:
4665 ///
4666 /// ```norust
4667 /// "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
4668 /// ```
4669 ///
4670 /// For example:
4671 ///
4672 /// `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"`
4673 ///
4674 /// To enable CMEK for the Log Router, set this field to a valid
4675 /// `kms_key_name` for which the associated service account has the required
4676 /// cloudkms.cryptoKeyEncrypterDecrypter roles assigned for the key.
4677 ///
4678 /// The Cloud KMS key used by the Log Router can be updated by changing the
4679 /// `kms_key_name` to a new valid key name or disabled by setting the key name
4680 /// to an empty string. Encryption operations that are in progress will be
4681 /// completed with the key that was in use when they started. Decryption
4682 /// operations will be completed using the key that was used at the time of
4683 /// encryption unless access to that key has been revoked.
4684 ///
4685 /// To disable CMEK for the Log Router, set this field to an empty string.
4686 ///
4687 /// See [Enabling CMEK for Log
4688 /// Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
4689 /// for more information.
4690 pub kms_key_name: std::string::String,
4691
4692 /// The CryptoKeyVersion resource name for the configured Cloud KMS key.
4693 ///
4694 /// KMS key name format:
4695 ///
4696 /// ```norust
4697 /// "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]/cryptoKeyVersions/[VERSION]"
4698 /// ```
4699 ///
4700 /// For example:
4701 ///
4702 /// `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key/cryptoKeyVersions/1"`
4703 ///
4704 /// This is a read-only field used to convey the specific configured
4705 /// CryptoKeyVersion of `kms_key` that has been configured. It will be
4706 /// populated in cases where the CMEK settings are bound to a single key
4707 /// version.
4708 ///
4709 /// If this field is populated, the `kms_key` is tied to a specific
4710 /// CryptoKeyVersion.
4711 pub kms_key_version_name: std::string::String,
4712
4713 /// Output only. The service account that will be used by the Log Router to
4714 /// access your Cloud KMS key.
4715 ///
4716 /// Before enabling CMEK for Log Router, you must first assign the
4717 /// cloudkms.cryptoKeyEncrypterDecrypter role to the service account that
4718 /// the Log Router will use to access your Cloud KMS key. Use
4719 /// [GetCmekSettings][google.logging.v2.ConfigServiceV2.GetCmekSettings] to
4720 /// obtain the service account ID.
4721 ///
4722 /// See [Enabling CMEK for Log
4723 /// Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
4724 /// for more information.
4725 ///
4726 /// [google.logging.v2.ConfigServiceV2.GetCmekSettings]: crate::client::ConfigServiceV2::get_cmek_settings
4727 pub service_account_id: std::string::String,
4728
4729 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4730}
4731
4732impl CmekSettings {
4733 pub fn new() -> Self {
4734 std::default::Default::default()
4735 }
4736
4737 /// Sets the value of [name][crate::model::CmekSettings::name].
4738 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4739 self.name = v.into();
4740 self
4741 }
4742
4743 /// Sets the value of [kms_key_name][crate::model::CmekSettings::kms_key_name].
4744 pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4745 self.kms_key_name = v.into();
4746 self
4747 }
4748
4749 /// Sets the value of [kms_key_version_name][crate::model::CmekSettings::kms_key_version_name].
4750 pub fn set_kms_key_version_name<T: std::convert::Into<std::string::String>>(
4751 mut self,
4752 v: T,
4753 ) -> Self {
4754 self.kms_key_version_name = v.into();
4755 self
4756 }
4757
4758 /// Sets the value of [service_account_id][crate::model::CmekSettings::service_account_id].
4759 pub fn set_service_account_id<T: std::convert::Into<std::string::String>>(
4760 mut self,
4761 v: T,
4762 ) -> Self {
4763 self.service_account_id = v.into();
4764 self
4765 }
4766}
4767
4768impl wkt::message::Message for CmekSettings {
4769 fn typename() -> &'static str {
4770 "type.googleapis.com/google.logging.v2.CmekSettings"
4771 }
4772}
4773
4774/// The parameters to
4775/// [GetSettings][google.logging.v2.ConfigServiceV2.GetSettings].
4776///
4777/// See [Enabling CMEK for Log
4778/// Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for
4779/// more information.
4780///
4781/// [google.logging.v2.ConfigServiceV2.GetSettings]: crate::client::ConfigServiceV2::get_settings
4782#[derive(Clone, Default, PartialEq)]
4783#[non_exhaustive]
4784pub struct GetSettingsRequest {
4785 /// Required. The resource for which to retrieve settings.
4786 ///
4787 /// ```norust
4788 /// "projects/[PROJECT_ID]/settings"
4789 /// "organizations/[ORGANIZATION_ID]/settings"
4790 /// "billingAccounts/[BILLING_ACCOUNT_ID]/settings"
4791 /// "folders/[FOLDER_ID]/settings"
4792 /// ```
4793 ///
4794 /// For example:
4795 ///
4796 /// `"organizations/12345/settings"`
4797 ///
4798 /// Note: Settings for the Log Router can be get for Google Cloud projects,
4799 /// folders, organizations and billing accounts. Currently it can only be
4800 /// configured for organizations. Once configured for an organization, it
4801 /// applies to all projects and folders in the Google Cloud organization.
4802 pub name: std::string::String,
4803
4804 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4805}
4806
4807impl GetSettingsRequest {
4808 pub fn new() -> Self {
4809 std::default::Default::default()
4810 }
4811
4812 /// Sets the value of [name][crate::model::GetSettingsRequest::name].
4813 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4814 self.name = v.into();
4815 self
4816 }
4817}
4818
4819impl wkt::message::Message for GetSettingsRequest {
4820 fn typename() -> &'static str {
4821 "type.googleapis.com/google.logging.v2.GetSettingsRequest"
4822 }
4823}
4824
4825/// The parameters to
4826/// [UpdateSettings][google.logging.v2.ConfigServiceV2.UpdateSettings].
4827///
4828/// See [Enabling CMEK for Log
4829/// Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for
4830/// more information.
4831///
4832/// [google.logging.v2.ConfigServiceV2.UpdateSettings]: crate::client::ConfigServiceV2::update_settings
4833#[derive(Clone, Default, PartialEq)]
4834#[non_exhaustive]
4835pub struct UpdateSettingsRequest {
4836 /// Required. The resource name for the settings to update.
4837 ///
4838 /// ```norust
4839 /// "organizations/[ORGANIZATION_ID]/settings"
4840 /// ```
4841 ///
4842 /// For example:
4843 ///
4844 /// `"organizations/12345/settings"`
4845 ///
4846 /// Note: Settings for the Log Router can currently only be configured for
4847 /// Google Cloud organizations. Once configured, it applies to all projects and
4848 /// folders in the Google Cloud organization.
4849 pub name: std::string::String,
4850
4851 /// Required. The settings to update.
4852 ///
4853 /// See [Enabling CMEK for Log
4854 /// Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
4855 /// for more information.
4856 pub settings: std::option::Option<crate::model::Settings>,
4857
4858 /// Optional. Field mask identifying which fields from `settings` should
4859 /// be updated. A field will be overwritten if and only if it is in the update
4860 /// mask. Output only fields cannot be updated.
4861 ///
4862 /// See [FieldMask][google.protobuf.FieldMask] for more information.
4863 ///
4864 /// For example: `"updateMask=kmsKeyName"`
4865 ///
4866 /// [google.protobuf.FieldMask]: wkt::FieldMask
4867 pub update_mask: std::option::Option<wkt::FieldMask>,
4868
4869 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4870}
4871
4872impl UpdateSettingsRequest {
4873 pub fn new() -> Self {
4874 std::default::Default::default()
4875 }
4876
4877 /// Sets the value of [name][crate::model::UpdateSettingsRequest::name].
4878 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4879 self.name = v.into();
4880 self
4881 }
4882
4883 /// Sets the value of [settings][crate::model::UpdateSettingsRequest::settings].
4884 pub fn set_settings<T>(mut self, v: T) -> Self
4885 where
4886 T: std::convert::Into<crate::model::Settings>,
4887 {
4888 self.settings = std::option::Option::Some(v.into());
4889 self
4890 }
4891
4892 /// Sets or clears the value of [settings][crate::model::UpdateSettingsRequest::settings].
4893 pub fn set_or_clear_settings<T>(mut self, v: std::option::Option<T>) -> Self
4894 where
4895 T: std::convert::Into<crate::model::Settings>,
4896 {
4897 self.settings = v.map(|x| x.into());
4898 self
4899 }
4900
4901 /// Sets the value of [update_mask][crate::model::UpdateSettingsRequest::update_mask].
4902 pub fn set_update_mask<T>(mut self, v: T) -> Self
4903 where
4904 T: std::convert::Into<wkt::FieldMask>,
4905 {
4906 self.update_mask = std::option::Option::Some(v.into());
4907 self
4908 }
4909
4910 /// Sets or clears the value of [update_mask][crate::model::UpdateSettingsRequest::update_mask].
4911 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4912 where
4913 T: std::convert::Into<wkt::FieldMask>,
4914 {
4915 self.update_mask = v.map(|x| x.into());
4916 self
4917 }
4918}
4919
4920impl wkt::message::Message for UpdateSettingsRequest {
4921 fn typename() -> &'static str {
4922 "type.googleapis.com/google.logging.v2.UpdateSettingsRequest"
4923 }
4924}
4925
4926/// Describes the settings associated with a project, folder, organization,
4927/// billing account, or flexible resource.
4928#[derive(Clone, Default, PartialEq)]
4929#[non_exhaustive]
4930pub struct Settings {
4931 /// Output only. The resource name of the settings.
4932 pub name: std::string::String,
4933
4934 /// Optional. The resource name for the configured Cloud KMS key.
4935 ///
4936 /// KMS key name format:
4937 ///
4938 /// ```norust
4939 /// "projects/[PROJECT_ID]/locations/[LOCATION]/keyRings/[KEYRING]/cryptoKeys/[KEY]"
4940 /// ```
4941 ///
4942 /// For example:
4943 ///
4944 /// `"projects/my-project/locations/us-central1/keyRings/my-ring/cryptoKeys/my-key"`
4945 ///
4946 /// To enable CMEK for the Log Router, set this field to a valid
4947 /// `kms_key_name` for which the associated service account has the required
4948 /// `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key.
4949 ///
4950 /// The Cloud KMS key used by the Log Router can be updated by changing the
4951 /// `kms_key_name` to a new valid key name. Encryption operations that are in
4952 /// progress will be completed with the key that was in use when they started.
4953 /// Decryption operations will be completed using the key that was used at the
4954 /// time of encryption unless access to that key has been revoked.
4955 ///
4956 /// To disable CMEK for the Log Router, set this field to an empty string.
4957 ///
4958 /// See [Enabling CMEK for Log
4959 /// Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
4960 /// for more information.
4961 pub kms_key_name: std::string::String,
4962
4963 /// Output only. The service account that will be used by the Log Router to
4964 /// access your Cloud KMS key.
4965 ///
4966 /// Before enabling CMEK for Log Router, you must first assign the role
4967 /// `roles/cloudkms.cryptoKeyEncrypterDecrypter` to the service account that
4968 /// the Log Router will use to access your Cloud KMS key. Use
4969 /// [GetSettings][google.logging.v2.ConfigServiceV2.GetSettings] to
4970 /// obtain the service account ID.
4971 ///
4972 /// See [Enabling CMEK for Log
4973 /// Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
4974 /// for more information.
4975 ///
4976 /// [google.logging.v2.ConfigServiceV2.GetSettings]: crate::client::ConfigServiceV2::get_settings
4977 pub kms_service_account_id: std::string::String,
4978
4979 /// Optional. The Cloud region that will be used for _Default and _Required log
4980 /// buckets for newly created projects and folders. For example `europe-west1`.
4981 /// This setting does not affect the location of custom log buckets.
4982 pub storage_location: std::string::String,
4983
4984 /// Optional. If set to true, the _Default sink in newly created projects and
4985 /// folders will created in a disabled state. This can be used to automatically
4986 /// disable log ingestion if there is already an aggregated sink configured in
4987 /// the hierarchy. The _Default sink can be re-enabled manually if needed.
4988 pub disable_default_sink: bool,
4989
4990 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4991}
4992
4993impl Settings {
4994 pub fn new() -> Self {
4995 std::default::Default::default()
4996 }
4997
4998 /// Sets the value of [name][crate::model::Settings::name].
4999 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5000 self.name = v.into();
5001 self
5002 }
5003
5004 /// Sets the value of [kms_key_name][crate::model::Settings::kms_key_name].
5005 pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5006 self.kms_key_name = v.into();
5007 self
5008 }
5009
5010 /// Sets the value of [kms_service_account_id][crate::model::Settings::kms_service_account_id].
5011 pub fn set_kms_service_account_id<T: std::convert::Into<std::string::String>>(
5012 mut self,
5013 v: T,
5014 ) -> Self {
5015 self.kms_service_account_id = v.into();
5016 self
5017 }
5018
5019 /// Sets the value of [storage_location][crate::model::Settings::storage_location].
5020 pub fn set_storage_location<T: std::convert::Into<std::string::String>>(
5021 mut self,
5022 v: T,
5023 ) -> Self {
5024 self.storage_location = v.into();
5025 self
5026 }
5027
5028 /// Sets the value of [disable_default_sink][crate::model::Settings::disable_default_sink].
5029 pub fn set_disable_default_sink<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5030 self.disable_default_sink = v.into();
5031 self
5032 }
5033}
5034
5035impl wkt::message::Message for Settings {
5036 fn typename() -> &'static str {
5037 "type.googleapis.com/google.logging.v2.Settings"
5038 }
5039}
5040
5041/// The parameters to CopyLogEntries.
5042#[derive(Clone, Default, PartialEq)]
5043#[non_exhaustive]
5044pub struct CopyLogEntriesRequest {
5045 /// Required. Log bucket from which to copy log entries.
5046 ///
5047 /// For example:
5048 ///
5049 /// `"projects/my-project/locations/global/buckets/my-source-bucket"`
5050 pub name: std::string::String,
5051
5052 /// Optional. A filter specifying which log entries to copy. The filter must be
5053 /// no more than 20k characters. An empty filter matches all log entries.
5054 pub filter: std::string::String,
5055
5056 /// Required. Destination to which to copy log entries.
5057 pub destination: std::string::String,
5058
5059 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5060}
5061
5062impl CopyLogEntriesRequest {
5063 pub fn new() -> Self {
5064 std::default::Default::default()
5065 }
5066
5067 /// Sets the value of [name][crate::model::CopyLogEntriesRequest::name].
5068 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5069 self.name = v.into();
5070 self
5071 }
5072
5073 /// Sets the value of [filter][crate::model::CopyLogEntriesRequest::filter].
5074 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5075 self.filter = v.into();
5076 self
5077 }
5078
5079 /// Sets the value of [destination][crate::model::CopyLogEntriesRequest::destination].
5080 pub fn set_destination<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5081 self.destination = v.into();
5082 self
5083 }
5084}
5085
5086impl wkt::message::Message for CopyLogEntriesRequest {
5087 fn typename() -> &'static str {
5088 "type.googleapis.com/google.logging.v2.CopyLogEntriesRequest"
5089 }
5090}
5091
5092/// Metadata for CopyLogEntries long running operations.
5093#[derive(Clone, Default, PartialEq)]
5094#[non_exhaustive]
5095pub struct CopyLogEntriesMetadata {
5096 /// The create time of an operation.
5097 pub start_time: std::option::Option<wkt::Timestamp>,
5098
5099 /// The end time of an operation.
5100 pub end_time: std::option::Option<wkt::Timestamp>,
5101
5102 /// State of an operation.
5103 pub state: crate::model::OperationState,
5104
5105 /// Identifies whether the user has requested cancellation of the operation.
5106 pub cancellation_requested: bool,
5107
5108 /// CopyLogEntries RPC request.
5109 pub request: std::option::Option<crate::model::CopyLogEntriesRequest>,
5110
5111 /// Estimated progress of the operation (0 - 100%).
5112 pub progress: i32,
5113
5114 /// The IAM identity of a service account that must be granted access to the
5115 /// destination.
5116 ///
5117 /// If the service account is not granted permission to the destination within
5118 /// an hour, the operation will be cancelled.
5119 ///
5120 /// For example: `"serviceAccount:foo@bar.com"`
5121 pub writer_identity: std::string::String,
5122
5123 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5124}
5125
5126impl CopyLogEntriesMetadata {
5127 pub fn new() -> Self {
5128 std::default::Default::default()
5129 }
5130
5131 /// Sets the value of [start_time][crate::model::CopyLogEntriesMetadata::start_time].
5132 pub fn set_start_time<T>(mut self, v: T) -> Self
5133 where
5134 T: std::convert::Into<wkt::Timestamp>,
5135 {
5136 self.start_time = std::option::Option::Some(v.into());
5137 self
5138 }
5139
5140 /// Sets or clears the value of [start_time][crate::model::CopyLogEntriesMetadata::start_time].
5141 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
5142 where
5143 T: std::convert::Into<wkt::Timestamp>,
5144 {
5145 self.start_time = v.map(|x| x.into());
5146 self
5147 }
5148
5149 /// Sets the value of [end_time][crate::model::CopyLogEntriesMetadata::end_time].
5150 pub fn set_end_time<T>(mut self, v: T) -> Self
5151 where
5152 T: std::convert::Into<wkt::Timestamp>,
5153 {
5154 self.end_time = std::option::Option::Some(v.into());
5155 self
5156 }
5157
5158 /// Sets or clears the value of [end_time][crate::model::CopyLogEntriesMetadata::end_time].
5159 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
5160 where
5161 T: std::convert::Into<wkt::Timestamp>,
5162 {
5163 self.end_time = v.map(|x| x.into());
5164 self
5165 }
5166
5167 /// Sets the value of [state][crate::model::CopyLogEntriesMetadata::state].
5168 pub fn set_state<T: std::convert::Into<crate::model::OperationState>>(mut self, v: T) -> Self {
5169 self.state = v.into();
5170 self
5171 }
5172
5173 /// Sets the value of [cancellation_requested][crate::model::CopyLogEntriesMetadata::cancellation_requested].
5174 pub fn set_cancellation_requested<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5175 self.cancellation_requested = v.into();
5176 self
5177 }
5178
5179 /// Sets the value of [request][crate::model::CopyLogEntriesMetadata::request].
5180 pub fn set_request<T>(mut self, v: T) -> Self
5181 where
5182 T: std::convert::Into<crate::model::CopyLogEntriesRequest>,
5183 {
5184 self.request = std::option::Option::Some(v.into());
5185 self
5186 }
5187
5188 /// Sets or clears the value of [request][crate::model::CopyLogEntriesMetadata::request].
5189 pub fn set_or_clear_request<T>(mut self, v: std::option::Option<T>) -> Self
5190 where
5191 T: std::convert::Into<crate::model::CopyLogEntriesRequest>,
5192 {
5193 self.request = v.map(|x| x.into());
5194 self
5195 }
5196
5197 /// Sets the value of [progress][crate::model::CopyLogEntriesMetadata::progress].
5198 pub fn set_progress<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5199 self.progress = v.into();
5200 self
5201 }
5202
5203 /// Sets the value of [writer_identity][crate::model::CopyLogEntriesMetadata::writer_identity].
5204 pub fn set_writer_identity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5205 self.writer_identity = v.into();
5206 self
5207 }
5208}
5209
5210impl wkt::message::Message for CopyLogEntriesMetadata {
5211 fn typename() -> &'static str {
5212 "type.googleapis.com/google.logging.v2.CopyLogEntriesMetadata"
5213 }
5214}
5215
5216/// Response type for CopyLogEntries long running operations.
5217#[derive(Clone, Default, PartialEq)]
5218#[non_exhaustive]
5219pub struct CopyLogEntriesResponse {
5220 /// Number of log entries copied.
5221 pub log_entries_copied_count: i64,
5222
5223 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5224}
5225
5226impl CopyLogEntriesResponse {
5227 pub fn new() -> Self {
5228 std::default::Default::default()
5229 }
5230
5231 /// Sets the value of [log_entries_copied_count][crate::model::CopyLogEntriesResponse::log_entries_copied_count].
5232 pub fn set_log_entries_copied_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
5233 self.log_entries_copied_count = v.into();
5234 self
5235 }
5236}
5237
5238impl wkt::message::Message for CopyLogEntriesResponse {
5239 fn typename() -> &'static str {
5240 "type.googleapis.com/google.logging.v2.CopyLogEntriesResponse"
5241 }
5242}
5243
5244/// Metadata for LongRunningUpdateBucket Operations.
5245#[derive(Clone, Default, PartialEq)]
5246#[non_exhaustive]
5247pub struct BucketMetadata {
5248 /// The create time of an operation.
5249 pub start_time: std::option::Option<wkt::Timestamp>,
5250
5251 /// The end time of an operation.
5252 pub end_time: std::option::Option<wkt::Timestamp>,
5253
5254 /// State of an operation.
5255 pub state: crate::model::OperationState,
5256
5257 pub request: std::option::Option<crate::model::bucket_metadata::Request>,
5258
5259 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5260}
5261
5262impl BucketMetadata {
5263 pub fn new() -> Self {
5264 std::default::Default::default()
5265 }
5266
5267 /// Sets the value of [start_time][crate::model::BucketMetadata::start_time].
5268 pub fn set_start_time<T>(mut self, v: T) -> Self
5269 where
5270 T: std::convert::Into<wkt::Timestamp>,
5271 {
5272 self.start_time = std::option::Option::Some(v.into());
5273 self
5274 }
5275
5276 /// Sets or clears the value of [start_time][crate::model::BucketMetadata::start_time].
5277 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
5278 where
5279 T: std::convert::Into<wkt::Timestamp>,
5280 {
5281 self.start_time = v.map(|x| x.into());
5282 self
5283 }
5284
5285 /// Sets the value of [end_time][crate::model::BucketMetadata::end_time].
5286 pub fn set_end_time<T>(mut self, v: T) -> Self
5287 where
5288 T: std::convert::Into<wkt::Timestamp>,
5289 {
5290 self.end_time = std::option::Option::Some(v.into());
5291 self
5292 }
5293
5294 /// Sets or clears the value of [end_time][crate::model::BucketMetadata::end_time].
5295 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
5296 where
5297 T: std::convert::Into<wkt::Timestamp>,
5298 {
5299 self.end_time = v.map(|x| x.into());
5300 self
5301 }
5302
5303 /// Sets the value of [state][crate::model::BucketMetadata::state].
5304 pub fn set_state<T: std::convert::Into<crate::model::OperationState>>(mut self, v: T) -> Self {
5305 self.state = v.into();
5306 self
5307 }
5308
5309 /// Sets the value of [request][crate::model::BucketMetadata::request].
5310 ///
5311 /// Note that all the setters affecting `request` are mutually
5312 /// exclusive.
5313 pub fn set_request<
5314 T: std::convert::Into<std::option::Option<crate::model::bucket_metadata::Request>>,
5315 >(
5316 mut self,
5317 v: T,
5318 ) -> Self {
5319 self.request = v.into();
5320 self
5321 }
5322
5323 /// The value of [request][crate::model::BucketMetadata::request]
5324 /// if it holds a `CreateBucketRequest`, `None` if the field is not set or
5325 /// holds a different branch.
5326 pub fn create_bucket_request(
5327 &self,
5328 ) -> std::option::Option<&std::boxed::Box<crate::model::CreateBucketRequest>> {
5329 #[allow(unreachable_patterns)]
5330 self.request.as_ref().and_then(|v| match v {
5331 crate::model::bucket_metadata::Request::CreateBucketRequest(v) => {
5332 std::option::Option::Some(v)
5333 }
5334 _ => std::option::Option::None,
5335 })
5336 }
5337
5338 /// Sets the value of [request][crate::model::BucketMetadata::request]
5339 /// to hold a `CreateBucketRequest`.
5340 ///
5341 /// Note that all the setters affecting `request` are
5342 /// mutually exclusive.
5343 pub fn set_create_bucket_request<
5344 T: std::convert::Into<std::boxed::Box<crate::model::CreateBucketRequest>>,
5345 >(
5346 mut self,
5347 v: T,
5348 ) -> Self {
5349 self.request = std::option::Option::Some(
5350 crate::model::bucket_metadata::Request::CreateBucketRequest(v.into()),
5351 );
5352 self
5353 }
5354
5355 /// The value of [request][crate::model::BucketMetadata::request]
5356 /// if it holds a `UpdateBucketRequest`, `None` if the field is not set or
5357 /// holds a different branch.
5358 pub fn update_bucket_request(
5359 &self,
5360 ) -> std::option::Option<&std::boxed::Box<crate::model::UpdateBucketRequest>> {
5361 #[allow(unreachable_patterns)]
5362 self.request.as_ref().and_then(|v| match v {
5363 crate::model::bucket_metadata::Request::UpdateBucketRequest(v) => {
5364 std::option::Option::Some(v)
5365 }
5366 _ => std::option::Option::None,
5367 })
5368 }
5369
5370 /// Sets the value of [request][crate::model::BucketMetadata::request]
5371 /// to hold a `UpdateBucketRequest`.
5372 ///
5373 /// Note that all the setters affecting `request` are
5374 /// mutually exclusive.
5375 pub fn set_update_bucket_request<
5376 T: std::convert::Into<std::boxed::Box<crate::model::UpdateBucketRequest>>,
5377 >(
5378 mut self,
5379 v: T,
5380 ) -> Self {
5381 self.request = std::option::Option::Some(
5382 crate::model::bucket_metadata::Request::UpdateBucketRequest(v.into()),
5383 );
5384 self
5385 }
5386}
5387
5388impl wkt::message::Message for BucketMetadata {
5389 fn typename() -> &'static str {
5390 "type.googleapis.com/google.logging.v2.BucketMetadata"
5391 }
5392}
5393
5394/// Defines additional types related to [BucketMetadata].
5395pub mod bucket_metadata {
5396 #[allow(unused_imports)]
5397 use super::*;
5398
5399 #[derive(Clone, Debug, PartialEq)]
5400 #[non_exhaustive]
5401 pub enum Request {
5402 /// LongRunningCreateBucket RPC request.
5403 CreateBucketRequest(std::boxed::Box<crate::model::CreateBucketRequest>),
5404 /// LongRunningUpdateBucket RPC request.
5405 UpdateBucketRequest(std::boxed::Box<crate::model::UpdateBucketRequest>),
5406 }
5407}
5408
5409/// Metadata for long running Link operations.
5410#[derive(Clone, Default, PartialEq)]
5411#[non_exhaustive]
5412pub struct LinkMetadata {
5413 /// The start time of an operation.
5414 pub start_time: std::option::Option<wkt::Timestamp>,
5415
5416 /// The end time of an operation.
5417 pub end_time: std::option::Option<wkt::Timestamp>,
5418
5419 /// State of an operation.
5420 pub state: crate::model::OperationState,
5421
5422 pub request: std::option::Option<crate::model::link_metadata::Request>,
5423
5424 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5425}
5426
5427impl LinkMetadata {
5428 pub fn new() -> Self {
5429 std::default::Default::default()
5430 }
5431
5432 /// Sets the value of [start_time][crate::model::LinkMetadata::start_time].
5433 pub fn set_start_time<T>(mut self, v: T) -> Self
5434 where
5435 T: std::convert::Into<wkt::Timestamp>,
5436 {
5437 self.start_time = std::option::Option::Some(v.into());
5438 self
5439 }
5440
5441 /// Sets or clears the value of [start_time][crate::model::LinkMetadata::start_time].
5442 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
5443 where
5444 T: std::convert::Into<wkt::Timestamp>,
5445 {
5446 self.start_time = v.map(|x| x.into());
5447 self
5448 }
5449
5450 /// Sets the value of [end_time][crate::model::LinkMetadata::end_time].
5451 pub fn set_end_time<T>(mut self, v: T) -> Self
5452 where
5453 T: std::convert::Into<wkt::Timestamp>,
5454 {
5455 self.end_time = std::option::Option::Some(v.into());
5456 self
5457 }
5458
5459 /// Sets or clears the value of [end_time][crate::model::LinkMetadata::end_time].
5460 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
5461 where
5462 T: std::convert::Into<wkt::Timestamp>,
5463 {
5464 self.end_time = v.map(|x| x.into());
5465 self
5466 }
5467
5468 /// Sets the value of [state][crate::model::LinkMetadata::state].
5469 pub fn set_state<T: std::convert::Into<crate::model::OperationState>>(mut self, v: T) -> Self {
5470 self.state = v.into();
5471 self
5472 }
5473
5474 /// Sets the value of [request][crate::model::LinkMetadata::request].
5475 ///
5476 /// Note that all the setters affecting `request` are mutually
5477 /// exclusive.
5478 pub fn set_request<
5479 T: std::convert::Into<std::option::Option<crate::model::link_metadata::Request>>,
5480 >(
5481 mut self,
5482 v: T,
5483 ) -> Self {
5484 self.request = v.into();
5485 self
5486 }
5487
5488 /// The value of [request][crate::model::LinkMetadata::request]
5489 /// if it holds a `CreateLinkRequest`, `None` if the field is not set or
5490 /// holds a different branch.
5491 pub fn create_link_request(
5492 &self,
5493 ) -> std::option::Option<&std::boxed::Box<crate::model::CreateLinkRequest>> {
5494 #[allow(unreachable_patterns)]
5495 self.request.as_ref().and_then(|v| match v {
5496 crate::model::link_metadata::Request::CreateLinkRequest(v) => {
5497 std::option::Option::Some(v)
5498 }
5499 _ => std::option::Option::None,
5500 })
5501 }
5502
5503 /// Sets the value of [request][crate::model::LinkMetadata::request]
5504 /// to hold a `CreateLinkRequest`.
5505 ///
5506 /// Note that all the setters affecting `request` are
5507 /// mutually exclusive.
5508 pub fn set_create_link_request<
5509 T: std::convert::Into<std::boxed::Box<crate::model::CreateLinkRequest>>,
5510 >(
5511 mut self,
5512 v: T,
5513 ) -> Self {
5514 self.request = std::option::Option::Some(
5515 crate::model::link_metadata::Request::CreateLinkRequest(v.into()),
5516 );
5517 self
5518 }
5519
5520 /// The value of [request][crate::model::LinkMetadata::request]
5521 /// if it holds a `DeleteLinkRequest`, `None` if the field is not set or
5522 /// holds a different branch.
5523 pub fn delete_link_request(
5524 &self,
5525 ) -> std::option::Option<&std::boxed::Box<crate::model::DeleteLinkRequest>> {
5526 #[allow(unreachable_patterns)]
5527 self.request.as_ref().and_then(|v| match v {
5528 crate::model::link_metadata::Request::DeleteLinkRequest(v) => {
5529 std::option::Option::Some(v)
5530 }
5531 _ => std::option::Option::None,
5532 })
5533 }
5534
5535 /// Sets the value of [request][crate::model::LinkMetadata::request]
5536 /// to hold a `DeleteLinkRequest`.
5537 ///
5538 /// Note that all the setters affecting `request` are
5539 /// mutually exclusive.
5540 pub fn set_delete_link_request<
5541 T: std::convert::Into<std::boxed::Box<crate::model::DeleteLinkRequest>>,
5542 >(
5543 mut self,
5544 v: T,
5545 ) -> Self {
5546 self.request = std::option::Option::Some(
5547 crate::model::link_metadata::Request::DeleteLinkRequest(v.into()),
5548 );
5549 self
5550 }
5551}
5552
5553impl wkt::message::Message for LinkMetadata {
5554 fn typename() -> &'static str {
5555 "type.googleapis.com/google.logging.v2.LinkMetadata"
5556 }
5557}
5558
5559/// Defines additional types related to [LinkMetadata].
5560pub mod link_metadata {
5561 #[allow(unused_imports)]
5562 use super::*;
5563
5564 #[derive(Clone, Debug, PartialEq)]
5565 #[non_exhaustive]
5566 pub enum Request {
5567 /// CreateLink RPC request.
5568 CreateLinkRequest(std::boxed::Box<crate::model::CreateLinkRequest>),
5569 /// DeleteLink RPC request.
5570 DeleteLinkRequest(std::boxed::Box<crate::model::DeleteLinkRequest>),
5571 }
5572}
5573
5574/// Cloud Logging specific location metadata.
5575#[derive(Clone, Default, PartialEq)]
5576#[non_exhaustive]
5577pub struct LocationMetadata {
5578 /// Indicates whether or not Log Analytics features are supported in the given
5579 /// location.
5580 pub log_analytics_enabled: bool,
5581
5582 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5583}
5584
5585impl LocationMetadata {
5586 pub fn new() -> Self {
5587 std::default::Default::default()
5588 }
5589
5590 /// Sets the value of [log_analytics_enabled][crate::model::LocationMetadata::log_analytics_enabled].
5591 pub fn set_log_analytics_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5592 self.log_analytics_enabled = v.into();
5593 self
5594 }
5595}
5596
5597impl wkt::message::Message for LocationMetadata {
5598 fn typename() -> &'static str {
5599 "type.googleapis.com/google.logging.v2.LocationMetadata"
5600 }
5601}
5602
5603/// Describes a logs-based metric. The value of the metric is the number of log
5604/// entries that match a logs filter in a given time interval.
5605///
5606/// Logs-based metrics can also be used to extract values from logs and create a
5607/// distribution of the values. The distribution records the statistics of the
5608/// extracted values along with an optional histogram of the values as specified
5609/// by the bucket options.
5610#[derive(Clone, Default, PartialEq)]
5611#[non_exhaustive]
5612pub struct LogMetric {
5613 /// Required. The client-assigned metric identifier.
5614 /// Examples: `"error_count"`, `"nginx/requests"`.
5615 ///
5616 /// Metric identifiers are limited to 100 characters and can include only the
5617 /// following characters: `A-Z`, `a-z`, `0-9`, and the special characters
5618 /// `_-.,+!*',()%/`. The forward-slash character (`/`) denotes a hierarchy of
5619 /// name pieces, and it cannot be the first character of the name.
5620 ///
5621 /// This field is the `[METRIC_ID]` part of a metric resource name in the
5622 /// format "projects/[PROJECT_ID]/metrics/[METRIC_ID]". Example: If the
5623 /// resource name of a metric is
5624 /// `"projects/my-project/metrics/nginx%2Frequests"`, this field's value is
5625 /// `"nginx/requests"`.
5626 pub name: std::string::String,
5627
5628 /// Optional. A description of this metric, which is used in documentation.
5629 /// The maximum length of the description is 8000 characters.
5630 pub description: std::string::String,
5631
5632 /// Required. An [advanced logs
5633 /// filter](https://cloud.google.com/logging/docs/view/advanced_filters) which
5634 /// is used to match log entries. Example:
5635 ///
5636 /// ```norust
5637 /// "resource.type=gae_app AND severity>=ERROR"
5638 /// ```
5639 ///
5640 /// The maximum length of the filter is 20000 characters.
5641 pub filter: std::string::String,
5642
5643 /// Optional. The resource name of the Log Bucket that owns the Log Metric.
5644 /// Only Log Buckets in projects are supported. The bucket has to be in the
5645 /// same project as the metric.
5646 ///
5647 /// For example:
5648 ///
5649 /// `projects/my-project/locations/global/buckets/my-bucket`
5650 ///
5651 /// If empty, then the Log Metric is considered a non-Bucket Log Metric.
5652 pub bucket_name: std::string::String,
5653
5654 /// Optional. If set to True, then this metric is disabled and it does not
5655 /// generate any points.
5656 pub disabled: bool,
5657
5658 /// Optional. The metric descriptor associated with the logs-based metric.
5659 /// If unspecified, it uses a default metric descriptor with a DELTA metric
5660 /// kind, INT64 value type, with no labels and a unit of "1". Such a metric
5661 /// counts the number of log entries matching the `filter` expression.
5662 ///
5663 /// The `name`, `type`, and `description` fields in the `metric_descriptor`
5664 /// are output only, and is constructed using the `name` and `description`
5665 /// field in the LogMetric.
5666 ///
5667 /// To create a logs-based metric that records a distribution of log values, a
5668 /// DELTA metric kind with a DISTRIBUTION value type must be used along with
5669 /// a `value_extractor` expression in the LogMetric.
5670 ///
5671 /// Each label in the metric descriptor must have a matching label
5672 /// name as the key and an extractor expression as the value in the
5673 /// `label_extractors` map.
5674 ///
5675 /// The `metric_kind` and `value_type` fields in the `metric_descriptor` cannot
5676 /// be updated once initially configured. New labels can be added in the
5677 /// `metric_descriptor`, but existing labels cannot be modified except for
5678 /// their description.
5679 pub metric_descriptor: std::option::Option<api::model::MetricDescriptor>,
5680
5681 /// Optional. A `value_extractor` is required when using a distribution
5682 /// logs-based metric to extract the values to record from a log entry.
5683 /// Two functions are supported for value extraction: `EXTRACT(field)` or
5684 /// `REGEXP_EXTRACT(field, regex)`. The arguments are:
5685 ///
5686 /// 1. field: The name of the log entry field from which the value is to be
5687 /// extracted.
5688 /// 1. regex: A regular expression using the Google RE2 syntax
5689 /// (<https://github.com/google/re2/wiki/Syntax>) with a single capture
5690 /// group to extract data from the specified log entry field. The value
5691 /// of the field is converted to a string before applying the regex.
5692 /// It is an error to specify a regex that does not include exactly one
5693 /// capture group.
5694 ///
5695 /// The result of the extraction must be convertible to a double type, as the
5696 /// distribution always records double values. If either the extraction or
5697 /// the conversion to double fails, then those values are not recorded in the
5698 /// distribution.
5699 ///
5700 /// Example: `REGEXP_EXTRACT(jsonPayload.request, ".*quantity=(\d+).*")`
5701 pub value_extractor: std::string::String,
5702
5703 /// Optional. A map from a label key string to an extractor expression which is
5704 /// used to extract data from a log entry field and assign as the label value.
5705 /// Each label key specified in the LabelDescriptor must have an associated
5706 /// extractor expression in this map. The syntax of the extractor expression
5707 /// is the same as for the `value_extractor` field.
5708 ///
5709 /// The extracted value is converted to the type defined in the label
5710 /// descriptor. If either the extraction or the type conversion fails,
5711 /// the label will have a default value. The default value for a string
5712 /// label is an empty string, for an integer label its 0, and for a boolean
5713 /// label its `false`.
5714 ///
5715 /// Note that there are upper bounds on the maximum number of labels and the
5716 /// number of active time series that are allowed in a project.
5717 pub label_extractors: std::collections::HashMap<std::string::String, std::string::String>,
5718
5719 /// Optional. The `bucket_options` are required when the logs-based metric is
5720 /// using a DISTRIBUTION value type and it describes the bucket boundaries
5721 /// used to create a histogram of the extracted values.
5722 pub bucket_options: std::option::Option<api::model::distribution::BucketOptions>,
5723
5724 /// Output only. The creation timestamp of the metric.
5725 ///
5726 /// This field may not be present for older metrics.
5727 pub create_time: std::option::Option<wkt::Timestamp>,
5728
5729 /// Output only. The last update timestamp of the metric.
5730 ///
5731 /// This field may not be present for older metrics.
5732 pub update_time: std::option::Option<wkt::Timestamp>,
5733
5734 /// Deprecated. The API version that created or updated this metric.
5735 /// The v2 format is used by default and cannot be changed.
5736 #[deprecated]
5737 pub version: crate::model::log_metric::ApiVersion,
5738
5739 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5740}
5741
5742impl LogMetric {
5743 pub fn new() -> Self {
5744 std::default::Default::default()
5745 }
5746
5747 /// Sets the value of [name][crate::model::LogMetric::name].
5748 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5749 self.name = v.into();
5750 self
5751 }
5752
5753 /// Sets the value of [description][crate::model::LogMetric::description].
5754 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5755 self.description = v.into();
5756 self
5757 }
5758
5759 /// Sets the value of [filter][crate::model::LogMetric::filter].
5760 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5761 self.filter = v.into();
5762 self
5763 }
5764
5765 /// Sets the value of [bucket_name][crate::model::LogMetric::bucket_name].
5766 pub fn set_bucket_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5767 self.bucket_name = v.into();
5768 self
5769 }
5770
5771 /// Sets the value of [disabled][crate::model::LogMetric::disabled].
5772 pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5773 self.disabled = v.into();
5774 self
5775 }
5776
5777 /// Sets the value of [metric_descriptor][crate::model::LogMetric::metric_descriptor].
5778 pub fn set_metric_descriptor<T>(mut self, v: T) -> Self
5779 where
5780 T: std::convert::Into<api::model::MetricDescriptor>,
5781 {
5782 self.metric_descriptor = std::option::Option::Some(v.into());
5783 self
5784 }
5785
5786 /// Sets or clears the value of [metric_descriptor][crate::model::LogMetric::metric_descriptor].
5787 pub fn set_or_clear_metric_descriptor<T>(mut self, v: std::option::Option<T>) -> Self
5788 where
5789 T: std::convert::Into<api::model::MetricDescriptor>,
5790 {
5791 self.metric_descriptor = v.map(|x| x.into());
5792 self
5793 }
5794
5795 /// Sets the value of [value_extractor][crate::model::LogMetric::value_extractor].
5796 pub fn set_value_extractor<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5797 self.value_extractor = v.into();
5798 self
5799 }
5800
5801 /// Sets the value of [label_extractors][crate::model::LogMetric::label_extractors].
5802 pub fn set_label_extractors<T, K, V>(mut self, v: T) -> Self
5803 where
5804 T: std::iter::IntoIterator<Item = (K, V)>,
5805 K: std::convert::Into<std::string::String>,
5806 V: std::convert::Into<std::string::String>,
5807 {
5808 use std::iter::Iterator;
5809 self.label_extractors = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
5810 self
5811 }
5812
5813 /// Sets the value of [bucket_options][crate::model::LogMetric::bucket_options].
5814 pub fn set_bucket_options<T>(mut self, v: T) -> Self
5815 where
5816 T: std::convert::Into<api::model::distribution::BucketOptions>,
5817 {
5818 self.bucket_options = std::option::Option::Some(v.into());
5819 self
5820 }
5821
5822 /// Sets or clears the value of [bucket_options][crate::model::LogMetric::bucket_options].
5823 pub fn set_or_clear_bucket_options<T>(mut self, v: std::option::Option<T>) -> Self
5824 where
5825 T: std::convert::Into<api::model::distribution::BucketOptions>,
5826 {
5827 self.bucket_options = v.map(|x| x.into());
5828 self
5829 }
5830
5831 /// Sets the value of [create_time][crate::model::LogMetric::create_time].
5832 pub fn set_create_time<T>(mut self, v: T) -> Self
5833 where
5834 T: std::convert::Into<wkt::Timestamp>,
5835 {
5836 self.create_time = std::option::Option::Some(v.into());
5837 self
5838 }
5839
5840 /// Sets or clears the value of [create_time][crate::model::LogMetric::create_time].
5841 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5842 where
5843 T: std::convert::Into<wkt::Timestamp>,
5844 {
5845 self.create_time = v.map(|x| x.into());
5846 self
5847 }
5848
5849 /// Sets the value of [update_time][crate::model::LogMetric::update_time].
5850 pub fn set_update_time<T>(mut self, v: T) -> Self
5851 where
5852 T: std::convert::Into<wkt::Timestamp>,
5853 {
5854 self.update_time = std::option::Option::Some(v.into());
5855 self
5856 }
5857
5858 /// Sets or clears the value of [update_time][crate::model::LogMetric::update_time].
5859 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5860 where
5861 T: std::convert::Into<wkt::Timestamp>,
5862 {
5863 self.update_time = v.map(|x| x.into());
5864 self
5865 }
5866
5867 /// Sets the value of [version][crate::model::LogMetric::version].
5868 #[deprecated]
5869 pub fn set_version<T: std::convert::Into<crate::model::log_metric::ApiVersion>>(
5870 mut self,
5871 v: T,
5872 ) -> Self {
5873 self.version = v.into();
5874 self
5875 }
5876}
5877
5878impl wkt::message::Message for LogMetric {
5879 fn typename() -> &'static str {
5880 "type.googleapis.com/google.logging.v2.LogMetric"
5881 }
5882}
5883
5884/// Defines additional types related to [LogMetric].
5885pub mod log_metric {
5886 #[allow(unused_imports)]
5887 use super::*;
5888
5889 /// Logging API version.
5890 ///
5891 /// # Working with unknown values
5892 ///
5893 /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5894 /// additional enum variants at any time. Adding new variants is not considered
5895 /// a breaking change. Applications should write their code in anticipation of:
5896 ///
5897 /// - New values appearing in future releases of the client library, **and**
5898 /// - New values received dynamically, without application changes.
5899 ///
5900 /// Please consult the [Working with enums] section in the user guide for some
5901 /// guidelines.
5902 ///
5903 /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
5904 #[derive(Clone, Debug, PartialEq)]
5905 #[non_exhaustive]
5906 pub enum ApiVersion {
5907 /// Logging API v2.
5908 V2,
5909 /// Logging API v1.
5910 V1,
5911 /// If set, the enum was initialized with an unknown value.
5912 ///
5913 /// Applications can examine the value using [ApiVersion::value] or
5914 /// [ApiVersion::name].
5915 UnknownValue(api_version::UnknownValue),
5916 }
5917
5918 #[doc(hidden)]
5919 pub mod api_version {
5920 #[allow(unused_imports)]
5921 use super::*;
5922 #[derive(Clone, Debug, PartialEq)]
5923 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5924 }
5925
5926 impl ApiVersion {
5927 /// Gets the enum value.
5928 ///
5929 /// Returns `None` if the enum contains an unknown value deserialized from
5930 /// the string representation of enums.
5931 pub fn value(&self) -> std::option::Option<i32> {
5932 match self {
5933 Self::V2 => std::option::Option::Some(0),
5934 Self::V1 => std::option::Option::Some(1),
5935 Self::UnknownValue(u) => u.0.value(),
5936 }
5937 }
5938
5939 /// Gets the enum value as a string.
5940 ///
5941 /// Returns `None` if the enum contains an unknown value deserialized from
5942 /// the integer representation of enums.
5943 pub fn name(&self) -> std::option::Option<&str> {
5944 match self {
5945 Self::V2 => std::option::Option::Some("V2"),
5946 Self::V1 => std::option::Option::Some("V1"),
5947 Self::UnknownValue(u) => u.0.name(),
5948 }
5949 }
5950 }
5951
5952 impl std::default::Default for ApiVersion {
5953 fn default() -> Self {
5954 use std::convert::From;
5955 Self::from(0)
5956 }
5957 }
5958
5959 impl std::fmt::Display for ApiVersion {
5960 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5961 wkt::internal::display_enum(f, self.name(), self.value())
5962 }
5963 }
5964
5965 impl std::convert::From<i32> for ApiVersion {
5966 fn from(value: i32) -> Self {
5967 match value {
5968 0 => Self::V2,
5969 1 => Self::V1,
5970 _ => Self::UnknownValue(api_version::UnknownValue(
5971 wkt::internal::UnknownEnumValue::Integer(value),
5972 )),
5973 }
5974 }
5975 }
5976
5977 impl std::convert::From<&str> for ApiVersion {
5978 fn from(value: &str) -> Self {
5979 use std::string::ToString;
5980 match value {
5981 "V2" => Self::V2,
5982 "V1" => Self::V1,
5983 _ => Self::UnknownValue(api_version::UnknownValue(
5984 wkt::internal::UnknownEnumValue::String(value.to_string()),
5985 )),
5986 }
5987 }
5988 }
5989
5990 impl serde::ser::Serialize for ApiVersion {
5991 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5992 where
5993 S: serde::Serializer,
5994 {
5995 match self {
5996 Self::V2 => serializer.serialize_i32(0),
5997 Self::V1 => serializer.serialize_i32(1),
5998 Self::UnknownValue(u) => u.0.serialize(serializer),
5999 }
6000 }
6001 }
6002
6003 impl<'de> serde::de::Deserialize<'de> for ApiVersion {
6004 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6005 where
6006 D: serde::Deserializer<'de>,
6007 {
6008 deserializer.deserialize_any(wkt::internal::EnumVisitor::<ApiVersion>::new(
6009 ".google.logging.v2.LogMetric.ApiVersion",
6010 ))
6011 }
6012 }
6013}
6014
6015/// The parameters to ListLogMetrics.
6016#[derive(Clone, Default, PartialEq)]
6017#[non_exhaustive]
6018pub struct ListLogMetricsRequest {
6019 /// Required. The name of the project containing the metrics:
6020 ///
6021 /// ```norust
6022 /// "projects/[PROJECT_ID]"
6023 /// ```
6024 pub parent: std::string::String,
6025
6026 /// Optional. If present, then retrieve the next batch of results from the
6027 /// preceding call to this method. `pageToken` must be the value of
6028 /// `nextPageToken` from the previous response. The values of other method
6029 /// parameters should be identical to those in the previous call.
6030 pub page_token: std::string::String,
6031
6032 /// Optional. The maximum number of results to return from this request.
6033 /// Non-positive values are ignored. The presence of `nextPageToken` in the
6034 /// response indicates that more results might be available.
6035 pub page_size: i32,
6036
6037 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6038}
6039
6040impl ListLogMetricsRequest {
6041 pub fn new() -> Self {
6042 std::default::Default::default()
6043 }
6044
6045 /// Sets the value of [parent][crate::model::ListLogMetricsRequest::parent].
6046 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6047 self.parent = v.into();
6048 self
6049 }
6050
6051 /// Sets the value of [page_token][crate::model::ListLogMetricsRequest::page_token].
6052 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6053 self.page_token = v.into();
6054 self
6055 }
6056
6057 /// Sets the value of [page_size][crate::model::ListLogMetricsRequest::page_size].
6058 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6059 self.page_size = v.into();
6060 self
6061 }
6062}
6063
6064impl wkt::message::Message for ListLogMetricsRequest {
6065 fn typename() -> &'static str {
6066 "type.googleapis.com/google.logging.v2.ListLogMetricsRequest"
6067 }
6068}
6069
6070/// Result returned from ListLogMetrics.
6071#[derive(Clone, Default, PartialEq)]
6072#[non_exhaustive]
6073pub struct ListLogMetricsResponse {
6074 /// A list of logs-based metrics.
6075 pub metrics: std::vec::Vec<crate::model::LogMetric>,
6076
6077 /// If there might be more results than appear in this response, then
6078 /// `nextPageToken` is included. To get the next set of results, call this
6079 /// method again using the value of `nextPageToken` as `pageToken`.
6080 pub next_page_token: std::string::String,
6081
6082 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6083}
6084
6085impl ListLogMetricsResponse {
6086 pub fn new() -> Self {
6087 std::default::Default::default()
6088 }
6089
6090 /// Sets the value of [metrics][crate::model::ListLogMetricsResponse::metrics].
6091 pub fn set_metrics<T, V>(mut self, v: T) -> Self
6092 where
6093 T: std::iter::IntoIterator<Item = V>,
6094 V: std::convert::Into<crate::model::LogMetric>,
6095 {
6096 use std::iter::Iterator;
6097 self.metrics = v.into_iter().map(|i| i.into()).collect();
6098 self
6099 }
6100
6101 /// Sets the value of [next_page_token][crate::model::ListLogMetricsResponse::next_page_token].
6102 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6103 self.next_page_token = v.into();
6104 self
6105 }
6106}
6107
6108impl wkt::message::Message for ListLogMetricsResponse {
6109 fn typename() -> &'static str {
6110 "type.googleapis.com/google.logging.v2.ListLogMetricsResponse"
6111 }
6112}
6113
6114#[doc(hidden)]
6115impl gax::paginator::internal::PageableResponse for ListLogMetricsResponse {
6116 type PageItem = crate::model::LogMetric;
6117
6118 fn items(self) -> std::vec::Vec<Self::PageItem> {
6119 self.metrics
6120 }
6121
6122 fn next_page_token(&self) -> std::string::String {
6123 use std::clone::Clone;
6124 self.next_page_token.clone()
6125 }
6126}
6127
6128/// The parameters to GetLogMetric.
6129#[derive(Clone, Default, PartialEq)]
6130#[non_exhaustive]
6131pub struct GetLogMetricRequest {
6132 /// Required. The resource name of the desired metric:
6133 ///
6134 /// ```norust
6135 /// "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
6136 /// ```
6137 pub metric_name: std::string::String,
6138
6139 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6140}
6141
6142impl GetLogMetricRequest {
6143 pub fn new() -> Self {
6144 std::default::Default::default()
6145 }
6146
6147 /// Sets the value of [metric_name][crate::model::GetLogMetricRequest::metric_name].
6148 pub fn set_metric_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6149 self.metric_name = v.into();
6150 self
6151 }
6152}
6153
6154impl wkt::message::Message for GetLogMetricRequest {
6155 fn typename() -> &'static str {
6156 "type.googleapis.com/google.logging.v2.GetLogMetricRequest"
6157 }
6158}
6159
6160/// The parameters to CreateLogMetric.
6161#[derive(Clone, Default, PartialEq)]
6162#[non_exhaustive]
6163pub struct CreateLogMetricRequest {
6164 /// Required. The resource name of the project in which to create the metric:
6165 ///
6166 /// ```norust
6167 /// "projects/[PROJECT_ID]"
6168 /// ```
6169 ///
6170 /// The new metric must be provided in the request.
6171 pub parent: std::string::String,
6172
6173 /// Required. The new logs-based metric, which must not have an identifier that
6174 /// already exists.
6175 pub metric: std::option::Option<crate::model::LogMetric>,
6176
6177 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6178}
6179
6180impl CreateLogMetricRequest {
6181 pub fn new() -> Self {
6182 std::default::Default::default()
6183 }
6184
6185 /// Sets the value of [parent][crate::model::CreateLogMetricRequest::parent].
6186 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6187 self.parent = v.into();
6188 self
6189 }
6190
6191 /// Sets the value of [metric][crate::model::CreateLogMetricRequest::metric].
6192 pub fn set_metric<T>(mut self, v: T) -> Self
6193 where
6194 T: std::convert::Into<crate::model::LogMetric>,
6195 {
6196 self.metric = std::option::Option::Some(v.into());
6197 self
6198 }
6199
6200 /// Sets or clears the value of [metric][crate::model::CreateLogMetricRequest::metric].
6201 pub fn set_or_clear_metric<T>(mut self, v: std::option::Option<T>) -> Self
6202 where
6203 T: std::convert::Into<crate::model::LogMetric>,
6204 {
6205 self.metric = v.map(|x| x.into());
6206 self
6207 }
6208}
6209
6210impl wkt::message::Message for CreateLogMetricRequest {
6211 fn typename() -> &'static str {
6212 "type.googleapis.com/google.logging.v2.CreateLogMetricRequest"
6213 }
6214}
6215
6216/// The parameters to UpdateLogMetric.
6217#[derive(Clone, Default, PartialEq)]
6218#[non_exhaustive]
6219pub struct UpdateLogMetricRequest {
6220 /// Required. The resource name of the metric to update:
6221 ///
6222 /// ```norust
6223 /// "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
6224 /// ```
6225 ///
6226 /// The updated metric must be provided in the request and it's
6227 /// `name` field must be the same as `[METRIC_ID]` If the metric
6228 /// does not exist in `[PROJECT_ID]`, then a new metric is created.
6229 pub metric_name: std::string::String,
6230
6231 /// Required. The updated metric.
6232 pub metric: std::option::Option<crate::model::LogMetric>,
6233
6234 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6235}
6236
6237impl UpdateLogMetricRequest {
6238 pub fn new() -> Self {
6239 std::default::Default::default()
6240 }
6241
6242 /// Sets the value of [metric_name][crate::model::UpdateLogMetricRequest::metric_name].
6243 pub fn set_metric_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6244 self.metric_name = v.into();
6245 self
6246 }
6247
6248 /// Sets the value of [metric][crate::model::UpdateLogMetricRequest::metric].
6249 pub fn set_metric<T>(mut self, v: T) -> Self
6250 where
6251 T: std::convert::Into<crate::model::LogMetric>,
6252 {
6253 self.metric = std::option::Option::Some(v.into());
6254 self
6255 }
6256
6257 /// Sets or clears the value of [metric][crate::model::UpdateLogMetricRequest::metric].
6258 pub fn set_or_clear_metric<T>(mut self, v: std::option::Option<T>) -> Self
6259 where
6260 T: std::convert::Into<crate::model::LogMetric>,
6261 {
6262 self.metric = v.map(|x| x.into());
6263 self
6264 }
6265}
6266
6267impl wkt::message::Message for UpdateLogMetricRequest {
6268 fn typename() -> &'static str {
6269 "type.googleapis.com/google.logging.v2.UpdateLogMetricRequest"
6270 }
6271}
6272
6273/// The parameters to DeleteLogMetric.
6274#[derive(Clone, Default, PartialEq)]
6275#[non_exhaustive]
6276pub struct DeleteLogMetricRequest {
6277 /// Required. The resource name of the metric to delete:
6278 ///
6279 /// ```norust
6280 /// "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
6281 /// ```
6282 pub metric_name: std::string::String,
6283
6284 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6285}
6286
6287impl DeleteLogMetricRequest {
6288 pub fn new() -> Self {
6289 std::default::Default::default()
6290 }
6291
6292 /// Sets the value of [metric_name][crate::model::DeleteLogMetricRequest::metric_name].
6293 pub fn set_metric_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6294 self.metric_name = v.into();
6295 self
6296 }
6297}
6298
6299impl wkt::message::Message for DeleteLogMetricRequest {
6300 fn typename() -> &'static str {
6301 "type.googleapis.com/google.logging.v2.DeleteLogMetricRequest"
6302 }
6303}
6304
6305/// List of different operation states.
6306/// High level state of the operation. This is used to report the job's
6307/// current state to the user. Once a long running operation is created,
6308/// the current state of the operation can be queried even before the
6309/// operation is finished and the final result is available.
6310///
6311/// # Working with unknown values
6312///
6313/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6314/// additional enum variants at any time. Adding new variants is not considered
6315/// a breaking change. Applications should write their code in anticipation of:
6316///
6317/// - New values appearing in future releases of the client library, **and**
6318/// - New values received dynamically, without application changes.
6319///
6320/// Please consult the [Working with enums] section in the user guide for some
6321/// guidelines.
6322///
6323/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6324#[derive(Clone, Debug, PartialEq)]
6325#[non_exhaustive]
6326pub enum OperationState {
6327 /// Should not be used.
6328 Unspecified,
6329 /// The operation is scheduled.
6330 Scheduled,
6331 /// Waiting for necessary permissions.
6332 WaitingForPermissions,
6333 /// The operation is running.
6334 Running,
6335 /// The operation was completed successfully.
6336 Succeeded,
6337 /// The operation failed.
6338 Failed,
6339 /// The operation was cancelled by the user.
6340 Cancelled,
6341 /// If set, the enum was initialized with an unknown value.
6342 ///
6343 /// Applications can examine the value using [OperationState::value] or
6344 /// [OperationState::name].
6345 UnknownValue(operation_state::UnknownValue),
6346}
6347
6348#[doc(hidden)]
6349pub mod operation_state {
6350 #[allow(unused_imports)]
6351 use super::*;
6352 #[derive(Clone, Debug, PartialEq)]
6353 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6354}
6355
6356impl OperationState {
6357 /// Gets the enum value.
6358 ///
6359 /// Returns `None` if the enum contains an unknown value deserialized from
6360 /// the string representation of enums.
6361 pub fn value(&self) -> std::option::Option<i32> {
6362 match self {
6363 Self::Unspecified => std::option::Option::Some(0),
6364 Self::Scheduled => std::option::Option::Some(1),
6365 Self::WaitingForPermissions => std::option::Option::Some(2),
6366 Self::Running => std::option::Option::Some(3),
6367 Self::Succeeded => std::option::Option::Some(4),
6368 Self::Failed => std::option::Option::Some(5),
6369 Self::Cancelled => std::option::Option::Some(6),
6370 Self::UnknownValue(u) => u.0.value(),
6371 }
6372 }
6373
6374 /// Gets the enum value as a string.
6375 ///
6376 /// Returns `None` if the enum contains an unknown value deserialized from
6377 /// the integer representation of enums.
6378 pub fn name(&self) -> std::option::Option<&str> {
6379 match self {
6380 Self::Unspecified => std::option::Option::Some("OPERATION_STATE_UNSPECIFIED"),
6381 Self::Scheduled => std::option::Option::Some("OPERATION_STATE_SCHEDULED"),
6382 Self::WaitingForPermissions => {
6383 std::option::Option::Some("OPERATION_STATE_WAITING_FOR_PERMISSIONS")
6384 }
6385 Self::Running => std::option::Option::Some("OPERATION_STATE_RUNNING"),
6386 Self::Succeeded => std::option::Option::Some("OPERATION_STATE_SUCCEEDED"),
6387 Self::Failed => std::option::Option::Some("OPERATION_STATE_FAILED"),
6388 Self::Cancelled => std::option::Option::Some("OPERATION_STATE_CANCELLED"),
6389 Self::UnknownValue(u) => u.0.name(),
6390 }
6391 }
6392}
6393
6394impl std::default::Default for OperationState {
6395 fn default() -> Self {
6396 use std::convert::From;
6397 Self::from(0)
6398 }
6399}
6400
6401impl std::fmt::Display for OperationState {
6402 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6403 wkt::internal::display_enum(f, self.name(), self.value())
6404 }
6405}
6406
6407impl std::convert::From<i32> for OperationState {
6408 fn from(value: i32) -> Self {
6409 match value {
6410 0 => Self::Unspecified,
6411 1 => Self::Scheduled,
6412 2 => Self::WaitingForPermissions,
6413 3 => Self::Running,
6414 4 => Self::Succeeded,
6415 5 => Self::Failed,
6416 6 => Self::Cancelled,
6417 _ => Self::UnknownValue(operation_state::UnknownValue(
6418 wkt::internal::UnknownEnumValue::Integer(value),
6419 )),
6420 }
6421 }
6422}
6423
6424impl std::convert::From<&str> for OperationState {
6425 fn from(value: &str) -> Self {
6426 use std::string::ToString;
6427 match value {
6428 "OPERATION_STATE_UNSPECIFIED" => Self::Unspecified,
6429 "OPERATION_STATE_SCHEDULED" => Self::Scheduled,
6430 "OPERATION_STATE_WAITING_FOR_PERMISSIONS" => Self::WaitingForPermissions,
6431 "OPERATION_STATE_RUNNING" => Self::Running,
6432 "OPERATION_STATE_SUCCEEDED" => Self::Succeeded,
6433 "OPERATION_STATE_FAILED" => Self::Failed,
6434 "OPERATION_STATE_CANCELLED" => Self::Cancelled,
6435 _ => Self::UnknownValue(operation_state::UnknownValue(
6436 wkt::internal::UnknownEnumValue::String(value.to_string()),
6437 )),
6438 }
6439 }
6440}
6441
6442impl serde::ser::Serialize for OperationState {
6443 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6444 where
6445 S: serde::Serializer,
6446 {
6447 match self {
6448 Self::Unspecified => serializer.serialize_i32(0),
6449 Self::Scheduled => serializer.serialize_i32(1),
6450 Self::WaitingForPermissions => serializer.serialize_i32(2),
6451 Self::Running => serializer.serialize_i32(3),
6452 Self::Succeeded => serializer.serialize_i32(4),
6453 Self::Failed => serializer.serialize_i32(5),
6454 Self::Cancelled => serializer.serialize_i32(6),
6455 Self::UnknownValue(u) => u.0.serialize(serializer),
6456 }
6457 }
6458}
6459
6460impl<'de> serde::de::Deserialize<'de> for OperationState {
6461 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6462 where
6463 D: serde::Deserializer<'de>,
6464 {
6465 deserializer.deserialize_any(wkt::internal::EnumVisitor::<OperationState>::new(
6466 ".google.logging.v2.OperationState",
6467 ))
6468 }
6469}
6470
6471/// LogBucket lifecycle states.
6472///
6473/// # Working with unknown values
6474///
6475/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6476/// additional enum variants at any time. Adding new variants is not considered
6477/// a breaking change. Applications should write their code in anticipation of:
6478///
6479/// - New values appearing in future releases of the client library, **and**
6480/// - New values received dynamically, without application changes.
6481///
6482/// Please consult the [Working with enums] section in the user guide for some
6483/// guidelines.
6484///
6485/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6486#[derive(Clone, Debug, PartialEq)]
6487#[non_exhaustive]
6488pub enum LifecycleState {
6489 /// Unspecified state. This is only used/useful for distinguishing unset
6490 /// values.
6491 Unspecified,
6492 /// The normal and active state.
6493 Active,
6494 /// The resource has been marked for deletion by the user. For some resources
6495 /// (e.g. buckets), this can be reversed by an un-delete operation.
6496 DeleteRequested,
6497 /// The resource has been marked for an update by the user. It will remain in
6498 /// this state until the update is complete.
6499 Updating,
6500 /// The resource has been marked for creation by the user. It will remain in
6501 /// this state until the creation is complete.
6502 Creating,
6503 /// The resource is in an INTERNAL error state.
6504 Failed,
6505 /// If set, the enum was initialized with an unknown value.
6506 ///
6507 /// Applications can examine the value using [LifecycleState::value] or
6508 /// [LifecycleState::name].
6509 UnknownValue(lifecycle_state::UnknownValue),
6510}
6511
6512#[doc(hidden)]
6513pub mod lifecycle_state {
6514 #[allow(unused_imports)]
6515 use super::*;
6516 #[derive(Clone, Debug, PartialEq)]
6517 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6518}
6519
6520impl LifecycleState {
6521 /// Gets the enum value.
6522 ///
6523 /// Returns `None` if the enum contains an unknown value deserialized from
6524 /// the string representation of enums.
6525 pub fn value(&self) -> std::option::Option<i32> {
6526 match self {
6527 Self::Unspecified => std::option::Option::Some(0),
6528 Self::Active => std::option::Option::Some(1),
6529 Self::DeleteRequested => std::option::Option::Some(2),
6530 Self::Updating => std::option::Option::Some(3),
6531 Self::Creating => std::option::Option::Some(4),
6532 Self::Failed => std::option::Option::Some(5),
6533 Self::UnknownValue(u) => u.0.value(),
6534 }
6535 }
6536
6537 /// Gets the enum value as a string.
6538 ///
6539 /// Returns `None` if the enum contains an unknown value deserialized from
6540 /// the integer representation of enums.
6541 pub fn name(&self) -> std::option::Option<&str> {
6542 match self {
6543 Self::Unspecified => std::option::Option::Some("LIFECYCLE_STATE_UNSPECIFIED"),
6544 Self::Active => std::option::Option::Some("ACTIVE"),
6545 Self::DeleteRequested => std::option::Option::Some("DELETE_REQUESTED"),
6546 Self::Updating => std::option::Option::Some("UPDATING"),
6547 Self::Creating => std::option::Option::Some("CREATING"),
6548 Self::Failed => std::option::Option::Some("FAILED"),
6549 Self::UnknownValue(u) => u.0.name(),
6550 }
6551 }
6552}
6553
6554impl std::default::Default for LifecycleState {
6555 fn default() -> Self {
6556 use std::convert::From;
6557 Self::from(0)
6558 }
6559}
6560
6561impl std::fmt::Display for LifecycleState {
6562 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6563 wkt::internal::display_enum(f, self.name(), self.value())
6564 }
6565}
6566
6567impl std::convert::From<i32> for LifecycleState {
6568 fn from(value: i32) -> Self {
6569 match value {
6570 0 => Self::Unspecified,
6571 1 => Self::Active,
6572 2 => Self::DeleteRequested,
6573 3 => Self::Updating,
6574 4 => Self::Creating,
6575 5 => Self::Failed,
6576 _ => Self::UnknownValue(lifecycle_state::UnknownValue(
6577 wkt::internal::UnknownEnumValue::Integer(value),
6578 )),
6579 }
6580 }
6581}
6582
6583impl std::convert::From<&str> for LifecycleState {
6584 fn from(value: &str) -> Self {
6585 use std::string::ToString;
6586 match value {
6587 "LIFECYCLE_STATE_UNSPECIFIED" => Self::Unspecified,
6588 "ACTIVE" => Self::Active,
6589 "DELETE_REQUESTED" => Self::DeleteRequested,
6590 "UPDATING" => Self::Updating,
6591 "CREATING" => Self::Creating,
6592 "FAILED" => Self::Failed,
6593 _ => Self::UnknownValue(lifecycle_state::UnknownValue(
6594 wkt::internal::UnknownEnumValue::String(value.to_string()),
6595 )),
6596 }
6597 }
6598}
6599
6600impl serde::ser::Serialize for LifecycleState {
6601 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6602 where
6603 S: serde::Serializer,
6604 {
6605 match self {
6606 Self::Unspecified => serializer.serialize_i32(0),
6607 Self::Active => serializer.serialize_i32(1),
6608 Self::DeleteRequested => serializer.serialize_i32(2),
6609 Self::Updating => serializer.serialize_i32(3),
6610 Self::Creating => serializer.serialize_i32(4),
6611 Self::Failed => serializer.serialize_i32(5),
6612 Self::UnknownValue(u) => u.0.serialize(serializer),
6613 }
6614 }
6615}
6616
6617impl<'de> serde::de::Deserialize<'de> for LifecycleState {
6618 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6619 where
6620 D: serde::Deserializer<'de>,
6621 {
6622 deserializer.deserialize_any(wkt::internal::EnumVisitor::<LifecycleState>::new(
6623 ".google.logging.v2.LifecycleState",
6624 ))
6625 }
6626}
6627
6628/// IndexType is used for custom indexing. It describes the type of an indexed
6629/// field.
6630///
6631/// # Working with unknown values
6632///
6633/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
6634/// additional enum variants at any time. Adding new variants is not considered
6635/// a breaking change. Applications should write their code in anticipation of:
6636///
6637/// - New values appearing in future releases of the client library, **and**
6638/// - New values received dynamically, without application changes.
6639///
6640/// Please consult the [Working with enums] section in the user guide for some
6641/// guidelines.
6642///
6643/// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
6644#[derive(Clone, Debug, PartialEq)]
6645#[non_exhaustive]
6646pub enum IndexType {
6647 /// The index's type is unspecified.
6648 Unspecified,
6649 /// The index is a string-type index.
6650 String,
6651 /// The index is a integer-type index.
6652 Integer,
6653 /// If set, the enum was initialized with an unknown value.
6654 ///
6655 /// Applications can examine the value using [IndexType::value] or
6656 /// [IndexType::name].
6657 UnknownValue(index_type::UnknownValue),
6658}
6659
6660#[doc(hidden)]
6661pub mod index_type {
6662 #[allow(unused_imports)]
6663 use super::*;
6664 #[derive(Clone, Debug, PartialEq)]
6665 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
6666}
6667
6668impl IndexType {
6669 /// Gets the enum value.
6670 ///
6671 /// Returns `None` if the enum contains an unknown value deserialized from
6672 /// the string representation of enums.
6673 pub fn value(&self) -> std::option::Option<i32> {
6674 match self {
6675 Self::Unspecified => std::option::Option::Some(0),
6676 Self::String => std::option::Option::Some(1),
6677 Self::Integer => std::option::Option::Some(2),
6678 Self::UnknownValue(u) => u.0.value(),
6679 }
6680 }
6681
6682 /// Gets the enum value as a string.
6683 ///
6684 /// Returns `None` if the enum contains an unknown value deserialized from
6685 /// the integer representation of enums.
6686 pub fn name(&self) -> std::option::Option<&str> {
6687 match self {
6688 Self::Unspecified => std::option::Option::Some("INDEX_TYPE_UNSPECIFIED"),
6689 Self::String => std::option::Option::Some("INDEX_TYPE_STRING"),
6690 Self::Integer => std::option::Option::Some("INDEX_TYPE_INTEGER"),
6691 Self::UnknownValue(u) => u.0.name(),
6692 }
6693 }
6694}
6695
6696impl std::default::Default for IndexType {
6697 fn default() -> Self {
6698 use std::convert::From;
6699 Self::from(0)
6700 }
6701}
6702
6703impl std::fmt::Display for IndexType {
6704 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
6705 wkt::internal::display_enum(f, self.name(), self.value())
6706 }
6707}
6708
6709impl std::convert::From<i32> for IndexType {
6710 fn from(value: i32) -> Self {
6711 match value {
6712 0 => Self::Unspecified,
6713 1 => Self::String,
6714 2 => Self::Integer,
6715 _ => Self::UnknownValue(index_type::UnknownValue(
6716 wkt::internal::UnknownEnumValue::Integer(value),
6717 )),
6718 }
6719 }
6720}
6721
6722impl std::convert::From<&str> for IndexType {
6723 fn from(value: &str) -> Self {
6724 use std::string::ToString;
6725 match value {
6726 "INDEX_TYPE_UNSPECIFIED" => Self::Unspecified,
6727 "INDEX_TYPE_STRING" => Self::String,
6728 "INDEX_TYPE_INTEGER" => Self::Integer,
6729 _ => Self::UnknownValue(index_type::UnknownValue(
6730 wkt::internal::UnknownEnumValue::String(value.to_string()),
6731 )),
6732 }
6733 }
6734}
6735
6736impl serde::ser::Serialize for IndexType {
6737 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6738 where
6739 S: serde::Serializer,
6740 {
6741 match self {
6742 Self::Unspecified => serializer.serialize_i32(0),
6743 Self::String => serializer.serialize_i32(1),
6744 Self::Integer => serializer.serialize_i32(2),
6745 Self::UnknownValue(u) => u.0.serialize(serializer),
6746 }
6747 }
6748}
6749
6750impl<'de> serde::de::Deserialize<'de> for IndexType {
6751 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6752 where
6753 D: serde::Deserializer<'de>,
6754 {
6755 deserializer.deserialize_any(wkt::internal::EnumVisitor::<IndexType>::new(
6756 ".google.logging.v2.IndexType",
6757 ))
6758 }
6759}