google-cloud-pubsub 0.31.0-preview

Google Cloud Client Libraries for Rust - Pub/Sub
Documentation
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
// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.
#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]

/// Implements a client for the Cloud Pub/Sub API.
///
/// # Example
/// ```
/// # tokio_test::block_on(async {
/// # use google_cloud_pubsub::client::TopicAdmin;
/// let client = TopicAdmin::builder().build().await?;
/// // use `client` to make requests to the Cloud Pub/Sub API.
/// # gax::client_builder::Result::<()>::Ok(()) });
/// ```
///
/// # Service Description
///
/// The service that an application uses to manipulate topics, and to send
/// messages to a topic.
///
/// # Configuration
///
/// To configure `TopicAdmin` use the `with_*` methods in the type returned
/// by [builder()][TopicAdmin::builder]. The default configuration should
/// work for most applications. Common configuration changes include
///
/// * [with_endpoint()]: by default this client uses the global default endpoint
///   (`https://pubsub.googleapis.com`). Applications using regional
///   endpoints or running in restricted networks (e.g. a network configured
//    with [Private Google Access with VPC Service Controls]) may want to
///   override this default.
/// * [with_credentials()]: by default this client uses
///   [Application Default Credentials]. Applications using custom
///   authentication may need to override this default.
///
/// [with_endpoint()]: super::builder::topic_admin::ClientBuilder::with_endpoint
/// [with_credentials()]: super::builder::topic_admin::ClientBuilder::credentials
/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
///
/// # Pooling and Cloning
///
/// `TopicAdmin` holds a connection pool internally, it is advised to
/// create one and the reuse it.  You do not need to wrap `TopicAdmin` in
/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
/// already uses an `Arc` internally.
#[derive(Clone, Debug)]
pub struct TopicAdmin {
    inner: std::sync::Arc<dyn super::stub::dynamic::TopicAdmin>,
}

impl TopicAdmin {
    /// Returns a builder for [TopicAdmin].
    ///
    /// ```
    /// # tokio_test::block_on(async {
    /// # use google_cloud_pubsub::client::TopicAdmin;
    /// let client = TopicAdmin::builder().build().await?;
    /// # gax::client_builder::Result::<()>::Ok(()) });
    /// ```
    pub fn builder() -> super::builder::topic_admin::ClientBuilder {
        gax::client_builder::internal::new_builder(super::builder::topic_admin::client::Factory)
    }

    /// Creates a new client from the provided stub.
    ///
    /// The most common case for calling this function is in tests mocking the
    /// client's behavior.
    pub fn from_stub<T>(stub: T) -> Self
    where
        T: super::stub::TopicAdmin + 'static,
    {
        Self {
            inner: std::sync::Arc::new(stub),
        }
    }

    pub(crate) async fn new(
        config: gaxi::options::ClientConfig,
    ) -> gax::client_builder::Result<Self> {
        let inner = Self::build_inner(config).await?;
        Ok(Self { inner })
    }

