pub struct SchemaService { /* private fields */ }Expand description
Implements a client for the Cloud Pub/Sub API.
§Example
let client = SchemaService::builder().build().await?;
// use `client` to make requests to the Cloud Pub/Sub API.§Service Description
Service for doing schema-related operations.
§Configuration
To configure SchemaService use the with_* methods in the type returned
by 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 override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§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 or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl SchemaService
impl SchemaService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for SchemaService.
let client = SchemaService::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: SchemaService + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: SchemaService + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is in tests mocking the client’s behavior.
Sourcepub fn create_schema(&self) -> CreateSchema
pub fn create_schema(&self) -> CreateSchema
Creates a schema.
Sourcepub fn get_schema(&self) -> GetSchema
pub fn get_schema(&self) -> GetSchema
Gets a schema.
Sourcepub fn list_schemas(&self) -> ListSchemas
pub fn list_schemas(&self) -> ListSchemas
Lists schemas in a project.
Sourcepub fn list_schema_revisions(&self) -> ListSchemaRevisions
pub fn list_schema_revisions(&self) -> ListSchemaRevisions
Lists all schema revisions for the named schema.
Sourcepub fn commit_schema(&self) -> CommitSchema
pub fn commit_schema(&self) -> CommitSchema
Commits a new schema revision to an existing schema.
Sourcepub fn rollback_schema(&self) -> RollbackSchema
pub fn rollback_schema(&self) -> RollbackSchema
Creates a new schema revision that is a copy of the provided revision_id.
Sourcepub fn delete_schema_revision(&self) -> DeleteSchemaRevision
pub fn delete_schema_revision(&self) -> DeleteSchemaRevision
Deletes a specific schema revision.
Sourcepub fn delete_schema(&self) -> DeleteSchema
pub fn delete_schema(&self) -> DeleteSchema
Deletes a schema.
Sourcepub fn validate_schema(&self) -> ValidateSchema
pub fn validate_schema(&self) -> ValidateSchema
Validates a schema.
Sourcepub fn validate_message(&self) -> ValidateMessage
pub fn validate_message(&self) -> ValidateMessage
Validates a message against a schema.
Sourcepub fn set_iam_policy(&self) -> SetIamPolicy
pub fn set_iam_policy(&self) -> SetIamPolicy
Sets the access control policy on the specified resource. Replaces any existing policy.
Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED
errors.
Sourcepub fn get_iam_policy(&self) -> GetIamPolicy
pub fn get_iam_policy(&self) -> GetIamPolicy
Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
Sourcepub fn test_iam_permissions(&self) -> TestIamPermissions
pub fn test_iam_permissions(&self) -> TestIamPermissions
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.
Trait Implementations§
Source§impl Clone for SchemaService
impl Clone for SchemaService
Source§fn clone(&self) -> SchemaService
fn clone(&self) -> SchemaService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SchemaService
impl !RefUnwindSafe for SchemaService
impl Send for SchemaService
impl Sync for SchemaService
impl Unpin for SchemaService
impl !UnwindSafe for SchemaService
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request