1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
// This file is @generated by prost-build.
/// A subscription to receive events about a Google Workspace resource. To learn
/// more about subscriptions, see the [Google Workspace Events API
/// overview](<https://developers.google.com/workspace/events>).
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Subscription {
    /// Optional. Immutable. Identifier. Resource name of the subscription.
    ///
    /// Format: `subscriptions/{subscription}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Output only. System-assigned unique identifier for the subscription.
    #[prost(string, tag = "2")]
    pub uid: ::prost::alloc::string::String,
    /// Required. Immutable. The Google Workspace resource that's monitored for
    /// events, formatted as the [full resource
    /// name](<https://google.aip.dev/122#full-resource-names>). To learn about
    /// target resources and the events that they support, see [Supported Google
    /// Workspace
    /// events](<https://developers.google.com/workspace/events#supported-events>).
    ///
    /// A user can only authorize your app to create one subscription for a given
    /// target resource. If your app tries to create another subscription with the
    /// same user credentials, the request returns an `ALREADY_EXISTS` error.
    #[prost(string, tag = "4")]
    pub target_resource: ::prost::alloc::string::String,
    /// Required. Immutable. Unordered list. Input for creating a subscription.
    /// Otherwise, output only. One or more types of events to receive about the
    /// target resource. Formatted according to the CloudEvents specification.
    ///
    /// The supported event types depend on the target resource of your
    /// subscription. For details, see [Supported Google Workspace
    /// events](<https://developers.google.com/workspace/events/guides#supported-events>).
    ///
    /// By default, you also receive events about the [lifecycle of your
    /// subscription](<https://developers.google.com/workspace/events/guides/events-lifecycle>).
    /// You don't need to specify lifecycle events for this field.
    ///
    /// If you specify an event type that doesn't exist for the target resource,
    /// the request returns an HTTP `400 Bad Request` status code.
    #[prost(string, repeated, tag = "5")]
    pub event_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Optional. Options about what data to include in the event payload. Only
    /// supported for Google Chat events.
    #[prost(message, optional, tag = "6")]
    pub payload_options: ::core::option::Option<PayloadOptions>,
    /// Required. Immutable. The endpoint where the subscription delivers events,
    /// such as a Pub/Sub topic.
    #[prost(message, optional, tag = "7")]
    pub notification_endpoint: ::core::option::Option<NotificationEndpoint>,
    /// Output only. The state of the subscription. Determines whether the
    /// subscription can receive events and deliver them to the notification
    /// endpoint.
    #[prost(enumeration = "subscription::State", tag = "8")]
    pub state: i32,
    /// Output only. The error that suspended the subscription.
    ///
    /// To reactivate the subscription, resolve the error and call the
    /// [`ReactivateSubscription`][google.apps.events.subscriptions.v1.SubscriptionsService.ReactivateSubscription]
    /// method.
    #[prost(enumeration = "subscription::ErrorType", tag = "18")]
    pub suspension_reason: i32,
    /// Output only. The user who authorized the creation of the
    /// subscription.
    ///
    /// Format: `users/{user}`
    ///
    /// For Google Workspace users, the `{user}` value is the
    /// [`user.id`](<https://developers.google.com/admin-sdk/directory/reference/rest/v1/users#User.FIELDS.ids>)
    /// field from the Directory API.
    #[prost(string, tag = "10")]
    pub authority: ::prost::alloc::string::String,
    /// Output only. The time when the subscription is created.
    #[prost(message, optional, tag = "11")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. The last time that the subscription is updated.
    #[prost(message, optional, tag = "12")]
    pub update_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. If `true`, the subscription is in the process of being
    /// updated.
    #[prost(bool, tag = "15")]
    pub reconciling: bool,
    /// Optional. This checksum is computed by the server based on the value of
    /// other fields, and might be sent on update requests to ensure the client has
    /// an up-to-date value before proceeding.
    #[prost(string, tag = "17")]
    pub etag: ::prost::alloc::string::String,
    /// The time when the subscription expires.
    ///
    /// The maximum expiration time depends on whether your subscription includes
    /// resource data in event payloads (specified in the
    /// [PayloadOptions][google.apps.events.subscriptions.v1.PayloadOptions]
    /// field):
    ///
    /// * If payloads omit resource data, up to 7 days.
    /// * If payloads include resource data, up to 4 hours. If your Google
    /// Workspace organization grants access to the resource through [domain-wide
    /// delegation](<https://support.google.com/a/answer/162106>), you can extend the
    /// subscription's expiration time to up to 24 hours.
    ///
    /// After a subscription expires, it's deleted automatically. You receive
    /// lifecycle events to the
    /// [notification_endpoint][google.apps.events.subscriptions.v1.Subscription.notification_endpoint]
    /// 12 hours and one hour before the subscription expires. For details, see
    /// [Receive and respond to lifecycle
    /// events](<https://developers.google.com/workspace/events/guides/events-lifecycle>).
    ///
    /// To prevent a subscription from expiring, you can use the
    /// [`UpdateSubscription`][google.apps.events.subscriptions.v1.SubscriptionsService.UpdateSubscription]
    /// method to extend its expiration date. For details, see [Update or renew a
    /// subscription](<https://developers.google.com/workspace/events/guides/update-subscription>).
    #[prost(oneof = "subscription::Expiration", tags = "13, 14")]
    pub expiration: ::core::option::Option<subscription::Expiration>,
}
/// Nested message and enum types in `Subscription`.
pub mod subscription {
    /// Possible states for the subscription.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum State {
        /// Default value. This value is unused.
        Unspecified = 0,
        /// The subscription is active and can receive and deliver events to its
        /// notification endpoint.
        Active = 1,
        /// The subscription is unable to receive events due to an error.
        /// To identify the error, see the
        /// [`suspension_reason`][google.apps.events.subscriptions.v1.Subscription.suspension_reason]
        /// field.
        Suspended = 2,
        /// The subscription is deleted.
        Deleted = 3,
    }
    impl State {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                State::Unspecified => "STATE_UNSPECIFIED",
                State::Active => "ACTIVE",
                State::Suspended => "SUSPENDED",
                State::Deleted => "DELETED",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "STATE_UNSPECIFIED" => Some(Self::Unspecified),
                "ACTIVE" => Some(Self::Active),
                "SUSPENDED" => Some(Self::Suspended),
                "DELETED" => Some(Self::Deleted),
                _ => None,
            }
        }
    }
    /// Possible errors for a subscription.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum ErrorType {
        /// Default value. This value is unused.
        Unspecified = 0,
        /// The authorizing user has revoked the grant of one or more OAuth scopes.
        /// To learn more about authorization for Google Workspace, see [Configure
        /// the OAuth consent
        /// screen](<https://developers.google.com/workspace/guides/configure-oauth-consent#choose-scopes>).
        UserScopeRevoked = 1,
        /// The target resource for the subscription no longer exists.
        ResourceDeleted = 2,
        /// The user that authorized the creation of the subscription no longer has
        /// access to the subscription's target resource.
        UserAuthorizationFailure = 3,
        /// The Google Workspace application doesn't have access to deliver
        /// events to your subscription's notification endpoint.
        EndpointPermissionDenied = 4,
        /// The subscription's notification endpoint doesn't exist, or the endpoint
        /// can't be found in the Google Cloud project where you created the
        /// subscription.
        EndpointNotFound = 6,
        /// The subscription's notification endpoint failed to receive events due to
        /// insufficient quota or reaching rate limiting.
        EndpointResourceExhausted = 7,
        /// An unidentified error has occurred.
        Other = 5,
    }
    impl ErrorType {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                ErrorType::Unspecified => "ERROR_TYPE_UNSPECIFIED",
                ErrorType::UserScopeRevoked => "USER_SCOPE_REVOKED",
                ErrorType::ResourceDeleted => "RESOURCE_DELETED",
                ErrorType::UserAuthorizationFailure => "USER_AUTHORIZATION_FAILURE",
                ErrorType::EndpointPermissionDenied => "ENDPOINT_PERMISSION_DENIED",
                ErrorType::EndpointNotFound => "ENDPOINT_NOT_FOUND",
                ErrorType::EndpointResourceExhausted => "ENDPOINT_RESOURCE_EXHAUSTED",
                ErrorType::Other => "OTHER",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "ERROR_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                "USER_SCOPE_REVOKED" => Some(Self::UserScopeRevoked),
                "RESOURCE_DELETED" => Some(Self::ResourceDeleted),
                "USER_AUTHORIZATION_FAILURE" => Some(Self::UserAuthorizationFailure),
                "ENDPOINT_PERMISSION_DENIED" => Some(Self::EndpointPermissionDenied),
                "ENDPOINT_NOT_FOUND" => Some(Self::EndpointNotFound),
                "ENDPOINT_RESOURCE_EXHAUSTED" => Some(Self::EndpointResourceExhausted),
                "OTHER" => Some(Self::Other),
                _ => None,
            }
        }
    }
    /// The time when the subscription expires.
    ///
    /// The maximum expiration time depends on whether your subscription includes
    /// resource data in event payloads (specified in the
    /// [PayloadOptions][google.apps.events.subscriptions.v1.PayloadOptions]
    /// field):
    ///
    /// * If payloads omit resource data, up to 7 days.
    /// * If payloads include resource data, up to 4 hours. If your Google
    /// Workspace organization grants access to the resource through [domain-wide
    /// delegation](<https://support.google.com/a/answer/162106>), you can extend the
    /// subscription's expiration time to up to 24 hours.
    ///
    /// After a subscription expires, it's deleted automatically. You receive
    /// lifecycle events to the
    /// [notification_endpoint][google.apps.events.subscriptions.v1.Subscription.notification_endpoint]
    /// 12 hours and one hour before the subscription expires. For details, see
    /// [Receive and respond to lifecycle
    /// events](<https://developers.google.com/workspace/events/guides/events-lifecycle>).
    ///
    /// To prevent a subscription from expiring, you can use the
    /// [`UpdateSubscription`][google.apps.events.subscriptions.v1.SubscriptionsService.UpdateSubscription]
    /// method to extend its expiration date. For details, see [Update or renew a
    /// subscription](<https://developers.google.com/workspace/events/guides/update-subscription>).
    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
    pub enum Expiration {
        /// Non-empty default. The timestamp in UTC when the subscription expires.
        /// Always displayed on output, regardless of what was used on input.
        #[prost(message, tag = "13")]
        ExpireTime(::prost_types::Timestamp),
        /// Input only. The time-to-live (TTL) or duration for the subscription. If
        /// unspecified or set to `0`, uses the maximum possible duration.
        #[prost(message, tag = "14")]
        Ttl(::prost_types::Duration),
    }
}
/// Options about what data to include in the event payload. Only supported for
/// Google Chat events.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PayloadOptions {
    /// Optional. Whether the event payload includes data about the resource that
    /// changed. For example, for an event where a Google Chat message was created,
    /// whether the payload contains data about the
    /// [`Message`](<https://developers.google.com/chat/api/reference/rest/v1/spaces.messages>)
    /// resource. If false, the event payload only includes the name of the changed
    /// resource.
    #[prost(bool, tag = "1")]
    pub include_resource: bool,
    /// Optional. If `include_resource` is set to `true`, the list of fields to
    /// include in the event payload. Separate fields with a comma. For example, to
    /// include a Google Chat message's sender and create time, enter
    /// `message.sender,message.createTime`. If omitted, the payload includes all
    /// fields for the resource.
    ///
    /// If you specify a field that doesn't exist for the resource, the system
    /// ignores the field.
    #[prost(message, optional, tag = "2")]
    pub field_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// The endpoint where the subscription delivers events.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NotificationEndpoint {
    #[prost(oneof = "notification_endpoint::Endpoint", tags = "1")]
    pub endpoint: ::core::option::Option<notification_endpoint::Endpoint>,
}
/// Nested message and enum types in `NotificationEndpoint`.
pub mod notification_endpoint {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Endpoint {
        /// Immutable. The Cloud Pub/Sub topic that receives events for the
        /// subscription.
        ///
        /// Format: `projects/{project}/topics/{topic}`
        ///
        ///
        /// You must create the topic in the same Google Cloud project where
        /// you create this subscription.
        ///
        /// When the topic receives events, the events are encoded as Cloud Pub/Sub
        /// messages. For details, see the [Google Cloud Pub/Sub Protocol Binding for
        /// CloudEvents](<https://github.com/googleapis/google-cloudevents/blob/main/docs/spec/pubsub.md>).
        #[prost(string, tag = "1")]
        PubsubTopic(::prost::alloc::string::String),
    }
}
/// The request message for
/// [SubscriptionsService.CreateSubscription][google.apps.events.subscriptions.v1.SubscriptionsService.CreateSubscription].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateSubscriptionRequest {
    /// Required. The subscription resource to create.
    #[prost(message, optional, tag = "1")]
    pub subscription: ::core::option::Option<Subscription>,
    /// Optional. If set to `true`, validates and previews the request, but doesn't
    /// create the subscription.
    #[prost(bool, tag = "2")]
    pub validate_only: bool,
}
/// The request message for
/// [SubscriptionsService.DeleteSubscription][google.apps.events.subscriptions.v1.SubscriptionsService.DeleteSubscription].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DeleteSubscriptionRequest {
    /// Required. Resource name of the subscription to delete.
    ///
    /// Format: `subscriptions/{subscription}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Optional. If set to `true`, validates and previews the request, but doesn't
    /// delete the subscription.
    #[prost(bool, tag = "2")]
    pub validate_only: bool,
    /// Optional. If set to `true` and the subscription isn't found, the request
    /// succeeds but doesn't delete the subscription.
    #[prost(bool, tag = "3")]
    pub allow_missing: bool,
    /// Optional. Etag of the subscription.
    ///
    /// If present, it must match with the server's etag. Otherwise, request
    /// fails with the status `ABORTED`.
    #[prost(string, tag = "4")]
    pub etag: ::prost::alloc::string::String,
}
/// The request message for
/// [SubscriptionsService.GetSubscription][google.apps.events.subscriptions.v1.SubscriptionsService.GetSubscription].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSubscriptionRequest {
    /// Required. Resource name of the subscription.
    ///
    /// Format: `subscriptions/{subscription}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// The request message for