    async fn build_inner(
        conf: gaxi::options::ClientConfig,
    ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::TopicAdmin>> {
        if gaxi::options::tracing_enabled(&conf) {
            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
        }
        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
    }

    async fn build_transport(
        conf: gaxi::options::ClientConfig,
    ) -> gax::client_builder::Result<impl super::stub::TopicAdmin> {
        super::transport::TopicAdmin::new(conf).await
    }

    async fn build_with_tracing(
        conf: gaxi::options::ClientConfig,
    ) -> gax::client_builder::Result<impl super::stub::TopicAdmin> {
        Self::build_transport(conf)
            .await
            .map(super::tracing::TopicAdmin::new)
    }

    /// Creates the given topic with the given name. See the [resource name rules]
    /// (<https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names>).
    pub fn create_topic(&self) -> super::builder::topic_admin::CreateTopic {
        super::builder::topic_admin::CreateTopic::new(self.inner.clone())
    }

    /// Updates an existing topic by updating the fields specified in the update
    /// mask. Note that certain properties of a topic are not modifiable.
    pub fn update_topic(&self) -> super::builder::topic_admin::UpdateTopic {
        super::builder::topic_admin::UpdateTopic::new(self.inner.clone())
    }

    /// Gets the configuration of a topic.
    pub fn get_topic(&self) -> super::builder::topic_admin::GetTopic {
        super::builder::topic_admin::GetTopic::new(self.inner.clone())
    }

    /// Lists matching topics.
    pub fn list_topics(&self) -> super::builder::topic_admin::ListTopics {
        super::builder::topic_admin::ListTopics::new(self.inner.clone())
    }

    /// Lists the names of the attached subscriptions on this topic.
    pub fn list_topic_subscriptions(&self) -> super::builder::topic_admin::ListTopicSubscriptions {
        super::builder::topic_admin::ListTopicSubscriptions::new(self.inner.clone())
    }

    /// Lists the names of the snapshots on this topic. Snapshots are used in
    /// [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations,
    /// which allow you to manage message acknowledgments in bulk. That is, you can
    /// set the acknowledgment state of messages in an existing subscription to the
    /// state captured by a snapshot.
    pub fn list_topic_snapshots(&self) -> super::builder::topic_admin::ListTopicSnapshots {
        super::builder::topic_admin::ListTopicSnapshots::new(self.inner.clone())
    }

    /// Deletes the topic with the given name. Returns `NOT_FOUND` if the topic
    /// does not exist. After a topic is deleted, a new topic may be created with
    /// the same name; this is an entirely new topic with none of the old
    /// configuration or subscriptions. Existing subscriptions to this topic are
    /// not deleted, but their `topic` field is set to `_deleted-topic_`.
    pub fn delete_topic(&self) -> super::builder::topic_admin::DeleteTopic {
        super::builder::topic_admin::DeleteTopic::new(self.inner.clone())
    }

    /// Detaches a subscription from this topic. All messages retained in the
    /// subscription are dropped. Subsequent `Pull` and `StreamingPull` requests
    /// will return FAILED_PRECONDITION. If the subscription is a push
    /// subscription, pushes to the endpoint will stop.
    pub fn detach_subscription(&self) -> super::builder::topic_admin::DetachSubscription {
        super::builder::topic_admin::DetachSubscription::new(self.inner.clone())
    }
}

/// Implements a client for the Cloud Pub/Sub API.
///
/// # Example
/// ```
/// # tokio_test::block_on(async {
/// # use google_cloud_pubsub::client::SubscriptionAdmin;
/// let client = SubscriptionAdmin::builder().build().await?;
/// // use `client` to make requests to the Cloud Pub/Sub API.
/// # gax::client_builder::Result::<()>::Ok(()) });
/// ```
///
/// # Service Description
///
/// The service that an application uses to manipulate subscriptions and to
/// consume messages from a subscription via the `Pull` method or by
/// establishing a bi-directional stream using the `StreamingPull` method.
///
/// # Configuration
///
/// To configure `SubscriptionAdmin` use the `with_*` methods in the type returned
/// by [builder()][SubscriptionAdmin::builder]. The default configuration should
/// work for most applications. Common configuration changes include
///
/// * [with_endpoint()]: by default this client uses the global default endpoint
///   (`https://pubsub.googleapis.com`). Applications using regional
///   endpoints or running in restricted networks (e.g. a network configured
//    with [Private Google Access with VPC Service Controls]) may want to
///   override this default.
/// * [with_credentials()]: by default this client uses
///   [Application Default Credentials]. Applications using custom
///   authentication may need to override this default.
///
/// [with_endpoint()]: super::builder::subscription_admin::ClientBuilder::with_endpoint
/// [with_credentials()]: super::builder::subscription_admin::ClientBuilder::credentials
/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
///
/// # Pooling and Cloning
///
/// `SubscriptionAdmin` holds a connection pool internally, it is advised to
/// create one and the reuse it.  You do not need to wrap `SubscriptionAdmin` in
/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
/// already uses an `Arc` internally.
#[derive(Clone, Debug)]
pub struct SubscriptionAdmin {
    inner: std::sync::Arc<dyn super::stub::dynamic::SubscriptionAdmin>,
}

impl SubscriptionAdmin {
    /// Returns a builder for [SubscriptionAdmin].
    ///
    /// ```
    /// # tokio_test::block_on(async {
    /// # use google_cloud_pubsub::client::SubscriptionAdmin;
    /// let client = SubscriptionAdmin::builder().build().await?;
    /// # gax::client_builder::Result::<()>::Ok(()) });
    /// ```
    pub fn builder() -> super::builder::subscription_admin::ClientBuilder {
        gax::client_builder::internal::new_builder(
            super::builder::subscription_admin::client::Factory,
        )
    }

    /// Creates a new client from the provided stub.
    ///
    /// The most common case for calling this function is in tests mocking the
    /// client's behavior.
    pub fn from_stub<T>(stub: T) -> Self
    where
        T: super::stub::SubscriptionAdmin + 'static,
    {
        Self {
            inner: std::sync::Arc::new(stub),
        }
    }

    pub(crate) async fn new(
        config: gaxi::options::ClientConfig,
    ) -> gax::client_builder::Result<Self> {
        let inner = Self::build_inner(config).await?;
        Ok(Self { inner })
    }

