1mod _accessor_impls {
2 #![allow(clippy::useless_conversion)]
3 impl super::BadRequest {
4 pub const fn const_default() -> Self {
5 Self {
6 field_violations: Vec::new(),
7 }
8 }
9 #[doc(hidden)]
10 pub fn default_instance() -> &'static Self {
11 static DEFAULT: super::BadRequest = super::BadRequest::const_default();
12 &DEFAULT
13 }
14 pub fn field_violations(&self) -> &[super::bad_request::FieldViolation] {
16 &self.field_violations
17 }
18 pub fn field_violations_mut(
21 &mut self,
22 ) -> &mut Vec<super::bad_request::FieldViolation> {
23 &mut self.field_violations
24 }
25 pub fn set_field_violations(
27 &mut self,
28 field: Vec<super::bad_request::FieldViolation>,
29 ) {
30 self.field_violations = field;
31 }
32 pub fn with_field_violations(
34 mut self,
35 field: Vec<super::bad_request::FieldViolation>,
36 ) -> Self {
37 self.set_field_violations(field);
38 self
39 }
40 }
41 impl super::bad_request::FieldViolation {
42 pub const fn const_default() -> Self {
43 Self {
44 field: String::new(),
45 description: String::new(),
46 reason: String::new(),
47 localized_message: None,
48 }
49 }
50 #[doc(hidden)]
51 pub fn default_instance() -> &'static Self {
52 static DEFAULT: super::bad_request::FieldViolation = super::bad_request::FieldViolation::const_default();
53 &DEFAULT
54 }
55 pub fn field_mut(&mut self) -> &mut String {
58 &mut self.field
59 }
60 pub fn set_field<T: Into<String>>(&mut self, field: T) {
62 self.field = field.into().into();
63 }
64 pub fn with_field<T: Into<String>>(mut self, field: T) -> Self {
66 self.set_field(field.into());
67 self
68 }
69 pub fn description_mut(&mut self) -> &mut String {
72 &mut self.description
73 }
74 pub fn set_description<T: Into<String>>(&mut self, field: T) {
76 self.description = field.into().into();
77 }
78 pub fn with_description<T: Into<String>>(mut self, field: T) -> Self {
80 self.set_description(field.into());
81 self
82 }
83 pub fn reason_mut(&mut self) -> &mut String {
86 &mut self.reason
87 }
88 pub fn set_reason<T: Into<String>>(&mut self, field: T) {
90 self.reason = field.into().into();
91 }
92 pub fn with_reason<T: Into<String>>(mut self, field: T) -> Self {
94 self.set_reason(field.into());
95 self
96 }
97 pub fn localized_message(&self) -> &super::LocalizedMessage {
99 self.localized_message
100 .as_ref()
101 .map(|field| field as _)
102 .unwrap_or_else(|| super::LocalizedMessage::default_instance() as _)
103 }
104 pub fn localized_message_opt_mut(
106 &mut self,
107 ) -> Option<&mut super::LocalizedMessage> {
108 self.localized_message.as_mut().map(|field| field as _)
109 }
110 pub fn localized_message_mut(&mut self) -> &mut super::LocalizedMessage {
113 self.localized_message.get_or_insert_default()
114 }
115 pub fn localized_message_opt(&self) -> Option<&super::LocalizedMessage> {
117 self.localized_message.as_ref().map(|field| field as _)
118 }
119 pub fn set_localized_message<T: Into<super::LocalizedMessage>>(
121 &mut self,
122 field: T,
123 ) {
124 self.localized_message = Some(field.into().into());
125 }
126 pub fn with_localized_message<T: Into<super::LocalizedMessage>>(
128 mut self,
129 field: T,
130 ) -> Self {
131 self.set_localized_message(field.into());
132 self
133 }
134 }
135 impl super::DebugInfo {
136 pub const fn const_default() -> Self {
137 Self {
138 stack_entries: Vec::new(),
139 detail: String::new(),
140 }
141 }
142 #[doc(hidden)]
143 pub fn default_instance() -> &'static Self {
144 static DEFAULT: super::DebugInfo = super::DebugInfo::const_default();
145 &DEFAULT
146 }
147 pub fn stack_entries(&self) -> &[String] {
149 &self.stack_entries
150 }
151 pub fn stack_entries_mut(&mut self) -> &mut Vec<String> {
154 &mut self.stack_entries
155 }
156 pub fn set_stack_entries(&mut self, field: Vec<String>) {
158 self.stack_entries = field;
159 }
160 pub fn with_stack_entries(mut self, field: Vec<String>) -> Self {
162 self.set_stack_entries(field);
163 self
164 }
165 pub fn detail_mut(&mut self) -> &mut String {
168 &mut self.detail
169 }
170 pub fn set_detail<T: Into<String>>(&mut self, field: T) {
172 self.detail = field.into().into();
173 }
174 pub fn with_detail<T: Into<String>>(mut self, field: T) -> Self {
176 self.set_detail(field.into());
177 self
178 }
179 }
180 impl super::ErrorInfo {
181 pub const fn const_default() -> Self {
182 Self {
183 reason: String::new(),
184 domain: String::new(),
185 metadata: std::collections::BTreeMap::new(),
186 }
187 }
188 #[doc(hidden)]
189 pub fn default_instance() -> &'static Self {
190 static DEFAULT: super::ErrorInfo = super::ErrorInfo::const_default();
191 &DEFAULT
192 }
193 pub fn reason_mut(&mut self) -> &mut String {
196 &mut self.reason
197 }
198 pub fn set_reason<T: Into<String>>(&mut self, field: T) {
200 self.reason = field.into().into();
201 }
202 pub fn with_reason<T: Into<String>>(mut self, field: T) -> Self {
204 self.set_reason(field.into());
205 self
206 }
207 pub fn domain_mut(&mut self) -> &mut String {
210 &mut self.domain
211 }
212 pub fn set_domain<T: Into<String>>(&mut self, field: T) {
214 self.domain = field.into().into();
215 }
216 pub fn with_domain<T: Into<String>>(mut self, field: T) -> Self {
218 self.set_domain(field.into());
219 self
220 }
221 pub fn metadata(&self) -> &::std::collections::BTreeMap<String, String> {
223 &self.metadata
224 }
225 pub fn metadata_mut(
228 &mut self,
229 ) -> &mut ::std::collections::BTreeMap<String, String> {
230 &mut self.metadata
231 }
232 pub fn set_metadata(
234 &mut self,
235 field: ::std::collections::BTreeMap<String, String>,
236 ) {
237 self.metadata = field;
238 }
239 pub fn with_metadata(
241 mut self,
242 field: ::std::collections::BTreeMap<String, String>,
243 ) -> Self {
244 self.set_metadata(field);
245 self
246 }
247 }
248 impl super::Help {
249 pub const fn const_default() -> Self {
250 Self { links: Vec::new() }
251 }
252 #[doc(hidden)]
253 pub fn default_instance() -> &'static Self {
254 static DEFAULT: super::Help = super::Help::const_default();
255 &DEFAULT
256 }
257 pub fn links(&self) -> &[super::help::Link] {
259 &self.links
260 }
261 pub fn links_mut(&mut self) -> &mut Vec<super::help::Link> {
264 &mut self.links
265 }
266 pub fn set_links(&mut self, field: Vec<super::help::Link>) {
268 self.links = field;
269 }
270 pub fn with_links(mut self, field: Vec<super::help::Link>) -> Self {
272 self.set_links(field);
273 self
274 }
275 }
276 impl super::help::Link {
277 pub const fn const_default() -> Self {
278 Self {
279 description: String::new(),
280 url: String::new(),
281 }
282 }
283 #[doc(hidden)]
284 pub fn default_instance() -> &'static Self {
285 static DEFAULT: super::help::Link = super::help::Link::const_default();
286 &DEFAULT
287 }
288 pub fn description_mut(&mut self) -> &mut String {
291 &mut self.description
292 }
293 pub fn set_description<T: Into<String>>(&mut self, field: T) {
295 self.description = field.into().into();
296 }
297 pub fn with_description<T: Into<String>>(mut self, field: T) -> Self {
299 self.set_description(field.into());
300 self
301 }
302 pub fn url_mut(&mut self) -> &mut String {
305 &mut self.url
306 }
307 pub fn set_url<T: Into<String>>(&mut self, field: T) {
309 self.url = field.into().into();
310 }
311 pub fn with_url<T: Into<String>>(mut self, field: T) -> Self {
313 self.set_url(field.into());
314 self
315 }
316 }
317 impl super::LocalizedMessage {
318 pub const fn const_default() -> Self {
319 Self {
320 locale: String::new(),
321 message: String::new(),
322 }
323 }
324 #[doc(hidden)]
325 pub fn default_instance() -> &'static Self {
326 static DEFAULT: super::LocalizedMessage = super::LocalizedMessage::const_default();
327 &DEFAULT
328 }
329 pub fn locale_mut(&mut self) -> &mut String {
332 &mut self.locale
333 }
334 pub fn set_locale<T: Into<String>>(&mut self, field: T) {
336 self.locale = field.into().into();
337 }
338 pub fn with_locale<T: Into<String>>(mut self, field: T) -> Self {
340 self.set_locale(field.into());
341 self
342 }
343 pub fn message_mut(&mut self) -> &mut String {
346 &mut self.message
347 }
348 pub fn set_message<T: Into<String>>(&mut self, field: T) {
350 self.message = field.into().into();
351 }
352 pub fn with_message<T: Into<String>>(mut self, field: T) -> Self {
354 self.set_message(field.into());
355 self
356 }
357 }
358 impl super::PreconditionFailure {
359 pub const fn const_default() -> Self {
360 Self { violations: Vec::new() }
361 }
362 #[doc(hidden)]
363 pub fn default_instance() -> &'static Self {
364 static DEFAULT: super::PreconditionFailure = super::PreconditionFailure::const_default();
365 &DEFAULT
366 }
367 pub fn violations(&self) -> &[super::precondition_failure::Violation] {
369 &self.violations
370 }
371 pub fn violations_mut(
374 &mut self,
375 ) -> &mut Vec<super::precondition_failure::Violation> {
376 &mut self.violations
377 }
378 pub fn set_violations(
380 &mut self,
381 field: Vec<super::precondition_failure::Violation>,
382 ) {
383 self.violations = field;
384 }
385 pub fn with_violations(
387 mut self,
388 field: Vec<super::precondition_failure::Violation>,
389 ) -> Self {
390 self.set_violations(field);
391 self
392 }
393 }
394 impl super::precondition_failure::Violation {
395 pub const fn const_default() -> Self {
396 Self {
397 r#type: String::new(),
398 subject: String::new(),
399 description: String::new(),
400 }
401 }
402 #[doc(hidden)]
403 pub fn default_instance() -> &'static Self {
404 static DEFAULT: super::precondition_failure::Violation = super::precondition_failure::Violation::const_default();
405 &DEFAULT
406 }
407 pub fn type_mut(&mut self) -> &mut String {
410 &mut self.r#type
411 }
412 pub fn set_type<T: Into<String>>(&mut self, field: T) {
414 self.r#type = field.into().into();
415 }
416 pub fn with_type<T: Into<String>>(mut self, field: T) -> Self {
418 self.set_type(field.into());
419 self
420 }
421 pub fn subject_mut(&mut self) -> &mut String {
424 &mut self.subject
425 }
426 pub fn set_subject<T: Into<String>>(&mut self, field: T) {
428 self.subject = field.into().into();
429 }
430 pub fn with_subject<T: Into<String>>(mut self, field: T) -> Self {
432 self.set_subject(field.into());
433 self
434 }
435 pub fn description_mut(&mut self) -> &mut String {
438 &mut self.description
439 }
440 pub fn set_description<T: Into<String>>(&mut self, field: T) {
442 self.description = field.into().into();
443 }
444 pub fn with_description<T: Into<String>>(mut self, field: T) -> Self {
446 self.set_description(field.into());
447 self
448 }
449 }
450 impl super::QuotaFailure {
451 pub const fn const_default() -> Self {
452 Self { violations: Vec::new() }
453 }
454 #[doc(hidden)]
455 pub fn default_instance() -> &'static Self {
456 static DEFAULT: super::QuotaFailure = super::QuotaFailure::const_default();
457 &DEFAULT
458 }
459 pub fn violations(&self) -> &[super::quota_failure::Violation] {
461 &self.violations
462 }
463 pub fn violations_mut(&mut self) -> &mut Vec<super::quota_failure::Violation> {
466 &mut self.violations
467 }
468 pub fn set_violations(&mut self, field: Vec<super::quota_failure::Violation>) {
470 self.violations = field;
471 }
472 pub fn with_violations(
474 mut self,
475 field: Vec<super::quota_failure::Violation>,
476 ) -> Self {
477 self.set_violations(field);
478 self
479 }
480 }
481 impl super::quota_failure::Violation {
482 pub const fn const_default() -> Self {
483 Self {
484 subject: String::new(),
485 description: String::new(),
486 }
487 }
488 #[doc(hidden)]
489 pub fn default_instance() -> &'static Self {
490 static DEFAULT: super::quota_failure::Violation = super::quota_failure::Violation::const_default();
491 &DEFAULT
492 }
493 pub fn subject_mut(&mut self) -> &mut String {
496 &mut self.subject
497 }
498 pub fn set_subject<T: Into<String>>(&mut self, field: T) {
500 self.subject = field.into().into();
501 }
502 pub fn with_subject<T: Into<String>>(mut self, field: T) -> Self {
504 self.set_subject(field.into());
505 self
506 }
507 pub fn description_mut(&mut self) -> &mut String {
510 &mut self.description
511 }
512 pub fn set_description<T: Into<String>>(&mut self, field: T) {
514 self.description = field.into().into();
515 }
516 pub fn with_description<T: Into<String>>(mut self, field: T) -> Self {
518 self.set_description(field.into());
519 self
520 }
521 }
522 impl super::RequestInfo {
523 pub const fn const_default() -> Self {
524 Self {
525 request_id: String::new(),
526 serving_data: String::new(),
527 }
528 }
529 #[doc(hidden)]
530 pub fn default_instance() -> &'static Self {
531 static DEFAULT: super::RequestInfo = super::RequestInfo::const_default();
532 &DEFAULT
533 }
534 pub fn request_id_mut(&mut self) -> &mut String {
537 &mut self.request_id
538 }
539 pub fn set_request_id<T: Into<String>>(&mut self, field: T) {
541 self.request_id = field.into().into();
542 }
543 pub fn with_request_id<T: Into<String>>(mut self, field: T) -> Self {
545 self.set_request_id(field.into());
546 self
547 }
548 pub fn serving_data_mut(&mut self) -> &mut String {
551 &mut self.serving_data
552 }
553 pub fn set_serving_data<T: Into<String>>(&mut self, field: T) {
555 self.serving_data = field.into().into();
556 }
557 pub fn with_serving_data<T: Into<String>>(mut self, field: T) -> Self {
559 self.set_serving_data(field.into());
560 self
561 }
562 }
563 impl super::ResourceInfo {
564 pub const fn const_default() -> Self {
565 Self {
566 resource_type: String::new(),
567 resource_name: String::new(),
568 owner: String::new(),
569 description: String::new(),
570 }
571 }
572 #[doc(hidden)]
573 pub fn default_instance() -> &'static Self {
574 static DEFAULT: super::ResourceInfo = super::ResourceInfo::const_default();
575 &DEFAULT
576 }
577 pub fn resource_type_mut(&mut self) -> &mut String {
580 &mut self.resource_type
581 }
582 pub fn set_resource_type<T: Into<String>>(&mut self, field: T) {
584 self.resource_type = field.into().into();
585 }
586 pub fn with_resource_type<T: Into<String>>(mut self, field: T) -> Self {
588 self.set_resource_type(field.into());
589 self
590 }
591 pub fn resource_name_mut(&mut self) -> &mut String {
594 &mut self.resource_name
595 }
596 pub fn set_resource_name<T: Into<String>>(&mut self, field: T) {
598 self.resource_name = field.into().into();
599 }
600 pub fn with_resource_name<T: Into<String>>(mut self, field: T) -> Self {
602 self.set_resource_name(field.into());
603 self
604 }
605 pub fn owner_mut(&mut self) -> &mut String {
608 &mut self.owner
609 }
610 pub fn set_owner<T: Into<String>>(&mut self, field: T) {
612 self.owner = field.into().into();
613 }
614 pub fn with_owner<T: Into<String>>(mut self, field: T) -> Self {
616 self.set_owner(field.into());
617 self
618 }
619 pub fn description_mut(&mut self) -> &mut String {
622 &mut self.description
623 }
624 pub fn set_description<T: Into<String>>(&mut self, field: T) {
626 self.description = field.into().into();
627 }
628 pub fn with_description<T: Into<String>>(mut self, field: T) -> Self {
630 self.set_description(field.into());
631 self
632 }
633 }
634 impl super::RetryInfo {
635 pub const fn const_default() -> Self {
636 Self { retry_delay: None }
637 }
638 #[doc(hidden)]
639 pub fn default_instance() -> &'static Self {
640 static DEFAULT: super::RetryInfo = super::RetryInfo::const_default();
641 &DEFAULT
642 }
643 pub fn retry_delay_opt_mut(&mut self) -> Option<&mut ::prost_types::Duration> {
645 self.retry_delay.as_mut().map(|field| field as _)
646 }
647 pub fn retry_delay_mut(&mut self) -> &mut ::prost_types::Duration {
650 self.retry_delay.get_or_insert_default()
651 }
652 pub fn retry_delay_opt(&self) -> Option<&::prost_types::Duration> {
654 self.retry_delay.as_ref().map(|field| field as _)
655 }
656 pub fn set_retry_delay<T: Into<::prost_types::Duration>>(&mut self, field: T) {
658 self.retry_delay = Some(field.into().into());
659 }
660 pub fn with_retry_delay<T: Into<::prost_types::Duration>>(
662 mut self,
663 field: T,
664 ) -> Self {
665 self.set_retry_delay(field.into());
666 self
667 }
668 }
669 impl super::Status {
670 pub const fn const_default() -> Self {
671 Self {
672 code: 0,
673 message: String::new(),
674 details: Vec::new(),
675 }
676 }
677 #[doc(hidden)]
678 pub fn default_instance() -> &'static Self {
679 static DEFAULT: super::Status = super::Status::const_default();
680 &DEFAULT
681 }
682 pub fn code_mut(&mut self) -> &mut i32 {
685 &mut self.code
686 }
687 pub fn set_code<T: Into<i32>>(&mut self, field: T) {
689 self.code = field.into().into();
690 }
691 pub fn with_code<T: Into<i32>>(mut self, field: T) -> Self {
693 self.set_code(field.into());
694 self
695 }
696 pub fn message_mut(&mut self) -> &mut String {
699 &mut self.message
700 }
701 pub fn set_message<T: Into<String>>(&mut self, field: T) {
703 self.message = field.into().into();
704 }
705 pub fn with_message<T: Into<String>>(mut self, field: T) -> Self {
707 self.set_message(field.into());
708 self
709 }
710 pub fn details(&self) -> &[::prost_types::Any] {
712 &self.details
713 }
714 pub fn details_mut(&mut self) -> &mut Vec<::prost_types::Any> {
717 &mut self.details
718 }
719 pub fn set_details(&mut self, field: Vec<::prost_types::Any>) {
721 self.details = field;
722 }
723 pub fn with_details(mut self, field: Vec<::prost_types::Any>) -> Self {
725 self.set_details(field);
726 self
727 }
728 }
729}