Skip to main content

google_cloud_support_v2/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate serde;
25extern crate serde_json;
26extern crate serde_with;
27extern crate std;
28extern crate tracing;
29extern crate wkt;
30
31mod debug;
32mod deserialize;
33mod serialize;
34
35/// An Actor represents an entity that performed an action. For example, an actor
36/// could be a user who posted a comment on a support case, a user who
37/// uploaded an attachment, or a service account that created a support case.
38#[derive(Clone, Default, PartialEq)]
39#[non_exhaustive]
40pub struct Actor {
41    /// The name to display for the actor. If not provided, it is inferred from
42    /// credentials supplied during case creation. When an email is provided, a
43    /// display name must also be provided. This will be obfuscated if the user
44    /// is a Google Support agent.
45    pub display_name: std::string::String,
46
47    /// The email address of the actor. If not provided, it is inferred from the
48    /// credentials supplied during case creation. When a name is provided, an
49    /// email must also be provided. If the user is a Google Support agent, this is
50    /// obfuscated.
51    ///
52    /// This field is deprecated. Use `username` instead.
53    #[deprecated]
54    pub email: std::string::String,
55
56    /// Output only. Whether the actor is a Google support actor.
57    pub google_support: bool,
58
59    /// Output only. The username of the actor. It may look like an email or other
60    /// format provided by the identity provider. If not provided, it is inferred
61    /// from the credentials supplied. When a name is provided, a username must
62    /// also be provided. If the user is a Google Support agent, this will not be
63    /// set.
64    pub username: std::string::String,
65
66    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
67}
68
69impl Actor {
70    /// Creates a new default instance.
71    pub fn new() -> Self {
72        std::default::Default::default()
73    }
74
75    /// Sets the value of [display_name][crate::model::Actor::display_name].
76    ///
77    /// # Example
78    /// ```ignore,no_run
79    /// # use google_cloud_support_v2::model::Actor;
80    /// let x = Actor::new().set_display_name("example");
81    /// ```
82    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
83        self.display_name = v.into();
84        self
85    }
86
87    /// Sets the value of [email][crate::model::Actor::email].
88    ///
89    /// # Example
90    /// ```ignore,no_run
91    /// # use google_cloud_support_v2::model::Actor;
92    /// let x = Actor::new().set_email("example");
93    /// ```
94    #[deprecated]
95    pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
96        self.email = v.into();
97        self
98    }
99
100    /// Sets the value of [google_support][crate::model::Actor::google_support].
101    ///
102    /// # Example
103    /// ```ignore,no_run
104    /// # use google_cloud_support_v2::model::Actor;
105    /// let x = Actor::new().set_google_support(true);
106    /// ```
107    pub fn set_google_support<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
108        self.google_support = v.into();
109        self
110    }
111
112    /// Sets the value of [username][crate::model::Actor::username].
113    ///
114    /// # Example
115    /// ```ignore,no_run
116    /// # use google_cloud_support_v2::model::Actor;
117    /// let x = Actor::new().set_username("example");
118    /// ```
119    pub fn set_username<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
120        self.username = v.into();
121        self
122    }
123}
124
125impl wkt::message::Message for Actor {
126    fn typename() -> &'static str {
127        "type.googleapis.com/google.cloud.support.v2.Actor"
128    }
129}
130
131/// An Attachment contains metadata about a file that was uploaded to a
132/// case - it is NOT a file itself. That being said, the name of an Attachment
133/// object can be used to download its accompanying file through the
134/// `media.download` endpoint.
135///
136/// While attachments can be uploaded in the console at the
137/// same time as a comment, they're associated on a "case" level, not a
138/// "comment" level.
139#[derive(Clone, Default, PartialEq)]
140#[non_exhaustive]
141pub struct Attachment {
142    /// Output only. Identifier. The resource name of the attachment.
143    pub name: std::string::String,
144
145    /// Output only. The time at which the attachment was created.
146    pub create_time: std::option::Option<wkt::Timestamp>,
147
148    /// Output only. The user who uploaded the attachment. Note, the name and email
149    /// will be obfuscated if the attachment was uploaded by Google support.
150    pub creator: std::option::Option<crate::model::Actor>,
151
152    /// The filename of the attachment (e.g. `"graph.jpg"`).
153    pub filename: std::string::String,
154
155    /// Output only. The MIME type of the attachment (e.g. text/plain).
156    pub mime_type: std::string::String,
157
158    /// Output only. The size of the attachment in bytes.
159    pub size_bytes: i64,
160
161    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
162}
163
164impl Attachment {
165    /// Creates a new default instance.
166    pub fn new() -> Self {
167        std::default::Default::default()
168    }
169
170    /// Sets the value of [name][crate::model::Attachment::name].
171    ///
172    /// # Example
173    /// ```ignore,no_run
174    /// # use google_cloud_support_v2::model::Attachment;
175    /// let x = Attachment::new().set_name("example");
176    /// ```
177    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
178        self.name = v.into();
179        self
180    }
181
182    /// Sets the value of [create_time][crate::model::Attachment::create_time].
183    ///
184    /// # Example
185    /// ```ignore,no_run
186    /// # use google_cloud_support_v2::model::Attachment;
187    /// use wkt::Timestamp;
188    /// let x = Attachment::new().set_create_time(Timestamp::default()/* use setters */);
189    /// ```
190    pub fn set_create_time<T>(mut self, v: T) -> Self
191    where
192        T: std::convert::Into<wkt::Timestamp>,
193    {
194        self.create_time = std::option::Option::Some(v.into());
195        self
196    }
197
198    /// Sets or clears the value of [create_time][crate::model::Attachment::create_time].
199    ///
200    /// # Example
201    /// ```ignore,no_run
202    /// # use google_cloud_support_v2::model::Attachment;
203    /// use wkt::Timestamp;
204    /// let x = Attachment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
205    /// let x = Attachment::new().set_or_clear_create_time(None::<Timestamp>);
206    /// ```
207    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
208    where
209        T: std::convert::Into<wkt::Timestamp>,
210    {
211        self.create_time = v.map(|x| x.into());
212        self
213    }
214
215    /// Sets the value of [creator][crate::model::Attachment::creator].
216    ///
217    /// # Example
218    /// ```ignore,no_run
219    /// # use google_cloud_support_v2::model::Attachment;
220    /// use google_cloud_support_v2::model::Actor;
221    /// let x = Attachment::new().set_creator(Actor::default()/* use setters */);
222    /// ```
223    pub fn set_creator<T>(mut self, v: T) -> Self
224    where
225        T: std::convert::Into<crate::model::Actor>,
226    {
227        self.creator = std::option::Option::Some(v.into());
228        self
229    }
230
231    /// Sets or clears the value of [creator][crate::model::Attachment::creator].
232    ///
233    /// # Example
234    /// ```ignore,no_run
235    /// # use google_cloud_support_v2::model::Attachment;
236    /// use google_cloud_support_v2::model::Actor;
237    /// let x = Attachment::new().set_or_clear_creator(Some(Actor::default()/* use setters */));
238    /// let x = Attachment::new().set_or_clear_creator(None::<Actor>);
239    /// ```
240    pub fn set_or_clear_creator<T>(mut self, v: std::option::Option<T>) -> Self
241    where
242        T: std::convert::Into<crate::model::Actor>,
243    {
244        self.creator = v.map(|x| x.into());
245        self
246    }
247
248    /// Sets the value of [filename][crate::model::Attachment::filename].
249    ///
250    /// # Example
251    /// ```ignore,no_run
252    /// # use google_cloud_support_v2::model::Attachment;
253    /// let x = Attachment::new().set_filename("example");
254    /// ```
255    pub fn set_filename<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
256        self.filename = v.into();
257        self
258    }
259
260    /// Sets the value of [mime_type][crate::model::Attachment::mime_type].
261    ///
262    /// # Example
263    /// ```ignore,no_run
264    /// # use google_cloud_support_v2::model::Attachment;
265    /// let x = Attachment::new().set_mime_type("example");
266    /// ```
267    pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
268        self.mime_type = v.into();
269        self
270    }
271
272    /// Sets the value of [size_bytes][crate::model::Attachment::size_bytes].
273    ///
274    /// # Example
275    /// ```ignore,no_run
276    /// # use google_cloud_support_v2::model::Attachment;
277    /// let x = Attachment::new().set_size_bytes(42);
278    /// ```
279    pub fn set_size_bytes<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
280        self.size_bytes = v.into();
281        self
282    }
283}
284
285impl wkt::message::Message for Attachment {
286    fn typename() -> &'static str {
287        "type.googleapis.com/google.cloud.support.v2.Attachment"
288    }
289}
290
291/// The request message for the ListAttachments endpoint.
292#[derive(Clone, Default, PartialEq)]
293#[non_exhaustive]
294pub struct ListAttachmentsRequest {
295    /// Required. The name of the case for which attachments should be listed.
296    pub parent: std::string::String,
297
298    /// The maximum number of attachments fetched with each request.
299    ///
300    /// If not provided, the default is 10. The maximum page size that will be
301    /// returned is 100.
302    ///
303    /// The size of each page can be smaller than the requested page size and can
304    /// include zero. For example, you could request 100 attachments on one page,
305    /// receive 0, and then on the next page, receive 90.
306    pub page_size: i32,
307
308    /// A token identifying the page of results to return. If unspecified, the
309    /// first page is retrieved.
310    pub page_token: std::string::String,
311
312    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
313}
314
315impl ListAttachmentsRequest {
316    /// Creates a new default instance.
317    pub fn new() -> Self {
318        std::default::Default::default()
319    }
320
321    /// Sets the value of [parent][crate::model::ListAttachmentsRequest::parent].
322    ///
323    /// # Example
324    /// ```ignore,no_run
325    /// # use google_cloud_support_v2::model::ListAttachmentsRequest;
326    /// let x = ListAttachmentsRequest::new().set_parent("example");
327    /// ```
328    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
329        self.parent = v.into();
330        self
331    }
332
333    /// Sets the value of [page_size][crate::model::ListAttachmentsRequest::page_size].
334    ///
335    /// # Example
336    /// ```ignore,no_run
337    /// # use google_cloud_support_v2::model::ListAttachmentsRequest;
338    /// let x = ListAttachmentsRequest::new().set_page_size(42);
339    /// ```
340    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
341        self.page_size = v.into();
342        self
343    }
344
345    /// Sets the value of [page_token][crate::model::ListAttachmentsRequest::page_token].
346    ///
347    /// # Example
348    /// ```ignore,no_run
349    /// # use google_cloud_support_v2::model::ListAttachmentsRequest;
350    /// let x = ListAttachmentsRequest::new().set_page_token("example");
351    /// ```
352    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
353        self.page_token = v.into();
354        self
355    }
356}
357
358impl wkt::message::Message for ListAttachmentsRequest {
359    fn typename() -> &'static str {
360        "type.googleapis.com/google.cloud.support.v2.ListAttachmentsRequest"
361    }
362}
363
364/// The response message for the ListAttachments endpoint.
365#[derive(Clone, Default, PartialEq)]
366#[non_exhaustive]
367pub struct ListAttachmentsResponse {
368    /// The list of attachments associated with a case.
369    pub attachments: std::vec::Vec<crate::model::Attachment>,
370
371    /// A token to retrieve the next page of results. Set this in the `page_token`
372    /// field of subsequent `cases.attachments.list` requests. If unspecified,
373    /// there are no more results to retrieve.
374    pub next_page_token: std::string::String,
375
376    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
377}
378
379impl ListAttachmentsResponse {
380    /// Creates a new default instance.
381    pub fn new() -> Self {
382        std::default::Default::default()
383    }
384
385    /// Sets the value of [attachments][crate::model::ListAttachmentsResponse::attachments].
386    ///
387    /// # Example
388    /// ```ignore,no_run
389    /// # use google_cloud_support_v2::model::ListAttachmentsResponse;
390    /// use google_cloud_support_v2::model::Attachment;
391    /// let x = ListAttachmentsResponse::new()
392    ///     .set_attachments([
393    ///         Attachment::default()/* use setters */,
394    ///         Attachment::default()/* use (different) setters */,
395    ///     ]);
396    /// ```
397    pub fn set_attachments<T, V>(mut self, v: T) -> Self
398    where
399        T: std::iter::IntoIterator<Item = V>,
400        V: std::convert::Into<crate::model::Attachment>,
401    {
402        use std::iter::Iterator;
403        self.attachments = v.into_iter().map(|i| i.into()).collect();
404        self
405    }
406
407    /// Sets the value of [next_page_token][crate::model::ListAttachmentsResponse::next_page_token].
408    ///
409    /// # Example
410    /// ```ignore,no_run
411    /// # use google_cloud_support_v2::model::ListAttachmentsResponse;
412    /// let x = ListAttachmentsResponse::new().set_next_page_token("example");
413    /// ```
414    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
415        self.next_page_token = v.into();
416        self
417    }
418}
419
420impl wkt::message::Message for ListAttachmentsResponse {
421    fn typename() -> &'static str {
422        "type.googleapis.com/google.cloud.support.v2.ListAttachmentsResponse"
423    }
424}
425
426#[doc(hidden)]
427impl google_cloud_gax::paginator::internal::PageableResponse for ListAttachmentsResponse {
428    type PageItem = crate::model::Attachment;
429
430    fn items(self) -> std::vec::Vec<Self::PageItem> {
431        self.attachments
432    }
433
434    fn next_page_token(&self) -> std::string::String {
435        use std::clone::Clone;
436        self.next_page_token.clone()
437    }
438}
439
440/// A Case is an object that contains the details of a support case. It
441/// contains fields for the time it was created, its priority, its
442/// classification, and more. Cases can also have comments and attachments that
443/// get added over time.
444///
445/// A case is parented by a Google Cloud organization or project.
446///
447/// Organizations are identified by a number, so the name of a case parented by
448/// an organization would look like this:
449///
450/// ```norust
451/// organizations/123/cases/456
452/// ```
453///
454/// Projects have two unique identifiers, an ID and a number, and they look like
455/// this:
456///
457/// ```norust
458/// projects/abc/cases/456
459/// ```
460///
461/// ```norust
462/// projects/123/cases/456
463/// ```
464///
465/// You can use either of them when calling the API. To learn more
466/// about project identifiers, see [AIP-2510](https://google.aip.dev/cloud/2510).
467#[derive(Clone, Default, PartialEq)]
468#[non_exhaustive]
469pub struct Case {
470    /// Identifier. The resource name for the case.
471    pub name: std::string::String,
472
473    /// The short summary of the issue reported in this case.
474    pub display_name: std::string::String,
475
476    /// A broad description of the issue.
477    pub description: std::string::String,
478
479    /// The issue classification applicable to this case.
480    pub classification: std::option::Option<crate::model::CaseClassification>,
481
482    /// The timezone of the user who created the support case.
483    /// It should be in a format IANA recognizes: <https://www.iana.org/time-zones>.
484    /// There is no additional validation done by the API.
485    pub time_zone: std::string::String,
486
487    /// The email addresses to receive updates on this case.
488    pub subscriber_email_addresses: std::vec::Vec<std::string::String>,
489
490    /// Output only. The current status of the support case.
491    pub state: crate::model::case::State,
492
493    /// Output only. The time this case was created.
494    pub create_time: std::option::Option<wkt::Timestamp>,
495
496    /// Output only. The time this case was last updated.
497    pub update_time: std::option::Option<wkt::Timestamp>,
498
499    /// The user who created the case.
500    ///
501    /// Note: The name and email will be obfuscated if the case was created by
502    /// Google Support.
503    pub creator: std::option::Option<crate::model::Actor>,
504
505    /// A user-supplied email address to send case update notifications for. This
506    /// should only be used in BYOID flows, where we cannot infer the user's email
507    /// address directly from their EUCs.
508    pub contact_email: std::string::String,
509
510    /// Whether the case is currently escalated.
511    pub escalated: bool,
512
513    /// Whether this case was created for internal API testing and should not be
514    /// acted on by the support team.
515    pub test_case: bool,
516
517    /// The language the user has requested to receive support in. This should be a
518    /// BCP 47 language code (e.g., `"en"`, `"zh-CN"`, `"zh-TW"`, `"ja"`, `"ko"`).
519    /// If no language or an unsupported language is specified, this field defaults
520    /// to English (en).
521    ///
522    /// Language selection during case creation may affect your available support
523    /// options. For a list of supported languages and their support working hours,
524    /// see: <https://cloud.google.com/support/docs/language-working-hours>
525    pub language_code: std::string::String,
526
527    /// The priority of this case.
528    pub priority: crate::model::case::Priority,
529
530    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
531}
532
533impl Case {
534    /// Creates a new default instance.
535    pub fn new() -> Self {
536        std::default::Default::default()
537    }
538
539    /// Sets the value of [name][crate::model::Case::name].
540    ///
541    /// # Example
542    /// ```ignore,no_run
543    /// # use google_cloud_support_v2::model::Case;
544    /// let x = Case::new().set_name("example");
545    /// ```
546    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
547        self.name = v.into();
548        self
549    }
550
551    /// Sets the value of [display_name][crate::model::Case::display_name].
552    ///
553    /// # Example
554    /// ```ignore,no_run
555    /// # use google_cloud_support_v2::model::Case;
556    /// let x = Case::new().set_display_name("example");
557    /// ```
558    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
559        self.display_name = v.into();
560        self
561    }
562
563    /// Sets the value of [description][crate::model::Case::description].
564    ///
565    /// # Example
566    /// ```ignore,no_run
567    /// # use google_cloud_support_v2::model::Case;
568    /// let x = Case::new().set_description("example");
569    /// ```
570    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
571        self.description = v.into();
572        self
573    }
574
575    /// Sets the value of [classification][crate::model::Case::classification].
576    ///
577    /// # Example
578    /// ```ignore,no_run
579    /// # use google_cloud_support_v2::model::Case;
580    /// use google_cloud_support_v2::model::CaseClassification;
581    /// let x = Case::new().set_classification(CaseClassification::default()/* use setters */);
582    /// ```
583    pub fn set_classification<T>(mut self, v: T) -> Self
584    where
585        T: std::convert::Into<crate::model::CaseClassification>,
586    {
587        self.classification = std::option::Option::Some(v.into());
588        self
589    }
590
591    /// Sets or clears the value of [classification][crate::model::Case::classification].
592    ///
593    /// # Example
594    /// ```ignore,no_run
595    /// # use google_cloud_support_v2::model::Case;
596    /// use google_cloud_support_v2::model::CaseClassification;
597    /// let x = Case::new().set_or_clear_classification(Some(CaseClassification::default()/* use setters */));
598    /// let x = Case::new().set_or_clear_classification(None::<CaseClassification>);
599    /// ```
600    pub fn set_or_clear_classification<T>(mut self, v: std::option::Option<T>) -> Self
601    where
602        T: std::convert::Into<crate::model::CaseClassification>,
603    {
604        self.classification = v.map(|x| x.into());
605        self
606    }
607
608    /// Sets the value of [time_zone][crate::model::Case::time_zone].
609    ///
610    /// # Example
611    /// ```ignore,no_run
612    /// # use google_cloud_support_v2::model::Case;
613    /// let x = Case::new().set_time_zone("example");
614    /// ```
615    pub fn set_time_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
616        self.time_zone = v.into();
617        self
618    }
619
620    /// Sets the value of [subscriber_email_addresses][crate::model::Case::subscriber_email_addresses].
621    ///
622    /// # Example
623    /// ```ignore,no_run
624    /// # use google_cloud_support_v2::model::Case;
625    /// let x = Case::new().set_subscriber_email_addresses(["a", "b", "c"]);
626    /// ```
627    pub fn set_subscriber_email_addresses<T, V>(mut self, v: T) -> Self
628    where
629        T: std::iter::IntoIterator<Item = V>,
630        V: std::convert::Into<std::string::String>,
631    {
632        use std::iter::Iterator;
633        self.subscriber_email_addresses = v.into_iter().map(|i| i.into()).collect();
634        self
635    }
636
637    /// Sets the value of [state][crate::model::Case::state].
638    ///
639    /// # Example
640    /// ```ignore,no_run
641    /// # use google_cloud_support_v2::model::Case;
642    /// use google_cloud_support_v2::model::case::State;
643    /// let x0 = Case::new().set_state(State::New);
644    /// let x1 = Case::new().set_state(State::InProgressGoogleSupport);
645    /// let x2 = Case::new().set_state(State::ActionRequired);
646    /// ```
647    pub fn set_state<T: std::convert::Into<crate::model::case::State>>(mut self, v: T) -> Self {
648        self.state = v.into();
649        self
650    }
651
652    /// Sets the value of [create_time][crate::model::Case::create_time].
653    ///
654    /// # Example
655    /// ```ignore,no_run
656    /// # use google_cloud_support_v2::model::Case;
657    /// use wkt::Timestamp;
658    /// let x = Case::new().set_create_time(Timestamp::default()/* use setters */);
659    /// ```
660    pub fn set_create_time<T>(mut self, v: T) -> Self
661    where
662        T: std::convert::Into<wkt::Timestamp>,
663    {
664        self.create_time = std::option::Option::Some(v.into());
665        self
666    }
667
668    /// Sets or clears the value of [create_time][crate::model::Case::create_time].
669    ///
670    /// # Example
671    /// ```ignore,no_run
672    /// # use google_cloud_support_v2::model::Case;
673    /// use wkt::Timestamp;
674    /// let x = Case::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
675    /// let x = Case::new().set_or_clear_create_time(None::<Timestamp>);
676    /// ```
677    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
678    where
679        T: std::convert::Into<wkt::Timestamp>,
680    {
681        self.create_time = v.map(|x| x.into());
682        self
683    }
684
685    /// Sets the value of [update_time][crate::model::Case::update_time].
686    ///
687    /// # Example
688    /// ```ignore,no_run
689    /// # use google_cloud_support_v2::model::Case;
690    /// use wkt::Timestamp;
691    /// let x = Case::new().set_update_time(Timestamp::default()/* use setters */);
692    /// ```
693    pub fn set_update_time<T>(mut self, v: T) -> Self
694    where
695        T: std::convert::Into<wkt::Timestamp>,
696    {
697        self.update_time = std::option::Option::Some(v.into());
698        self
699    }
700
701    /// Sets or clears the value of [update_time][crate::model::Case::update_time].
702    ///
703    /// # Example
704    /// ```ignore,no_run
705    /// # use google_cloud_support_v2::model::Case;
706    /// use wkt::Timestamp;
707    /// let x = Case::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
708    /// let x = Case::new().set_or_clear_update_time(None::<Timestamp>);
709    /// ```
710    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
711    where
712        T: std::convert::Into<wkt::Timestamp>,
713    {
714        self.update_time = v.map(|x| x.into());
715        self
716    }
717
718    /// Sets the value of [creator][crate::model::Case::creator].
719    ///
720    /// # Example
721    /// ```ignore,no_run
722    /// # use google_cloud_support_v2::model::Case;
723    /// use google_cloud_support_v2::model::Actor;
724    /// let x = Case::new().set_creator(Actor::default()/* use setters */);
725    /// ```
726    pub fn set_creator<T>(mut self, v: T) -> Self
727    where
728        T: std::convert::Into<crate::model::Actor>,
729    {
730        self.creator = std::option::Option::Some(v.into());
731        self
732    }
733
734    /// Sets or clears the value of [creator][crate::model::Case::creator].
735    ///
736    /// # Example
737    /// ```ignore,no_run
738    /// # use google_cloud_support_v2::model::Case;
739    /// use google_cloud_support_v2::model::Actor;
740    /// let x = Case::new().set_or_clear_creator(Some(Actor::default()/* use setters */));
741    /// let x = Case::new().set_or_clear_creator(None::<Actor>);
742    /// ```
743    pub fn set_or_clear_creator<T>(mut self, v: std::option::Option<T>) -> Self
744    where
745        T: std::convert::Into<crate::model::Actor>,
746    {
747        self.creator = v.map(|x| x.into());
748        self
749    }
750
751    /// Sets the value of [contact_email][crate::model::Case::contact_email].
752    ///
753    /// # Example
754    /// ```ignore,no_run
755    /// # use google_cloud_support_v2::model::Case;
756    /// let x = Case::new().set_contact_email("example");
757    /// ```
758    pub fn set_contact_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
759        self.contact_email = v.into();
760        self
761    }
762
763    /// Sets the value of [escalated][crate::model::Case::escalated].
764    ///
765    /// # Example
766    /// ```ignore,no_run
767    /// # use google_cloud_support_v2::model::Case;
768    /// let x = Case::new().set_escalated(true);
769    /// ```
770    pub fn set_escalated<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
771        self.escalated = v.into();
772        self
773    }
774
775    /// Sets the value of [test_case][crate::model::Case::test_case].
776    ///
777    /// # Example
778    /// ```ignore,no_run
779    /// # use google_cloud_support_v2::model::Case;
780    /// let x = Case::new().set_test_case(true);
781    /// ```
782    pub fn set_test_case<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
783        self.test_case = v.into();
784        self
785    }
786
787    /// Sets the value of [language_code][crate::model::Case::language_code].
788    ///
789    /// # Example
790    /// ```ignore,no_run
791    /// # use google_cloud_support_v2::model::Case;
792    /// let x = Case::new().set_language_code("example");
793    /// ```
794    pub fn set_language_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
795        self.language_code = v.into();
796        self
797    }
798
799    /// Sets the value of [priority][crate::model::Case::priority].
800    ///
801    /// # Example
802    /// ```ignore,no_run
803    /// # use google_cloud_support_v2::model::Case;
804    /// use google_cloud_support_v2::model::case::Priority;
805    /// let x0 = Case::new().set_priority(Priority::P0);
806    /// let x1 = Case::new().set_priority(Priority::P1);
807    /// let x2 = Case::new().set_priority(Priority::P2);
808    /// ```
809    pub fn set_priority<T: std::convert::Into<crate::model::case::Priority>>(
810        mut self,
811        v: T,
812    ) -> Self {
813        self.priority = v.into();
814        self
815    }
816}
817
818impl wkt::message::Message for Case {
819    fn typename() -> &'static str {
820        "type.googleapis.com/google.cloud.support.v2.Case"
821    }
822}
823
824/// Defines additional types related to [Case].
825pub mod case {
826    #[allow(unused_imports)]
827    use super::*;
828
829    /// The status of a support case.
830    ///
831    /// # Working with unknown values
832    ///
833    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
834    /// additional enum variants at any time. Adding new variants is not considered
835    /// a breaking change. Applications should write their code in anticipation of:
836    ///
837    /// - New values appearing in future releases of the client library, **and**
838    /// - New values received dynamically, without application changes.
839    ///
840    /// Please consult the [Working with enums] section in the user guide for some
841    /// guidelines.
842    ///
843    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
844    #[derive(Clone, Debug, PartialEq)]
845    #[non_exhaustive]
846    pub enum State {
847        /// Case is in an unknown state.
848        Unspecified,
849        /// The case has been created but no one is assigned to work on it yet.
850        New,
851        /// The case is currently being handled by Google support.
852        InProgressGoogleSupport,
853        /// Google is waiting for a response.
854        ActionRequired,
855        /// A solution has been offered for the case, but it isn't yet closed.
856        SolutionProvided,
857        /// The case has been resolved.
858        Closed,
859        /// If set, the enum was initialized with an unknown value.
860        ///
861        /// Applications can examine the value using [State::value] or
862        /// [State::name].
863        UnknownValue(state::UnknownValue),
864    }
865
866    #[doc(hidden)]
867    pub mod state {
868        #[allow(unused_imports)]
869        use super::*;
870        #[derive(Clone, Debug, PartialEq)]
871        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
872    }
873
874    impl State {
875        /// Gets the enum value.
876        ///
877        /// Returns `None` if the enum contains an unknown value deserialized from
878        /// the string representation of enums.
879        pub fn value(&self) -> std::option::Option<i32> {
880            match self {
881                Self::Unspecified => std::option::Option::Some(0),
882                Self::New => std::option::Option::Some(1),
883                Self::InProgressGoogleSupport => std::option::Option::Some(2),
884                Self::ActionRequired => std::option::Option::Some(3),
885                Self::SolutionProvided => std::option::Option::Some(4),
886                Self::Closed => std::option::Option::Some(5),
887                Self::UnknownValue(u) => u.0.value(),
888            }
889        }
890
891        /// Gets the enum value as a string.
892        ///
893        /// Returns `None` if the enum contains an unknown value deserialized from
894        /// the integer representation of enums.
895        pub fn name(&self) -> std::option::Option<&str> {
896            match self {
897                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
898                Self::New => std::option::Option::Some("NEW"),
899                Self::InProgressGoogleSupport => {
900                    std::option::Option::Some("IN_PROGRESS_GOOGLE_SUPPORT")
901                }
902                Self::ActionRequired => std::option::Option::Some("ACTION_REQUIRED"),
903                Self::SolutionProvided => std::option::Option::Some("SOLUTION_PROVIDED"),
904                Self::Closed => std::option::Option::Some("CLOSED"),
905                Self::UnknownValue(u) => u.0.name(),
906            }
907        }
908    }
909
910    impl std::default::Default for State {
911        fn default() -> Self {
912            use std::convert::From;
913            Self::from(0)
914        }
915    }
916
917    impl std::fmt::Display for State {
918        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
919            wkt::internal::display_enum(f, self.name(), self.value())
920        }
921    }
922
923    impl std::convert::From<i32> for State {
924        fn from(value: i32) -> Self {
925            match value {
926                0 => Self::Unspecified,
927                1 => Self::New,
928                2 => Self::InProgressGoogleSupport,
929                3 => Self::ActionRequired,
930                4 => Self::SolutionProvided,
931                5 => Self::Closed,
932                _ => Self::UnknownValue(state::UnknownValue(
933                    wkt::internal::UnknownEnumValue::Integer(value),
934                )),
935            }
936        }
937    }
938
939    impl std::convert::From<&str> for State {
940        fn from(value: &str) -> Self {
941            use std::string::ToString;
942            match value {
943                "STATE_UNSPECIFIED" => Self::Unspecified,
944                "NEW" => Self::New,
945                "IN_PROGRESS_GOOGLE_SUPPORT" => Self::InProgressGoogleSupport,
946                "ACTION_REQUIRED" => Self::ActionRequired,
947                "SOLUTION_PROVIDED" => Self::SolutionProvided,
948                "CLOSED" => Self::Closed,
949                _ => Self::UnknownValue(state::UnknownValue(
950                    wkt::internal::UnknownEnumValue::String(value.to_string()),
951                )),
952            }
953        }
954    }
955
956    impl serde::ser::Serialize for State {
957        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
958        where
959            S: serde::Serializer,
960        {
961            match self {
962                Self::Unspecified => serializer.serialize_i32(0),
963                Self::New => serializer.serialize_i32(1),
964                Self::InProgressGoogleSupport => serializer.serialize_i32(2),
965                Self::ActionRequired => serializer.serialize_i32(3),
966                Self::SolutionProvided => serializer.serialize_i32(4),
967                Self::Closed => serializer.serialize_i32(5),
968                Self::UnknownValue(u) => u.0.serialize(serializer),
969            }
970        }
971    }
972
973    impl<'de> serde::de::Deserialize<'de> for State {
974        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
975        where
976            D: serde::Deserializer<'de>,
977        {
978            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
979                ".google.cloud.support.v2.Case.State",
980            ))
981        }
982    }
983
984    /// The case Priority. P0 is most urgent and P4 the least.
985    ///
986    /// # Working with unknown values
987    ///
988    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
989    /// additional enum variants at any time. Adding new variants is not considered
990    /// a breaking change. Applications should write their code in anticipation of:
991    ///
992    /// - New values appearing in future releases of the client library, **and**
993    /// - New values received dynamically, without application changes.
994    ///
995    /// Please consult the [Working with enums] section in the user guide for some
996    /// guidelines.
997    ///
998    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
999    #[derive(Clone, Debug, PartialEq)]
1000    #[non_exhaustive]
1001    pub enum Priority {
1002        /// Priority is undefined or has not been set yet.
1003        Unspecified,
1004        /// Extreme impact on a production service. Service is hard down.
1005        P0,
1006        /// Critical impact on a production service. Service is currently unusable.
1007        P1,
1008        /// Severe impact on a production service. Service is usable but greatly
1009        /// impaired.
1010        P2,
1011        /// Medium impact on a production service.  Service is available, but
1012        /// moderately impaired.
1013        P3,
1014        /// General questions or minor issues.  Production service is fully
1015        /// available.
1016        P4,
1017        /// If set, the enum was initialized with an unknown value.
1018        ///
1019        /// Applications can examine the value using [Priority::value] or
1020        /// [Priority::name].
1021        UnknownValue(priority::UnknownValue),
1022    }
1023
1024    #[doc(hidden)]
1025    pub mod priority {
1026        #[allow(unused_imports)]
1027        use super::*;
1028        #[derive(Clone, Debug, PartialEq)]
1029        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1030    }
1031
1032    impl Priority {
1033        /// Gets the enum value.
1034        ///
1035        /// Returns `None` if the enum contains an unknown value deserialized from
1036        /// the string representation of enums.
1037        pub fn value(&self) -> std::option::Option<i32> {
1038            match self {
1039                Self::Unspecified => std::option::Option::Some(0),
1040                Self::P0 => std::option::Option::Some(1),
1041                Self::P1 => std::option::Option::Some(2),
1042                Self::P2 => std::option::Option::Some(3),
1043                Self::P3 => std::option::Option::Some(4),
1044                Self::P4 => std::option::Option::Some(5),
1045                Self::UnknownValue(u) => u.0.value(),
1046            }
1047        }
1048
1049        /// Gets the enum value as a string.
1050        ///
1051        /// Returns `None` if the enum contains an unknown value deserialized from
1052        /// the integer representation of enums.
1053        pub fn name(&self) -> std::option::Option<&str> {
1054            match self {
1055                Self::Unspecified => std::option::Option::Some("PRIORITY_UNSPECIFIED"),
1056                Self::P0 => std::option::Option::Some("P0"),
1057                Self::P1 => std::option::Option::Some("P1"),
1058                Self::P2 => std::option::Option::Some("P2"),
1059                Self::P3 => std::option::Option::Some("P3"),
1060                Self::P4 => std::option::Option::Some("P4"),
1061                Self::UnknownValue(u) => u.0.name(),
1062            }
1063        }
1064    }
1065
1066    impl std::default::Default for Priority {
1067        fn default() -> Self {
1068            use std::convert::From;
1069            Self::from(0)
1070        }
1071    }
1072
1073    impl std::fmt::Display for Priority {
1074        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1075            wkt::internal::display_enum(f, self.name(), self.value())
1076        }
1077    }
1078
1079    impl std::convert::From<i32> for Priority {
1080        fn from(value: i32) -> Self {
1081            match value {
1082                0 => Self::Unspecified,
1083                1 => Self::P0,
1084                2 => Self::P1,
1085                3 => Self::P2,
1086                4 => Self::P3,
1087                5 => Self::P4,
1088                _ => Self::UnknownValue(priority::UnknownValue(
1089                    wkt::internal::UnknownEnumValue::Integer(value),
1090                )),
1091            }
1092        }
1093    }
1094
1095    impl std::convert::From<&str> for Priority {
1096        fn from(value: &str) -> Self {
1097            use std::string::ToString;
1098            match value {
1099                "PRIORITY_UNSPECIFIED" => Self::Unspecified,
1100                "P0" => Self::P0,
1101                "P1" => Self::P1,
1102                "P2" => Self::P2,
1103                "P3" => Self::P3,
1104                "P4" => Self::P4,
1105                _ => Self::UnknownValue(priority::UnknownValue(
1106                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1107                )),
1108            }
1109        }
1110    }
1111
1112    impl serde::ser::Serialize for Priority {
1113        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1114        where
1115            S: serde::Serializer,
1116        {
1117            match self {
1118                Self::Unspecified => serializer.serialize_i32(0),
1119                Self::P0 => serializer.serialize_i32(1),
1120                Self::P1 => serializer.serialize_i32(2),
1121                Self::P2 => serializer.serialize_i32(3),
1122                Self::P3 => serializer.serialize_i32(4),
1123                Self::P4 => serializer.serialize_i32(5),
1124                Self::UnknownValue(u) => u.0.serialize(serializer),
1125            }
1126        }
1127    }
1128
1129    impl<'de> serde::de::Deserialize<'de> for Priority {
1130        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1131        where
1132            D: serde::Deserializer<'de>,
1133        {
1134            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Priority>::new(
1135                ".google.cloud.support.v2.Case.Priority",
1136            ))
1137        }
1138    }
1139}
1140
1141/// A Case Classification represents the topic that a case is about. It's very
1142/// important to use accurate classifications, because they're
1143/// used to route your cases to specialists who can help you.
1144///
1145/// A classification always has an ID that is its unique identifier.
1146/// A valid ID is required when creating a case.
1147#[derive(Clone, Default, PartialEq)]
1148#[non_exhaustive]
1149pub struct CaseClassification {
1150    /// The unique ID for a classification. Must be specified for case creation.
1151    ///
1152    /// To retrieve valid classification IDs for case creation, use
1153    /// `caseClassifications.search`.
1154    ///
1155    /// Classification IDs returned by `caseClassifications.search` are guaranteed
1156    /// to be valid for at least 6 months. If a given classification is
1157    /// deactiveated, it will immediately stop being returned. After 6 months,
1158    /// `case.create` requests using the classification ID will fail.
1159    pub id: std::string::String,
1160
1161    /// A display name for the classification.
1162    ///
1163    /// The display name is not static and can change. To uniquely and consistently
1164    /// identify classifications, use the `CaseClassification.id` field.
1165    pub display_name: std::string::String,
1166
1167    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1168}
1169
1170impl CaseClassification {
1171    /// Creates a new default instance.
1172    pub fn new() -> Self {
1173        std::default::Default::default()
1174    }
1175
1176    /// Sets the value of [id][crate::model::CaseClassification::id].
1177    ///
1178    /// # Example
1179    /// ```ignore,no_run
1180    /// # use google_cloud_support_v2::model::CaseClassification;
1181    /// let x = CaseClassification::new().set_id("example");
1182    /// ```
1183    pub fn set_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1184        self.id = v.into();
1185        self
1186    }
1187
1188    /// Sets the value of [display_name][crate::model::CaseClassification::display_name].
1189    ///
1190    /// # Example
1191    /// ```ignore,no_run
1192    /// # use google_cloud_support_v2::model::CaseClassification;
1193    /// let x = CaseClassification::new().set_display_name("example");
1194    /// ```
1195    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1196        self.display_name = v.into();
1197        self
1198    }
1199}
1200
1201impl wkt::message::Message for CaseClassification {
1202    fn typename() -> &'static str {
1203        "type.googleapis.com/google.cloud.support.v2.CaseClassification"
1204    }
1205}
1206
1207/// The request message for the GetCase endpoint.
1208#[derive(Clone, Default, PartialEq)]
1209#[non_exhaustive]
1210pub struct GetCaseRequest {
1211    /// Required. The full name of a case to be retrieved.
1212    pub name: std::string::String,
1213
1214    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1215}
1216
1217impl GetCaseRequest {
1218    /// Creates a new default instance.
1219    pub fn new() -> Self {
1220        std::default::Default::default()
1221    }
1222
1223    /// Sets the value of [name][crate::model::GetCaseRequest::name].
1224    ///
1225    /// # Example
1226    /// ```ignore,no_run
1227    /// # use google_cloud_support_v2::model::GetCaseRequest;
1228    /// let x = GetCaseRequest::new().set_name("example");
1229    /// ```
1230    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1231        self.name = v.into();
1232        self
1233    }
1234}
1235
1236impl wkt::message::Message for GetCaseRequest {
1237    fn typename() -> &'static str {
1238        "type.googleapis.com/google.cloud.support.v2.GetCaseRequest"
1239    }
1240}
1241
1242/// The request message for the CreateCase endpoint.
1243#[derive(Clone, Default, PartialEq)]
1244#[non_exhaustive]
1245pub struct CreateCaseRequest {
1246    /// Required. The name of the parent under which the case should be created.
1247    pub parent: std::string::String,
1248
1249    /// Required. The case to be created.
1250    pub case: std::option::Option<crate::model::Case>,
1251
1252    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1253}
1254
1255impl CreateCaseRequest {
1256    /// Creates a new default instance.
1257    pub fn new() -> Self {
1258        std::default::Default::default()
1259    }
1260
1261    /// Sets the value of [parent][crate::model::CreateCaseRequest::parent].
1262    ///
1263    /// # Example
1264    /// ```ignore,no_run
1265    /// # use google_cloud_support_v2::model::CreateCaseRequest;
1266    /// let x = CreateCaseRequest::new().set_parent("example");
1267    /// ```
1268    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1269        self.parent = v.into();
1270        self
1271    }
1272
1273    /// Sets the value of [case][crate::model::CreateCaseRequest::case].
1274    ///
1275    /// # Example
1276    /// ```ignore,no_run
1277    /// # use google_cloud_support_v2::model::CreateCaseRequest;
1278    /// use google_cloud_support_v2::model::Case;
1279    /// let x = CreateCaseRequest::new().set_case(Case::default()/* use setters */);
1280    /// ```
1281    pub fn set_case<T>(mut self, v: T) -> Self
1282    where
1283        T: std::convert::Into<crate::model::Case>,
1284    {
1285        self.case = std::option::Option::Some(v.into());
1286        self
1287    }
1288
1289    /// Sets or clears the value of [case][crate::model::CreateCaseRequest::case].
1290    ///
1291    /// # Example
1292    /// ```ignore,no_run
1293    /// # use google_cloud_support_v2::model::CreateCaseRequest;
1294    /// use google_cloud_support_v2::model::Case;
1295    /// let x = CreateCaseRequest::new().set_or_clear_case(Some(Case::default()/* use setters */));
1296    /// let x = CreateCaseRequest::new().set_or_clear_case(None::<Case>);
1297    /// ```
1298    pub fn set_or_clear_case<T>(mut self, v: std::option::Option<T>) -> Self
1299    where
1300        T: std::convert::Into<crate::model::Case>,
1301    {
1302        self.case = v.map(|x| x.into());
1303        self
1304    }
1305}
1306
1307impl wkt::message::Message for CreateCaseRequest {
1308    fn typename() -> &'static str {
1309        "type.googleapis.com/google.cloud.support.v2.CreateCaseRequest"
1310    }
1311}
1312
1313/// The request message for the ListCases endpoint.
1314#[derive(Clone, Default, PartialEq)]
1315#[non_exhaustive]
1316pub struct ListCasesRequest {
1317    /// Required. The name of a parent to list cases under.
1318    pub parent: std::string::String,
1319
1320    /// An expression used to filter cases.
1321    ///
1322    /// If it's an empty string, then no filtering happens. Otherwise, the endpoint
1323    /// returns the cases that match the filter.
1324    ///
1325    /// Expressions use the following fields separated by `AND` and specified with
1326    /// `=`:
1327    ///
1328    /// - `state`: Can be `OPEN` or `CLOSED`.
1329    /// - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You
1330    ///   can specify multiple values for priority using the `OR` operator. For
1331    ///   example, `priority=P1 OR priority=P2`.
1332    /// - `creator.email`: The email address of the case creator.
1333    ///
1334    /// EXAMPLES:
1335    ///
1336    /// - `state=CLOSED`
1337    /// - `state=OPEN AND creator.email="tester@example.com"`
1338    /// - `state=OPEN AND (priority=P0 OR priority=P1)`
1339    pub filter: std::string::String,
1340
1341    /// The maximum number of cases fetched with each request. Defaults to 10.
1342    pub page_size: i32,
1343
1344    /// A token identifying the page of results to return. If unspecified, the
1345    /// first page is retrieved.
1346    pub page_token: std::string::String,
1347
1348    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1349}
1350
1351impl ListCasesRequest {
1352    /// Creates a new default instance.
1353    pub fn new() -> Self {
1354        std::default::Default::default()
1355    }
1356
1357    /// Sets the value of [parent][crate::model::ListCasesRequest::parent].
1358    ///
1359    /// # Example
1360    /// ```ignore,no_run
1361    /// # use google_cloud_support_v2::model::ListCasesRequest;
1362    /// let x = ListCasesRequest::new().set_parent("example");
1363    /// ```
1364    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1365        self.parent = v.into();
1366        self
1367    }
1368
1369    /// Sets the value of [filter][crate::model::ListCasesRequest::filter].
1370    ///
1371    /// # Example
1372    /// ```ignore,no_run
1373    /// # use google_cloud_support_v2::model::ListCasesRequest;
1374    /// let x = ListCasesRequest::new().set_filter("example");
1375    /// ```
1376    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1377        self.filter = v.into();
1378        self
1379    }
1380
1381    /// Sets the value of [page_size][crate::model::ListCasesRequest::page_size].
1382    ///
1383    /// # Example
1384    /// ```ignore,no_run
1385    /// # use google_cloud_support_v2::model::ListCasesRequest;
1386    /// let x = ListCasesRequest::new().set_page_size(42);
1387    /// ```
1388    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1389        self.page_size = v.into();
1390        self
1391    }
1392
1393    /// Sets the value of [page_token][crate::model::ListCasesRequest::page_token].
1394    ///
1395    /// # Example
1396    /// ```ignore,no_run
1397    /// # use google_cloud_support_v2::model::ListCasesRequest;
1398    /// let x = ListCasesRequest::new().set_page_token("example");
1399    /// ```
1400    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1401        self.page_token = v.into();
1402        self
1403    }
1404}
1405
1406impl wkt::message::Message for ListCasesRequest {
1407    fn typename() -> &'static str {
1408        "type.googleapis.com/google.cloud.support.v2.ListCasesRequest"
1409    }
1410}
1411
1412/// The response message for the ListCases endpoint.
1413#[derive(Clone, Default, PartialEq)]
1414#[non_exhaustive]
1415pub struct ListCasesResponse {
1416    /// The list of cases associated with the parent after any
1417    /// filters have been applied.
1418    pub cases: std::vec::Vec<crate::model::Case>,
1419
1420    /// A token to retrieve the next page of results. Set this in the `page_token`
1421    /// field of subsequent `cases.list` requests. If unspecified, there are no
1422    /// more results to retrieve.
1423    pub next_page_token: std::string::String,
1424
1425    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1426}
1427
1428impl ListCasesResponse {
1429    /// Creates a new default instance.
1430    pub fn new() -> Self {
1431        std::default::Default::default()
1432    }
1433
1434    /// Sets the value of [cases][crate::model::ListCasesResponse::cases].
1435    ///
1436    /// # Example
1437    /// ```ignore,no_run
1438    /// # use google_cloud_support_v2::model::ListCasesResponse;
1439    /// use google_cloud_support_v2::model::Case;
1440    /// let x = ListCasesResponse::new()
1441    ///     .set_cases([
1442    ///         Case::default()/* use setters */,
1443    ///         Case::default()/* use (different) setters */,
1444    ///     ]);
1445    /// ```
1446    pub fn set_cases<T, V>(mut self, v: T) -> Self
1447    where
1448        T: std::iter::IntoIterator<Item = V>,
1449        V: std::convert::Into<crate::model::Case>,
1450    {
1451        use std::iter::Iterator;
1452        self.cases = v.into_iter().map(|i| i.into()).collect();
1453        self
1454    }
1455
1456    /// Sets the value of [next_page_token][crate::model::ListCasesResponse::next_page_token].
1457    ///
1458    /// # Example
1459    /// ```ignore,no_run
1460    /// # use google_cloud_support_v2::model::ListCasesResponse;
1461    /// let x = ListCasesResponse::new().set_next_page_token("example");
1462    /// ```
1463    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1464        self.next_page_token = v.into();
1465        self
1466    }
1467}
1468
1469impl wkt::message::Message for ListCasesResponse {
1470    fn typename() -> &'static str {
1471        "type.googleapis.com/google.cloud.support.v2.ListCasesResponse"
1472    }
1473}
1474
1475#[doc(hidden)]
1476impl google_cloud_gax::paginator::internal::PageableResponse for ListCasesResponse {
1477    type PageItem = crate::model::Case;
1478
1479    fn items(self) -> std::vec::Vec<Self::PageItem> {
1480        self.cases
1481    }
1482
1483    fn next_page_token(&self) -> std::string::String {
1484        use std::clone::Clone;
1485        self.next_page_token.clone()
1486    }
1487}
1488
1489/// The request message for the SearchCases endpoint.
1490#[derive(Clone, Default, PartialEq)]
1491#[non_exhaustive]
1492pub struct SearchCasesRequest {
1493    /// The name of the parent resource to search for cases under.
1494    pub parent: std::string::String,
1495
1496    /// An expression used to filter cases.
1497    ///
1498    /// Expressions use the following fields separated by `AND` and specified with
1499    /// `=`:
1500    ///
1501    /// - `organization`: An organization name in the form
1502    ///   `organizations/<organization_id>`.
1503    /// - `project`: A project name in the form `projects/<project_id>`.
1504    /// - `state`: Can be `OPEN` or `CLOSED`.
1505    /// - `priority`: Can be `P0`, `P1`, `P2`, `P3`, or `P4`. You
1506    ///   can specify multiple values for priority using the `OR` operator. For
1507    ///   example, `priority=P1 OR priority=P2`.
1508    /// - `creator.email`: The email address of the case creator.
1509    ///
1510    /// You must specify either `organization` or `project`.
1511    ///
1512    /// To search across `displayName`, `description`, and comments, use a global
1513    /// restriction with no keyword or operator. For example, `"my search"`.
1514    ///
1515    /// To search only cases updated after a certain date, use `update_time`
1516    /// restricted with that particular date, time, and timezone in ISO datetime
1517    /// format. For example, `update_time>"2020-01-01T00:00:00-05:00"`.
1518    /// `update_time` only supports the greater than operator (`>`).
1519    ///
1520    /// Examples:
1521    ///
1522    /// - `organization="organizations/123456789"`
1523    /// - `project="projects/my-project-id"`
1524    /// - `project="projects/123456789"`
1525    /// - `organization="organizations/123456789" AND state=CLOSED`
1526    /// - `project="projects/my-project-id" AND creator.email="tester@example.com"`
1527    /// - `project="projects/my-project-id" AND (priority=P0 OR priority=P1)`
1528    pub query: std::string::String,
1529
1530    /// The maximum number of cases fetched with each request. The default page
1531    /// size is 10.
1532    pub page_size: i32,
1533
1534    /// A token identifying the page of results to return. If unspecified, the
1535    /// first page is retrieved.
1536    pub page_token: std::string::String,
1537
1538    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1539}
1540
1541impl SearchCasesRequest {
1542    /// Creates a new default instance.
1543    pub fn new() -> Self {
1544        std::default::Default::default()
1545    }
1546
1547    /// Sets the value of [parent][crate::model::SearchCasesRequest::parent].
1548    ///
1549    /// # Example
1550    /// ```ignore,no_run
1551    /// # use google_cloud_support_v2::model::SearchCasesRequest;
1552    /// let x = SearchCasesRequest::new().set_parent("example");
1553    /// ```
1554    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1555        self.parent = v.into();
1556        self
1557    }
1558
1559    /// Sets the value of [query][crate::model::SearchCasesRequest::query].
1560    ///
1561    /// # Example
1562    /// ```ignore,no_run
1563    /// # use google_cloud_support_v2::model::SearchCasesRequest;
1564    /// let x = SearchCasesRequest::new().set_query("example");
1565    /// ```
1566    pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1567        self.query = v.into();
1568        self
1569    }
1570
1571    /// Sets the value of [page_size][crate::model::SearchCasesRequest::page_size].
1572    ///
1573    /// # Example
1574    /// ```ignore,no_run
1575    /// # use google_cloud_support_v2::model::SearchCasesRequest;
1576    /// let x = SearchCasesRequest::new().set_page_size(42);
1577    /// ```
1578    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1579        self.page_size = v.into();
1580        self
1581    }
1582
1583    /// Sets the value of [page_token][crate::model::SearchCasesRequest::page_token].
1584    ///
1585    /// # Example
1586    /// ```ignore,no_run
1587    /// # use google_cloud_support_v2::model::SearchCasesRequest;
1588    /// let x = SearchCasesRequest::new().set_page_token("example");
1589    /// ```
1590    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1591        self.page_token = v.into();
1592        self
1593    }
1594}
1595
1596impl wkt::message::Message for SearchCasesRequest {
1597    fn typename() -> &'static str {
1598        "type.googleapis.com/google.cloud.support.v2.SearchCasesRequest"
1599    }
1600}
1601
1602/// The response message for the SearchCases endpoint.
1603#[derive(Clone, Default, PartialEq)]
1604#[non_exhaustive]
1605pub struct SearchCasesResponse {
1606    /// The list of cases associated with the parent after any
1607    /// filters have been applied.
1608    pub cases: std::vec::Vec<crate::model::Case>,
1609
1610    /// A token to retrieve the next page of results. Set this in the
1611    /// `page_token` field of subsequent `cases.search` requests. If unspecified,
1612    /// there are no more results to retrieve.
1613    pub next_page_token: std::string::String,
1614
1615    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1616}
1617
1618impl SearchCasesResponse {
1619    /// Creates a new default instance.
1620    pub fn new() -> Self {
1621        std::default::Default::default()
1622    }
1623
1624    /// Sets the value of [cases][crate::model::SearchCasesResponse::cases].
1625    ///
1626    /// # Example
1627    /// ```ignore,no_run
1628    /// # use google_cloud_support_v2::model::SearchCasesResponse;
1629    /// use google_cloud_support_v2::model::Case;
1630    /// let x = SearchCasesResponse::new()
1631    ///     .set_cases([
1632    ///         Case::default()/* use setters */,
1633    ///         Case::default()/* use (different) setters */,
1634    ///     ]);
1635    /// ```
1636    pub fn set_cases<T, V>(mut self, v: T) -> Self
1637    where
1638        T: std::iter::IntoIterator<Item = V>,
1639        V: std::convert::Into<crate::model::Case>,
1640    {
1641        use std::iter::Iterator;
1642        self.cases = v.into_iter().map(|i| i.into()).collect();
1643        self
1644    }
1645
1646    /// Sets the value of [next_page_token][crate::model::SearchCasesResponse::next_page_token].
1647    ///
1648    /// # Example
1649    /// ```ignore,no_run
1650    /// # use google_cloud_support_v2::model::SearchCasesResponse;
1651    /// let x = SearchCasesResponse::new().set_next_page_token("example");
1652    /// ```
1653    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1654        self.next_page_token = v.into();
1655        self
1656    }
1657}
1658
1659impl wkt::message::Message for SearchCasesResponse {
1660    fn typename() -> &'static str {
1661        "type.googleapis.com/google.cloud.support.v2.SearchCasesResponse"
1662    }
1663}
1664
1665#[doc(hidden)]
1666impl google_cloud_gax::paginator::internal::PageableResponse for SearchCasesResponse {
1667    type PageItem = crate::model::Case;
1668
1669    fn items(self) -> std::vec::Vec<Self::PageItem> {
1670        self.cases
1671    }
1672
1673    fn next_page_token(&self) -> std::string::String {
1674        use std::clone::Clone;
1675        self.next_page_token.clone()
1676    }
1677}
1678
1679/// The request message for the EscalateCase endpoint.
1680#[derive(Clone, Default, PartialEq)]
1681#[non_exhaustive]
1682pub struct EscalateCaseRequest {
1683    /// Required. The name of the case to be escalated.
1684    pub name: std::string::String,
1685
1686    /// The escalation information to be sent with the escalation request.
1687    pub escalation: std::option::Option<crate::model::Escalation>,
1688
1689    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1690}
1691
1692impl EscalateCaseRequest {
1693    /// Creates a new default instance.
1694    pub fn new() -> Self {
1695        std::default::Default::default()
1696    }
1697
1698    /// Sets the value of [name][crate::model::EscalateCaseRequest::name].
1699    ///
1700    /// # Example
1701    /// ```ignore,no_run
1702    /// # use google_cloud_support_v2::model::EscalateCaseRequest;
1703    /// let x = EscalateCaseRequest::new().set_name("example");
1704    /// ```
1705    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1706        self.name = v.into();
1707        self
1708    }
1709
1710    /// Sets the value of [escalation][crate::model::EscalateCaseRequest::escalation].
1711    ///
1712    /// # Example
1713    /// ```ignore,no_run
1714    /// # use google_cloud_support_v2::model::EscalateCaseRequest;
1715    /// use google_cloud_support_v2::model::Escalation;
1716    /// let x = EscalateCaseRequest::new().set_escalation(Escalation::default()/* use setters */);
1717    /// ```
1718    pub fn set_escalation<T>(mut self, v: T) -> Self
1719    where
1720        T: std::convert::Into<crate::model::Escalation>,
1721    {
1722        self.escalation = std::option::Option::Some(v.into());
1723        self
1724    }
1725
1726    /// Sets or clears the value of [escalation][crate::model::EscalateCaseRequest::escalation].
1727    ///
1728    /// # Example
1729    /// ```ignore,no_run
1730    /// # use google_cloud_support_v2::model::EscalateCaseRequest;
1731    /// use google_cloud_support_v2::model::Escalation;
1732    /// let x = EscalateCaseRequest::new().set_or_clear_escalation(Some(Escalation::default()/* use setters */));
1733    /// let x = EscalateCaseRequest::new().set_or_clear_escalation(None::<Escalation>);
1734    /// ```
1735    pub fn set_or_clear_escalation<T>(mut self, v: std::option::Option<T>) -> Self
1736    where
1737        T: std::convert::Into<crate::model::Escalation>,
1738    {
1739        self.escalation = v.map(|x| x.into());
1740        self
1741    }
1742}
1743
1744impl wkt::message::Message for EscalateCaseRequest {
1745    fn typename() -> &'static str {
1746        "type.googleapis.com/google.cloud.support.v2.EscalateCaseRequest"
1747    }
1748}
1749
1750/// The request message for the UpdateCase endpoint
1751#[derive(Clone, Default, PartialEq)]
1752#[non_exhaustive]
1753pub struct UpdateCaseRequest {
1754    /// Required. The case to update.
1755    pub case: std::option::Option<crate::model::Case>,
1756
1757    /// A list of attributes of the case that should be updated. Supported values
1758    /// are `priority`, `display_name`, and `subscriber_email_addresses`. If no
1759    /// fields are specified, all supported fields are updated.
1760    ///
1761    /// Be careful - if you do not provide a field mask, then you might
1762    /// accidentally clear some fields. For example, if you leave the field mask
1763    /// empty and do not provide a value for `subscriber_email_addresses`, then
1764    /// `subscriber_email_addresses` is updated to empty.
1765    pub update_mask: std::option::Option<wkt::FieldMask>,
1766
1767    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1768}
1769
1770impl UpdateCaseRequest {
1771    /// Creates a new default instance.
1772    pub fn new() -> Self {
1773        std::default::Default::default()
1774    }
1775
1776    /// Sets the value of [case][crate::model::UpdateCaseRequest::case].
1777    ///
1778    /// # Example
1779    /// ```ignore,no_run
1780    /// # use google_cloud_support_v2::model::UpdateCaseRequest;
1781    /// use google_cloud_support_v2::model::Case;
1782    /// let x = UpdateCaseRequest::new().set_case(Case::default()/* use setters */);
1783    /// ```
1784    pub fn set_case<T>(mut self, v: T) -> Self
1785    where
1786        T: std::convert::Into<crate::model::Case>,
1787    {
1788        self.case = std::option::Option::Some(v.into());
1789        self
1790    }
1791
1792    /// Sets or clears the value of [case][crate::model::UpdateCaseRequest::case].
1793    ///
1794    /// # Example
1795    /// ```ignore,no_run
1796    /// # use google_cloud_support_v2::model::UpdateCaseRequest;
1797    /// use google_cloud_support_v2::model::Case;
1798    /// let x = UpdateCaseRequest::new().set_or_clear_case(Some(Case::default()/* use setters */));
1799    /// let x = UpdateCaseRequest::new().set_or_clear_case(None::<Case>);
1800    /// ```
1801    pub fn set_or_clear_case<T>(mut self, v: std::option::Option<T>) -> Self
1802    where
1803        T: std::convert::Into<crate::model::Case>,
1804    {
1805        self.case = v.map(|x| x.into());
1806        self
1807    }
1808
1809    /// Sets the value of [update_mask][crate::model::UpdateCaseRequest::update_mask].
1810    ///
1811    /// # Example
1812    /// ```ignore,no_run
1813    /// # use google_cloud_support_v2::model::UpdateCaseRequest;
1814    /// use wkt::FieldMask;
1815    /// let x = UpdateCaseRequest::new().set_update_mask(FieldMask::default()/* use setters */);
1816    /// ```
1817    pub fn set_update_mask<T>(mut self, v: T) -> Self
1818    where
1819        T: std::convert::Into<wkt::FieldMask>,
1820    {
1821        self.update_mask = std::option::Option::Some(v.into());
1822        self
1823    }
1824
1825    /// Sets or clears the value of [update_mask][crate::model::UpdateCaseRequest::update_mask].
1826    ///
1827    /// # Example
1828    /// ```ignore,no_run
1829    /// # use google_cloud_support_v2::model::UpdateCaseRequest;
1830    /// use wkt::FieldMask;
1831    /// let x = UpdateCaseRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
1832    /// let x = UpdateCaseRequest::new().set_or_clear_update_mask(None::<FieldMask>);
1833    /// ```
1834    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1835    where
1836        T: std::convert::Into<wkt::FieldMask>,
1837    {
1838        self.update_mask = v.map(|x| x.into());
1839        self
1840    }
1841}
1842
1843impl wkt::message::Message for UpdateCaseRequest {
1844    fn typename() -> &'static str {
1845        "type.googleapis.com/google.cloud.support.v2.UpdateCaseRequest"
1846    }
1847}
1848
1849/// The request message for the CloseCase endpoint.
1850#[derive(Clone, Default, PartialEq)]
1851#[non_exhaustive]
1852pub struct CloseCaseRequest {
1853    /// Required. The name of the case to close.
1854    pub name: std::string::String,
1855
1856    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1857}
1858
1859impl CloseCaseRequest {
1860    /// Creates a new default instance.
1861    pub fn new() -> Self {
1862        std::default::Default::default()
1863    }
1864
1865    /// Sets the value of [name][crate::model::CloseCaseRequest::name].
1866    ///
1867    /// # Example
1868    /// ```ignore,no_run
1869    /// # use google_cloud_support_v2::model::CloseCaseRequest;
1870    /// let x = CloseCaseRequest::new().set_name("example");
1871    /// ```
1872    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1873        self.name = v.into();
1874        self
1875    }
1876}
1877
1878impl wkt::message::Message for CloseCaseRequest {
1879    fn typename() -> &'static str {
1880        "type.googleapis.com/google.cloud.support.v2.CloseCaseRequest"
1881    }
1882}
1883
1884/// The request message for the SearchCaseClassifications endpoint.
1885#[derive(Clone, Default, PartialEq)]
1886#[non_exhaustive]
1887pub struct SearchCaseClassificationsRequest {
1888    /// An expression used to filter case classifications.
1889    ///
1890    /// If it's an empty string, then no filtering happens. Otherwise, case
1891    /// classifications will be returned that match the filter.
1892    pub query: std::string::String,
1893
1894    /// The maximum number of classifications fetched with each request.
1895    pub page_size: i32,
1896
1897    /// A token identifying the page of results to return. If unspecified, the
1898    /// first page is retrieved.
1899    pub page_token: std::string::String,
1900
1901    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1902}
1903
1904impl SearchCaseClassificationsRequest {
1905    /// Creates a new default instance.
1906    pub fn new() -> Self {
1907        std::default::Default::default()
1908    }
1909
1910    /// Sets the value of [query][crate::model::SearchCaseClassificationsRequest::query].
1911    ///
1912    /// # Example
1913    /// ```ignore,no_run
1914    /// # use google_cloud_support_v2::model::SearchCaseClassificationsRequest;
1915    /// let x = SearchCaseClassificationsRequest::new().set_query("example");
1916    /// ```
1917    pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1918        self.query = v.into();
1919        self
1920    }
1921
1922    /// Sets the value of [page_size][crate::model::SearchCaseClassificationsRequest::page_size].
1923    ///
1924    /// # Example
1925    /// ```ignore,no_run
1926    /// # use google_cloud_support_v2::model::SearchCaseClassificationsRequest;
1927    /// let x = SearchCaseClassificationsRequest::new().set_page_size(42);
1928    /// ```
1929    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1930        self.page_size = v.into();
1931        self
1932    }
1933
1934    /// Sets the value of [page_token][crate::model::SearchCaseClassificationsRequest::page_token].
1935    ///
1936    /// # Example
1937    /// ```ignore,no_run
1938    /// # use google_cloud_support_v2::model::SearchCaseClassificationsRequest;
1939    /// let x = SearchCaseClassificationsRequest::new().set_page_token("example");
1940    /// ```
1941    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1942        self.page_token = v.into();
1943        self
1944    }
1945}
1946
1947impl wkt::message::Message for SearchCaseClassificationsRequest {
1948    fn typename() -> &'static str {
1949        "type.googleapis.com/google.cloud.support.v2.SearchCaseClassificationsRequest"
1950    }
1951}
1952
1953/// The response message for SearchCaseClassifications endpoint.
1954#[derive(Clone, Default, PartialEq)]
1955#[non_exhaustive]
1956pub struct SearchCaseClassificationsResponse {
1957    /// The classifications retrieved.
1958    pub case_classifications: std::vec::Vec<crate::model::CaseClassification>,
1959
1960    /// A token to retrieve the next page of results. Set this in the `page_token`
1961    /// field of subsequent `caseClassifications.list` requests. If unspecified,
1962    /// there are no more results to retrieve.
1963    pub next_page_token: std::string::String,
1964
1965    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1966}
1967
1968impl SearchCaseClassificationsResponse {
1969    /// Creates a new default instance.
1970    pub fn new() -> Self {
1971        std::default::Default::default()
1972    }
1973
1974    /// Sets the value of [case_classifications][crate::model::SearchCaseClassificationsResponse::case_classifications].
1975    ///
1976    /// # Example
1977    /// ```ignore,no_run
1978    /// # use google_cloud_support_v2::model::SearchCaseClassificationsResponse;
1979    /// use google_cloud_support_v2::model::CaseClassification;
1980    /// let x = SearchCaseClassificationsResponse::new()
1981    ///     .set_case_classifications([
1982    ///         CaseClassification::default()/* use setters */,
1983    ///         CaseClassification::default()/* use (different) setters */,
1984    ///     ]);
1985    /// ```
1986    pub fn set_case_classifications<T, V>(mut self, v: T) -> Self
1987    where
1988        T: std::iter::IntoIterator<Item = V>,
1989        V: std::convert::Into<crate::model::CaseClassification>,
1990    {
1991        use std::iter::Iterator;
1992        self.case_classifications = v.into_iter().map(|i| i.into()).collect();
1993        self
1994    }
1995
1996    /// Sets the value of [next_page_token][crate::model::SearchCaseClassificationsResponse::next_page_token].
1997    ///
1998    /// # Example
1999    /// ```ignore,no_run
2000    /// # use google_cloud_support_v2::model::SearchCaseClassificationsResponse;
2001    /// let x = SearchCaseClassificationsResponse::new().set_next_page_token("example");
2002    /// ```
2003    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2004        self.next_page_token = v.into();
2005        self
2006    }
2007}
2008
2009impl wkt::message::Message for SearchCaseClassificationsResponse {
2010    fn typename() -> &'static str {
2011        "type.googleapis.com/google.cloud.support.v2.SearchCaseClassificationsResponse"
2012    }
2013}
2014
2015#[doc(hidden)]
2016impl google_cloud_gax::paginator::internal::PageableResponse for SearchCaseClassificationsResponse {
2017    type PageItem = crate::model::CaseClassification;
2018
2019    fn items(self) -> std::vec::Vec<Self::PageItem> {
2020        self.case_classifications
2021    }
2022
2023    fn next_page_token(&self) -> std::string::String {
2024        use std::clone::Clone;
2025        self.next_page_token.clone()
2026    }
2027}
2028
2029/// A comment associated with a support case.
2030///
2031/// Case comments are the primary way for Google Support to communicate with a
2032/// user who has opened a case. When a user responds to Google Support, the
2033/// user's responses also appear as comments.
2034#[derive(Clone, Default, PartialEq)]
2035#[non_exhaustive]
2036pub struct Comment {
2037    /// Output only. Identifier. The resource name of the comment.
2038    pub name: std::string::String,
2039
2040    /// Output only. The time when the comment was created.
2041    pub create_time: std::option::Option<wkt::Timestamp>,
2042
2043    /// Output only. The user or Google Support agent who created the comment.
2044    pub creator: std::option::Option<crate::model::Actor>,
2045
2046    /// The full comment body.
2047    ///
2048    /// Maximum of 12800 characters.
2049    pub body: std::string::String,
2050
2051    /// Output only. DEPRECATED. DO NOT USE.
2052    ///
2053    /// A duplicate of the `body` field.
2054    ///
2055    /// This field is only present for legacy reasons.
2056    #[deprecated]
2057    pub plain_text_body: std::string::String,
2058
2059    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2060}
2061
2062impl Comment {
2063    /// Creates a new default instance.
2064    pub fn new() -> Self {
2065        std::default::Default::default()
2066    }
2067
2068    /// Sets the value of [name][crate::model::Comment::name].
2069    ///
2070    /// # Example
2071    /// ```ignore,no_run
2072    /// # use google_cloud_support_v2::model::Comment;
2073    /// let x = Comment::new().set_name("example");
2074    /// ```
2075    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2076        self.name = v.into();
2077        self
2078    }
2079
2080    /// Sets the value of [create_time][crate::model::Comment::create_time].
2081    ///
2082    /// # Example
2083    /// ```ignore,no_run
2084    /// # use google_cloud_support_v2::model::Comment;
2085    /// use wkt::Timestamp;
2086    /// let x = Comment::new().set_create_time(Timestamp::default()/* use setters */);
2087    /// ```
2088    pub fn set_create_time<T>(mut self, v: T) -> Self
2089    where
2090        T: std::convert::Into<wkt::Timestamp>,
2091    {
2092        self.create_time = std::option::Option::Some(v.into());
2093        self
2094    }
2095
2096    /// Sets or clears the value of [create_time][crate::model::Comment::create_time].
2097    ///
2098    /// # Example
2099    /// ```ignore,no_run
2100    /// # use google_cloud_support_v2::model::Comment;
2101    /// use wkt::Timestamp;
2102    /// let x = Comment::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2103    /// let x = Comment::new().set_or_clear_create_time(None::<Timestamp>);
2104    /// ```
2105    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2106    where
2107        T: std::convert::Into<wkt::Timestamp>,
2108    {
2109        self.create_time = v.map(|x| x.into());
2110        self
2111    }
2112
2113    /// Sets the value of [creator][crate::model::Comment::creator].
2114    ///
2115    /// # Example
2116    /// ```ignore,no_run
2117    /// # use google_cloud_support_v2::model::Comment;
2118    /// use google_cloud_support_v2::model::Actor;
2119    /// let x = Comment::new().set_creator(Actor::default()/* use setters */);
2120    /// ```
2121    pub fn set_creator<T>(mut self, v: T) -> Self
2122    where
2123        T: std::convert::Into<crate::model::Actor>,
2124    {
2125        self.creator = std::option::Option::Some(v.into());
2126        self
2127    }
2128
2129    /// Sets or clears the value of [creator][crate::model::Comment::creator].
2130    ///
2131    /// # Example
2132    /// ```ignore,no_run
2133    /// # use google_cloud_support_v2::model::Comment;
2134    /// use google_cloud_support_v2::model::Actor;
2135    /// let x = Comment::new().set_or_clear_creator(Some(Actor::default()/* use setters */));
2136    /// let x = Comment::new().set_or_clear_creator(None::<Actor>);
2137    /// ```
2138    pub fn set_or_clear_creator<T>(mut self, v: std::option::Option<T>) -> Self
2139    where
2140        T: std::convert::Into<crate::model::Actor>,
2141    {
2142        self.creator = v.map(|x| x.into());
2143        self
2144    }
2145
2146    /// Sets the value of [body][crate::model::Comment::body].
2147    ///
2148    /// # Example
2149    /// ```ignore,no_run
2150    /// # use google_cloud_support_v2::model::Comment;
2151    /// let x = Comment::new().set_body("example");
2152    /// ```
2153    pub fn set_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2154        self.body = v.into();
2155        self
2156    }
2157
2158    /// Sets the value of [plain_text_body][crate::model::Comment::plain_text_body].
2159    ///
2160    /// # Example
2161    /// ```ignore,no_run
2162    /// # use google_cloud_support_v2::model::Comment;
2163    /// let x = Comment::new().set_plain_text_body("example");
2164    /// ```
2165    #[deprecated]
2166    pub fn set_plain_text_body<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2167        self.plain_text_body = v.into();
2168        self
2169    }
2170}
2171
2172impl wkt::message::Message for Comment {
2173    fn typename() -> &'static str {
2174        "type.googleapis.com/google.cloud.support.v2.Comment"
2175    }
2176}
2177
2178/// The request message for the ListComments endpoint.
2179#[derive(Clone, Default, PartialEq)]
2180#[non_exhaustive]
2181pub struct ListCommentsRequest {
2182    /// Required. The name of the case for which to list comments.
2183    pub parent: std::string::String,
2184
2185    /// The maximum number of comments to fetch. Defaults to 10.
2186    pub page_size: i32,
2187
2188    /// A token identifying the page of results to return. If unspecified, the
2189    /// first page is returned.
2190    pub page_token: std::string::String,
2191
2192    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2193}
2194
2195impl ListCommentsRequest {
2196    /// Creates a new default instance.
2197    pub fn new() -> Self {
2198        std::default::Default::default()
2199    }
2200
2201    /// Sets the value of [parent][crate::model::ListCommentsRequest::parent].
2202    ///
2203    /// # Example
2204    /// ```ignore,no_run
2205    /// # use google_cloud_support_v2::model::ListCommentsRequest;
2206    /// let x = ListCommentsRequest::new().set_parent("example");
2207    /// ```
2208    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2209        self.parent = v.into();
2210        self
2211    }
2212
2213    /// Sets the value of [page_size][crate::model::ListCommentsRequest::page_size].
2214    ///
2215    /// # Example
2216    /// ```ignore,no_run
2217    /// # use google_cloud_support_v2::model::ListCommentsRequest;
2218    /// let x = ListCommentsRequest::new().set_page_size(42);
2219    /// ```
2220    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2221        self.page_size = v.into();
2222        self
2223    }
2224
2225    /// Sets the value of [page_token][crate::model::ListCommentsRequest::page_token].
2226    ///
2227    /// # Example
2228    /// ```ignore,no_run
2229    /// # use google_cloud_support_v2::model::ListCommentsRequest;
2230    /// let x = ListCommentsRequest::new().set_page_token("example");
2231    /// ```
2232    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2233        self.page_token = v.into();
2234        self
2235    }
2236}
2237
2238impl wkt::message::Message for ListCommentsRequest {
2239    fn typename() -> &'static str {
2240        "type.googleapis.com/google.cloud.support.v2.ListCommentsRequest"
2241    }
2242}
2243
2244/// The response message for the ListComments endpoint.
2245#[derive(Clone, Default, PartialEq)]
2246#[non_exhaustive]
2247pub struct ListCommentsResponse {
2248    /// List of the comments associated with the case.
2249    pub comments: std::vec::Vec<crate::model::Comment>,
2250
2251    /// A token to retrieve the next page of results. Set this in the `page_token`
2252    /// field of subsequent `cases.comments.list` requests. If unspecified, there
2253    /// are no more results to retrieve.
2254    pub next_page_token: std::string::String,
2255
2256    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2257}
2258
2259impl ListCommentsResponse {
2260    /// Creates a new default instance.
2261    pub fn new() -> Self {
2262        std::default::Default::default()
2263    }
2264
2265    /// Sets the value of [comments][crate::model::ListCommentsResponse::comments].
2266    ///
2267    /// # Example
2268    /// ```ignore,no_run
2269    /// # use google_cloud_support_v2::model::ListCommentsResponse;
2270    /// use google_cloud_support_v2::model::Comment;
2271    /// let x = ListCommentsResponse::new()
2272    ///     .set_comments([
2273    ///         Comment::default()/* use setters */,
2274    ///         Comment::default()/* use (different) setters */,
2275    ///     ]);
2276    /// ```
2277    pub fn set_comments<T, V>(mut self, v: T) -> Self
2278    where
2279        T: std::iter::IntoIterator<Item = V>,
2280        V: std::convert::Into<crate::model::Comment>,
2281    {
2282        use std::iter::Iterator;
2283        self.comments = v.into_iter().map(|i| i.into()).collect();
2284        self
2285    }
2286
2287    /// Sets the value of [next_page_token][crate::model::ListCommentsResponse::next_page_token].
2288    ///
2289    /// # Example
2290    /// ```ignore,no_run
2291    /// # use google_cloud_support_v2::model::ListCommentsResponse;
2292    /// let x = ListCommentsResponse::new().set_next_page_token("example");
2293    /// ```
2294    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2295        self.next_page_token = v.into();
2296        self
2297    }
2298}
2299
2300impl wkt::message::Message for ListCommentsResponse {
2301    fn typename() -> &'static str {
2302        "type.googleapis.com/google.cloud.support.v2.ListCommentsResponse"
2303    }
2304}
2305
2306#[doc(hidden)]
2307impl google_cloud_gax::paginator::internal::PageableResponse for ListCommentsResponse {
2308    type PageItem = crate::model::Comment;
2309
2310    fn items(self) -> std::vec::Vec<Self::PageItem> {
2311        self.comments
2312    }
2313
2314    fn next_page_token(&self) -> std::string::String {
2315        use std::clone::Clone;
2316        self.next_page_token.clone()
2317    }
2318}
2319
2320/// The request message for the CreateComment endpoint.
2321#[derive(Clone, Default, PartialEq)]
2322#[non_exhaustive]
2323pub struct CreateCommentRequest {
2324    /// Required. The name of the case to which the comment should be added.
2325    pub parent: std::string::String,
2326
2327    /// Required. The comment to be added.
2328    pub comment: std::option::Option<crate::model::Comment>,
2329
2330    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2331}
2332
2333impl CreateCommentRequest {
2334    /// Creates a new default instance.
2335    pub fn new() -> Self {
2336        std::default::Default::default()
2337    }
2338
2339    /// Sets the value of [parent][crate::model::CreateCommentRequest::parent].
2340    ///
2341    /// # Example
2342    /// ```ignore,no_run
2343    /// # use google_cloud_support_v2::model::CreateCommentRequest;
2344    /// let x = CreateCommentRequest::new().set_parent("example");
2345    /// ```
2346    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2347        self.parent = v.into();
2348        self
2349    }
2350
2351    /// Sets the value of [comment][crate::model::CreateCommentRequest::comment].
2352    ///
2353    /// # Example
2354    /// ```ignore,no_run
2355    /// # use google_cloud_support_v2::model::CreateCommentRequest;
2356    /// use google_cloud_support_v2::model::Comment;
2357    /// let x = CreateCommentRequest::new().set_comment(Comment::default()/* use setters */);
2358    /// ```
2359    pub fn set_comment<T>(mut self, v: T) -> Self
2360    where
2361        T: std::convert::Into<crate::model::Comment>,
2362    {
2363        self.comment = std::option::Option::Some(v.into());
2364        self
2365    }
2366
2367    /// Sets or clears the value of [comment][crate::model::CreateCommentRequest::comment].
2368    ///
2369    /// # Example
2370    /// ```ignore,no_run
2371    /// # use google_cloud_support_v2::model::CreateCommentRequest;
2372    /// use google_cloud_support_v2::model::Comment;
2373    /// let x = CreateCommentRequest::new().set_or_clear_comment(Some(Comment::default()/* use setters */));
2374    /// let x = CreateCommentRequest::new().set_or_clear_comment(None::<Comment>);
2375    /// ```
2376    pub fn set_or_clear_comment<T>(mut self, v: std::option::Option<T>) -> Self
2377    where
2378        T: std::convert::Into<crate::model::Comment>,
2379    {
2380        self.comment = v.map(|x| x.into());
2381        self
2382    }
2383}
2384
2385impl wkt::message::Message for CreateCommentRequest {
2386    fn typename() -> &'static str {
2387        "type.googleapis.com/google.cloud.support.v2.CreateCommentRequest"
2388    }
2389}
2390
2391/// An escalation of a support case.
2392#[derive(Clone, Default, PartialEq)]
2393#[non_exhaustive]
2394pub struct Escalation {
2395    /// Required. The reason why the Case is being escalated.
2396    pub reason: crate::model::escalation::Reason,
2397
2398    /// Required. A free text description to accompany the `reason` field above.
2399    /// Provides additional context on why the case is being escalated.
2400    pub justification: std::string::String,
2401
2402    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2403}
2404
2405impl Escalation {
2406    /// Creates a new default instance.
2407    pub fn new() -> Self {
2408        std::default::Default::default()
2409    }
2410
2411    /// Sets the value of [reason][crate::model::Escalation::reason].
2412    ///
2413    /// # Example
2414    /// ```ignore,no_run
2415    /// # use google_cloud_support_v2::model::Escalation;
2416    /// use google_cloud_support_v2::model::escalation::Reason;
2417    /// let x0 = Escalation::new().set_reason(Reason::ResolutionTime);
2418    /// let x1 = Escalation::new().set_reason(Reason::TechnicalExpertise);
2419    /// let x2 = Escalation::new().set_reason(Reason::BusinessImpact);
2420    /// ```
2421    pub fn set_reason<T: std::convert::Into<crate::model::escalation::Reason>>(
2422        mut self,
2423        v: T,
2424    ) -> Self {
2425        self.reason = v.into();
2426        self
2427    }
2428
2429    /// Sets the value of [justification][crate::model::Escalation::justification].
2430    ///
2431    /// # Example
2432    /// ```ignore,no_run
2433    /// # use google_cloud_support_v2::model::Escalation;
2434    /// let x = Escalation::new().set_justification("example");
2435    /// ```
2436    pub fn set_justification<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2437        self.justification = v.into();
2438        self
2439    }
2440}
2441
2442impl wkt::message::Message for Escalation {
2443    fn typename() -> &'static str {
2444        "type.googleapis.com/google.cloud.support.v2.Escalation"
2445    }
2446}
2447
2448/// Defines additional types related to [Escalation].
2449pub mod escalation {
2450    #[allow(unused_imports)]
2451    use super::*;
2452
2453    /// An enum detailing the possible reasons a case may be escalated.
2454    ///
2455    /// # Working with unknown values
2456    ///
2457    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2458    /// additional enum variants at any time. Adding new variants is not considered
2459    /// a breaking change. Applications should write their code in anticipation of:
2460    ///
2461    /// - New values appearing in future releases of the client library, **and**
2462    /// - New values received dynamically, without application changes.
2463    ///
2464    /// Please consult the [Working with enums] section in the user guide for some
2465    /// guidelines.
2466    ///
2467    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2468    #[derive(Clone, Debug, PartialEq)]
2469    #[non_exhaustive]
2470    pub enum Reason {
2471        /// The escalation reason is in an unknown state or has not been specified.
2472        Unspecified,
2473        /// The case is taking too long to resolve.
2474        ResolutionTime,
2475        /// The support agent does not have the expertise required to successfully
2476        /// resolve the issue.
2477        TechnicalExpertise,
2478        /// The issue is having a significant business impact.
2479        BusinessImpact,
2480        /// If set, the enum was initialized with an unknown value.
2481        ///
2482        /// Applications can examine the value using [Reason::value] or
2483        /// [Reason::name].
2484        UnknownValue(reason::UnknownValue),
2485    }
2486
2487    #[doc(hidden)]
2488    pub mod reason {
2489        #[allow(unused_imports)]
2490        use super::*;
2491        #[derive(Clone, Debug, PartialEq)]
2492        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2493    }
2494
2495    impl Reason {
2496        /// Gets the enum value.
2497        ///
2498        /// Returns `None` if the enum contains an unknown value deserialized from
2499        /// the string representation of enums.
2500        pub fn value(&self) -> std::option::Option<i32> {
2501            match self {
2502                Self::Unspecified => std::option::Option::Some(0),
2503                Self::ResolutionTime => std::option::Option::Some(1),
2504                Self::TechnicalExpertise => std::option::Option::Some(2),
2505                Self::BusinessImpact => std::option::Option::Some(3),
2506                Self::UnknownValue(u) => u.0.value(),
2507            }
2508        }
2509
2510        /// Gets the enum value as a string.
2511        ///
2512        /// Returns `None` if the enum contains an unknown value deserialized from
2513        /// the integer representation of enums.
2514        pub fn name(&self) -> std::option::Option<&str> {
2515            match self {
2516                Self::Unspecified => std::option::Option::Some("REASON_UNSPECIFIED"),
2517                Self::ResolutionTime => std::option::Option::Some("RESOLUTION_TIME"),
2518                Self::TechnicalExpertise => std::option::Option::Some("TECHNICAL_EXPERTISE"),
2519                Self::BusinessImpact => std::option::Option::Some("BUSINESS_IMPACT"),
2520                Self::UnknownValue(u) => u.0.name(),
2521            }
2522        }
2523    }
2524
2525    impl std::default::Default for Reason {
2526        fn default() -> Self {
2527            use std::convert::From;
2528            Self::from(0)
2529        }
2530    }
2531
2532    impl std::fmt::Display for Reason {
2533        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2534            wkt::internal::display_enum(f, self.name(), self.value())
2535        }
2536    }
2537
2538    impl std::convert::From<i32> for Reason {
2539        fn from(value: i32) -> Self {
2540            match value {
2541                0 => Self::Unspecified,
2542                1 => Self::ResolutionTime,
2543                2 => Self::TechnicalExpertise,
2544                3 => Self::BusinessImpact,
2545                _ => Self::UnknownValue(reason::UnknownValue(
2546                    wkt::internal::UnknownEnumValue::Integer(value),
2547                )),
2548            }
2549        }
2550    }
2551
2552    impl std::convert::From<&str> for Reason {
2553        fn from(value: &str) -> Self {
2554            use std::string::ToString;
2555            match value {
2556                "REASON_UNSPECIFIED" => Self::Unspecified,
2557                "RESOLUTION_TIME" => Self::ResolutionTime,
2558                "TECHNICAL_EXPERTISE" => Self::TechnicalExpertise,
2559                "BUSINESS_IMPACT" => Self::BusinessImpact,
2560                _ => Self::UnknownValue(reason::UnknownValue(
2561                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2562                )),
2563            }
2564        }
2565    }
2566
2567    impl serde::ser::Serialize for Reason {
2568        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2569        where
2570            S: serde::Serializer,
2571        {
2572            match self {
2573                Self::Unspecified => serializer.serialize_i32(0),
2574                Self::ResolutionTime => serializer.serialize_i32(1),
2575                Self::TechnicalExpertise => serializer.serialize_i32(2),
2576                Self::BusinessImpact => serializer.serialize_i32(3),
2577                Self::UnknownValue(u) => u.0.serialize(serializer),
2578            }
2579        }
2580    }
2581
2582    impl<'de> serde::de::Deserialize<'de> for Reason {
2583        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2584        where
2585            D: serde::Deserializer<'de>,
2586        {
2587            deserializer.deserialize_any(wkt::internal::EnumVisitor::<Reason>::new(
2588                ".google.cloud.support.v2.Escalation.Reason",
2589            ))
2590        }
2591    }
2592}