    async fn build_inner(
        conf: gaxi::options::ClientConfig,
    ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::SubscriptionAdmin>>
    {
        if gaxi::options::tracing_enabled(&conf) {
            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
        }
        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
    }

    async fn build_transport(
        conf: gaxi::options::ClientConfig,
    ) -> gax::client_builder::Result<impl super::stub::SubscriptionAdmin> {
        super::transport::SubscriptionAdmin::new(conf).await
    }

    async fn build_with_tracing(
        conf: gaxi::options::ClientConfig,
    ) -> gax::client_builder::Result<impl super::stub::SubscriptionAdmin> {
        Self::build_transport(conf)
            .await
            .map(super::tracing::SubscriptionAdmin::new)
    }

    /// Creates a subscription to a given topic. See the [resource name rules]
    /// (<https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names>).
    /// If the subscription already exists, returns `ALREADY_EXISTS`.
    /// If the corresponding topic doesn't exist, returns `NOT_FOUND`.
    ///
    /// If the name is not provided in the request, the server will assign a random
    /// name for this subscription on the same project as the topic, conforming
    /// to the [resource name format]
    /// (<https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names>). The
    /// generated name is populated in the returned Subscription object. Note that
    /// for REST API requests, you must specify a name in the request.
    pub fn create_subscription(&self) -> super::builder::subscription_admin::CreateSubscription {
        super::builder::subscription_admin::CreateSubscription::new(self.inner.clone())
    }

    /// Gets the configuration details of a subscription.
    pub fn get_subscription(&self) -> super::builder::subscription_admin::GetSubscription {
        super::builder::subscription_admin::GetSubscription::new(self.inner.clone())
    }

    /// Updates an existing subscription by updating the fields specified in the
    /// update mask. Note that certain properties of a subscription, such as its
    /// topic, are not modifiable.
    pub fn update_subscription(&self) -> super::builder::subscription_admin::UpdateSubscription {
        super::builder::subscription_admin::UpdateSubscription::new(self.inner.clone())
    }

    /// Lists matching subscriptions.
    pub fn list_subscriptions(&self) -> super::builder::subscription_admin::ListSubscriptions {
        super::builder::subscription_admin::ListSubscriptions::new(self.inner.clone())
    }

    /// Deletes an existing subscription. All messages retained in the subscription
    /// are immediately dropped. Calls to `Pull` after deletion will return
    /// `NOT_FOUND`. After a subscription is deleted, a new one may be created with
    /// the same name, but the new one has no association with the old
    /// subscription or its topic unless the same topic is specified.
    pub fn delete_subscription(&self) -> super::builder::subscription_admin::DeleteSubscription {
        super::builder::subscription_admin::DeleteSubscription::new(self.inner.clone())
    }

    /// Modifies the `PushConfig` for a specified subscription.
    ///
    /// This may be used to change a push subscription to a pull one (signified by
    /// an empty `PushConfig`) or vice versa, or change the endpoint URL and other
    /// attributes of a push subscription. Messages will accumulate for delivery
    /// continuously through the call regardless of changes to the `PushConfig`.
    pub fn modify_push_config(&self) -> super::builder::subscription_admin::ModifyPushConfig {
        super::builder::subscription_admin::ModifyPushConfig::new(self.inner.clone())
    }

    /// Gets the configuration details of a snapshot. Snapshots are used in
    /// [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations,
    /// which allow you to manage message acknowledgments in bulk. That is, you can
    /// set the acknowledgment state of messages in an existing subscription to the
    /// state captured by a snapshot.
    pub fn get_snapshot(&self) -> super::builder::subscription_admin::GetSnapshot {
        super::builder::subscription_admin::GetSnapshot::new(self.inner.clone())
    }

    /// Lists the existing snapshots. Snapshots are used in [Seek](
    /// <https://cloud.google.com/pubsub/docs/replay-overview>) operations, which
    /// allow you to manage message acknowledgments in bulk. That is, you can set
    /// the acknowledgment state of messages in an existing subscription to the
    /// state captured by a snapshot.
    pub fn list_snapshots(&self) -> super::builder::subscription_admin::ListSnapshots {
        super::builder::subscription_admin::ListSnapshots::new(self.inner.clone())
    }

    /// Creates a snapshot from the requested subscription. Snapshots are used in
    /// [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations,
    /// which allow you to manage message acknowledgments in bulk. That is, you can
    /// set the acknowledgment state of messages in an existing subscription to the
    /// state captured by a snapshot.
    /// If the snapshot already exists, returns `ALREADY_EXISTS`.
    /// If the requested subscription doesn't exist, returns `NOT_FOUND`.
    /// If the backlog in the subscription is too old -- and the resulting snapshot
    /// would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned.
    /// See also the `Snapshot.expire_time` field. If the name is not provided in
    /// the request, the server will assign a random
    /// name for this snapshot on the same project as the subscription, conforming
    /// to the [resource name format]
    /// (<https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names>). The
    /// generated name is populated in the returned Snapshot object. Note that for
    /// REST API requests, you must specify a name in the request.
    pub fn create_snapshot(&self) -> super::builder::subscription_admin::CreateSnapshot {
        super::builder::subscription_admin::CreateSnapshot::new(self.inner.clone())
    }

    /// Updates an existing snapshot by updating the fields specified in the update
    /// mask. Snapshots are used in
    /// [Seek](https://cloud.google.com/pubsub/docs/replay-overview) operations,
    /// which allow you to manage message acknowledgments in bulk. That is, you can
    /// set the acknowledgment state of messages in an existing subscription to the
    /// state captured by a snapshot.
    pub fn update_snapshot(&self) -> super::builder::subscription_admin::UpdateSnapshot {
        super::builder::subscription_admin::UpdateSnapshot::new(self.inner.clone())
    }

    /// Removes an existing snapshot. Snapshots are used in [Seek]
    /// (<https://cloud.google.com/pubsub/docs/replay-overview>) operations, which
    /// allow you to manage message acknowledgments in bulk. That is, you can set
    /// the acknowledgment state of messages in an existing subscription to the
    /// state captured by a snapshot.
    /// When the snapshot is deleted, all messages retained in the snapshot
    /// are immediately dropped. After a snapshot is deleted, a new one may be
    /// created with the same name, but the new one has no association with the old
    /// snapshot or its subscription, unless the same subscription is specified.
    pub fn delete_snapshot(&self) -> super::builder::subscription_admin::DeleteSnapshot {
        super::builder::subscription_admin::DeleteSnapshot::new(self.inner.clone())
    }

    /// Seeks an existing subscription to a point in time or to a given snapshot,
    /// whichever is provided in the request. Snapshots are used in [Seek]
    /// (<https://cloud.google.com/pubsub/docs/replay-overview>) operations, which
    /// allow you to manage message acknowledgments in bulk. That is, you can set
    /// the acknowledgment state of messages in an existing subscription to the
    /// state captured by a snapshot. Note that both the subscription and the
    /// snapshot must be on the same topic.
    pub fn seek(&self) -> super::builder::subscription_admin::Seek {
        super::builder::subscription_admin::Seek::new(self.inner.clone())
    }
}

/// Implements a client for the Cloud Pub/Sub API.
///
/// # Example
/// ```
/// # tokio_test::block_on(async {
/// # use google_cloud_pubsub::client::SchemaService;
/// let client = SchemaService::builder().build().await?;
/// // use `client` to make requests to the Cloud Pub/Sub API.
/// # gax::client_builder::Result::<()>::Ok(()) });
/// ```
///
/// # Service Description
///
/// Service for doing schema-related operations.
///
/// # Configuration
///
/// To configure `SchemaService` use the `with_*` methods in the type returned
/// by [builder()][SchemaService::builder]. The default configuration should
/// work for most applications. Common configuration changes include
///
/// * [with_endpoint()]: by default this client uses the global default endpoint
///   (`https://pubsub.googleapis.com`). Applications using regional
///   endpoints or running in restricted networks (e.g. a network configured
//    with [Private Google Access with VPC Service Controls]) may want to
///   override this default.
/// * [with_credentials()]: by default this client uses
///   [Application Default Credentials]. Applications using custom
///   authentication may need to override this default.
///
/// [with_endpoint()]: super::builder::schema_service::ClientBuilder::with_endpoint
/// [with_credentials()]: super::builder::schema_service::ClientBuilder::credentials
/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
///
/// # Pooling and Cloning
///
/// `SchemaService` holds a connection pool internally, it is advised to
/// create one and the reuse it.  You do not need to wrap `SchemaService` in
/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
/// already uses an `Arc` internally.
#[derive(Clone, Debug)]
pub struct SchemaService {
    inner: std::sync::Arc<dyn super::stub::dynamic::SchemaService>,
}

impl SchemaService {
    /// Returns a builder for [SchemaService].
    ///
    /// ```
    /// # tokio_test::block_on(async {
    /// # use google_cloud_pubsub::client::SchemaService;
    /// let client = SchemaService::builder().build().await?;
    /// # gax::client_builder::Result::<()>::Ok(()) });
    /// ```
    pub fn builder() -> super::builder::schema_service::ClientBuilder {
        gax::client_builder::internal::new_builder(super::builder::schema_service::client::Factory)
    }

