1#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gax;
23extern crate gaxi;
24extern crate lazy_static;
25extern crate reqwest;
26extern crate serde;
27extern crate serde_json;
28extern crate serde_with;
29extern crate std;
30extern crate tracing;
31extern crate wkt;
32
33mod debug;
34mod deserialize;
35mod serialize;
36
37#[derive(Clone, Default, PartialEq)]
41#[non_exhaustive]
42pub struct Actor {
43 pub display_name: std::string::String,
48
49 #[deprecated]
56 pub email: std::string::String,
57
58 pub google_support: bool,
60
61 pub username: std::string::String,
67
68 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
69}
70
71impl Actor {
72 pub fn new() -> Self {
73 std::default::Default::default()
74 }
75
76 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
78 self.display_name = v.into();
79 self
80 }
81
82 #[deprecated]
84 pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
85 self.email = v.into();
86 self
87 }
88
89 pub fn set_google_support<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
91 self.google_support = v.into();
92 self
93 }
94
95 pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
97 self.username = v.into();
98 self
99 }
100}
101
102impl wkt::message::Message for Actor {
103 fn typename() -> &'static str {
104 "type.googleapis.com/google.cloud.support.v2.Actor"
105 }
106}
107
108#[derive(Clone, Default, PartialEq)]
117#[non_exhaustive]
118pub struct Attachment {
119 pub name: std::string::String,
121
122 pub create_time: std::option::Option<wkt::Timestamp>,
124
125 pub creator: std::option::Option<crate::model::Actor>,
128
129 pub filename: std::string::String,
131
132 pub mime_type: std::string::String,
134
135 pub size_bytes: i64,
137
138 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
139}
140
141impl Attachment {
142 pub fn new() -> Self {
143 std::default::Default::default()
144 }
145
146 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
148 self.name = v.into();
149 self
150 }
151
152 pub fn set_create_time<T>(mut self, v: T) -> Self
154 where
155 T: std::convert::Into<wkt::Timestamp>,
156 {
157 self.create_time = std::option::Option::Some(v.into());
158 self
159 }
160
161 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
163 where
164 T: std::convert::Into<wkt::Timestamp>,
165 {
166 self.create_time = v.map(|x| x.into());
167 self
168 }
169
170 pub fn set_creator<T>(mut self, v: T) -> Self
172 where
173 T: std::convert::Into<crate::model::Actor>,
174 {
175 self.creator = std::option::Option::Some(v.into());
176 self
177 }
178
179 pub fn set_or_clear_creator<T>(mut self, v: std::option::Option<T>) -> Self
181 where
182 T: std::convert::Into<crate::model::Actor>,
183 {
184 self.creator = v.map(|x| x.into());
185 self
186 }
187
188 pub fn set_filename<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
190 self.filename = v.into();
191 self
192 }
193
194 pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
196 self.mime_type = v.into();
197 self
198 }
199
200 pub fn set_size_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
202 self.size_bytes = v.into();
203 self
204 }
205}
206
207impl wkt::message::Message for Attachment {
208 fn typename() -> &'static str {
209 "type.googleapis.com/google.cloud.support.v2.Attachment"
210 }
211}
212
213#[derive(Clone, Default, PartialEq)]
215#[non_exhaustive]
216pub struct ListAttachmentsRequest {
217 pub parent: std::string::String,
219
220 pub page_size: i32,
229
230 pub page_token: std::string::String,
233
234 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
235}
236
237impl ListAttachmentsRequest {
238 pub fn new() -> Self {
239 std::default::Default::default()
240 }
241
242 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
244 self.parent = v.into();
245 self
246 }
247
248 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
250 self.page_size = v.into();
251 self
252 }
253
254 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
256 self.page_token = v.into();
257 self
258 }
259}
260
261impl wkt::message::Message for ListAttachmentsRequest {
262 fn typename() -> &'static str {
263 "type.googleapis.com/google.cloud.support.v2.ListAttachmentsRequest"
264 }
265}
266
267#[derive(Clone, Default, PartialEq)]
269#[non_exhaustive]
270pub struct ListAttachmentsResponse {
271 pub attachments: std::vec::Vec<crate::model::Attachment>,
273
274 pub next_page_token: std::string::String,
278
279 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
280}
281
282impl ListAttachmentsResponse {
283 pub fn new() -> Self {
284 std::default::Default::default()
285 }
286
287 pub fn set_attachments<T, V>(mut self, v: T) -> Self
289 where
290 T: std::iter::IntoIterator<Item = V>,
291 V: std::convert::Into<crate::model::Attachment>,
292 {
293 use std::iter::Iterator;
294 self.attachments = v.into_iter().map(|i| i.into()).collect();
295 self
296 }
297
298 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
300 self.next_page_token = v.into();
301 self
302 }
303}
304
305impl wkt::message::Message for ListAttachmentsResponse {
306 fn typename() -> &'static str {
307 "type.googleapis.com/google.cloud.support.v2.ListAttachmentsResponse"
308 }
309}
310
311#[doc(hidden)]
312impl gax::paginator::internal::PageableResponse for ListAttachmentsResponse {
313 type PageItem = crate::model::Attachment;
314
315 fn items(self) -> std::vec::Vec<Self::PageItem> {
316 self.attachments
317 }
318
319 fn next_page_token(&self) -> std::string::String {
320 use std::clone::Clone;
321 self.next_page_token.clone()
322 }
323}
324
325#[derive(Clone, Default, PartialEq)]
353#[non_exhaustive]
354pub struct Case {
355 pub name: std::string::String,
357
358 pub display_name: std::string::String,
360
361 pub description: std::string::String,
363
364 pub classification: std::option::Option<crate::model::CaseClassification>,
366
367 pub time_zone: std::string::String,
371
372 pub subscriber_email_addresses: std::vec::Vec<std::string::String>,
374
375 pub state: crate::model::case::State,
377
378 pub create_time: std::option::Option<wkt::Timestamp>,
380
381 pub update_time: std::option::Option<wkt::Timestamp>,
383
384 pub creator: std::option::Option<crate::model::Actor>,
389
390 pub contact_email: std::string::String,
394
395 pub escalated: bool,
397
398 pub test_case: bool,
401
402 pub language_code: std::string::String,
411
412 pub priority: crate::model::case::Priority,
414
415 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
416}
417
418impl Case {
419 pub fn new() -> Self {
420 std::default::Default::default()
421 }
422
423 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
425 self.name = v.into();
426 self
427 }
428
429 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
431 self.display_name = v.into();
432 self
433 }
434
435 pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
437 self.description = v.into();
438 self
439 }
440
441 pub fn set_classification<T>(mut self, v: T) -> Self
443 where
444 T: std::convert::Into<crate::model::CaseClassification>,
445 {
446 self.classification = std::option::Option::Some(v.into());
447 self
448 }
449
450 pub fn set_or_clear_classification<T>(mut self, v: std::option::Option<T>) -> Self
452 where
453 T: std::convert::Into<crate::model::CaseClassification>,
454 {
455 self.classification = v.map(|x| x.into());
456 self
457 }
458
459 pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
461 self.time_zone = v.into();
462 self
463 }
464
465 pub fn set_subscriber_email_addresses<T, V>(mut self, v: T) -> Self
467 where
468 T: std::iter::IntoIterator<Item = V>,
469 V: std::convert::Into<std::string::String>,
470 {
471 use std::iter::Iterator;
472 self.subscriber_email_addresses = v.into_iter().map(|i| i.into()).collect();
473 self
474 }
475
476 pub fn set_state<T: std::convert::Into<crate::model::case::State>>(mut self, v: T) -> Self {
478 self.state = v.into();
479 self
480 }
481
482 pub fn set_create_time<T>(mut self, v: T) -> Self
484 where
485 T: std::convert::Into<wkt::Timestamp>,
486 {
487 self.create_time = std::option::Option::Some(v.into());
488 self
489 }
490
491 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
493 where
494 T: std::convert::Into<wkt::Timestamp>,
495 {
496 self.create_time = v.map(|x| x.into());
497 self
498 }
499
500 pub fn set_update_time<T>(mut self, v: T) -> Self
502 where
503 T: std::convert::Into<wkt::Timestamp>,
504 {
505 self.update_time = std::option::Option::Some(v.into());
506 self
507 }
508
509 pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
511 where
512 T: std::convert::Into<wkt::Timestamp>,
513 {
514 self.update_time = v.map(|x| x.into());
515 self
516 }
517
518 pub fn set_creator<T>(mut self, v: T) -> Self
520 where
521 T: std::convert::Into<crate::model::Actor>,
522 {
523 self.creator = std::option::Option::Some(v.into());
524 self
525 }
526
527 pub fn set_or_clear_creator<T>(mut self, v: std::option::Option<T>) -> Self
529 where
530 T: std::convert::Into<crate::model::Actor>,
531 {
532 self.creator = v.map(|x| x.into());
533 self
534 }
535
536 pub fn set_contact_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
538 self.contact_email = v.into();
539 self
540 }
541
542 pub fn set_escalated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
544 self.escalated = v.into();
545 self
546 }
547
548 pub fn set_test_case<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
550 self.test_case = v.into();
551 self
552 }
553
554 pub fn set_language_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
556 self.language_code = v.into();
557 self
558 }
559
560 pub fn set_priority<T: std::convert::Into<crate::model::case::Priority>>(
562 mut self,
563 v: T,
564 ) -> Self {
565 self.priority = v.into();
566 self
567 }
568}
569
570impl wkt::message::Message for Case {
571 fn typename() -> &'static str {
572 "type.googleapis.com/google.cloud.support.v2.Case"
573 }
574}
575
576pub mod case {
578 #[allow(unused_imports)]
579 use super::*;
580
581 #[derive(Clone, Debug, PartialEq)]
597 #[non_exhaustive]
598 pub enum State {
599 Unspecified,
601 New,
603 InProgressGoogleSupport,
605 ActionRequired,
607 SolutionProvided,
609 Closed,
611 UnknownValue(state::UnknownValue),
616 }
617
618 #[doc(hidden)]
619 pub mod state {
620 #[allow(unused_imports)]
621 use super::*;
622 #[derive(Clone, Debug, PartialEq)]
623 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
624 }
625
626 impl State {
627 pub fn value(&self) -> std::option::Option<i32> {
632 match self {
633 Self::Unspecified => std::option::Option::Some(0),
634 Self::New => std::option::Option::Some(1),
635 Self::InProgressGoogleSupport => std::option::Option::Some(2),
636 Self::ActionRequired => std::option::Option::Some(3),
637 Self::SolutionProvided => std::option::Option::Some(4),
638 Self::Closed => std::option::Option::Some(5),
639 Self::UnknownValue(u) => u.0.value(),
640 }
641 }
642
643 pub fn name(&self) -> std::option::Option<&str> {
648 match self {
649 Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
650 Self::New => std::option::Option::Some("NEW"),
651 Self::InProgressGoogleSupport => {
652 std::option::Option::Some("IN_PROGRESS_GOOGLE_SUPPORT")
653 }
654 Self::ActionRequired => std::option::Option::Some("ACTION_REQUIRED"),
655 Self::SolutionProvided => std::option::Option::Some("SOLUTION_PROVIDED"),
656 Self::Closed => std::option::Option::Some("CLOSED"),
657 Self::UnknownValue(u) => u.0.name(),
658 }
659 }
660 }
661
662 impl std::default::Default for State {
663 fn default() -> Self {
664 use std::convert::From;
665 Self::from(0)
666 }
667 }
668
669 impl std::fmt::Display for State {
670 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
671 wkt::internal::display_enum(f, self.name(), self.value())
672 }
673 }
674
675 impl std::convert::From<i32> for State {
676 fn from(value: i32) -> Self {
677 match value {
678 0 => Self::Unspecified,
679 1 => Self::New,
680 2 => Self::InProgressGoogleSupport,
681 3 => Self::ActionRequired,
682 4 => Self::SolutionProvided,
683 5 => Self::Closed,
684 _ => Self::UnknownValue(state::UnknownValue(
685 wkt::internal::UnknownEnumValue::Integer(value),
686 )),
687 }
688 }
689 }
690
691 impl std::convert::From<&str> for State {
692 fn from(value: &str) -> Self {
693 use std::string::ToString;
694 match value {
695 "STATE_UNSPECIFIED" => Self::Unspecified,
696 "NEW" => Self::New,
697 "IN_PROGRESS_GOOGLE_SUPPORT" => Self::InProgressGoogleSupport,
698 "ACTION_REQUIRED" => Self::ActionRequired,
699 "SOLUTION_PROVIDED" => Self::SolutionProvided,
700 "CLOSED" => Self::Closed,
701 _ => Self::UnknownValue(state::UnknownValue(
702 wkt::internal::UnknownEnumValue::String(value.to_string()),
703 )),
704 }
705 }
706 }
707
708 impl serde::ser::Serialize for State {
709 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
710 where
711 S: serde::Serializer,
712 {
713 match self {
714 Self::Unspecified => serializer.serialize_i32(0),
715 Self::New => serializer.serialize_i32(1),
716 Self::InProgressGoogleSupport => serializer.serialize_i32(2),
717 Self::ActionRequired => serializer.serialize_i32(3),
718 Self::SolutionProvided => serializer.serialize_i32(4),
719 Self::Closed => serializer.serialize_i32(5),
720 Self::UnknownValue(u) => u.0.serialize(serializer),
721 }
722 }
723 }
724
725 impl<'de> serde::de::Deserialize<'de> for State {
726 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
727 where
728 D: serde::Deserializer<'de>,
729 {
730 deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
731 ".google.cloud.support.v2.Case.State",
732 ))
733 }
734 }
735
736 #[derive(Clone, Debug, PartialEq)]
752 #[non_exhaustive]
753 pub enum Priority {
754 Unspecified,
756 P0,
758 P1,
760 P2,
763 P3,
766 P4,
769 UnknownValue(priority::UnknownValue),
774 }
775
776 #[doc(hidden)]
777 pub mod priority {
778 #[allow(unused_imports)]
779 use super::*;
780 #[derive(Clone, Debug, PartialEq)]
781 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
782 }
783
784 impl Priority {
785 pub fn value(&self) -> std::option::Option<i32> {
790 match self {
791 Self::Unspecified => std::option::Option::Some(0),
792 Self::P0 => std::option::Option::Some(1),
793 Self::P1 => std::option::Option::Some(2),
794 Self::P2 => std::option::Option::Some(3),
795 Self::P3 => std::option::Option::Some(4),
796 Self::P4 => std::option::Option::Some(5),
797 Self::UnknownValue(u) => u.0.value(),
798 }
799 }
800
801 pub fn name(&self) -> std::option::Option<&str> {
806 match self {
807 Self::Unspecified => std::option::Option::Some("PRIORITY_UNSPECIFIED"),
808 Self::P0 => std::option::Option::Some("P0"),
809 Self::P1 => std::option::Option::Some("P1"),
810 Self::P2 => std::option::Option::Some("P2"),
811 Self::P3 => std::option::Option::Some("P3"),
812 Self::P4 => std::option::Option::Some("P4"),
813 Self::UnknownValue(u) => u.0.name(),
814 }
815 }
816 }
817
818 impl std::default::Default for Priority {
819 fn default() -> Self {
820 use std::convert::From;
821 Self::from(0)
822 }
823 }
824
825 impl std::fmt::Display for Priority {
826 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
827 wkt::internal::display_enum(f, self.name(), self.value())
828 }
829 }
830
831 impl std::convert::From<i32> for Priority {
832 fn from(value: i32) -> Self {
833 match value {
834 0 => Self::Unspecified,
835 1 => Self::P0,
836 2 => Self::P1,
837 3 => Self::P2,
838 4 => Self::P3,
839 5 => Self::P4,
840 _ => Self::UnknownValue(priority::UnknownValue(
841 wkt::internal::UnknownEnumValue::Integer(value),
842 )),
843 }
844 }
845 }
846
847 impl std::convert::From<&str> for Priority {
848 fn from(value: &str) -> Self {
849 use std::string::ToString;
850 match value {
851 "PRIORITY_UNSPECIFIED" => Self::Unspecified,
852 "P0" => Self::P0,
853 "P1" => Self::P1,
854 "P2" => Self::P2,
855 "P3" => Self::P3,
856 "P4" => Self::P4,
857 _ => Self::UnknownValue(priority::UnknownValue(
858 wkt::internal::UnknownEnumValue::String(value.to_string()),
859 )),
860 }
861 }
862 }
863
864 impl serde::ser::Serialize for Priority {
865 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
866 where
867 S: serde::Serializer,
868 {
869 match self {
870 Self::Unspecified => serializer.serialize_i32(0),
871 Self::P0 => serializer.serialize_i32(1),
872 Self::P1 => serializer.serialize_i32(2),
873 Self::P2 => serializer.serialize_i32(3),
874 Self::P3 => serializer.serialize_i32(4),
875 Self::P4 => serializer.serialize_i32(5),
876 Self::UnknownValue(u) => u.0.serialize(serializer),
877 }
878 }
879 }
880
881 impl<'de> serde::de::Deserialize<'de> for Priority {
882 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
883 where
884 D: serde::Deserializer<'de>,
885 {
886 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Priority>::new(
887 ".google.cloud.support.v2.Case.Priority",
888 ))
889 }
890 }
891}
892
893#[derive(Clone, Default, PartialEq)]
900#[non_exhaustive]
901pub struct CaseClassification {
902 pub id: std::string::String,
912
913 pub display_name: std::string::String,
918
919 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
920}
921
922impl CaseClassification {
923 pub fn new() -> Self {
924 std::default::Default::default()
925 }
926
927 pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
929 self.id = v.into();
930 self
931 }
932
933 pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
935 self.display_name = v.into();
936 self
937 }
938}
939
940impl wkt::message::Message for CaseClassification {
941 fn typename() -> &'static str {
942 "type.googleapis.com/google.cloud.support.v2.CaseClassification"
943 }
944}
945
946#[derive(Clone, Default, PartialEq)]
948#[non_exhaustive]
949pub struct GetCaseRequest {
950 pub name: std::string::String,
952
953 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
954}
955
956impl GetCaseRequest {
957 pub fn new() -> Self {
958 std::default::Default::default()
959 }
960
961 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
963 self.name = v.into();
964 self
965 }
966}
967
968impl wkt::message::Message for GetCaseRequest {
969 fn typename() -> &'static str {
970 "type.googleapis.com/google.cloud.support.v2.GetCaseRequest"
971 }
972}
973
974#[derive(Clone, Default, PartialEq)]
976#[non_exhaustive]
977pub struct CreateCaseRequest {
978 pub parent: std::string::String,
980
981 pub case: std::option::Option<crate::model::Case>,
983
984 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
985}
986
987impl CreateCaseRequest {
988 pub fn new() -> Self {
989 std::default::Default::default()
990 }
991
992 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
994 self.parent = v.into();
995 self
996 }
997
998 pub fn set_case<T>(mut self, v: T) -> Self
1000 where
1001 T: std::convert::Into<crate::model::Case>,
1002 {
1003 self.case = std::option::Option::Some(v.into());
1004 self
1005 }
1006
1007 pub fn set_or_clear_case<T>(mut self, v: std::option::Option<T>) -> Self
1009 where
1010 T: std::convert::Into<crate::model::Case>,
1011 {
1012 self.case = v.map(|x| x.into());
1013 self
1014 }
1015}
1016
1017impl wkt::message::Message for CreateCaseRequest {
1018 fn typename() -> &'static str {
1019 "type.googleapis.com/google.cloud.support.v2.CreateCaseRequest"
1020 }
1021}
1022
1023#[derive(Clone, Default, PartialEq)]
1025#[non_exhaustive]
1026pub struct ListCasesRequest {
1027 pub parent: std::string::String,
1029
1030 pub filter: std::string::String,
1050
1051 pub page_size: i32,
1053
1054 pub page_token: std::string::String,
1057
1058 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1059}
1060
1061impl ListCasesRequest {
1062 pub fn new() -> Self {
1063 std::default::Default::default()
1064 }
1065
1066 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1068 self.parent = v.into();
1069 self
1070 }
1071
1072 pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1074 self.filter = v.into();
1075 self
1076 }
1077
1078 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1080 self.page_size = v.into();
1081 self
1082 }
1083
1084 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1086 self.page_token = v.into();
1087 self
1088 }
1089}
1090
1091impl wkt::message::Message for ListCasesRequest {
1092 fn typename() -> &'static str {
1093 "type.googleapis.com/google.cloud.support.v2.ListCasesRequest"
1094 }
1095}
1096
1097#[derive(Clone, Default, PartialEq)]
1099#[non_exhaustive]
1100pub struct ListCasesResponse {
1101 pub cases: std::vec::Vec<crate::model::Case>,
1104
1105 pub next_page_token: std::string::String,
1109
1110 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1111}
1112
1113impl ListCasesResponse {
1114 pub fn new() -> Self {
1115 std::default::Default::default()
1116 }
1117
1118 pub fn set_cases<T, V>(mut self, v: T) -> Self
1120 where
1121 T: std::iter::IntoIterator<Item = V>,
1122 V: std::convert::Into<crate::model::Case>,
1123 {
1124 use std::iter::Iterator;
1125 self.cases = v.into_iter().map(|i| i.into()).collect();
1126 self
1127 }
1128
1129 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1131 self.next_page_token = v.into();
1132 self
1133 }
1134}
1135
1136impl wkt::message::Message for ListCasesResponse {
1137 fn typename() -> &'static str {
1138 "type.googleapis.com/google.cloud.support.v2.ListCasesResponse"
1139 }
1140}
1141
1142#[doc(hidden)]
1143impl gax::paginator::internal::PageableResponse for ListCasesResponse {
1144 type PageItem = crate::model::Case;
1145
1146 fn items(self) -> std::vec::Vec<Self::PageItem> {
1147 self.cases
1148 }
1149
1150 fn next_page_token(&self) -> std::string::String {
1151 use std::clone::Clone;
1152 self.next_page_token.clone()
1153 }
1154}
1155
1156#[derive(Clone, Default, PartialEq)]
1158#[non_exhaustive]
1159pub struct SearchCasesRequest {
1160 pub parent: std::string::String,
1162
1163 pub query: std::string::String,
1196
1197 pub page_size: i32,
1200
1201 pub page_token: std::string::String,
1204
1205 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1206}
1207
1208impl SearchCasesRequest {
1209 pub fn new() -> Self {
1210 std::default::Default::default()
1211 }
1212
1213 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1215 self.parent = v.into();
1216 self
1217 }
1218
1219 pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1221 self.query = v.into();
1222 self
1223 }
1224
1225 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1227 self.page_size = v.into();
1228 self
1229 }
1230
1231 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1233 self.page_token = v.into();
1234 self
1235 }
1236}
1237
1238impl wkt::message::Message for SearchCasesRequest {
1239 fn typename() -> &'static str {
1240 "type.googleapis.com/google.cloud.support.v2.SearchCasesRequest"
1241 }
1242}
1243
1244#[derive(Clone, Default, PartialEq)]
1246#[non_exhaustive]
1247pub struct SearchCasesResponse {
1248 pub cases: std::vec::Vec<crate::model::Case>,
1251
1252 pub next_page_token: std::string::String,
1256
1257 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1258}
1259
1260impl SearchCasesResponse {
1261 pub fn new() -> Self {
1262 std::default::Default::default()
1263 }
1264
1265 pub fn set_cases<T, V>(mut self, v: T) -> Self
1267 where
1268 T: std::iter::IntoIterator<Item = V>,
1269 V: std::convert::Into<crate::model::Case>,
1270 {
1271 use std::iter::Iterator;
1272 self.cases = v.into_iter().map(|i| i.into()).collect();
1273 self
1274 }
1275
1276 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1278 self.next_page_token = v.into();
1279 self
1280 }
1281}
1282
1283impl wkt::message::Message for SearchCasesResponse {
1284 fn typename() -> &'static str {
1285 "type.googleapis.com/google.cloud.support.v2.SearchCasesResponse"
1286 }
1287}
1288
1289#[doc(hidden)]
1290impl gax::paginator::internal::PageableResponse for SearchCasesResponse {
1291 type PageItem = crate::model::Case;
1292
1293 fn items(self) -> std::vec::Vec<Self::PageItem> {
1294 self.cases
1295 }
1296
1297 fn next_page_token(&self) -> std::string::String {
1298 use std::clone::Clone;
1299 self.next_page_token.clone()
1300 }
1301}
1302
1303#[derive(Clone, Default, PartialEq)]
1305#[non_exhaustive]
1306pub struct EscalateCaseRequest {
1307 pub name: std::string::String,
1309
1310 pub escalation: std::option::Option<crate::model::Escalation>,
1312
1313 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1314}
1315
1316impl EscalateCaseRequest {
1317 pub fn new() -> Self {
1318 std::default::Default::default()
1319 }
1320
1321 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1323 self.name = v.into();
1324 self
1325 }
1326
1327 pub fn set_escalation<T>(mut self, v: T) -> Self
1329 where
1330 T: std::convert::Into<crate::model::Escalation>,
1331 {
1332 self.escalation = std::option::Option::Some(v.into());
1333 self
1334 }
1335
1336 pub fn set_or_clear_escalation<T>(mut self, v: std::option::Option<T>) -> Self
1338 where
1339 T: std::convert::Into<crate::model::Escalation>,
1340 {
1341 self.escalation = v.map(|x| x.into());
1342 self
1343 }
1344}
1345
1346impl wkt::message::Message for EscalateCaseRequest {
1347 fn typename() -> &'static str {
1348 "type.googleapis.com/google.cloud.support.v2.EscalateCaseRequest"
1349 }
1350}
1351
1352#[derive(Clone, Default, PartialEq)]
1354#[non_exhaustive]
1355pub struct UpdateCaseRequest {
1356 pub case: std::option::Option<crate::model::Case>,
1358
1359 pub update_mask: std::option::Option<wkt::FieldMask>,
1368
1369 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1370}
1371
1372impl UpdateCaseRequest {
1373 pub fn new() -> Self {
1374 std::default::Default::default()
1375 }
1376
1377 pub fn set_case<T>(mut self, v: T) -> Self
1379 where
1380 T: std::convert::Into<crate::model::Case>,
1381 {
1382 self.case = std::option::Option::Some(v.into());
1383 self
1384 }
1385
1386 pub fn set_or_clear_case<T>(mut self, v: std::option::Option<T>) -> Self
1388 where
1389 T: std::convert::Into<crate::model::Case>,
1390 {
1391 self.case = v.map(|x| x.into());
1392 self
1393 }
1394
1395 pub fn set_update_mask<T>(mut self, v: T) -> Self
1397 where
1398 T: std::convert::Into<wkt::FieldMask>,
1399 {
1400 self.update_mask = std::option::Option::Some(v.into());
1401 self
1402 }
1403
1404 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1406 where
1407 T: std::convert::Into<wkt::FieldMask>,
1408 {
1409 self.update_mask = v.map(|x| x.into());
1410 self
1411 }
1412}
1413
1414impl wkt::message::Message for UpdateCaseRequest {
1415 fn typename() -> &'static str {
1416 "type.googleapis.com/google.cloud.support.v2.UpdateCaseRequest"
1417 }
1418}
1419
1420#[derive(Clone, Default, PartialEq)]
1422#[non_exhaustive]
1423pub struct CloseCaseRequest {
1424 pub name: std::string::String,
1426
1427 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1428}
1429
1430impl CloseCaseRequest {
1431 pub fn new() -> Self {
1432 std::default::Default::default()
1433 }
1434
1435 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1437 self.name = v.into();
1438 self
1439 }
1440}
1441
1442impl wkt::message::Message for CloseCaseRequest {
1443 fn typename() -> &'static str {
1444 "type.googleapis.com/google.cloud.support.v2.CloseCaseRequest"
1445 }
1446}
1447
1448#[derive(Clone, Default, PartialEq)]
1450#[non_exhaustive]
1451pub struct SearchCaseClassificationsRequest {
1452 pub query: std::string::String,
1457
1458 pub page_size: i32,
1460
1461 pub page_token: std::string::String,
1464
1465 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1466}
1467
1468impl SearchCaseClassificationsRequest {
1469 pub fn new() -> Self {
1470 std::default::Default::default()
1471 }
1472
1473 pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1475 self.query = v.into();
1476 self
1477 }
1478
1479 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1481 self.page_size = v.into();
1482 self
1483 }
1484
1485 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1487 self.page_token = v.into();
1488 self
1489 }
1490}
1491
1492impl wkt::message::Message for SearchCaseClassificationsRequest {
1493 fn typename() -> &'static str {
1494 "type.googleapis.com/google.cloud.support.v2.SearchCaseClassificationsRequest"
1495 }
1496}
1497
1498#[derive(Clone, Default, PartialEq)]
1500#[non_exhaustive]
1501pub struct SearchCaseClassificationsResponse {
1502 pub case_classifications: std::vec::Vec<crate::model::CaseClassification>,
1504
1505 pub next_page_token: std::string::String,
1509
1510 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1511}
1512
1513impl SearchCaseClassificationsResponse {
1514 pub fn new() -> Self {
1515 std::default::Default::default()
1516 }
1517
1518 pub fn set_case_classifications<T, V>(mut self, v: T) -> Self
1520 where
1521 T: std::iter::IntoIterator<Item = V>,
1522 V: std::convert::Into<crate::model::CaseClassification>,
1523 {
1524 use std::iter::Iterator;
1525 self.case_classifications = v.into_iter().map(|i| i.into()).collect();
1526 self
1527 }
1528
1529 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1531 self.next_page_token = v.into();
1532 self
1533 }
1534}
1535
1536impl wkt::message::Message for SearchCaseClassificationsResponse {
1537 fn typename() -> &'static str {
1538 "type.googleapis.com/google.cloud.support.v2.SearchCaseClassificationsResponse"
1539 }
1540}
1541
1542#[doc(hidden)]
1543impl gax::paginator::internal::PageableResponse for SearchCaseClassificationsResponse {
1544 type PageItem = crate::model::CaseClassification;
1545
1546 fn items(self) -> std::vec::Vec<Self::PageItem> {
1547 self.case_classifications
1548 }
1549
1550 fn next_page_token(&self) -> std::string::String {
1551 use std::clone::Clone;
1552 self.next_page_token.clone()
1553 }
1554}
1555
1556#[derive(Clone, Default, PartialEq)]
1562#[non_exhaustive]
1563pub struct Comment {
1564 pub name: std::string::String,
1566
1567 pub create_time: std::option::Option<wkt::Timestamp>,
1569
1570 pub creator: std::option::Option<crate::model::Actor>,
1572
1573 pub body: std::string::String,
1577
1578 #[deprecated]
1584 pub plain_text_body: std::string::String,
1585
1586 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1587}
1588
1589impl Comment {
1590 pub fn new() -> Self {
1591 std::default::Default::default()
1592 }
1593
1594 pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1596 self.name = v.into();
1597 self
1598 }
1599
1600 pub fn set_create_time<T>(mut self, v: T) -> Self
1602 where
1603 T: std::convert::Into<wkt::Timestamp>,
1604 {
1605 self.create_time = std::option::Option::Some(v.into());
1606 self
1607 }
1608
1609 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1611 where
1612 T: std::convert::Into<wkt::Timestamp>,
1613 {
1614 self.create_time = v.map(|x| x.into());
1615 self
1616 }
1617
1618 pub fn set_creator<T>(mut self, v: T) -> Self
1620 where
1621 T: std::convert::Into<crate::model::Actor>,
1622 {
1623 self.creator = std::option::Option::Some(v.into());
1624 self
1625 }
1626
1627 pub fn set_or_clear_creator<T>(mut self, v: std::option::Option<T>) -> Self
1629 where
1630 T: std::convert::Into<crate::model::Actor>,
1631 {
1632 self.creator = v.map(|x| x.into());
1633 self
1634 }
1635
1636 pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1638 self.body = v.into();
1639 self
1640 }
1641
1642 #[deprecated]
1644 pub fn set_plain_text_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1645 self.plain_text_body = v.into();
1646 self
1647 }
1648}
1649
1650impl wkt::message::Message for Comment {
1651 fn typename() -> &'static str {
1652 "type.googleapis.com/google.cloud.support.v2.Comment"
1653 }
1654}
1655
1656#[derive(Clone, Default, PartialEq)]
1658#[non_exhaustive]
1659pub struct ListCommentsRequest {
1660 pub parent: std::string::String,
1662
1663 pub page_size: i32,
1665
1666 pub page_token: std::string::String,
1669
1670 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1671}
1672
1673impl ListCommentsRequest {
1674 pub fn new() -> Self {
1675 std::default::Default::default()
1676 }
1677
1678 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1680 self.parent = v.into();
1681 self
1682 }
1683
1684 pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1686 self.page_size = v.into();
1687 self
1688 }
1689
1690 pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1692 self.page_token = v.into();
1693 self
1694 }
1695}
1696
1697impl wkt::message::Message for ListCommentsRequest {
1698 fn typename() -> &'static str {
1699 "type.googleapis.com/google.cloud.support.v2.ListCommentsRequest"
1700 }
1701}
1702
1703#[derive(Clone, Default, PartialEq)]
1705#[non_exhaustive]
1706pub struct ListCommentsResponse {
1707 pub comments: std::vec::Vec<crate::model::Comment>,
1709
1710 pub next_page_token: std::string::String,
1714
1715 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1716}
1717
1718impl ListCommentsResponse {
1719 pub fn new() -> Self {
1720 std::default::Default::default()
1721 }
1722
1723 pub fn set_comments<T, V>(mut self, v: T) -> Self
1725 where
1726 T: std::iter::IntoIterator<Item = V>,
1727 V: std::convert::Into<crate::model::Comment>,
1728 {
1729 use std::iter::Iterator;
1730 self.comments = v.into_iter().map(|i| i.into()).collect();
1731 self
1732 }
1733
1734 pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1736 self.next_page_token = v.into();
1737 self
1738 }
1739}
1740
1741impl wkt::message::Message for ListCommentsResponse {
1742 fn typename() -> &'static str {
1743 "type.googleapis.com/google.cloud.support.v2.ListCommentsResponse"
1744 }
1745}
1746
1747#[doc(hidden)]
1748impl gax::paginator::internal::PageableResponse for ListCommentsResponse {
1749 type PageItem = crate::model::Comment;
1750
1751 fn items(self) -> std::vec::Vec<Self::PageItem> {
1752 self.comments
1753 }
1754
1755 fn next_page_token(&self) -> std::string::String {
1756 use std::clone::Clone;
1757 self.next_page_token.clone()
1758 }
1759}
1760
1761#[derive(Clone, Default, PartialEq)]
1763#[non_exhaustive]
1764pub struct CreateCommentRequest {
1765 pub parent: std::string::String,
1767
1768 pub comment: std::option::Option<crate::model::Comment>,
1770
1771 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1772}
1773
1774impl CreateCommentRequest {
1775 pub fn new() -> Self {
1776 std::default::Default::default()
1777 }
1778
1779 pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1781 self.parent = v.into();
1782 self
1783 }
1784
1785 pub fn set_comment<T>(mut self, v: T) -> Self
1787 where
1788 T: std::convert::Into<crate::model::Comment>,
1789 {
1790 self.comment = std::option::Option::Some(v.into());
1791 self
1792 }
1793
1794 pub fn set_or_clear_comment<T>(mut self, v: std::option::Option<T>) -> Self
1796 where
1797 T: std::convert::Into<crate::model::Comment>,
1798 {
1799 self.comment = v.map(|x| x.into());
1800 self
1801 }
1802}
1803
1804impl wkt::message::Message for CreateCommentRequest {
1805 fn typename() -> &'static str {
1806 "type.googleapis.com/google.cloud.support.v2.CreateCommentRequest"
1807 }
1808}
1809
1810#[derive(Clone, Default, PartialEq)]
1812#[non_exhaustive]
1813pub struct Escalation {
1814 pub reason: crate::model::escalation::Reason,
1816
1817 pub justification: std::string::String,
1820
1821 pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1822}
1823
1824impl Escalation {
1825 pub fn new() -> Self {
1826 std::default::Default::default()
1827 }
1828
1829 pub fn set_reason<T: std::convert::Into<crate::model::escalation::Reason>>(
1831 mut self,
1832 v: T,
1833 ) -> Self {
1834 self.reason = v.into();
1835 self
1836 }
1837
1838 pub fn set_justification<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1840 self.justification = v.into();
1841 self
1842 }
1843}
1844
1845impl wkt::message::Message for Escalation {
1846 fn typename() -> &'static str {
1847 "type.googleapis.com/google.cloud.support.v2.Escalation"
1848 }
1849}
1850
1851pub mod escalation {
1853 #[allow(unused_imports)]
1854 use super::*;
1855
1856 #[derive(Clone, Debug, PartialEq)]
1872 #[non_exhaustive]
1873 pub enum Reason {
1874 Unspecified,
1876 ResolutionTime,
1878 TechnicalExpertise,
1881 BusinessImpact,
1883 UnknownValue(reason::UnknownValue),
1888 }
1889
1890 #[doc(hidden)]
1891 pub mod reason {
1892 #[allow(unused_imports)]
1893 use super::*;
1894 #[derive(Clone, Debug, PartialEq)]
1895 pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1896 }
1897
1898 impl Reason {
1899 pub fn value(&self) -> std::option::Option<i32> {
1904 match self {
1905 Self::Unspecified => std::option::Option::Some(0),
1906 Self::ResolutionTime => std::option::Option::Some(1),
1907 Self::TechnicalExpertise => std::option::Option::Some(2),
1908 Self::BusinessImpact => std::option::Option::Some(3),
1909 Self::UnknownValue(u) => u.0.value(),
1910 }
1911 }
1912
1913 pub fn name(&self) -> std::option::Option<&str> {
1918 match self {
1919 Self::Unspecified => std::option::Option::Some("REASON_UNSPECIFIED"),
1920 Self::ResolutionTime => std::option::Option::Some("RESOLUTION_TIME"),
1921 Self::TechnicalExpertise => std::option::Option::Some("TECHNICAL_EXPERTISE"),
1922 Self::BusinessImpact => std::option::Option::Some("BUSINESS_IMPACT"),
1923 Self::UnknownValue(u) => u.0.name(),
1924 }
1925 }
1926 }
1927
1928 impl std::default::Default for Reason {
1929 fn default() -> Self {
1930 use std::convert::From;
1931 Self::from(0)
1932 }
1933 }
1934
1935 impl std::fmt::Display for Reason {
1936 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1937 wkt::internal::display_enum(f, self.name(), self.value())
1938 }
1939 }
1940
1941 impl std::convert::From<i32> for Reason {
1942 fn from(value: i32) -> Self {
1943 match value {
1944 0 => Self::Unspecified,
1945 1 => Self::ResolutionTime,
1946 2 => Self::TechnicalExpertise,
1947 3 => Self::BusinessImpact,
1948 _ => Self::UnknownValue(reason::UnknownValue(
1949 wkt::internal::UnknownEnumValue::Integer(value),
1950 )),
1951 }
1952 }
1953 }
1954
1955 impl std::convert::From<&str> for Reason {
1956 fn from(value: &str) -> Self {
1957 use std::string::ToString;
1958 match value {
1959 "REASON_UNSPECIFIED" => Self::Unspecified,
1960 "RESOLUTION_TIME" => Self::ResolutionTime,
1961 "TECHNICAL_EXPERTISE" => Self::TechnicalExpertise,
1962 "BUSINESS_IMPACT" => Self::BusinessImpact,
1963 _ => Self::UnknownValue(reason::UnknownValue(
1964 wkt::internal::UnknownEnumValue::String(value.to_string()),
1965 )),
1966 }
1967 }
1968 }
1969
1970 impl serde::ser::Serialize for Reason {
1971 fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1972 where
1973 S: serde::Serializer,
1974 {
1975 match self {
1976 Self::Unspecified => serializer.serialize_i32(0),
1977 Self::ResolutionTime => serializer.serialize_i32(1),
1978 Self::TechnicalExpertise => serializer.serialize_i32(2),
1979 Self::BusinessImpact => serializer.serialize_i32(3),
1980 Self::UnknownValue(u) => u.0.serialize(serializer),
1981 }
1982 }
1983 }
1984
1985 impl<'de> serde::de::Deserialize<'de> for Reason {
1986 fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1987 where
1988 D: serde::Deserializer<'de>,
1989 {
1990 deserializer.deserialize_any(wkt::internal::EnumVisitor::<Reason>::new(
1991 ".google.cloud.support.v2.Escalation.Reason",
1992 ))
1993 }
1994 }
1995}