Google Cloud Pub/Sub C++ Client 2.13.0
A C++ Client Library for Google Cloud Pub/Sub
Loading...
Searching...
No Matches
Public Member Functions | List of all members
google::cloud::pubsub::SchemaServiceClient Class Reference

Service for doing schema-related operations. More...

#include <google/cloud/pubsub/schema_client.h>

Public Member Functions

 SchemaServiceClient (std::shared_ptr< SchemaServiceConnection > connection, Options opts={})
 
 ~SchemaServiceClient ()
 
StatusOr< google::pubsub::v1::Schema > CreateSchema (std::string const &parent, google::pubsub::v1::Schema const &schema, std::string const &schema_id, Options opts={})
 Creates a schema. More...
 
StatusOr< google::pubsub::v1::Schema > CreateSchema (google::pubsub::v1::CreateSchemaRequest const &request, Options opts={})
 Creates a schema. More...
 
StatusOr< google::pubsub::v1::Schema > GetSchema (std::string const &name, Options opts={})
 Gets a schema. More...
 
StatusOr< google::pubsub::v1::Schema > GetSchema (google::pubsub::v1::GetSchemaRequest const &request, Options opts={})
 Gets a schema. More...
 
StreamRange< google::pubsub::v1::Schema > ListSchemas (std::string const &parent, Options opts={})
 Lists schemas in a project. More...
 
StreamRange< google::pubsub::v1::Schema > ListSchemas (google::pubsub::v1::ListSchemasRequest request, Options opts={})
 Lists schemas in a project. More...
 
StreamRange< google::pubsub::v1::Schema > ListSchemaRevisions (std::string const &name, Options opts={})
 Lists all schema revisions for the named schema. More...
 
StreamRange< google::pubsub::v1::Schema > ListSchemaRevisions (google::pubsub::v1::ListSchemaRevisionsRequest request, Options opts={})
 Lists all schema revisions for the named schema. More...
 
StatusOr< google::pubsub::v1::Schema > CommitSchema (std::string const &name, google::pubsub::v1::Schema const &schema, Options opts={})
 Commits a new schema revision to an existing schema. More...
 
StatusOr< google::pubsub::v1::Schema > CommitSchema (google::pubsub::v1::CommitSchemaRequest const &request, Options opts={})
 Commits a new schema revision to an existing schema. More...
 
StatusOr< google::pubsub::v1::Schema > RollbackSchema (std::string const &name, std::string const &revision_id, Options opts={})
 Creates a new schema revision that is a copy of the provided revision_id. More...
 
StatusOr< google::pubsub::v1::Schema > RollbackSchema (google::pubsub::v1::RollbackSchemaRequest const &request, Options opts={})
 Creates a new schema revision that is a copy of the provided revision_id. More...
 
StatusOr< google::pubsub::v1::Schema > DeleteSchemaRevision (std::string const &name, std::string const &revision_id, Options opts={})
 Deletes a specific schema revision. More...
 
StatusOr< google::pubsub::v1::Schema > DeleteSchemaRevision (google::pubsub::v1::DeleteSchemaRevisionRequest const &request, Options opts={})
 Deletes a specific schema revision. More...
 
Status DeleteSchema (std::string const &name, Options opts={})
 Deletes a schema. More...
 
Status DeleteSchema (google::pubsub::v1::DeleteSchemaRequest const &request, Options opts={})
 Deletes a schema. More...
 
StatusOr< google::pubsub::v1::ValidateSchemaResponse > ValidateSchema (std::string const &parent, google::pubsub::v1::Schema const &schema, Options opts={})
 Validates a schema. More...
 
StatusOr< google::pubsub::v1::ValidateSchemaResponse > ValidateSchema (google::pubsub::v1::ValidateSchemaRequest const &request, Options opts={})
 Validates a schema. More...
 
StatusOr< google::pubsub::v1::ValidateMessageResponse > ValidateMessage (google::pubsub::v1::ValidateMessageRequest const &request, Options opts={})
 Validates a message against a schema. More...
 
Copy and move support
 SchemaServiceClient (SchemaServiceClient const &)=default
 
SchemaServiceClientoperator= (SchemaServiceClient const &)=default
 
 SchemaServiceClient (SchemaServiceClient &&)=default
 
SchemaServiceClientoperator= (SchemaServiceClient &&)=default
 

Friends

Equality
bool operator== (SchemaServiceClient const &a, SchemaServiceClient const &b)
 
bool operator!= (SchemaServiceClient const &a, SchemaServiceClient const &b)
 

Detailed Description

Service for doing schema-related operations.

Equality

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection> objects compare equal. Objects that compare equal share the same underlying resources.

Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

Constructor & Destructor Documentation

◆ SchemaServiceClient() [1/3]

