#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gaxi;
extern crate google_cloud_api;
extern crate google_cloud_gax;
extern crate google_cloud_logging_type;
extern crate google_cloud_longrunning;
extern crate google_cloud_lro;
extern crate google_cloud_rpc;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;
mod debug;
mod deserialize;
mod serialize;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LogEntry {
pub log_name: std::string::String,
pub resource: std::option::Option<google_cloud_api::model::MonitoredResource>,
pub timestamp: std::option::Option<wkt::Timestamp>,
pub receive_timestamp: std::option::Option<wkt::Timestamp>,
pub severity: google_cloud_logging_type::model::LogSeverity,
pub insert_id: std::string::String,
pub http_request: std::option::Option<google_cloud_logging_type::model::HttpRequest>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub operation: std::option::Option<crate::model::LogEntryOperation>,
pub trace: std::string::String,
pub span_id: std::string::String,
pub trace_sampled: bool,
pub source_location: std::option::Option<crate::model::LogEntrySourceLocation>,
pub split: std::option::Option<crate::model::LogSplit>,
pub payload: std::option::Option<crate::model::log_entry::Payload>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LogEntry {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_log_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.log_name = v.into();
self
}
pub fn set_resource<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_api::model::MonitoredResource>,
{
self.resource = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_api::model::MonitoredResource>,
{
self.resource = v.map(|x| x.into());
self
}
pub fn set_timestamp<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.timestamp = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_timestamp<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.timestamp = v.map(|x| x.into());
self
}
pub fn set_receive_timestamp<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.receive_timestamp = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_receive_timestamp<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.receive_timestamp = v.map(|x| x.into());
self
}
pub fn set_severity<T: std::convert::Into<google_cloud_logging_type::model::LogSeverity>>(
mut self,
v: T,
) -> Self {
self.severity = v.into();
self
}
pub fn set_insert_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.insert_id = v.into();
self
}
pub fn set_http_request<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_logging_type::model::HttpRequest>,
{
self.http_request = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_http_request<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_logging_type::model::HttpRequest>,
{
self.http_request = v.map(|x| x.into());
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_operation<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LogEntryOperation>,
{
self.operation = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_operation<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LogEntryOperation>,
{
self.operation = v.map(|x| x.into());
self
}
pub fn set_trace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.trace = v.into();
self
}
pub fn set_span_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.span_id = v.into();
self
}
pub fn set_trace_sampled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.trace_sampled = v.into();
self
}
pub fn set_source_location<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LogEntrySourceLocation>,
{
self.source_location = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_source_location<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LogEntrySourceLocation>,
{
self.source_location = v.map(|x| x.into());
self
}
pub fn set_split<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LogSplit>,
{
self.split = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_split<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LogSplit>,
{
self.split = v.map(|x| x.into());
self
}
pub fn set_payload<
T: std::convert::Into<std::option::Option<crate::model::log_entry::Payload>>,
>(
mut self,
v: T,
) -> Self {
self.payload = v.into();
self
}
pub fn proto_payload(&self) -> std::option::Option<&std::boxed::Box<wkt::Any>> {
#[allow(unreachable_patterns)]
self.payload.as_ref().and_then(|v| match v {
crate::model::log_entry::Payload::ProtoPayload(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_proto_payload<T: std::convert::Into<std::boxed::Box<wkt::Any>>>(
mut self,
v: T,
) -> Self {
self.payload =
std::option::Option::Some(crate::model::log_entry::Payload::ProtoPayload(v.into()));
self
}
pub fn text_payload(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.payload.as_ref().and_then(|v| match v {
crate::model::log_entry::Payload::TextPayload(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_text_payload<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.payload =
std::option::Option::Some(crate::model::log_entry::Payload::TextPayload(v.into()));
self
}
pub fn json_payload(&self) -> std::option::Option<&std::boxed::Box<wkt::Struct>> {
#[allow(unreachable_patterns)]
self.payload.as_ref().and_then(|v| match v {
crate::model::log_entry::Payload::JsonPayload(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_json_payload<T: std::convert::Into<std::boxed::Box<wkt::Struct>>>(
mut self,
v: T,
) -> Self {
self.payload =
std::option::Option::Some(crate::model::log_entry::Payload::JsonPayload(v.into()));
self
}
}
impl wkt::message::Message for LogEntry {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.LogEntry"
}
}
pub mod log_entry {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Payload {
ProtoPayload(std::boxed::Box<wkt::Any>),
TextPayload(std::string::String),
JsonPayload(std::boxed::Box<wkt::Struct>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LogEntryOperation {
pub id: std::string::String,
pub producer: std::string::String,
pub first: bool,
pub last: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LogEntryOperation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_producer<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.producer = v.into();
self
}
pub fn set_first<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.first = v.into();
self
}
pub fn set_last<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.last = v.into();
self
}
}
impl wkt::message::Message for LogEntryOperation {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.LogEntryOperation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LogEntrySourceLocation {
pub file: std::string::String,
pub line: i64,
pub function: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LogEntrySourceLocation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_file<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.file = v.into();
self
}
pub fn set_line<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.line = v.into();
self
}
pub fn set_function<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.function = v.into();
self
}
}
impl wkt::message::Message for LogEntrySourceLocation {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.LogEntrySourceLocation"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LogSplit {
pub uid: std::string::String,
pub index: i32,
pub total_splits: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LogSplit {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
pub fn set_index<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.index = v.into();
self
}
pub fn set_total_splits<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.total_splits = v.into();
self
}
}
impl wkt::message::Message for LogSplit {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.LogSplit"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteLogRequest {
pub log_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteLogRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_log_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.log_name = v.into();
self
}
}
impl wkt::message::Message for DeleteLogRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.DeleteLogRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WriteLogEntriesRequest {
pub log_name: std::string::String,
pub resource: std::option::Option<google_cloud_api::model::MonitoredResource>,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub entries: std::vec::Vec<crate::model::LogEntry>,
pub partial_success: bool,
pub dry_run: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl WriteLogEntriesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_log_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.log_name = v.into();
self
}
pub fn set_resource<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_api::model::MonitoredResource>,
{
self.resource = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_api::model::MonitoredResource>,
{
self.resource = v.map(|x| x.into());
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_entries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::LogEntry>,
{
use std::iter::Iterator;
self.entries = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_partial_success<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.partial_success = v.into();
self
}
pub fn set_dry_run<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.dry_run = v.into();
self
}
}
impl wkt::message::Message for WriteLogEntriesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.WriteLogEntriesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WriteLogEntriesResponse {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl WriteLogEntriesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for WriteLogEntriesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.WriteLogEntriesResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WriteLogEntriesPartialErrors {
pub log_entry_errors: std::collections::HashMap<i32, google_cloud_rpc::model::Status>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl WriteLogEntriesPartialErrors {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_log_entry_errors<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<i32>,
V: std::convert::Into<google_cloud_rpc::model::Status>,
{
use std::iter::Iterator;
self.log_entry_errors = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for WriteLogEntriesPartialErrors {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.WriteLogEntriesPartialErrors"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListLogEntriesRequest {
pub resource_names: std::vec::Vec<std::string::String>,
pub filter: std::string::String,
pub order_by: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListLogEntriesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_resource_names<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.resource_names = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListLogEntriesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.ListLogEntriesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListLogEntriesResponse {
pub entries: std::vec::Vec<crate::model::LogEntry>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListLogEntriesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_entries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::LogEntry>,
{
use std::iter::Iterator;
self.entries = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListLogEntriesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.ListLogEntriesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListLogEntriesResponse {
type PageItem = crate::model::LogEntry;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.entries
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMonitoredResourceDescriptorsRequest {
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListMonitoredResourceDescriptorsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListMonitoredResourceDescriptorsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.ListMonitoredResourceDescriptorsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMonitoredResourceDescriptorsResponse {
pub resource_descriptors: std::vec::Vec<google_cloud_api::model::MonitoredResourceDescriptor>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListMonitoredResourceDescriptorsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_resource_descriptors<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<google_cloud_api::model::MonitoredResourceDescriptor>,
{
use std::iter::Iterator;
self.resource_descriptors = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListMonitoredResourceDescriptorsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.ListMonitoredResourceDescriptorsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse
for ListMonitoredResourceDescriptorsResponse
{
type PageItem = google_cloud_api::model::MonitoredResourceDescriptor;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.resource_descriptors
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListLogsRequest {
pub parent: std::string::String,
pub resource_names: std::vec::Vec<std::string::String>,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListLogsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_resource_names<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.resource_names = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListLogsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.ListLogsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListLogsResponse {
pub log_names: std::vec::Vec<std::string::String>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListLogsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_log_names<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.log_names = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListLogsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.ListLogsResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TailLogEntriesRequest {
pub resource_names: std::vec::Vec<std::string::String>,
pub filter: std::string::String,
pub buffer_window: std::option::Option<wkt::Duration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TailLogEntriesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_resource_names<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.resource_names = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_buffer_window<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.buffer_window = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_buffer_window<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Duration>,
{
self.buffer_window = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for TailLogEntriesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.TailLogEntriesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TailLogEntriesResponse {
pub entries: std::vec::Vec<crate::model::LogEntry>,
pub suppression_info: std::vec::Vec<crate::model::tail_log_entries_response::SuppressionInfo>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TailLogEntriesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_entries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::LogEntry>,
{
use std::iter::Iterator;
self.entries = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_suppression_info<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::tail_log_entries_response::SuppressionInfo>,
{
use std::iter::Iterator;
self.suppression_info = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for TailLogEntriesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.TailLogEntriesResponse"
}
}
pub mod tail_log_entries_response {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SuppressionInfo {
pub reason: crate::model::tail_log_entries_response::suppression_info::Reason,
pub suppressed_count: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SuppressionInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_reason<
T: std::convert::Into<crate::model::tail_log_entries_response::suppression_info::Reason>,
>(
mut self,
v: T,
) -> Self {
self.reason = v.into();
self
}
pub fn set_suppressed_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.suppressed_count = v.into();
self
}
}
impl wkt::message::Message for SuppressionInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.TailLogEntriesResponse.SuppressionInfo"
}
}
pub mod suppression_info {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Reason {
Unspecified,
RateLimit,
NotConsumed,
UnknownValue(reason::UnknownValue),
}
#[doc(hidden)]
pub mod reason {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Reason {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::RateLimit => std::option::Option::Some(1),
Self::NotConsumed => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("REASON_UNSPECIFIED"),
Self::RateLimit => std::option::Option::Some("RATE_LIMIT"),
Self::NotConsumed => std::option::Option::Some("NOT_CONSUMED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Reason {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Reason {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Reason {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::RateLimit,
2 => Self::NotConsumed,
_ => Self::UnknownValue(reason::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Reason {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"REASON_UNSPECIFIED" => Self::Unspecified,
"RATE_LIMIT" => Self::RateLimit,
"NOT_CONSUMED" => Self::NotConsumed,
_ => Self::UnknownValue(reason::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Reason {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::RateLimit => serializer.serialize_i32(1),
Self::NotConsumed => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Reason {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Reason>::new(
".google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason",
))
}
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IndexConfig {
pub field_path: std::string::String,
pub r#type: crate::model::IndexType,
pub create_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl IndexConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_field_path<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.field_path = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::IndexType>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for IndexConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.IndexConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LogBucket {
pub name: std::string::String,
pub description: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub retention_days: i32,
pub locked: bool,
pub lifecycle_state: crate::model::LifecycleState,
pub analytics_enabled: bool,
pub restricted_fields: std::vec::Vec<std::string::String>,
pub index_configs: std::vec::Vec<crate::model::IndexConfig>,
pub cmek_settings: std::option::Option<crate::model::CmekSettings>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LogBucket {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_retention_days<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.retention_days = v.into();
self
}
pub fn set_locked<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.locked = v.into();
self
}
pub fn set_lifecycle_state<T: std::convert::Into<crate::model::LifecycleState>>(
mut self,
v: T,
) -> Self {
self.lifecycle_state = v.into();
self
}
pub fn set_analytics_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.analytics_enabled = v.into();
self
}
pub fn set_restricted_fields<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.restricted_fields = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_index_configs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::IndexConfig>,
{
use std::iter::Iterator;
self.index_configs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_cmek_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CmekSettings>,
{
self.cmek_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cmek_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CmekSettings>,
{
self.cmek_settings = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for LogBucket {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.LogBucket"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LogView {
pub name: std::string::String,
pub description: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LogView {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
}
impl wkt::message::Message for LogView {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.LogView"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LogSink {
pub name: std::string::String,
pub destination: std::string::String,
pub filter: std::string::String,
pub description: std::string::String,
pub disabled: bool,
pub exclusions: std::vec::Vec<crate::model::LogExclusion>,
#[deprecated]
pub output_version_format: crate::model::log_sink::VersionFormat,
pub writer_identity: std::string::String,
pub include_children: bool,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub options: std::option::Option<crate::model::log_sink::Options>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LogSink {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_destination<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.destination = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.disabled = v.into();
self
}
pub fn set_exclusions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::LogExclusion>,
{
use std::iter::Iterator;
self.exclusions = v.into_iter().map(|i| i.into()).collect();
self
}
#[deprecated]
pub fn set_output_version_format<
T: std::convert::Into<crate::model::log_sink::VersionFormat>,
>(
mut self,
v: T,
) -> Self {
self.output_version_format = v.into();
self
}
pub fn set_writer_identity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.writer_identity = v.into();
self
}
pub fn set_include_children<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.include_children = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_options<
T: std::convert::Into<std::option::Option<crate::model::log_sink::Options>>,
>(
mut self,
v: T,
) -> Self {
self.options = v.into();
self
}
pub fn bigquery_options(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::BigQueryOptions>> {
#[allow(unreachable_patterns)]
self.options.as_ref().and_then(|v| match v {
crate::model::log_sink::Options::BigqueryOptions(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_bigquery_options<
T: std::convert::Into<std::boxed::Box<crate::model::BigQueryOptions>>,
>(
mut self,
v: T,
) -> Self {
self.options =
std::option::Option::Some(crate::model::log_sink::Options::BigqueryOptions(v.into()));
self
}
}
impl wkt::message::Message for LogSink {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.LogSink"
}
}
pub mod log_sink {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum VersionFormat {
Unspecified,
V2,
V1,
UnknownValue(version_format::UnknownValue),
}
#[doc(hidden)]
pub mod version_format {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl VersionFormat {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::V2 => std::option::Option::Some(1),
Self::V1 => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("VERSION_FORMAT_UNSPECIFIED"),
Self::V2 => std::option::Option::Some("V2"),
Self::V1 => std::option::Option::Some("V1"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for VersionFormat {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for VersionFormat {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for VersionFormat {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::V2,
2 => Self::V1,
_ => Self::UnknownValue(version_format::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for VersionFormat {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"VERSION_FORMAT_UNSPECIFIED" => Self::Unspecified,
"V2" => Self::V2,
"V1" => Self::V1,
_ => Self::UnknownValue(version_format::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for VersionFormat {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::V2 => serializer.serialize_i32(1),
Self::V1 => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for VersionFormat {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<VersionFormat>::new(
".google.logging.v2.LogSink.VersionFormat",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Options {
BigqueryOptions(std::boxed::Box<crate::model::BigQueryOptions>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BigQueryDataset {
pub dataset_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BigQueryDataset {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_dataset_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.dataset_id = v.into();
self
}
}
impl wkt::message::Message for BigQueryDataset {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.BigQueryDataset"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Link {
pub name: std::string::String,
pub description: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub lifecycle_state: crate::model::LifecycleState,
pub bigquery_dataset: std::option::Option<crate::model::BigQueryDataset>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Link {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_lifecycle_state<T: std::convert::Into<crate::model::LifecycleState>>(
mut self,
v: T,
) -> Self {
self.lifecycle_state = v.into();
self
}
pub fn set_bigquery_dataset<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::BigQueryDataset>,
{
self.bigquery_dataset = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_bigquery_dataset<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::BigQueryDataset>,
{
self.bigquery_dataset = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Link {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.Link"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BigQueryOptions {
pub use_partitioned_tables: bool,
pub uses_timestamp_column_partitioning: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BigQueryOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_use_partitioned_tables<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.use_partitioned_tables = v.into();
self
}
pub fn set_uses_timestamp_column_partitioning<T: std::convert::Into<bool>>(
mut self,
v: T,
) -> Self {
self.uses_timestamp_column_partitioning = v.into();
self
}
}
impl wkt::message::Message for BigQueryOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.BigQueryOptions"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBucketsRequest {
pub parent: std::string::String,
pub page_token: std::string::String,
pub page_size: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListBucketsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
}
impl wkt::message::Message for ListBucketsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.ListBucketsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListBucketsResponse {
pub buckets: std::vec::Vec<crate::model::LogBucket>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListBucketsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_buckets<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::LogBucket>,
{
use std::iter::Iterator;
self.buckets = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListBucketsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.ListBucketsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListBucketsResponse {
type PageItem = crate::model::LogBucket;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.buckets
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateBucketRequest {
pub parent: std::string::String,
pub bucket_id: std::string::String,
pub bucket: std::option::Option<crate::model::LogBucket>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateBucketRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_bucket_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.bucket_id = v.into();
self
}
pub fn set_bucket<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LogBucket>,
{
self.bucket = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LogBucket>,
{
self.bucket = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateBucketRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.CreateBucketRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateBucketRequest {
pub name: std::string::String,
pub bucket: std::option::Option<crate::model::LogBucket>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateBucketRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_bucket<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LogBucket>,
{
self.bucket = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LogBucket>,
{
self.bucket = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateBucketRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.UpdateBucketRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetBucketRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetBucketRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetBucketRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.GetBucketRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteBucketRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteBucketRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteBucketRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.DeleteBucketRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UndeleteBucketRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UndeleteBucketRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for UndeleteBucketRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.UndeleteBucketRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListViewsRequest {
pub parent: std::string::String,
pub page_token: std::string::String,
pub page_size: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListViewsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
}
impl wkt::message::Message for ListViewsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.ListViewsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListViewsResponse {
pub views: std::vec::Vec<crate::model::LogView>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListViewsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_views<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::LogView>,
{
use std::iter::Iterator;
self.views = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListViewsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.ListViewsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListViewsResponse {
type PageItem = crate::model::LogView;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.views
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateViewRequest {
pub parent: std::string::String,
pub view_id: std::string::String,
pub view: std::option::Option<crate::model::LogView>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateViewRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_view_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.view_id = v.into();
self
}
pub fn set_view<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LogView>,
{
self.view = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_view<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LogView>,
{
self.view = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateViewRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.CreateViewRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateViewRequest {
pub name: std::string::String,
pub view: std::option::Option<crate::model::LogView>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateViewRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_view<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LogView>,
{
self.view = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_view<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LogView>,
{
self.view = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateViewRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.UpdateViewRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetViewRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetViewRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetViewRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.GetViewRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteViewRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteViewRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteViewRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.DeleteViewRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSinksRequest {
pub parent: std::string::String,
pub page_token: std::string::String,
pub page_size: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSinksRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
}
impl wkt::message::Message for ListSinksRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.ListSinksRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSinksResponse {
pub sinks: std::vec::Vec<crate::model::LogSink>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSinksResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_sinks<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::LogSink>,
{
use std::iter::Iterator;
self.sinks = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListSinksResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.ListSinksResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListSinksResponse {
type PageItem = crate::model::LogSink;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.sinks
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetSinkRequest {
pub sink_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetSinkRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_sink_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.sink_name = v.into();
self
}
}
impl wkt::message::Message for GetSinkRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.GetSinkRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateSinkRequest {
pub parent: std::string::String,
pub sink: std::option::Option<crate::model::LogSink>,
pub unique_writer_identity: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateSinkRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_sink<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LogSink>,
{
self.sink = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_sink<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LogSink>,
{
self.sink = v.map(|x| x.into());
self
}
pub fn set_unique_writer_identity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.unique_writer_identity = v.into();
self
}
}
impl wkt::message::Message for CreateSinkRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.CreateSinkRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateSinkRequest {
pub sink_name: std::string::String,
pub sink: std::option::Option<crate::model::LogSink>,
pub unique_writer_identity: bool,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateSinkRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_sink_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.sink_name = v.into();
self
}
pub fn set_sink<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LogSink>,
{
self.sink = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_sink<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LogSink>,
{
self.sink = v.map(|x| x.into());
self
}
pub fn set_unique_writer_identity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.unique_writer_identity = v.into();
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateSinkRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.UpdateSinkRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteSinkRequest {
pub sink_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteSinkRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_sink_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.sink_name = v.into();
self
}
}
impl wkt::message::Message for DeleteSinkRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.DeleteSinkRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateLinkRequest {
pub parent: std::string::String,
pub link: std::option::Option<crate::model::Link>,
pub link_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateLinkRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_link<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Link>,
{
self.link = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_link<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Link>,
{
self.link = v.map(|x| x.into());
self
}
pub fn set_link_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.link_id = v.into();
self
}
}
impl wkt::message::Message for CreateLinkRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.CreateLinkRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteLinkRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteLinkRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteLinkRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.DeleteLinkRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListLinksRequest {
pub parent: std::string::String,
pub page_token: std::string::String,
pub page_size: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListLinksRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
}
impl wkt::message::Message for ListLinksRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.ListLinksRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListLinksResponse {
pub links: std::vec::Vec<crate::model::Link>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListLinksResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_links<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Link>,
{
use std::iter::Iterator;
self.links = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListLinksResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.ListLinksResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListLinksResponse {
type PageItem = crate::model::Link;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.links
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetLinkRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetLinkRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetLinkRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.GetLinkRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LogExclusion {
pub name: std::string::String,
pub description: std::string::String,
pub filter: std::string::String,
pub disabled: bool,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LogExclusion {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.disabled = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for LogExclusion {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.LogExclusion"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListExclusionsRequest {
pub parent: std::string::String,
pub page_token: std::string::String,
pub page_size: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListExclusionsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
}
impl wkt::message::Message for ListExclusionsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.ListExclusionsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListExclusionsResponse {
pub exclusions: std::vec::Vec<crate::model::LogExclusion>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListExclusionsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_exclusions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::LogExclusion>,
{
use std::iter::Iterator;
self.exclusions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListExclusionsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.ListExclusionsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListExclusionsResponse {
type PageItem = crate::model::LogExclusion;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.exclusions
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetExclusionRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetExclusionRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetExclusionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.GetExclusionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateExclusionRequest {
pub parent: std::string::String,
pub exclusion: std::option::Option<crate::model::LogExclusion>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateExclusionRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_exclusion<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LogExclusion>,
{
self.exclusion = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_exclusion<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LogExclusion>,
{
self.exclusion = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateExclusionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.CreateExclusionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateExclusionRequest {
pub name: std::string::String,
pub exclusion: std::option::Option<crate::model::LogExclusion>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateExclusionRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_exclusion<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LogExclusion>,
{
self.exclusion = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_exclusion<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LogExclusion>,
{
self.exclusion = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateExclusionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.UpdateExclusionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteExclusionRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteExclusionRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteExclusionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.DeleteExclusionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetCmekSettingsRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetCmekSettingsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetCmekSettingsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.GetCmekSettingsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateCmekSettingsRequest {
pub name: std::string::String,
pub cmek_settings: std::option::Option<crate::model::CmekSettings>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateCmekSettingsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_cmek_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CmekSettings>,
{
self.cmek_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_cmek_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CmekSettings>,
{
self.cmek_settings = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateCmekSettingsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.UpdateCmekSettingsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CmekSettings {
pub name: std::string::String,
pub kms_key_name: std::string::String,
pub kms_key_version_name: std::string::String,
pub service_account_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CmekSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kms_key_name = v.into();
self
}
pub fn set_kms_key_version_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.kms_key_version_name = v.into();
self
}
pub fn set_service_account_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.service_account_id = v.into();
self
}
}
impl wkt::message::Message for CmekSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.CmekSettings"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetSettingsRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetSettingsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetSettingsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.GetSettingsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateSettingsRequest {
pub name: std::string::String,
pub settings: std::option::Option<crate::model::Settings>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateSettingsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Settings>,
{
self.settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Settings>,
{
self.settings = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateSettingsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.UpdateSettingsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Settings {
pub name: std::string::String,
pub kms_key_name: std::string::String,
pub kms_service_account_id: std::string::String,
pub storage_location: std::string::String,
pub disable_default_sink: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Settings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_kms_key_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.kms_key_name = v.into();
self
}
pub fn set_kms_service_account_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.kms_service_account_id = v.into();
self
}
pub fn set_storage_location<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.storage_location = v.into();
self
}
pub fn set_disable_default_sink<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.disable_default_sink = v.into();
self
}
}
impl wkt::message::Message for Settings {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.Settings"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CopyLogEntriesRequest {
pub name: std::string::String,
pub filter: std::string::String,
pub destination: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CopyLogEntriesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_destination<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.destination = v.into();
self
}
}
impl wkt::message::Message for CopyLogEntriesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.CopyLogEntriesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CopyLogEntriesMetadata {
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub state: crate::model::OperationState,
pub cancellation_requested: bool,
pub request: std::option::Option<crate::model::CopyLogEntriesRequest>,
pub progress: i32,
pub writer_identity: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CopyLogEntriesMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_state<T: std::convert::Into<crate::model::OperationState>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_cancellation_requested<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.cancellation_requested = v.into();
self
}
pub fn set_request<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CopyLogEntriesRequest>,
{
self.request = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_request<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CopyLogEntriesRequest>,
{
self.request = v.map(|x| x.into());
self
}
pub fn set_progress<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.progress = v.into();
self
}
pub fn set_writer_identity<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.writer_identity = v.into();
self
}
}
impl wkt::message::Message for CopyLogEntriesMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.CopyLogEntriesMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CopyLogEntriesResponse {
pub log_entries_copied_count: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CopyLogEntriesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_log_entries_copied_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.log_entries_copied_count = v.into();
self
}
}
impl wkt::message::Message for CopyLogEntriesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.CopyLogEntriesResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BucketMetadata {
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub state: crate::model::OperationState,
pub request: std::option::Option<crate::model::bucket_metadata::Request>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BucketMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_state<T: std::convert::Into<crate::model::OperationState>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_request<
T: std::convert::Into<std::option::Option<crate::model::bucket_metadata::Request>>,
>(
mut self,
v: T,
) -> Self {
self.request = v.into();
self
}
pub fn create_bucket_request(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CreateBucketRequest>> {
#[allow(unreachable_patterns)]
self.request.as_ref().and_then(|v| match v {
crate::model::bucket_metadata::Request::CreateBucketRequest(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_create_bucket_request<
T: std::convert::Into<std::boxed::Box<crate::model::CreateBucketRequest>>,
>(
mut self,
v: T,
) -> Self {
self.request = std::option::Option::Some(
crate::model::bucket_metadata::Request::CreateBucketRequest(v.into()),
);
self
}
pub fn update_bucket_request(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::UpdateBucketRequest>> {
#[allow(unreachable_patterns)]
self.request.as_ref().and_then(|v| match v {
crate::model::bucket_metadata::Request::UpdateBucketRequest(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_update_bucket_request<
T: std::convert::Into<std::boxed::Box<crate::model::UpdateBucketRequest>>,
>(
mut self,
v: T,
) -> Self {
self.request = std::option::Option::Some(
crate::model::bucket_metadata::Request::UpdateBucketRequest(v.into()),
);
self
}
}
impl wkt::message::Message for BucketMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.BucketMetadata"
}
}
pub mod bucket_metadata {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Request {
CreateBucketRequest(std::boxed::Box<crate::model::CreateBucketRequest>),
UpdateBucketRequest(std::boxed::Box<crate::model::UpdateBucketRequest>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LinkMetadata {
pub start_time: std::option::Option<wkt::Timestamp>,
pub end_time: std::option::Option<wkt::Timestamp>,
pub state: crate::model::OperationState,
pub request: std::option::Option<crate::model::link_metadata::Request>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LinkMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_start_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.start_time = v.map(|x| x.into());
self
}
pub fn set_end_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.end_time = v.map(|x| x.into());
self
}
pub fn set_state<T: std::convert::Into<crate::model::OperationState>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_request<
T: std::convert::Into<std::option::Option<crate::model::link_metadata::Request>>,
>(
mut self,
v: T,
) -> Self {
self.request = v.into();
self
}
pub fn create_link_request(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CreateLinkRequest>> {
#[allow(unreachable_patterns)]
self.request.as_ref().and_then(|v| match v {
crate::model::link_metadata::Request::CreateLinkRequest(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_create_link_request<
T: std::convert::Into<std::boxed::Box<crate::model::CreateLinkRequest>>,
>(
mut self,
v: T,
) -> Self {
self.request = std::option::Option::Some(
crate::model::link_metadata::Request::CreateLinkRequest(v.into()),
);
self
}
pub fn delete_link_request(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DeleteLinkRequest>> {
#[allow(unreachable_patterns)]
self.request.as_ref().and_then(|v| match v {
crate::model::link_metadata::Request::DeleteLinkRequest(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_delete_link_request<
T: std::convert::Into<std::boxed::Box<crate::model::DeleteLinkRequest>>,
>(
mut self,
v: T,
) -> Self {
self.request = std::option::Option::Some(
crate::model::link_metadata::Request::DeleteLinkRequest(v.into()),
);
self
}
}
impl wkt::message::Message for LinkMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.LinkMetadata"
}
}
pub mod link_metadata {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Request {
CreateLinkRequest(std::boxed::Box<crate::model::CreateLinkRequest>),
DeleteLinkRequest(std::boxed::Box<crate::model::DeleteLinkRequest>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LocationMetadata {
pub log_analytics_enabled: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LocationMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_log_analytics_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.log_analytics_enabled = v.into();
self
}
}
impl wkt::message::Message for LocationMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.LocationMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LogMetric {
pub name: std::string::String,
pub description: std::string::String,
pub filter: std::string::String,
pub bucket_name: std::string::String,
pub disabled: bool,
pub metric_descriptor: std::option::Option<google_cloud_api::model::MetricDescriptor>,
pub value_extractor: std::string::String,
pub label_extractors: std::collections::HashMap<std::string::String, std::string::String>,
pub bucket_options: std::option::Option<google_cloud_api::model::distribution::BucketOptions>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
#[deprecated]
pub version: crate::model::log_metric::ApiVersion,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LogMetric {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_bucket_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.bucket_name = v.into();
self
}
pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.disabled = v.into();
self
}
pub fn set_metric_descriptor<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_api::model::MetricDescriptor>,
{
self.metric_descriptor = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_metric_descriptor<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_api::model::MetricDescriptor>,
{
self.metric_descriptor = v.map(|x| x.into());
self
}
pub fn set_value_extractor<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.value_extractor = v.into();
self
}
pub fn set_label_extractors<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.label_extractors = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
pub fn set_bucket_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_api::model::distribution::BucketOptions>,
{
self.bucket_options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_bucket_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_api::model::distribution::BucketOptions>,
{
self.bucket_options = v.map(|x| x.into());
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
#[deprecated]
pub fn set_version<T: std::convert::Into<crate::model::log_metric::ApiVersion>>(
mut self,
v: T,
) -> Self {
self.version = v.into();
self
}
}
impl wkt::message::Message for LogMetric {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.LogMetric"
}
}
pub mod log_metric {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ApiVersion {
V2,
V1,
UnknownValue(api_version::UnknownValue),
}
#[doc(hidden)]
pub mod api_version {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ApiVersion {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::V2 => std::option::Option::Some(0),
Self::V1 => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::V2 => std::option::Option::Some("V2"),
Self::V1 => std::option::Option::Some("V1"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ApiVersion {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ApiVersion {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ApiVersion {
fn from(value: i32) -> Self {
match value {
0 => Self::V2,
1 => Self::V1,
_ => Self::UnknownValue(api_version::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ApiVersion {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"V2" => Self::V2,
"V1" => Self::V1,
_ => Self::UnknownValue(api_version::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ApiVersion {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::V2 => serializer.serialize_i32(0),
Self::V1 => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ApiVersion {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ApiVersion>::new(
".google.logging.v2.LogMetric.ApiVersion",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListLogMetricsRequest {
pub parent: std::string::String,
pub page_token: std::string::String,
pub page_size: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListLogMetricsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
}
impl wkt::message::Message for ListLogMetricsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.ListLogMetricsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListLogMetricsResponse {
pub metrics: std::vec::Vec<crate::model::LogMetric>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListLogMetricsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_metrics<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::LogMetric>,
{
use std::iter::Iterator;
self.metrics = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListLogMetricsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.ListLogMetricsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListLogMetricsResponse {
type PageItem = crate::model::LogMetric;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.metrics
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetLogMetricRequest {
pub metric_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetLogMetricRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_metric_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.metric_name = v.into();
self
}
}
impl wkt::message::Message for GetLogMetricRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.GetLogMetricRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateLogMetricRequest {
pub parent: std::string::String,
pub metric: std::option::Option<crate::model::LogMetric>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateLogMetricRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_metric<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LogMetric>,
{
self.metric = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_metric<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LogMetric>,
{
self.metric = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateLogMetricRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.CreateLogMetricRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateLogMetricRequest {
pub metric_name: std::string::String,
pub metric: std::option::Option<crate::model::LogMetric>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateLogMetricRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_metric_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.metric_name = v.into();
self
}
pub fn set_metric<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::LogMetric>,
{
self.metric = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_metric<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::LogMetric>,
{
self.metric = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateLogMetricRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.UpdateLogMetricRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteLogMetricRequest {
pub metric_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteLogMetricRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_metric_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.metric_name = v.into();
self
}
}
impl wkt::message::Message for DeleteLogMetricRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.logging.v2.DeleteLogMetricRequest"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum OperationState {
Unspecified,
Scheduled,
WaitingForPermissions,
Running,
Succeeded,
Failed,
Cancelled,
UnknownValue(operation_state::UnknownValue),
}
#[doc(hidden)]
pub mod operation_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl OperationState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Scheduled => std::option::Option::Some(1),
Self::WaitingForPermissions => std::option::Option::Some(2),
Self::Running => std::option::Option::Some(3),
Self::Succeeded => std::option::Option::Some(4),
Self::Failed => std::option::Option::Some(5),
Self::Cancelled => std::option::Option::Some(6),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("OPERATION_STATE_UNSPECIFIED"),
Self::Scheduled => std::option::Option::Some("OPERATION_STATE_SCHEDULED"),
Self::WaitingForPermissions => {
std::option::Option::Some("OPERATION_STATE_WAITING_FOR_PERMISSIONS")
}
Self::Running => std::option::Option::Some("OPERATION_STATE_RUNNING"),
Self::Succeeded => std::option::Option::Some("OPERATION_STATE_SUCCEEDED"),
Self::Failed => std::option::Option::Some("OPERATION_STATE_FAILED"),
Self::Cancelled => std::option::Option::Some("OPERATION_STATE_CANCELLED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for OperationState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for OperationState {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for OperationState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Scheduled,
2 => Self::WaitingForPermissions,
3 => Self::Running,
4 => Self::Succeeded,
5 => Self::Failed,
6 => Self::Cancelled,
_ => Self::UnknownValue(operation_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for OperationState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"OPERATION_STATE_UNSPECIFIED" => Self::Unspecified,
"OPERATION_STATE_SCHEDULED" => Self::Scheduled,
"OPERATION_STATE_WAITING_FOR_PERMISSIONS" => Self::WaitingForPermissions,
"OPERATION_STATE_RUNNING" => Self::Running,
"OPERATION_STATE_SUCCEEDED" => Self::Succeeded,
"OPERATION_STATE_FAILED" => Self::Failed,
"OPERATION_STATE_CANCELLED" => Self::Cancelled,
_ => Self::UnknownValue(operation_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for OperationState {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Scheduled => serializer.serialize_i32(1),
Self::WaitingForPermissions => serializer.serialize_i32(2),
Self::Running => serializer.serialize_i32(3),
Self::Succeeded => serializer.serialize_i32(4),
Self::Failed => serializer.serialize_i32(5),
Self::Cancelled => serializer.serialize_i32(6),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for OperationState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<OperationState>::new(
".google.logging.v2.OperationState",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum LifecycleState {
Unspecified,
Active,
DeleteRequested,
Updating,
Creating,
Failed,
UnknownValue(lifecycle_state::UnknownValue),
}
#[doc(hidden)]
pub mod lifecycle_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl LifecycleState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Active => std::option::Option::Some(1),
Self::DeleteRequested => std::option::Option::Some(2),
Self::Updating => std::option::Option::Some(3),
Self::Creating => std::option::Option::Some(4),
Self::Failed => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("LIFECYCLE_STATE_UNSPECIFIED"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::DeleteRequested => std::option::Option::Some("DELETE_REQUESTED"),
Self::Updating => std::option::Option::Some("UPDATING"),
Self::Creating => std::option::Option::Some("CREATING"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for LifecycleState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for LifecycleState {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for LifecycleState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Active,
2 => Self::DeleteRequested,
3 => Self::Updating,
4 => Self::Creating,
5 => Self::Failed,
_ => Self::UnknownValue(lifecycle_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for LifecycleState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"LIFECYCLE_STATE_UNSPECIFIED" => Self::Unspecified,
"ACTIVE" => Self::Active,
"DELETE_REQUESTED" => Self::DeleteRequested,
"UPDATING" => Self::Updating,
"CREATING" => Self::Creating,
"FAILED" => Self::Failed,
_ => Self::UnknownValue(lifecycle_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for LifecycleState {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Active => serializer.serialize_i32(1),
Self::DeleteRequested => serializer.serialize_i32(2),
Self::Updating => serializer.serialize_i32(3),
Self::Creating => serializer.serialize_i32(4),
Self::Failed => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for LifecycleState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<LifecycleState>::new(
".google.logging.v2.LifecycleState",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum IndexType {
Unspecified,
String,
Integer,
UnknownValue(index_type::UnknownValue),
}
#[doc(hidden)]
pub mod index_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl IndexType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::String => std::option::Option::Some(1),
Self::Integer => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("INDEX_TYPE_UNSPECIFIED"),
Self::String => std::option::Option::Some("INDEX_TYPE_STRING"),
Self::Integer => std::option::Option::Some("INDEX_TYPE_INTEGER"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for IndexType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for IndexType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for IndexType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::String,
2 => Self::Integer,
_ => Self::UnknownValue(index_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for IndexType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"INDEX_TYPE_UNSPECIFIED" => Self::Unspecified,
"INDEX_TYPE_STRING" => Self::String,
"INDEX_TYPE_INTEGER" => Self::Integer,
_ => Self::UnknownValue(index_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for IndexType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::String => serializer.serialize_i32(1),
Self::Integer => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for IndexType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<IndexType>::new(
".google.logging.v2.IndexType",
))
}
}