/// [SubscriptionsService.UpdateSubscription][google.apps.events.subscriptions.v1.SubscriptionsService.UpdateSubscription].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateSubscriptionRequest {
    /// Required. The subscription to update.
    ///
    /// The subscription's `name` field is used to identify the subscription to
    /// update.
    #[prost(message, optional, tag = "1")]
    pub subscription: ::core::option::Option<Subscription>,
    /// Optional. Required. The field to update.
    ///
    /// You can update one of the following fields in a subscription:
    ///
    /// * [`expire_time`][google.apps.events.subscriptions.v1.Subscription.expire_time]: The timestamp when the
    ///    subscription expires.
    /// * [`ttl`][google.apps.events.subscriptions.v1.Subscription.ttl]: The
    /// time-to-live (TTL) or duration of the
    ///    subscription.
    #[prost(message, optional, tag = "2")]
    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
    /// Optional. If set to `true`, validates and previews the request, but doesn't
    /// update the subscription.
    #[prost(bool, tag = "3")]
    pub validate_only: bool,
}
/// The request message for
/// [SubscriptionsService.ReactivateSubscription][google.apps.events.subscriptions.v1.SubscriptionsService.ReactivateSubscription].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReactivateSubscriptionRequest {
    /// Required. Resource name of the subscription.
    ///
    /// Format: `subscriptions/{subscription}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// The request message for
