#![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_gax;
extern crate google_cloud_longrunning;
extern crate google_cloud_lro;
extern crate google_cloud_rpc;
extern crate google_cloud_type;
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 CreateDataAccessLabelRequest {
pub parent: std::string::String,
pub data_access_label: std::option::Option<crate::model::DataAccessLabel>,
pub data_access_label_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateDataAccessLabelRequest {
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_data_access_label<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataAccessLabel>,
{
self.data_access_label = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_data_access_label<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataAccessLabel>,
{
self.data_access_label = v.map(|x| x.into());
self
}
pub fn set_data_access_label_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.data_access_label_id = v.into();
self
}
}
impl wkt::message::Message for CreateDataAccessLabelRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.CreateDataAccessLabelRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetDataAccessLabelRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetDataAccessLabelRequest {
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 GetDataAccessLabelRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.GetDataAccessLabelRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDataAccessLabelsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDataAccessLabelsRequest {
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_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
}
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 ListDataAccessLabelsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.ListDataAccessLabelsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDataAccessLabelsResponse {
pub data_access_labels: std::vec::Vec<crate::model::DataAccessLabel>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDataAccessLabelsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_data_access_labels<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataAccessLabel>,
{
use std::iter::Iterator;
self.data_access_labels = 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 ListDataAccessLabelsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.ListDataAccessLabelsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListDataAccessLabelsResponse {
type PageItem = crate::model::DataAccessLabel;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.data_access_labels
}
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 UpdateDataAccessLabelRequest {
pub data_access_label: std::option::Option<crate::model::DataAccessLabel>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateDataAccessLabelRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_data_access_label<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataAccessLabel>,
{
self.data_access_label = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_data_access_label<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataAccessLabel>,
{
self.data_access_label = 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 UpdateDataAccessLabelRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.UpdateDataAccessLabelRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteDataAccessLabelRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteDataAccessLabelRequest {
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 DeleteDataAccessLabelRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.DeleteDataAccessLabelRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateDataAccessScopeRequest {
pub parent: std::string::String,
pub data_access_scope: std::option::Option<crate::model::DataAccessScope>,
pub data_access_scope_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateDataAccessScopeRequest {
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_data_access_scope<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataAccessScope>,
{
self.data_access_scope = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_data_access_scope<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataAccessScope>,
{
self.data_access_scope = v.map(|x| x.into());
self
}
pub fn set_data_access_scope_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.data_access_scope_id = v.into();
self
}
}
impl wkt::message::Message for CreateDataAccessScopeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.CreateDataAccessScopeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetDataAccessScopeRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetDataAccessScopeRequest {
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 GetDataAccessScopeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.GetDataAccessScopeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDataAccessScopesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDataAccessScopesRequest {
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_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
}
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 ListDataAccessScopesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.ListDataAccessScopesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDataAccessScopesResponse {
pub data_access_scopes: std::vec::Vec<crate::model::DataAccessScope>,
pub global_data_access_scope_granted: std::option::Option<bool>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDataAccessScopesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_data_access_scopes<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataAccessScope>,
{
use std::iter::Iterator;
self.data_access_scopes = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_global_data_access_scope_granted<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.global_data_access_scope_granted = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_global_data_access_scope_granted<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<bool>,
{
self.global_data_access_scope_granted = v.map(|x| x.into());
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 ListDataAccessScopesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.ListDataAccessScopesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListDataAccessScopesResponse {
type PageItem = crate::model::DataAccessScope;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.data_access_scopes
}
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 UpdateDataAccessScopeRequest {
pub data_access_scope: std::option::Option<crate::model::DataAccessScope>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateDataAccessScopeRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_data_access_scope<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataAccessScope>,
{
self.data_access_scope = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_data_access_scope<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataAccessScope>,
{
self.data_access_scope = 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 UpdateDataAccessScopeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.UpdateDataAccessScopeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteDataAccessScopeRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteDataAccessScopeRequest {
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 DeleteDataAccessScopeRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.DeleteDataAccessScopeRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataAccessLabel {
pub name: std::string::String,
pub display_name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub author: std::string::String,
pub last_editor: std::string::String,
pub description: std::string::String,
pub definition: std::option::Option<crate::model::data_access_label::Definition>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataAccessLabel {
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_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = 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_author<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.author = v.into();
self
}
pub fn set_last_editor<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.last_editor = 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_definition<
T: std::convert::Into<std::option::Option<crate::model::data_access_label::Definition>>,
>(
mut self,
v: T,
) -> Self {
self.definition = v.into();
self
}
pub fn udm_query(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.definition.as_ref().and_then(|v| match v {
crate::model::data_access_label::Definition::UdmQuery(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_udm_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.definition = std::option::Option::Some(
crate::model::data_access_label::Definition::UdmQuery(v.into()),
);
self
}
}
impl wkt::message::Message for DataAccessLabel {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.DataAccessLabel"
}
}
pub mod data_access_label {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Definition {
UdmQuery(std::string::String),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataAccessScope {
pub name: std::string::String,
pub allowed_data_access_labels: std::vec::Vec<crate::model::DataAccessLabelReference>,
pub denied_data_access_labels: std::vec::Vec<crate::model::DataAccessLabelReference>,
pub display_name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub author: std::string::String,
pub last_editor: std::string::String,
pub description: std::string::String,
pub allow_all: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataAccessScope {
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_allowed_data_access_labels<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataAccessLabelReference>,
{
use std::iter::Iterator;
self.allowed_data_access_labels = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_denied_data_access_labels<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataAccessLabelReference>,
{
use std::iter::Iterator;
self.denied_data_access_labels = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = 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_author<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.author = v.into();
self
}
pub fn set_last_editor<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.last_editor = 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_allow_all<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allow_all = v.into();
self
}
}
impl wkt::message::Message for DataAccessScope {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.DataAccessScope"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataAccessLabelReference {
pub display_name: std::string::String,
pub label: std::option::Option<crate::model::data_access_label_reference::Label>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataAccessLabelReference {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_label<
T: std::convert::Into<std::option::Option<crate::model::data_access_label_reference::Label>>,
>(
mut self,
v: T,
) -> Self {
self.label = v.into();
self
}
pub fn data_access_label(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.label.as_ref().and_then(|v| match v {
crate::model::data_access_label_reference::Label::DataAccessLabel(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_data_access_label<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.label = std::option::Option::Some(
crate::model::data_access_label_reference::Label::DataAccessLabel(v.into()),
);
self
}
pub fn log_type(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.label.as_ref().and_then(|v| match v {
crate::model::data_access_label_reference::Label::LogType(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_log_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.label = std::option::Option::Some(
crate::model::data_access_label_reference::Label::LogType(v.into()),
);
self
}
pub fn asset_namespace(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.label.as_ref().and_then(|v| match v {
crate::model::data_access_label_reference::Label::AssetNamespace(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_asset_namespace<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.label = std::option::Option::Some(
crate::model::data_access_label_reference::Label::AssetNamespace(v.into()),
);
self
}
pub fn ingestion_label(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::IngestionLabel>> {
#[allow(unreachable_patterns)]
self.label.as_ref().and_then(|v| match v {
crate::model::data_access_label_reference::Label::IngestionLabel(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_ingestion_label<
T: std::convert::Into<std::boxed::Box<crate::model::IngestionLabel>>,
>(
mut self,
v: T,
) -> Self {
self.label = std::option::Option::Some(
crate::model::data_access_label_reference::Label::IngestionLabel(v.into()),
);
self
}
}
impl wkt::message::Message for DataAccessLabelReference {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.DataAccessLabelReference"
}
}
pub mod data_access_label_reference {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Label {
DataAccessLabel(std::string::String),
LogType(std::string::String),
AssetNamespace(std::string::String),
IngestionLabel(std::boxed::Box<crate::model::IngestionLabel>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IngestionLabel {
pub ingestion_label_key: std::string::String,
pub ingestion_label_value: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl IngestionLabel {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_ingestion_label_key<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.ingestion_label_key = v.into();
self
}
pub fn set_ingestion_label_value<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.ingestion_label_value = v.into();
self
}
}
impl wkt::message::Message for IngestionLabel {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.IngestionLabel"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateDataTableRequest {
pub parent: std::string::String,
pub data_table: std::option::Option<crate::model::DataTable>,
pub data_table_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateDataTableRequest {
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_data_table<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataTable>,
{
self.data_table = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_data_table<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataTable>,
{
self.data_table = v.map(|x| x.into());
self
}
pub fn set_data_table_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.data_table_id = v.into();
self
}
}
impl wkt::message::Message for CreateDataTableRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.CreateDataTableRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetDataTableRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetDataTableRequest {
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 GetDataTableRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.GetDataTableRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateDataTableRequest {
pub data_table: std::option::Option<crate::model::DataTable>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateDataTableRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_data_table<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataTable>,
{
self.data_table = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_data_table<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataTable>,
{
self.data_table = 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 UpdateDataTableRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.UpdateDataTableRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDataTablesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDataTablesRequest {
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_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
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for ListDataTablesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.ListDataTablesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteDataTableRequest {
pub name: std::string::String,
pub force: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteDataTableRequest {
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_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.force = v.into();
self
}
}
impl wkt::message::Message for DeleteDataTableRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.DeleteDataTableRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDataTablesResponse {
pub data_tables: std::vec::Vec<crate::model::DataTable>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDataTablesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_data_tables<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataTable>,
{
use std::iter::Iterator;
self.data_tables = 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 ListDataTablesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.ListDataTablesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListDataTablesResponse {
type PageItem = crate::model::DataTable;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.data_tables
}
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 CreateDataTableRowRequest {
pub parent: std::string::String,
pub data_table_row: std::option::Option<crate::model::DataTableRow>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateDataTableRowRequest {
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_data_table_row<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataTableRow>,
{
self.data_table_row = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_data_table_row<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataTableRow>,
{
self.data_table_row = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateDataTableRowRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.CreateDataTableRowRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateDataTableRowRequest {
pub data_table_row: std::option::Option<crate::model::DataTableRow>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateDataTableRowRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_data_table_row<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataTableRow>,
{
self.data_table_row = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_data_table_row<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataTableRow>,
{
self.data_table_row = 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 UpdateDataTableRowRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.UpdateDataTableRowRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDataTableRowsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub order_by: std::string::String,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDataTableRowsRequest {
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_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
}
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_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
}
impl wkt::message::Message for ListDataTableRowsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.ListDataTableRowsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListDataTableRowsResponse {
pub data_table_rows: std::vec::Vec<crate::model::DataTableRow>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListDataTableRowsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_data_table_rows<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataTableRow>,
{
use std::iter::Iterator;
self.data_table_rows = 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 ListDataTableRowsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.ListDataTableRowsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListDataTableRowsResponse {
type PageItem = crate::model::DataTableRow;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.data_table_rows
}
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 GetDataTableRowRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetDataTableRowRequest {
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 GetDataTableRowRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.GetDataTableRowRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteDataTableRowRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteDataTableRowRequest {
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 DeleteDataTableRowRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.DeleteDataTableRowRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BulkCreateDataTableRowsRequest {
pub parent: std::string::String,
pub requests: std::vec::Vec<crate::model::CreateDataTableRowRequest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BulkCreateDataTableRowsRequest {
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_requests<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CreateDataTableRowRequest>,
{
use std::iter::Iterator;
self.requests = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for BulkCreateDataTableRowsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.BulkCreateDataTableRowsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BulkCreateDataTableRowsResponse {
pub data_table_rows: std::vec::Vec<crate::model::DataTableRow>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BulkCreateDataTableRowsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_data_table_rows<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataTableRow>,
{
use std::iter::Iterator;
self.data_table_rows = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for BulkCreateDataTableRowsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.BulkCreateDataTableRowsResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BulkGetDataTableRowsRequest {
pub parent: std::string::String,
pub requests: std::vec::Vec<crate::model::GetDataTableRowRequest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BulkGetDataTableRowsRequest {
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_requests<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::GetDataTableRowRequest>,
{
use std::iter::Iterator;
self.requests = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for BulkGetDataTableRowsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.BulkGetDataTableRowsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BulkGetDataTableRowsResponse {
pub data_table_rows: std::vec::Vec<crate::model::DataTableRow>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BulkGetDataTableRowsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_data_table_rows<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataTableRow>,
{
use std::iter::Iterator;
self.data_table_rows = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for BulkGetDataTableRowsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.BulkGetDataTableRowsResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BulkReplaceDataTableRowsRequest {
pub parent: std::string::String,
pub requests: std::vec::Vec<crate::model::CreateDataTableRowRequest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BulkReplaceDataTableRowsRequest {
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_requests<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CreateDataTableRowRequest>,
{
use std::iter::Iterator;
self.requests = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for BulkReplaceDataTableRowsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.BulkReplaceDataTableRowsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BulkReplaceDataTableRowsResponse {
pub data_table_rows: std::vec::Vec<crate::model::DataTableRow>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BulkReplaceDataTableRowsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_data_table_rows<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataTableRow>,
{
use std::iter::Iterator;
self.data_table_rows = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for BulkReplaceDataTableRowsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.BulkReplaceDataTableRowsResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BulkUpdateDataTableRowsRequest {
pub parent: std::string::String,
pub requests: std::vec::Vec<crate::model::UpdateDataTableRowRequest>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BulkUpdateDataTableRowsRequest {
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_requests<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::UpdateDataTableRowRequest>,
{
use std::iter::Iterator;
self.requests = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for BulkUpdateDataTableRowsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.BulkUpdateDataTableRowsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BulkUpdateDataTableRowsResponse {
pub data_table_rows: std::vec::Vec<crate::model::DataTableRow>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BulkUpdateDataTableRowsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_data_table_rows<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataTableRow>,
{
use std::iter::Iterator;
self.data_table_rows = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for BulkUpdateDataTableRowsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.BulkUpdateDataTableRowsResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataTableScopeInfo {
pub data_access_scopes: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataTableScopeInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_data_access_scopes<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.data_access_scopes = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for DataTableScopeInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.DataTableScopeInfo"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataTable {
pub name: std::string::String,
pub display_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 column_info: std::vec::Vec<crate::model::DataTableColumnInfo>,
pub data_table_uuid: std::string::String,
pub rules: std::vec::Vec<std::string::String>,
pub rule_associations_count: i32,
pub row_time_to_live: std::string::String,
pub approximate_row_count: i64,
pub scope_info: std::option::Option<crate::model::DataTableScopeInfo>,
pub update_source: crate::model::DataTableUpdateSource,
pub row_time_to_live_update_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataTable {
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_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_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_column_info<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::DataTableColumnInfo>,
{
use std::iter::Iterator;
self.column_info = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_data_table_uuid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.data_table_uuid = v.into();
self
}
pub fn set_rules<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.rules = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_rule_associations_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.rule_associations_count = v.into();
self
}
pub fn set_row_time_to_live<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.row_time_to_live = v.into();
self
}
pub fn set_approximate_row_count<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.approximate_row_count = v.into();
self
}
pub fn set_scope_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DataTableScopeInfo>,
{
self.scope_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_scope_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DataTableScopeInfo>,
{
self.scope_info = v.map(|x| x.into());
self
}
pub fn set_update_source<T: std::convert::Into<crate::model::DataTableUpdateSource>>(
mut self,
v: T,
) -> Self {
self.update_source = v.into();
self
}
pub fn set_row_time_to_live_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.row_time_to_live_update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_row_time_to_live_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.row_time_to_live_update_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DataTable {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.DataTable"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataTableRow {
pub name: std::string::String,
pub values: std::vec::Vec<std::string::String>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub row_time_to_live: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataTableRow {
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_values<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.values = v.into_iter().map(|i| i.into()).collect();
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_row_time_to_live<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.row_time_to_live = v.into();
self
}
}
impl wkt::message::Message for DataTableRow {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.DataTableRow"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataTableColumnInfo {
pub column_index: i32,
pub original_column: std::string::String,
pub key_column: bool,
pub repeated_values: bool,
#[allow(missing_docs)]
pub path_or_type: std::option::Option<crate::model::data_table_column_info::PathOrType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataTableColumnInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_column_index<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.column_index = v.into();
self
}
pub fn set_original_column<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.original_column = v.into();
self
}
pub fn set_key_column<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.key_column = v.into();
self
}
pub fn set_repeated_values<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.repeated_values = v.into();
self
}
pub fn set_path_or_type<
T: std::convert::Into<std::option::Option<crate::model::data_table_column_info::PathOrType>>,
>(
mut self,
v: T,
) -> Self {
self.path_or_type = v.into();
self
}
pub fn mapped_column_path(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.path_or_type.as_ref().and_then(|v| match v {
crate::model::data_table_column_info::PathOrType::MappedColumnPath(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_mapped_column_path<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.path_or_type = std::option::Option::Some(
crate::model::data_table_column_info::PathOrType::MappedColumnPath(v.into()),
);
self
}
pub fn column_type(
&self,
) -> std::option::Option<&crate::model::data_table_column_info::DataTableColumnType> {
#[allow(unreachable_patterns)]
self.path_or_type.as_ref().and_then(|v| match v {
crate::model::data_table_column_info::PathOrType::ColumnType(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_column_type<
T: std::convert::Into<crate::model::data_table_column_info::DataTableColumnType>,
>(
mut self,
v: T,
) -> Self {
self.path_or_type = std::option::Option::Some(
crate::model::data_table_column_info::PathOrType::ColumnType(v.into()),
);
self
}
}
impl wkt::message::Message for DataTableColumnInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.DataTableColumnInfo"
}
}
pub mod data_table_column_info {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DataTableColumnType {
Unspecified,
String,
Regex,
Cidr,
Number,
UnknownValue(data_table_column_type::UnknownValue),
}
#[doc(hidden)]
pub mod data_table_column_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DataTableColumnType {
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::Regex => std::option::Option::Some(2),
Self::Cidr => std::option::Option::Some(3),
Self::Number => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("DATA_TABLE_COLUMN_TYPE_UNSPECIFIED")
}
Self::String => std::option::Option::Some("STRING"),
Self::Regex => std::option::Option::Some("REGEX"),
Self::Cidr => std::option::Option::Some("CIDR"),
Self::Number => std::option::Option::Some("NUMBER"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DataTableColumnType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DataTableColumnType {
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 DataTableColumnType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::String,
2 => Self::Regex,
3 => Self::Cidr,
4 => Self::Number,
_ => Self::UnknownValue(data_table_column_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DataTableColumnType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DATA_TABLE_COLUMN_TYPE_UNSPECIFIED" => Self::Unspecified,
"STRING" => Self::String,
"REGEX" => Self::Regex,
"CIDR" => Self::Cidr,
"NUMBER" => Self::Number,
_ => Self::UnknownValue(data_table_column_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DataTableColumnType {
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::Regex => serializer.serialize_i32(2),
Self::Cidr => serializer.serialize_i32(3),
Self::Number => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DataTableColumnType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataTableColumnType>::new(
".google.cloud.chronicle.v1.DataTableColumnInfo.DataTableColumnType",
))
}
}
#[allow(missing_docs)]
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PathOrType {
MappedColumnPath(std::string::String),
ColumnType(crate::model::data_table_column_info::DataTableColumnType),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetDataTableOperationErrorsRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetDataTableOperationErrorsRequest {
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 GetDataTableOperationErrorsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.GetDataTableOperationErrorsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DataTableOperationErrors {
pub name: std::string::String,
pub rpc_errors: std::vec::Vec<google_cloud_rpc::model::Status>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DataTableOperationErrors {
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_rpc_errors<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<google_cloud_rpc::model::Status>,
{
use std::iter::Iterator;
self.rpc_errors = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for DataTableOperationErrors {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.DataTableOperationErrors"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Watchlist {
pub name: std::string::String,
pub display_name: std::string::String,
pub description: std::string::String,
pub multiplying_factor: f32,
pub entity_population_mechanism:
std::option::Option<crate::model::watchlist::EntityPopulationMechanism>,
pub entity_count: std::option::Option<crate::model::watchlist::EntityCount>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub watchlist_user_preferences: std::option::Option<crate::model::WatchlistUserPreferences>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Watchlist {
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_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_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_multiplying_factor<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.multiplying_factor = v.into();
self
}
pub fn set_entity_population_mechanism<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::watchlist::EntityPopulationMechanism>,
{
self.entity_population_mechanism = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_entity_population_mechanism<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::watchlist::EntityPopulationMechanism>,
{
self.entity_population_mechanism = v.map(|x| x.into());
self
}
pub fn set_entity_count<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::watchlist::EntityCount>,
{
self.entity_count = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_entity_count<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::watchlist::EntityCount>,
{
self.entity_count = 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
}
pub fn set_watchlist_user_preferences<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::WatchlistUserPreferences>,
{
self.watchlist_user_preferences = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_watchlist_user_preferences<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::WatchlistUserPreferences>,
{
self.watchlist_user_preferences = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Watchlist {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.Watchlist"
}
}
pub mod watchlist {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EntityPopulationMechanism {
pub mechanism:
std::option::Option<crate::model::watchlist::entity_population_mechanism::Mechanism>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EntityPopulationMechanism {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_mechanism<
T: std::convert::Into<
std::option::Option<
crate::model::watchlist::entity_population_mechanism::Mechanism,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.mechanism = v.into();
self
}
pub fn manual(
&self,
) -> std::option::Option<
&std::boxed::Box<crate::model::watchlist::entity_population_mechanism::Manual>,
> {
#[allow(unreachable_patterns)]
self.mechanism.as_ref().and_then(|v| match v {
crate::model::watchlist::entity_population_mechanism::Mechanism::Manual(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_manual<
T: std::convert::Into<
std::boxed::Box<crate::model::watchlist::entity_population_mechanism::Manual>,
>,
>(
mut self,
v: T,
) -> Self {
self.mechanism = std::option::Option::Some(
crate::model::watchlist::entity_population_mechanism::Mechanism::Manual(v.into()),
);
self
}
}
impl wkt::message::Message for EntityPopulationMechanism {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.Watchlist.EntityPopulationMechanism"
}
}
pub mod entity_population_mechanism {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Manual {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Manual {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for Manual {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.Watchlist.EntityPopulationMechanism.Manual"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Mechanism {
Manual(std::boxed::Box<crate::model::watchlist::entity_population_mechanism::Manual>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EntityCount {
pub user: i32,
pub asset: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EntityCount {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_user<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.user = v.into();
self
}
pub fn set_asset<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.asset = v.into();
self
}
}
impl wkt::message::Message for EntityCount {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.Watchlist.EntityCount"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WatchlistUserPreferences {
pub pinned: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl WatchlistUserPreferences {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_pinned<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.pinned = v.into();
self
}
}
impl wkt::message::Message for WatchlistUserPreferences {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.WatchlistUserPreferences"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetWatchlistRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetWatchlistRequest {
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 GetWatchlistRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.GetWatchlistRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListWatchlistsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListWatchlistsRequest {
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_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
}
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 ListWatchlistsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.ListWatchlistsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListWatchlistsResponse {
pub watchlists: std::vec::Vec<crate::model::Watchlist>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListWatchlistsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_watchlists<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Watchlist>,
{
use std::iter::Iterator;
self.watchlists = 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 ListWatchlistsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.ListWatchlistsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListWatchlistsResponse {
type PageItem = crate::model::Watchlist;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.watchlists
}
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 CreateWatchlistRequest {
pub parent: std::string::String,
pub watchlist_id: std::string::String,
pub watchlist: std::option::Option<crate::model::Watchlist>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateWatchlistRequest {
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_watchlist_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.watchlist_id = v.into();
self
}
pub fn set_watchlist<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Watchlist>,
{
self.watchlist = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_watchlist<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Watchlist>,
{
self.watchlist = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateWatchlistRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.CreateWatchlistRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateWatchlistRequest {
pub watchlist: std::option::Option<crate::model::Watchlist>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateWatchlistRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_watchlist<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Watchlist>,
{
self.watchlist = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_watchlist<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Watchlist>,
{
self.watchlist = 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 UpdateWatchlistRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.UpdateWatchlistRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteWatchlistRequest {
pub name: std::string::String,
pub force: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteWatchlistRequest {
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_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.force = v.into();
self
}
}
impl wkt::message::Message for DeleteWatchlistRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.DeleteWatchlistRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Instance {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Instance {
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 Instance {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.Instance"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetInstanceRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetInstanceRequest {
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 GetInstanceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.GetInstanceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ScopeInfo {
pub reference_list_scope: std::option::Option<crate::model::ReferenceListScope>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ScopeInfo {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_reference_list_scope<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ReferenceListScope>,
{
self.reference_list_scope = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_reference_list_scope<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ReferenceListScope>,
{
self.reference_list_scope = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ScopeInfo {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.ScopeInfo"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReferenceListScope {
pub scope_names: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReferenceListScope {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_scope_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.scope_names = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ReferenceListScope {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.ReferenceListScope"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetReferenceListRequest {
pub name: std::string::String,
pub view: crate::model::ReferenceListView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetReferenceListRequest {
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: std::convert::Into<crate::model::ReferenceListView>>(
mut self,
v: T,
) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for GetReferenceListRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.GetReferenceListRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListReferenceListsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub view: crate::model::ReferenceListView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListReferenceListsRequest {
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_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
}
pub fn set_view<T: std::convert::Into<crate::model::ReferenceListView>>(
mut self,
v: T,
) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for ListReferenceListsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.ListReferenceListsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListReferenceListsResponse {
pub reference_lists: std::vec::Vec<crate::model::ReferenceList>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListReferenceListsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_reference_lists<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ReferenceList>,
{
use std::iter::Iterator;
self.reference_lists = 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 ListReferenceListsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.ListReferenceListsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListReferenceListsResponse {
type PageItem = crate::model::ReferenceList;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.reference_lists
}
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 CreateReferenceListRequest {
pub parent: std::string::String,
pub reference_list: std::option::Option<crate::model::ReferenceList>,
pub reference_list_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateReferenceListRequest {
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_reference_list<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ReferenceList>,
{
self.reference_list = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_reference_list<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ReferenceList>,
{
self.reference_list = v.map(|x| x.into());
self
}
pub fn set_reference_list_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.reference_list_id = v.into();
self
}
}
impl wkt::message::Message for CreateReferenceListRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.CreateReferenceListRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateReferenceListRequest {
pub reference_list: std::option::Option<crate::model::ReferenceList>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateReferenceListRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_reference_list<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ReferenceList>,
{
self.reference_list = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_reference_list<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ReferenceList>,
{
self.reference_list = 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 UpdateReferenceListRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.UpdateReferenceListRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReferenceList {
pub name: std::string::String,
pub display_name: std::string::String,
pub revision_create_time: std::option::Option<wkt::Timestamp>,
pub description: std::string::String,
pub entries: std::vec::Vec<crate::model::ReferenceListEntry>,
pub rules: std::vec::Vec<std::string::String>,
pub syntax_type: crate::model::ReferenceListSyntaxType,
pub rule_associations_count: i32,
pub scope_info: std::option::Option<crate::model::ScopeInfo>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReferenceList {
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_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_revision_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.revision_create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_revision_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.revision_create_time = v.map(|x| x.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_entries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ReferenceListEntry>,
{
use std::iter::Iterator;
self.entries = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_rules<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.rules = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_syntax_type<T: std::convert::Into<crate::model::ReferenceListSyntaxType>>(
mut self,
v: T,
) -> Self {
self.syntax_type = v.into();
self
}
pub fn set_rule_associations_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.rule_associations_count = v.into();
self
}
pub fn set_scope_info<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ScopeInfo>,
{
self.scope_info = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_scope_info<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ScopeInfo>,
{
self.scope_info = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ReferenceList {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.ReferenceList"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReferenceListEntry {
pub value: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReferenceListEntry {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.value = v.into();
self
}
}
impl wkt::message::Message for ReferenceListEntry {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.ReferenceListEntry"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Rule {
pub name: std::string::String,
pub revision_id: std::string::String,
pub display_name: std::string::String,
pub text: std::string::String,
pub author: std::string::String,
pub severity: std::option::Option<crate::model::Severity>,
pub metadata: std::collections::HashMap<std::string::String, std::string::String>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub revision_create_time: std::option::Option<wkt::Timestamp>,
pub compilation_state: crate::model::rule::CompilationState,
pub r#type: crate::model::RuleType,
pub reference_lists: std::vec::Vec<std::string::String>,
pub allowed_run_frequencies: std::vec::Vec<crate::model::RunFrequency>,
pub etag: std::string::String,
pub scope: std::string::String,
pub compilation_diagnostics: std::vec::Vec<crate::model::CompilationDiagnostic>,
pub near_real_time_live_rule_eligible: bool,
pub inputs_used: std::option::Option<crate::model::InputsUsed>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Rule {
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_revision_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.revision_id = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.text = v.into();
self
}
pub fn set_author<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.author = v.into();
self
}
pub fn set_severity<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Severity>,
{
self.severity = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_severity<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Severity>,
{
self.severity = v.map(|x| x.into());
self
}
pub fn set_metadata<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.metadata = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
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_revision_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.revision_create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_revision_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.revision_create_time = v.map(|x| x.into());
self
}
pub fn set_compilation_state<T: std::convert::Into<crate::model::rule::CompilationState>>(
mut self,
v: T,
) -> Self {
self.compilation_state = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::RuleType>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_reference_lists<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.reference_lists = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_allowed_run_frequencies<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::RunFrequency>,
{
use std::iter::Iterator;
self.allowed_run_frequencies = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_scope<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.scope = v.into();
self
}
pub fn set_compilation_diagnostics<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CompilationDiagnostic>,
{
use std::iter::Iterator;
self.compilation_diagnostics = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_near_real_time_live_rule_eligible<T: std::convert::Into<bool>>(
mut self,
v: T,
) -> Self {
self.near_real_time_live_rule_eligible = v.into();
self
}
pub fn set_inputs_used<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::InputsUsed>,
{
self.inputs_used = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_inputs_used<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::InputsUsed>,
{
self.inputs_used = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Rule {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.Rule"
}
}
pub mod rule {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CompilationState {
Unspecified,
Succeeded,
Failed,
UnknownValue(compilation_state::UnknownValue),
}
#[doc(hidden)]
pub mod compilation_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl CompilationState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Succeeded => std::option::Option::Some(1),
Self::Failed => 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("COMPILATION_STATE_UNSPECIFIED"),
Self::Succeeded => std::option::Option::Some("SUCCEEDED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for CompilationState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for CompilationState {
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 CompilationState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Succeeded,
2 => Self::Failed,
_ => Self::UnknownValue(compilation_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for CompilationState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"COMPILATION_STATE_UNSPECIFIED" => Self::Unspecified,
"SUCCEEDED" => Self::Succeeded,
"FAILED" => Self::Failed,
_ => Self::UnknownValue(compilation_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for CompilationState {
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::Succeeded => serializer.serialize_i32(1),
Self::Failed => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for CompilationState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<CompilationState>::new(
".google.cloud.chronicle.v1.Rule.CompilationState",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RuleDeployment {
pub name: std::string::String,
pub enabled: bool,
pub alerting: bool,
pub archived: bool,
pub archive_time: std::option::Option<wkt::Timestamp>,
pub run_frequency: crate::model::RunFrequency,
pub execution_state: crate::model::rule_deployment::ExecutionState,
pub producer_rules: std::vec::Vec<std::string::String>,
pub consumer_rules: std::vec::Vec<std::string::String>,
pub last_alert_status_change_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RuleDeployment {
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_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.enabled = v.into();
self
}
pub fn set_alerting<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.alerting = v.into();
self
}
pub fn set_archived<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.archived = v.into();
self
}
pub fn set_archive_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.archive_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_archive_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.archive_time = v.map(|x| x.into());
self
}
pub fn set_run_frequency<T: std::convert::Into<crate::model::RunFrequency>>(
mut self,
v: T,
) -> Self {
self.run_frequency = v.into();
self
}
pub fn set_execution_state<
T: std::convert::Into<crate::model::rule_deployment::ExecutionState>,
>(
mut self,
v: T,
) -> Self {
self.execution_state = v.into();
self
}
pub fn set_producer_rules<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.producer_rules = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_consumer_rules<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.consumer_rules = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_last_alert_status_change_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.last_alert_status_change_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_last_alert_status_change_time<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.last_alert_status_change_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for RuleDeployment {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.RuleDeployment"
}
}
pub mod rule_deployment {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ExecutionState {
Unspecified,
Default,
Limited,
Paused,
UnknownValue(execution_state::UnknownValue),
}
#[doc(hidden)]
pub mod execution_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ExecutionState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Default => std::option::Option::Some(1),
Self::Limited => std::option::Option::Some(2),
Self::Paused => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("EXECUTION_STATE_UNSPECIFIED"),
Self::Default => std::option::Option::Some("DEFAULT"),
Self::Limited => std::option::Option::Some("LIMITED"),
Self::Paused => std::option::Option::Some("PAUSED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ExecutionState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ExecutionState {
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 ExecutionState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Default,
2 => Self::Limited,
3 => Self::Paused,
_ => Self::UnknownValue(execution_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ExecutionState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"EXECUTION_STATE_UNSPECIFIED" => Self::Unspecified,
"DEFAULT" => Self::Default,
"LIMITED" => Self::Limited,
"PAUSED" => Self::Paused,
_ => Self::UnknownValue(execution_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ExecutionState {
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::Default => serializer.serialize_i32(1),
Self::Limited => serializer.serialize_i32(2),
Self::Paused => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ExecutionState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ExecutionState>::new(
".google.cloud.chronicle.v1.RuleDeployment.ExecutionState",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Retrohunt {
pub name: std::string::String,
pub process_interval: std::option::Option<google_cloud_type::model::Interval>,
pub execution_interval: std::option::Option<google_cloud_type::model::Interval>,
pub state: crate::model::retrohunt::State,
pub progress_percentage: f32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Retrohunt {
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_process_interval<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::Interval>,
{
self.process_interval = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_process_interval<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::Interval>,
{
self.process_interval = v.map(|x| x.into());
self
}
pub fn set_execution_interval<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::Interval>,
{
self.execution_interval = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_execution_interval<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::Interval>,
{
self.execution_interval = v.map(|x| x.into());
self
}
pub fn set_state<T: std::convert::Into<crate::model::retrohunt::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_progress_percentage<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.progress_percentage = v.into();
self
}
}
impl wkt::message::Message for Retrohunt {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.Retrohunt"
}
}
pub mod retrohunt {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Running,
Done,
Cancelled,
Failed,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Running => std::option::Option::Some(1),
Self::Done => std::option::Option::Some(2),
Self::Cancelled => std::option::Option::Some(3),
Self::Failed => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Running => std::option::Option::Some("RUNNING"),
Self::Done => std::option::Option::Some("DONE"),
Self::Cancelled => std::option::Option::Some("CANCELLED"),
Self::Failed => std::option::Option::Some("FAILED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
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 State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Running,
2 => Self::Done,
3 => Self::Cancelled,
4 => Self::Failed,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"RUNNING" => Self::Running,
"DONE" => Self::Done,
"CANCELLED" => Self::Cancelled,
"FAILED" => Self::Failed,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
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::Running => serializer.serialize_i32(1),
Self::Done => serializer.serialize_i32(2),
Self::Cancelled => serializer.serialize_i32(3),
Self::Failed => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.chronicle.v1.Retrohunt.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateRuleRequest {
pub parent: std::string::String,
pub rule: std::option::Option<crate::model::Rule>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateRuleRequest {
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_rule<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Rule>,
{
self.rule = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Rule>,
{
self.rule = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateRuleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.CreateRuleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetRuleRequest {
pub name: std::string::String,
pub view: crate::model::RuleView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetRuleRequest {
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: std::convert::Into<crate::model::RuleView>>(mut self, v: T) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for GetRuleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.GetRuleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRulesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub view: crate::model::RuleView,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRulesRequest {
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_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
}
pub fn set_view<T: std::convert::Into<crate::model::RuleView>>(mut self, v: T) -> Self {
self.view = v.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 ListRulesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.ListRulesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRulesResponse {
pub rules: std::vec::Vec<crate::model::Rule>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRulesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Rule>,
{
use std::iter::Iterator;
self.rules = 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 ListRulesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.ListRulesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListRulesResponse {
type PageItem = crate::model::Rule;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.rules
}
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 UpdateRuleRequest {
pub rule: std::option::Option<crate::model::Rule>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateRuleRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rule<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Rule>,
{
self.rule = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_rule<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Rule>,
{
self.rule = 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 UpdateRuleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.UpdateRuleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteRuleRequest {
pub name: std::string::String,
pub force: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteRuleRequest {
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_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.force = v.into();
self
}
}
impl wkt::message::Message for DeleteRuleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.DeleteRuleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRuleRevisionsRequest {
pub name: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub view: crate::model::RuleView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRuleRevisionsRequest {
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_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
}
pub fn set_view<T: std::convert::Into<crate::model::RuleView>>(mut self, v: T) -> Self {
self.view = v.into();
self
}
}
impl wkt::message::Message for ListRuleRevisionsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.ListRuleRevisionsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRuleRevisionsResponse {
pub rules: std::vec::Vec<crate::model::Rule>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRuleRevisionsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rules<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Rule>,
{
use std::iter::Iterator;
self.rules = 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 ListRuleRevisionsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.ListRuleRevisionsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListRuleRevisionsResponse {
type PageItem = crate::model::Rule;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.rules
}
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 CreateRetrohuntRequest {
pub parent: std::string::String,
pub retrohunt: std::option::Option<crate::model::Retrohunt>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateRetrohuntRequest {
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_retrohunt<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Retrohunt>,
{
self.retrohunt = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_retrohunt<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Retrohunt>,
{
self.retrohunt = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateRetrohuntRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.CreateRetrohuntRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetRetrohuntRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetRetrohuntRequest {
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 GetRetrohuntRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.GetRetrohuntRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRetrohuntsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRetrohuntsRequest {
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_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
}
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 ListRetrohuntsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.ListRetrohuntsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRetrohuntsResponse {
pub retrohunts: std::vec::Vec<crate::model::Retrohunt>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRetrohuntsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_retrohunts<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Retrohunt>,
{
use std::iter::Iterator;
self.retrohunts = 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 ListRetrohuntsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.ListRetrohuntsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListRetrohuntsResponse {
type PageItem = crate::model::Retrohunt;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.retrohunts
}
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 GetRuleDeploymentRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetRuleDeploymentRequest {
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 GetRuleDeploymentRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.GetRuleDeploymentRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRuleDeploymentsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRuleDeploymentsRequest {
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_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
}
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 ListRuleDeploymentsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.ListRuleDeploymentsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRuleDeploymentsResponse {
pub rule_deployments: std::vec::Vec<crate::model::RuleDeployment>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRuleDeploymentsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rule_deployments<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::RuleDeployment>,
{
use std::iter::Iterator;
self.rule_deployments = 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 ListRuleDeploymentsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.ListRuleDeploymentsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListRuleDeploymentsResponse {
type PageItem = crate::model::RuleDeployment;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.rule_deployments
}
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 UpdateRuleDeploymentRequest {
pub rule_deployment: std::option::Option<crate::model::RuleDeployment>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateRuleDeploymentRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_rule_deployment<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::RuleDeployment>,
{
self.rule_deployment = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_rule_deployment<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::RuleDeployment>,
{
self.rule_deployment = 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 UpdateRuleDeploymentRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.UpdateRuleDeploymentRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CompilationPosition {
pub start_line: i32,
pub start_column: i32,
pub end_line: i32,
pub end_column: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CompilationPosition {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_start_line<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.start_line = v.into();
self
}
pub fn set_start_column<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.start_column = v.into();
self
}
pub fn set_end_line<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.end_line = v.into();
self
}
pub fn set_end_column<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.end_column = v.into();
self
}
}
impl wkt::message::Message for CompilationPosition {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.CompilationPosition"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CompilationDiagnostic {
pub message: std::string::String,
pub position: std::option::Option<crate::model::CompilationPosition>,
pub severity: crate::model::compilation_diagnostic::Severity,
pub uri: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CompilationDiagnostic {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
pub fn set_position<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CompilationPosition>,
{
self.position = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_position<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CompilationPosition>,
{
self.position = v.map(|x| x.into());
self
}
pub fn set_severity<T: std::convert::Into<crate::model::compilation_diagnostic::Severity>>(
mut self,
v: T,
) -> Self {
self.severity = v.into();
self
}
pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uri = v.into();
self
}
}
impl wkt::message::Message for CompilationDiagnostic {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.CompilationDiagnostic"
}
}
pub mod compilation_diagnostic {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Severity {
Unspecified,
Warning,
Error,
UnknownValue(severity::UnknownValue),
}
#[doc(hidden)]
pub mod severity {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Severity {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Warning => std::option::Option::Some(1),
Self::Error => 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("SEVERITY_UNSPECIFIED"),
Self::Warning => std::option::Option::Some("WARNING"),
Self::Error => std::option::Option::Some("ERROR"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Severity {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Severity {
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 Severity {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Warning,
2 => Self::Error,
_ => Self::UnknownValue(severity::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Severity {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SEVERITY_UNSPECIFIED" => Self::Unspecified,
"WARNING" => Self::Warning,
"ERROR" => Self::Error,
_ => Self::UnknownValue(severity::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Severity {
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::Warning => serializer.serialize_i32(1),
Self::Error => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Severity {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
".google.cloud.chronicle.v1.CompilationDiagnostic.Severity",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Severity {
pub display_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Severity {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
}
impl wkt::message::Message for Severity {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.Severity"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RetrohuntMetadata {
pub retrohunt: std::string::String,
pub execution_interval: std::option::Option<google_cloud_type::model::Interval>,
pub progress_percentage: f32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RetrohuntMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_retrohunt<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.retrohunt = v.into();
self
}
pub fn set_execution_interval<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::Interval>,
{
self.execution_interval = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_execution_interval<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::Interval>,
{
self.execution_interval = v.map(|x| x.into());
self
}
pub fn set_progress_percentage<T: std::convert::Into<f32>>(mut self, v: T) -> Self {
self.progress_percentage = v.into();
self
}
}
impl wkt::message::Message for RetrohuntMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.RetrohuntMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct InputsUsed {
pub uses_udm: bool,
pub uses_entity: bool,
pub uses_detection: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl InputsUsed {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_uses_udm<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.uses_udm = v.into();
self
}
pub fn set_uses_entity<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.uses_entity = v.into();
self
}
pub fn set_uses_detection<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.uses_detection = v.into();
self
}
}
impl wkt::message::Message for InputsUsed {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.chronicle.v1.InputsUsed"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DataTableUpdateSource {
Unspecified,
User,
Rule,
Search,
UnknownValue(data_table_update_source::UnknownValue),
}
#[doc(hidden)]
pub mod data_table_update_source {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DataTableUpdateSource {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::User => std::option::Option::Some(1),
Self::Rule => std::option::Option::Some(2),
Self::Search => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("DATA_TABLE_UPDATE_SOURCE_UNSPECIFIED"),
Self::User => std::option::Option::Some("USER"),
Self::Rule => std::option::Option::Some("RULE"),
Self::Search => std::option::Option::Some("SEARCH"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DataTableUpdateSource {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DataTableUpdateSource {
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 DataTableUpdateSource {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::User,
2 => Self::Rule,
3 => Self::Search,
_ => Self::UnknownValue(data_table_update_source::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DataTableUpdateSource {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DATA_TABLE_UPDATE_SOURCE_UNSPECIFIED" => Self::Unspecified,
"USER" => Self::User,
"RULE" => Self::Rule,
"SEARCH" => Self::Search,
_ => Self::UnknownValue(data_table_update_source::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DataTableUpdateSource {
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::User => serializer.serialize_i32(1),
Self::Rule => serializer.serialize_i32(2),
Self::Search => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DataTableUpdateSource {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DataTableUpdateSource>::new(
".google.cloud.chronicle.v1.DataTableUpdateSource",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ReferenceListSyntaxType {
Unspecified,
PlainTextString,
Regex,
Cidr,
UnknownValue(reference_list_syntax_type::UnknownValue),
}
#[doc(hidden)]
pub mod reference_list_syntax_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ReferenceListSyntaxType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::PlainTextString => std::option::Option::Some(1),
Self::Regex => std::option::Option::Some(2),
Self::Cidr => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("REFERENCE_LIST_SYNTAX_TYPE_UNSPECIFIED")
}
Self::PlainTextString => {
std::option::Option::Some("REFERENCE_LIST_SYNTAX_TYPE_PLAIN_TEXT_STRING")
}
Self::Regex => std::option::Option::Some("REFERENCE_LIST_SYNTAX_TYPE_REGEX"),
Self::Cidr => std::option::Option::Some("REFERENCE_LIST_SYNTAX_TYPE_CIDR"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ReferenceListSyntaxType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ReferenceListSyntaxType {
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 ReferenceListSyntaxType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::PlainTextString,
2 => Self::Regex,
3 => Self::Cidr,
_ => Self::UnknownValue(reference_list_syntax_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ReferenceListSyntaxType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"REFERENCE_LIST_SYNTAX_TYPE_UNSPECIFIED" => Self::Unspecified,
"REFERENCE_LIST_SYNTAX_TYPE_PLAIN_TEXT_STRING" => Self::PlainTextString,
"REFERENCE_LIST_SYNTAX_TYPE_REGEX" => Self::Regex,
"REFERENCE_LIST_SYNTAX_TYPE_CIDR" => Self::Cidr,
_ => Self::UnknownValue(reference_list_syntax_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ReferenceListSyntaxType {
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::PlainTextString => serializer.serialize_i32(1),
Self::Regex => serializer.serialize_i32(2),
Self::Cidr => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ReferenceListSyntaxType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReferenceListSyntaxType>::new(
".google.cloud.chronicle.v1.ReferenceListSyntaxType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ReferenceListView {
Unspecified,
Basic,
Full,
UnknownValue(reference_list_view::UnknownValue),
}
#[doc(hidden)]
pub mod reference_list_view {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ReferenceListView {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Basic => std::option::Option::Some(1),
Self::Full => 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("REFERENCE_LIST_VIEW_UNSPECIFIED"),
Self::Basic => std::option::Option::Some("REFERENCE_LIST_VIEW_BASIC"),
Self::Full => std::option::Option::Some("REFERENCE_LIST_VIEW_FULL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ReferenceListView {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ReferenceListView {
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 ReferenceListView {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Basic,
2 => Self::Full,
_ => Self::UnknownValue(reference_list_view::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ReferenceListView {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"REFERENCE_LIST_VIEW_UNSPECIFIED" => Self::Unspecified,
"REFERENCE_LIST_VIEW_BASIC" => Self::Basic,
"REFERENCE_LIST_VIEW_FULL" => Self::Full,
_ => Self::UnknownValue(reference_list_view::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ReferenceListView {
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::Basic => serializer.serialize_i32(1),
Self::Full => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ReferenceListView {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ReferenceListView>::new(
".google.cloud.chronicle.v1.ReferenceListView",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RunFrequency {
Unspecified,
Live,
Hourly,
Daily,
UnknownValue(run_frequency::UnknownValue),
}
#[doc(hidden)]
pub mod run_frequency {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RunFrequency {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Live => std::option::Option::Some(1),
Self::Hourly => std::option::Option::Some(2),
Self::Daily => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("RUN_FREQUENCY_UNSPECIFIED"),
Self::Live => std::option::Option::Some("LIVE"),
Self::Hourly => std::option::Option::Some("HOURLY"),
Self::Daily => std::option::Option::Some("DAILY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RunFrequency {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RunFrequency {
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 RunFrequency {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Live,
2 => Self::Hourly,
3 => Self::Daily,
_ => Self::UnknownValue(run_frequency::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RunFrequency {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"RUN_FREQUENCY_UNSPECIFIED" => Self::Unspecified,
"LIVE" => Self::Live,
"HOURLY" => Self::Hourly,
"DAILY" => Self::Daily,
_ => Self::UnknownValue(run_frequency::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RunFrequency {
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::Live => serializer.serialize_i32(1),
Self::Hourly => serializer.serialize_i32(2),
Self::Daily => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RunFrequency {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RunFrequency>::new(
".google.cloud.chronicle.v1.RunFrequency",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RuleType {
Unspecified,
SingleEvent,
MultiEvent,
UnknownValue(rule_type::UnknownValue),
}
#[doc(hidden)]
pub mod rule_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RuleType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::SingleEvent => std::option::Option::Some(1),
Self::MultiEvent => 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("RULE_TYPE_UNSPECIFIED"),
Self::SingleEvent => std::option::Option::Some("SINGLE_EVENT"),
Self::MultiEvent => std::option::Option::Some("MULTI_EVENT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RuleType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RuleType {
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 RuleType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::SingleEvent,
2 => Self::MultiEvent,
_ => Self::UnknownValue(rule_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RuleType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"RULE_TYPE_UNSPECIFIED" => Self::Unspecified,
"SINGLE_EVENT" => Self::SingleEvent,
"MULTI_EVENT" => Self::MultiEvent,
_ => Self::UnknownValue(rule_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RuleType {
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::SingleEvent => serializer.serialize_i32(1),
Self::MultiEvent => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RuleType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RuleType>::new(
".google.cloud.chronicle.v1.RuleType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RuleView {
Unspecified,
Basic,
Full,
RevisionMetadataOnly,
UnknownValue(rule_view::UnknownValue),
}
#[doc(hidden)]
pub mod rule_view {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RuleView {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Basic => std::option::Option::Some(1),
Self::Full => std::option::Option::Some(2),
Self::RevisionMetadataOnly => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("RULE_VIEW_UNSPECIFIED"),
Self::Basic => std::option::Option::Some("BASIC"),
Self::Full => std::option::Option::Some("FULL"),
Self::RevisionMetadataOnly => std::option::Option::Some("REVISION_METADATA_ONLY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RuleView {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RuleView {
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 RuleView {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Basic,
2 => Self::Full,
3 => Self::RevisionMetadataOnly,
_ => Self::UnknownValue(rule_view::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RuleView {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"RULE_VIEW_UNSPECIFIED" => Self::Unspecified,
"BASIC" => Self::Basic,
"FULL" => Self::Full,
"REVISION_METADATA_ONLY" => Self::RevisionMetadataOnly,
_ => Self::UnknownValue(rule_view::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RuleView {
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::Basic => serializer.serialize_i32(1),
Self::Full => serializer.serialize_i32(2),
Self::RevisionMetadataOnly => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RuleView {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RuleView>::new(
".google.cloud.chronicle.v1.RuleView",
))
}
}