Class SchemaServiceClient (2.24.0)

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.

Constructors

SchemaServiceClient(SchemaServiceClient const &)

Copy and move support

Parameter
Name Description
SchemaServiceClient const &

SchemaServiceClient(SchemaServiceClient &&)

Copy and move support

Parameter
Name Description
SchemaServiceClient &&

SchemaServiceClient(std::shared_ptr< SchemaServiceConnection >, Options)

Parameters
Name Description
connection std::shared_ptr< SchemaServiceConnection >
opts Options

Operators

operator=(SchemaServiceClient const &)

Copy and move support

Parameter
Name Description
SchemaServiceClient const &
Returns
Type Description
SchemaServiceClient &

operator=(SchemaServiceClient &&)

Copy and move support

Parameter
Name Description
SchemaServiceClient &&
Returns
Type Description
SchemaServiceClient &

Functions

CreateSchema(std::string const &, google::pubsub::v1::Schema const &, std::string const &, Options)

Creates a schema.

Parameters
Name Description
parent std::string const &

Required. The name of the project in which to create the schema. Format is projects/{project-id}.

schema google::pubsub::v1::Schema const &

Required. 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_id std::string const &

The 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/pubsub-basics#resource_names for resource name constraints.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::pubsub::v1::Schema >

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(google::pubsub::v1::CreateSchemaRequest const &, Options)

Creates a schema.

Parameters
Name Description
request google::pubsub::v1::CreateSchemaRequest const &

Unary 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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::pubsub::v1::Schema >

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(std::string const &, Options)

Gets a schema.

Parameters
Name Description
name std::string const &

Required. The name of the schema to get. Format is projects/{project}/schemas/{schema}.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::pubsub::v1::Schema >

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(google::pubsub::v1::GetSchemaRequest const &, Options)

Gets a schema.

Parameters
Name Description
request google::pubsub::v1::GetSchemaRequest const &

Unary 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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::pubsub::v1::Schema >

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.

ListSchemas(std::string const &, Options)

Lists schemas in a project.

Parameters
Name Description
parent std::string const &

Required. The name of the project in which to list schemas. Format is projects/{project-id}.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::pubsub::v1::Schema >

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(google::pubsub::v1::ListSchemasRequest, Options)

Lists schemas in a project.

Parameters
Name Description
request google::pubsub::v1::ListSchemasRequest

Unary 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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::pubsub::v1::Schema >

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(std::string const &, Options)

Lists all schema revisions for the named schema.

Parameters
Name Description
name std::string const &

Required. The name of the schema to list revisions for.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::pubsub::v1::Schema >

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(google::pubsub::v1::ListSchemaRevisionsRequest, Options)

Lists all schema revisions for the named schema.

Parameters
Name Description
request google::pubsub::v1::ListSchemaRevisionsRequest

Unary 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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::pubsub::v1::Schema >

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.

CommitSchema(std::string const &, google::pubsub::v1::Schema const &, Options)

Commits a new schema revision to an existing schema.

Parameters
Name Description
name std::string const &

Required. The name of the schema we are revising. Format is projects/{project}/schemas/{schema}.

schema google::pubsub::v1::Schema const &

Required. The schema revision to commit.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::pubsub::v1::Schema >

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(google::pubsub::v1::CommitSchemaRequest const &, Options)

Commits a new schema revision to an existing schema.

Parameters
Name Description
request google::pubsub::v1::CommitSchemaRequest const &

Unary 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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::pubsub::v1::Schema >

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(std::string const &, std::string const &, Options)

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

Parameters
Name Description
name std::string const &

Required. The schema being rolled back with revision id.

revision_id std::string const &

Required. The revision ID to roll back to. It must be a revision of the same schema.
Example: c7cfa2a8

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::pubsub::v1::Schema >

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(google::pubsub::v1::RollbackSchemaRequest const &, Options)

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

Parameters
Name Description
request google::pubsub::v1::RollbackSchemaRequest const &

Unary 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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::pubsub::v1::Schema >

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(std::string const &, std::string const &, Options)

Deletes a specific schema revision.

Parameters
Name Description
name std::string const &

Required. The name of the schema revision to be deleted, with a revision ID explicitly included.
Example: projects/123/schemas/my-schema@c7cfa2a8

revision_id std::string const &

Optional. This field is deprecated and should not be used for specifying the revision ID. The revision ID should be specified via the name parameter.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::pubsub::v1::Schema >

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(google::pubsub::v1::DeleteSchemaRevisionRequest const &, Options)

Deletes a specific schema revision.

Parameters
Name Description
request google::pubsub::v1::DeleteSchemaRevisionRequest const &

Unary 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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::pubsub::v1::Schema >

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(std::string const &, Options)

Deletes a schema.

Parameters
Name Description
name std::string const &

Required. Name of the schema to delete. Format is projects/{project}/schemas/{schema}.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

DeleteSchema(google::pubsub::v1::DeleteSchemaRequest const &, Options)

Deletes a schema.

Parameters
Name Description
request google::pubsub::v1::DeleteSchemaRequest const &

Unary 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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

ValidateSchema(std::string const &, google::pubsub::v1::Schema const &, Options)

Validates a schema.

Parameters
Name Description
parent std::string const &

Required. The name of the project in which to validate schemas. Format is projects/{project-id}.

schema google::pubsub::v1::Schema const &

Required. The schema object to validate.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::pubsub::v1::ValidateSchemaResponse >

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(google::pubsub::v1::ValidateSchemaRequest const &, Options)

Validates a schema.

Parameters
Name Description
request google::pubsub::v1::ValidateSchemaRequest const &

Unary 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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::pubsub::v1::ValidateSchemaResponse >

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.

ValidateMessage(google::pubsub::v1::ValidateMessageRequest const &, Options)

Validates a message against a schema.

Parameters
Name Description
request google::pubsub::v1::ValidateMessageRequest const &

Unary 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.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::pubsub::v1::ValidateMessageResponse >

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.