/// [SubscriptionsService.ListSubscriptions][google.apps.events.subscriptions.v1.SubscriptionsService.ListSubscriptions].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSubscriptionsRequest {
    /// Optional. The maximum number of subscriptions to return. The service might
    /// return fewer than this value.
    ///
    /// If unspecified or set to `0`, up to 50 subscriptions are returned.
    ///
    /// The maximum value is 100. If you specify a value more than 100, the system
    /// only returns 100 subscriptions.
    #[prost(int32, tag = "1")]
    pub page_size: i32,
    /// Optional. A page token, received from a previous list subscriptions call.
    /// Provide this parameter to retrieve the subsequent page.
    ///
    /// When paginating, the filter value should match the call that provided the
    /// page token. Passing a different value might lead to unexpected results.
    #[prost(string, tag = "2")]
    pub page_token: ::prost::alloc::string::String,
    /// Required. A query filter.
    ///
    /// You can filter subscriptions by event type (`event_types`)
    /// and target resource (`target_resource`).
    ///
    /// You must specify at least one event type in your query. To filter for
    /// multiple event types, use the `OR` operator.
    ///
    /// To filter by both event type and target resource, use the `AND` operator
    /// and specify the full resource name, such as
    /// `//chat.googleapis.com/spaces/{space}`.
    ///
    /// For example, the following queries are valid:
    ///
    /// ```
    /// event_types:"google.workspace.chat.membership.v1.updated" OR
    ///    event_types:"google.workspace.chat.message.v1.created"
    ///
    /// event_types:"google.workspace.chat.message.v1.created" AND
    ///    target_resource="//chat.googleapis.com/spaces/{space}"
    ///
    /// ( event_types:"google.workspace.chat.membership.v1.updated" OR
    ///    event_types:"google.workspace.chat.message.v1.created" ) AND
    ///    target_resource="//chat.googleapis.com/spaces/{space}"
    /// ```
    ///
    /// The server rejects invalid queries with an `INVALID_ARGUMENT`
    /// error.
    #[prost(string, tag = "3")]
    pub filter: ::prost::alloc::string::String,
}
/// The response message for
/// [SubscriptionsService.ListSubscriptions][google.apps.events.subscriptions.v1.SubscriptionsService.ListSubscriptions].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSubscriptionsResponse {
    /// List of subscriptions.
    #[prost(message, repeated, tag = "1")]
    pub subscriptions: ::prost::alloc::vec::Vec<Subscription>,
    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// Metadata for UpdateSubscription LRO.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct UpdateSubscriptionMetadata {}