    /// Creates a new client from the provided stub.
    ///
    /// The most common case for calling this function is in tests mocking the
    /// client's behavior.
    pub fn from_stub<T>(stub: T) -> Self
    where
        T: super::stub::SchemaService + 'static,
    {
        Self {
            inner: std::sync::Arc::new(stub),
        }
    }

    pub(crate) async fn new(
        config: gaxi::options::ClientConfig,
    ) -> gax::client_builder::Result<Self> {
        let inner = Self::build_inner(config).await?;
        Ok(Self { inner })
    }

    async fn build_inner(
        conf: gaxi::options::ClientConfig,
    ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::SchemaService>> {
        if gaxi::options::tracing_enabled(&conf) {
            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
        }
        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
    }

    async fn build_transport(
        conf: gaxi::options::ClientConfig,
    ) -> gax::client_builder::Result<impl super::stub::SchemaService> {
        super::transport::SchemaService::new(conf).await
    }

    async fn build_with_tracing(
        conf: gaxi::options::ClientConfig,
    ) -> gax::client_builder::Result<impl super::stub::SchemaService> {
        Self::build_transport(conf)
            .await
            .map(super::tracing::SchemaService::new)
    }

    /// Creates a schema.
    pub fn create_schema(&self) -> super::builder::schema_service::CreateSchema {
        super::builder::schema_service::CreateSchema::new(self.inner.clone())
    }

    /// Gets a schema.
    pub fn get_schema(&self) -> super::builder::schema_service::GetSchema {
        super::builder::schema_service::GetSchema::new(self.inner.clone())
    }

    /// Lists schemas in a project.
    pub fn list_schemas(&self) -> super::builder::schema_service::ListSchemas {
        super::builder::schema_service::ListSchemas::new(self.inner.clone())
    }

    /// Lists all schema revisions for the named schema.
    pub fn list_schema_revisions(&self) -> super::builder::schema_service::ListSchemaRevisions {
        super::builder::schema_service::ListSchemaRevisions::new(self.inner.clone())
    }

    /// Commits a new schema revision to an existing schema.
    pub fn commit_schema(&self) -> super::builder::schema_service::CommitSchema {
        super::builder::schema_service::CommitSchema::new(self.inner.clone())
    }

    /// Creates a new schema revision that is a copy of the provided revision_id.
    pub fn rollback_schema(&self) -> super::builder::schema_service::RollbackSchema {
        super::builder::schema_service::RollbackSchema::new(self.inner.clone())
    }

    /// Deletes a specific schema revision.
    pub fn delete_schema_revision(&self) -> super::builder::schema_service::DeleteSchemaRevision {
        super::builder::schema_service::DeleteSchemaRevision::new(self.inner.clone())
    }

    /// Deletes a schema.
    pub fn delete_schema(&self) -> super::builder::schema_service::DeleteSchema {
        super::builder::schema_service::DeleteSchema::new(self.inner.clone())
    }

    /// Validates a schema.
    pub fn validate_schema(&self) -> super::builder::schema_service::ValidateSchema {
        super::builder::schema_service::ValidateSchema::new(self.inner.clone())
    }

    /// Validates a message against a schema.
    pub fn validate_message(&self) -> super::builder::schema_service::ValidateMessage {
        super::builder::schema_service::ValidateMessage::new(self.inner.clone())
    }

    /// Sets the access control policy on the specified resource. Replaces
    /// any existing policy.
    ///
    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
    /// errors.
    pub fn set_iam_policy(&self) -> super::builder::schema_service::SetIamPolicy {
        super::builder::schema_service::SetIamPolicy::new(self.inner.clone())
    }

    /// Gets the access control policy for a resource. Returns an empty policy
    /// if the resource exists and does not have a policy set.
    pub fn get_iam_policy(&self) -> super::builder::schema_service::GetIamPolicy {
        super::builder::schema_service::GetIamPolicy::new(self.inner.clone())
    }

    /// Returns permissions that a caller has on the specified resource. If the
    /// resource does not exist, this will return an empty set of
    /// permissions, not a `NOT_FOUND` error.
    ///
    /// Note: This operation is designed to be used for building
    /// permission-aware UIs and command-line tools, not for authorization
    /// checking. This operation may "fail open" without warning.
    pub fn test_iam_permissions(&self) -> super::builder::schema_service::TestIamPermissions {
        super::builder::schema_service::TestIamPermissions::new(self.inner.clone())
    }
}