google::cloud::pubsub::SchemaServiceClient::SchemaServiceClient ( std::shared_ptr< SchemaServiceConnection connection,
Options  opts = {} 
)
explicit

◆ ~SchemaServiceClient()

google::cloud::pubsub::SchemaServiceClient::~SchemaServiceClient ( )

◆ SchemaServiceClient() [2/3]

google::cloud::pubsub::SchemaServiceClient::SchemaServiceClient ( SchemaServiceClient const &  )
default

◆ SchemaServiceClient() [3/3]

google::cloud::pubsub::SchemaServiceClient::SchemaServiceClient ( SchemaServiceClient &&  )
default

Member Function Documentation

◆ CommitSchema() [1/2]

StatusOr< google::pubsub::v1::Schema > google::cloud::pubsub::SchemaServiceClient::CommitSchema ( google::pubsub::v1::CommitSchemaRequest const &  request,
Options  opts = {} 
)

Commits a new schema revision to an existing schema.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.pubsub.v1.CommitSchemaRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.pubsub.v1.Schema) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ CommitSchema() [2/2]

StatusOr< google::pubsub::v1::Schema > google::cloud::pubsub::SchemaServiceClient::CommitSchema ( std::string const &  name,
google::pubsub::v1::Schema const &  schema,
Options  opts = {} 
)

Commits a new schema revision to an existing schema.

Parameters
nameRequired. The name of the schema we are revising. Format is projects/{project}/schemas/{schema}.
schemaRequired. The schema revision to commit.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.pubsub.v1.Schema) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ CreateSchema() [1/2]

StatusOr< google::pubsub::v1::Schema > google::cloud::pubsub::SchemaServiceClient::CreateSchema ( google::pubsub::v1::CreateSchemaRequest const &  request,
Options  opts = {} 
)

Creates a schema.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.pubsub.v1.CreateSchemaRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.pubsub.v1.Schema) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ CreateSchema() [2/2]

StatusOr< google::pubsub::v1::Schema > google::cloud::pubsub::SchemaServiceClient::CreateSchema ( std::string const &  parent,
google::pubsub::v1::Schema const &  schema,
std::string const &  schema_id,
Options  opts = {} 
)

Creates a schema.

Parameters
parentRequired. The name of the project in which to create the schema. Format is projects/{project-id}.
schemaRequired. The schema object to create.
This schema's name parameter is ignored. The schema object returned by CreateSchema will have a name made using the given parent and schema_id.
schema_idThe ID to use for the schema, which will become the final component of the schema's resource name.
See https://cloud.google.com/pubsub/docs/admin#resource_names for resource name constraints.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.pubsub.v1.Schema) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ DeleteSchema() [1/2]

Status google::cloud::pubsub::SchemaServiceClient::DeleteSchema ( google::pubsub::v1::DeleteSchemaRequest const &  request,
Options  opts = {} 
)

Deletes a schema.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.pubsub.v1.DeleteSchemaRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a `Status` object. If the request failed, the status contains the details of the failure.

◆ DeleteSchema() [2/2]

Status google::cloud::pubsub::SchemaServiceClient::DeleteSchema ( std::string const &  name,
Options  opts = {} 
)

Deletes a schema.

Parameters
nameRequired. Name of the schema to delete. Format is projects/{project}/schemas/{schema}.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a `Status` object. If the request failed, the status contains the details of the failure.

◆ DeleteSchemaRevision() [1/2]

StatusOr< google::pubsub::v1::Schema > google::cloud::pubsub::SchemaServiceClient::DeleteSchemaRevision ( google::pubsub::v1::DeleteSchemaRevisionRequest const &  request,
Options  opts = {} 
)

Deletes a specific schema revision.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.pubsub.v1.DeleteSchemaRevisionRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.pubsub.v1.Schema) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ DeleteSchemaRevision() [2/2]

StatusOr< google::pubsub::v1::Schema > google::cloud::pubsub::SchemaServiceClient::DeleteSchemaRevision ( std::string const &  name,
std::string const &  revision_id,
Options  opts = {} 
)

Deletes a specific schema revision.

Parameters
nameRequired. The name of the schema revision to be deleted, with a revision ID explicitly included.
Example: projects/123/schemas/my-schema@c7cfa2a8
revision_idOptional. This field is deprecated and should not be used for specifying the revision ID. The revision ID should be specified via the name parameter.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.pubsub.v1.Schema) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ GetSchema() [1/2]

StatusOr< google::pubsub::v1::Schema > google::cloud::pubsub::SchemaServiceClient::GetSchema ( google::pubsub::v1::GetSchemaRequest const &  request,
Options  opts = {} 
)

Gets a schema.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.pubsub.v1.GetSchemaRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.pubsub.v1.Schema) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ GetSchema() [2/2]