/// Metadata for CreateSubscription LRO.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct CreateSubscriptionMetadata {}
/// Metadata for DeleteSubscription LRO.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DeleteSubscriptionMetadata {}
/// Metadata for ReactivateSubscription LRO.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ReactivateSubscriptionMetadata {}
/// Generated client implementations.
pub mod subscriptions_service_client {
    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// A service that manages subscriptions to Google Workspace events.
    #[derive(Debug, Clone)]
    pub struct SubscriptionsServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl<T> SubscriptionsServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::BoxBody>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> SubscriptionsServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::BoxBody>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            SubscriptionsServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// Creates a Google Workspace subscription. To learn how to use this
        /// method, see [Create a Google Workspace
        /// subscription](https://developers.google.com/workspace/events/guides/create-subscription).
        pub async fn create_subscription(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateSubscriptionRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.apps.events.subscriptions.v1.SubscriptionsService/CreateSubscription",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.apps.events.subscriptions.v1.SubscriptionsService",
                        "CreateSubscription",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Deletes a Google Workspace subscription.
        /// To learn how to use this method, see [Delete a Google Workspace
        /// subscription](https://developers.google.com/workspace/events/guides/delete-subscription).
        pub async fn delete_subscription(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteSubscriptionRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.apps.events.subscriptions.v1.SubscriptionsService/DeleteSubscription",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.apps.events.subscriptions.v1.SubscriptionsService",
                        "DeleteSubscription",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Gets details about a Google Workspace subscription. To learn how to use
        /// this method, see [Get details about a Google Workspace
        /// subscription](https://developers.google.com/workspace/events/guides/get-subscription).
        pub async fn get_subscription(
            &mut self,
            request: impl tonic::IntoRequest<super::GetSubscriptionRequest>,
        ) -> std::result::Result<tonic::Response<super::Subscription>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.apps.events.subscriptions.v1.SubscriptionsService/GetSubscription",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.apps.events.subscriptions.v1.SubscriptionsService",
                        "GetSubscription",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Lists Google Workspace subscriptions. To learn how to use this method, see
        /// [List Google Workspace
        /// subscriptions](https://developers.google.com/workspace/events/guides/list-subscriptions).
        pub async fn list_subscriptions(
            &mut self,
            request: impl tonic::IntoRequest<super::ListSubscriptionsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListSubscriptionsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.apps.events.subscriptions.v1.SubscriptionsService/ListSubscriptions",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.apps.events.subscriptions.v1.SubscriptionsService",
                        "ListSubscriptions",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Updates or renews a Google Workspace subscription. To learn how to use this
        /// method, see [Update or renew a Google Workspace
        /// subscription](https://developers.google.com/workspace/events/guides/update-subscription).
        pub async fn update_subscription(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdateSubscriptionRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.apps.events.subscriptions.v1.SubscriptionsService/UpdateSubscription",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.apps.events.subscriptions.v1.SubscriptionsService",
                        "UpdateSubscription",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Reactivates a suspended Google Workspace subscription.
        ///
        /// This method resets your subscription's `State` field to `ACTIVE`. Before
        /// you use this method, you must fix the error that suspended the
        /// subscription. To learn how to use this method, see [Reactivate a Google
        /// Workspace
        /// subscription](https://developers.google.com/workspace/events/guides/reactivate-subscription).
        pub async fn reactivate_subscription(
            &mut self,
            request: impl tonic::IntoRequest<super::ReactivateSubscriptionRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::new(
                        tonic::Code::Unknown,
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.apps.events.subscriptions.v1.SubscriptionsService/ReactivateSubscription",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.apps.events.subscriptions.v1.SubscriptionsService",
                        "ReactivateSubscription",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}