#![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 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 Actor {
pub display_name: std::string::String,
#[deprecated]
pub email: std::string::String,
pub google_support: bool,
pub username: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Actor {
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
}
#[deprecated]
pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.email = v.into();
self
}
pub fn set_google_support<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.google_support = v.into();
self
}
pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.username = v.into();
self
}
}
impl wkt::message::Message for Actor {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.support.v2.Actor"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Attachment {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub creator: std::option::Option<crate::model::Actor>,
pub filename: std::string::String,
pub mime_type: std::string::String,
pub size_bytes: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Attachment {
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_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_creator<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Actor>,
{
self.creator = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_creator<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Actor>,
{
self.creator = v.map(|x| x.into());
self
}
pub fn set_filename<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filename = v.into();
self
}
pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.mime_type = v.into();
self
}
pub fn set_size_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.size_bytes = v.into();
self
}
}
impl wkt::message::Message for Attachment {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.support.v2.Attachment"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAttachmentsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListAttachmentsRequest {
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
}
}
impl wkt::message::Message for ListAttachmentsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.support.v2.ListAttachmentsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAttachmentsResponse {
pub attachments: std::vec::Vec<crate::model::Attachment>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListAttachmentsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_attachments<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Attachment>,
{
use std::iter::Iterator;
self.attachments = 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 ListAttachmentsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.support.v2.ListAttachmentsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListAttachmentsResponse {
type PageItem = crate::model::Attachment;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.attachments
}
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 Case {
pub name: std::string::String,
pub display_name: std::string::String,
pub description: std::string::String,
pub classification: std::option::Option<crate::model::CaseClassification>,
pub time_zone: std::string::String,
pub subscriber_email_addresses: std::vec::Vec<std::string::String>,
pub state: crate::model::case::State,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub creator: std::option::Option<crate::model::Actor>,
pub contact_email: std::string::String,
pub escalated: bool,
pub test_case: bool,
pub language_code: std::string::String,
pub priority: crate::model::case::Priority,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Case {
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_classification<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CaseClassification>,
{
self.classification = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_classification<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CaseClassification>,
{
self.classification = v.map(|x| x.into());
self
}
pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.time_zone = v.into();
self
}
pub fn set_subscriber_email_addresses<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.subscriber_email_addresses = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_state<T: std::convert::Into<crate::model::case::State>>(mut self, v: T) -> Self {
self.state = 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_creator<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Actor>,
{
self.creator = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_creator<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Actor>,
{
self.creator = v.map(|x| x.into());
self
}
pub fn set_contact_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.contact_email = v.into();
self
}
pub fn set_escalated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.escalated = v.into();
self
}
pub fn set_test_case<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.test_case = v.into();
self
}
pub fn set_language_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.language_code = v.into();
self
}
pub fn set_priority<T: std::convert::Into<crate::model::case::Priority>>(
mut self,
v: T,
) -> Self {
self.priority = v.into();
self
}
}
impl wkt::message::Message for Case {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.support.v2.Case"
}
}
pub mod case {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
New,
InProgressGoogleSupport,
ActionRequired,
SolutionProvided,
Closed,
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::New => std::option::Option::Some(1),
Self::InProgressGoogleSupport => std::option::Option::Some(2),
Self::ActionRequired => std::option::Option::Some(3),
Self::SolutionProvided => std::option::Option::Some(4),
Self::Closed => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::New => std::option::Option::Some("NEW"),
Self::InProgressGoogleSupport => {
std::option::Option::Some("IN_PROGRESS_GOOGLE_SUPPORT")
}
Self::ActionRequired => std::option::Option::Some("ACTION_REQUIRED"),
Self::SolutionProvided => std::option::Option::Some("SOLUTION_PROVIDED"),
Self::Closed => std::option::Option::Some("CLOSED"),
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::New,
2 => Self::InProgressGoogleSupport,
3 => Self::ActionRequired,
4 => Self::SolutionProvided,
5 => Self::Closed,
_ => 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,
"NEW" => Self::New,
"IN_PROGRESS_GOOGLE_SUPPORT" => Self::InProgressGoogleSupport,
"ACTION_REQUIRED" => Self::ActionRequired,
"SOLUTION_PROVIDED" => Self::SolutionProvided,
"CLOSED" => Self::Closed,
_ => 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::New => serializer.serialize_i32(1),
Self::InProgressGoogleSupport => serializer.serialize_i32(2),
Self::ActionRequired => serializer.serialize_i32(3),
Self::SolutionProvided => serializer.serialize_i32(4),
Self::Closed => serializer.serialize_i32(5),
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.support.v2.Case.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Priority {
Unspecified,
P0,
P1,
P2,
P3,
P4,
UnknownValue(priority::UnknownValue),
}
#[doc(hidden)]
pub mod priority {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Priority {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::P0 => std::option::Option::Some(1),
Self::P1 => std::option::Option::Some(2),
Self::P2 => std::option::Option::Some(3),
Self::P3 => std::option::Option::Some(4),
Self::P4 => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("PRIORITY_UNSPECIFIED"),
Self::P0 => std::option::Option::Some("P0"),
Self::P1 => std::option::Option::Some("P1"),
Self::P2 => std::option::Option::Some("P2"),
Self::P3 => std::option::Option::Some("P3"),
Self::P4 => std::option::Option::Some("P4"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Priority {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Priority {
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 Priority {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::P0,
2 => Self::P1,
3 => Self::P2,
4 => Self::P3,
5 => Self::P4,
_ => Self::UnknownValue(priority::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Priority {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"PRIORITY_UNSPECIFIED" => Self::Unspecified,
"P0" => Self::P0,
"P1" => Self::P1,
"P2" => Self::P2,
"P3" => Self::P3,
"P4" => Self::P4,
_ => Self::UnknownValue(priority::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Priority {
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::P0 => serializer.serialize_i32(1),
Self::P1 => serializer.serialize_i32(2),
Self::P2 => serializer.serialize_i32(3),
Self::P3 => serializer.serialize_i32(4),
Self::P4 => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Priority {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Priority>::new(
".google.cloud.support.v2.Case.Priority",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CaseClassification {
pub id: std::string::String,
pub display_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CaseClassification {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.id = v.into();
self
}
pub fn set_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 CaseClassification {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.support.v2.CaseClassification"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetCaseRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetCaseRequest {
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 GetCaseRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.support.v2.GetCaseRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateCaseRequest {
pub parent: std::string::String,
pub case: std::option::Option<crate::model::Case>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateCaseRequest {
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_case<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Case>,
{
self.case = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_case<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Case>,
{
self.case = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateCaseRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.support.v2.CreateCaseRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCasesRequest {
pub parent: std::string::String,
pub filter: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListCasesRequest {
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_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListCasesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.support.v2.ListCasesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCasesResponse {
pub cases: std::vec::Vec<crate::model::Case>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListCasesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cases<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Case>,
{
use std::iter::Iterator;
self.cases = 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 ListCasesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.support.v2.ListCasesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListCasesResponse {
type PageItem = crate::model::Case;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.cases
}
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 SearchCasesRequest {
pub parent: std::string::String,
pub query: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SearchCasesRequest {
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_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.query = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for SearchCasesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.support.v2.SearchCasesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SearchCasesResponse {
pub cases: std::vec::Vec<crate::model::Case>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SearchCasesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_cases<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Case>,
{
use std::iter::Iterator;
self.cases = 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 SearchCasesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.support.v2.SearchCasesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for SearchCasesResponse {
type PageItem = crate::model::Case;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.cases
}
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 EscalateCaseRequest {
pub name: std::string::String,
pub escalation: std::option::Option<crate::model::Escalation>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EscalateCaseRequest {
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_escalation<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Escalation>,
{
self.escalation = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_escalation<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Escalation>,
{
self.escalation = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for EscalateCaseRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.support.v2.EscalateCaseRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateCaseRequest {
pub case: std::option::Option<crate::model::Case>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateCaseRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_case<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Case>,
{
self.case = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_case<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Case>,
{
self.case = 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 UpdateCaseRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.support.v2.UpdateCaseRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CloseCaseRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CloseCaseRequest {
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 CloseCaseRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.support.v2.CloseCaseRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SearchCaseClassificationsRequest {
pub query: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SearchCaseClassificationsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.query = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for SearchCaseClassificationsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.support.v2.SearchCaseClassificationsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SearchCaseClassificationsResponse {
pub case_classifications: std::vec::Vec<crate::model::CaseClassification>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SearchCaseClassificationsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_case_classifications<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CaseClassification>,
{
use std::iter::Iterator;
self.case_classifications = 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 SearchCaseClassificationsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.support.v2.SearchCaseClassificationsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for SearchCaseClassificationsResponse {
type PageItem = crate::model::CaseClassification;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.case_classifications
}
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 Comment {
pub name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub creator: std::option::Option<crate::model::Actor>,
pub body: std::string::String,
#[deprecated]
pub plain_text_body: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Comment {
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_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_creator<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Actor>,
{
self.creator = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_creator<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Actor>,
{
self.creator = v.map(|x| x.into());
self
}
pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.body = v.into();
self
}
#[deprecated]
pub fn set_plain_text_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.plain_text_body = v.into();
self
}
}
impl wkt::message::Message for Comment {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.support.v2.Comment"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCommentsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListCommentsRequest {
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
}
}
impl wkt::message::Message for ListCommentsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.support.v2.ListCommentsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCommentsResponse {
pub comments: std::vec::Vec<crate::model::Comment>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListCommentsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_comments<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Comment>,
{
use std::iter::Iterator;
self.comments = 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 ListCommentsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.support.v2.ListCommentsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListCommentsResponse {
type PageItem = crate::model::Comment;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.comments
}
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 CreateCommentRequest {
pub parent: std::string::String,
pub comment: std::option::Option<crate::model::Comment>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateCommentRequest {
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_comment<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Comment>,
{
self.comment = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_comment<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Comment>,
{
self.comment = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateCommentRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.support.v2.CreateCommentRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Escalation {
pub reason: crate::model::escalation::Reason,
pub justification: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Escalation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_reason<T: std::convert::Into<crate::model::escalation::Reason>>(
mut self,
v: T,
) -> Self {
self.reason = v.into();
self
}
pub fn set_justification<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.justification = v.into();
self
}
}
impl wkt::message::Message for Escalation {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.support.v2.Escalation"
}
}
pub mod escalation {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Reason {
Unspecified,
ResolutionTime,
TechnicalExpertise,
BusinessImpact,
UnknownValue(reason::UnknownValue),
}
#[doc(hidden)]
pub mod reason {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Reason {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ResolutionTime => std::option::Option::Some(1),
Self::TechnicalExpertise => std::option::Option::Some(2),
Self::BusinessImpact => 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("REASON_UNSPECIFIED"),
Self::ResolutionTime => std::option::Option::Some("RESOLUTION_TIME"),
Self::TechnicalExpertise => std::option::Option::Some("TECHNICAL_EXPERTISE"),
Self::BusinessImpact => std::option::Option::Some("BUSINESS_IMPACT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Reason {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Reason {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Reason {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ResolutionTime,
2 => Self::TechnicalExpertise,
3 => Self::BusinessImpact,
_ => Self::UnknownValue(reason::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Reason {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"REASON_UNSPECIFIED" => Self::Unspecified,
"RESOLUTION_TIME" => Self::ResolutionTime,
"TECHNICAL_EXPERTISE" => Self::TechnicalExpertise,
"BUSINESS_IMPACT" => Self::BusinessImpact,
_ => Self::UnknownValue(reason::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Reason {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::ResolutionTime => serializer.serialize_i32(1),
Self::TechnicalExpertise => serializer.serialize_i32(2),
Self::BusinessImpact => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Reason {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Reason>::new(
".google.cloud.support.v2.Escalation.Reason",
))
}
}
}