StatusOr< google::pubsub::v1::Schema > google::cloud::pubsub::SchemaServiceClient::GetSchema ( std::string const &  name,
Options  opts = {} 
)

Gets a schema.

Parameters
nameRequired. The name of the schema to get. Format is projects/{project}/schemas/{schema}.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.pubsub.v1.Schema) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ ListSchemaRevisions() [1/2]

StreamRange< google::pubsub::v1::Schema > google::cloud::pubsub::SchemaServiceClient::ListSchemaRevisions ( google::pubsub::v1::ListSchemaRevisionsRequest  request,
Options  opts = {} 
)

Lists all schema revisions for the named schema.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.pubsub.v1.ListSchemaRevisionsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a `StatusOr` as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.pubsub.v1.Schema, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

◆ ListSchemaRevisions() [2/2]

StreamRange< google::pubsub::v1::Schema > google::cloud::pubsub::SchemaServiceClient::ListSchemaRevisions ( std::string const &  name,
Options  opts = {} 
)

Lists all schema revisions for the named schema.

Parameters
nameRequired. The name of the schema to list revisions for.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a `StatusOr` as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.pubsub.v1.Schema, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

◆ ListSchemas() [1/2]

StreamRange< google::pubsub::v1::Schema > google::cloud::pubsub::SchemaServiceClient::ListSchemas ( google::pubsub::v1::ListSchemasRequest  request,
Options  opts = {} 
)

Lists schemas in a project.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.pubsub.v1.ListSchemasRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a `StatusOr` as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.pubsub.v1.Schema, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

◆ ListSchemas() [2/2]

StreamRange< google::pubsub::v1::Schema > google::cloud::pubsub::SchemaServiceClient::ListSchemas ( std::string const &  parent,
Options  opts = {} 
)

Lists schemas in a project.

Parameters
parentRequired. The name of the project in which to list schemas. Format is projects/{project-id}.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a `StatusOr` as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.pubsub.v1.Schema, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

◆ operator=() [1/2]

SchemaServiceClient & google::cloud::pubsub::SchemaServiceClient::operator= ( SchemaServiceClient &&  )
default

◆ operator=() [2/2]

SchemaServiceClient & google::cloud::pubsub::SchemaServiceClient::operator= ( SchemaServiceClient const &  )
default

◆ RollbackSchema() [1/2]

StatusOr< google::pubsub::v1::Schema > google::cloud::pubsub::SchemaServiceClient::RollbackSchema ( google::pubsub::v1::RollbackSchemaRequest const &  request,
Options  opts = {} 
)

Creates a new schema revision that is a copy of the provided revision_id.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.pubsub.v1.RollbackSchemaRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.pubsub.v1.Schema) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ RollbackSchema() [2/2]

StatusOr< google::pubsub::v1::Schema > google::cloud::pubsub::SchemaServiceClient::RollbackSchema ( std::string const &  name,
std::string const &  revision_id,
Options  opts = {} 
)

Creates a new schema revision that is a copy of the provided revision_id.

Parameters
nameRequired. The schema being rolled back with revision id.
revision_idRequired. The revision ID to roll back to. It must be a revision of the same schema.
Example: c7cfa2a8
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.pubsub.v1.Schema) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ ValidateMessage()

StatusOr< google::pubsub::v1::ValidateMessageResponse > google::cloud::pubsub::SchemaServiceClient::ValidateMessage ( google::pubsub::v1::ValidateMessageRequest const &  request,
Options  opts = {} 
)

Validates a message against a schema.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.pubsub.v1.ValidateMessageRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.pubsub.v1.ValidateMessageResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ ValidateSchema() [1/2]

StatusOr< google::pubsub::v1::ValidateSchemaResponse > google::cloud::pubsub::SchemaServiceClient::ValidateSchema ( google::pubsub::v1::ValidateSchemaRequest const &  request,
Options  opts = {} 
)

Validates a schema.

Parameters
requestUnary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.pubsub.v1.ValidateSchemaRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.pubsub.v1.ValidateSchemaResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

◆ ValidateSchema() [2/2]

StatusOr< google::pubsub::v1::ValidateSchemaResponse > google::cloud::pubsub::SchemaServiceClient::ValidateSchema ( std::string const &  parent,
google::pubsub::v1::Schema const &  schema,
Options  opts = {} 
)

Validates a schema.

Parameters
parentRequired. The name of the project in which to validate schemas. Format is projects/{project-id}.
schemaRequired. The schema object to validate.
optsOptional. Override the class-level options, such as retry and backoff policies.
Returns
the result of the RPC. The response message type (google.pubsub.v1.ValidateSchemaResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the `StatusOr` contains the error details.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( SchemaServiceClient const &  a,
SchemaServiceClient const &  b 
)
friend

◆ operator==

bool operator== ( SchemaServiceClient const &  a,
SchemaServiceClient const &  b 
)
friend