Google Cloud Pub/Sub C++ Client 2.13.0
A C++ Client Library for Google Cloud Pub/Sub
Loading...
Searching...
No Matches
schema_connection.h
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// Generated by the Codegen C++ plugin.
16// If you make any local changes, they will be lost.
17// source: google/pubsub/v1/schema.proto
18
19#ifndef GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_SCHEMA_CONNECTION_H
20#define GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_SCHEMA_CONNECTION_H
21
22#include "google/cloud/pubsub/internal/schema_retry_traits.h"
23#include "google/cloud/pubsub/schema_connection_idempotency_policy.h"
24#include "google/cloud/backoff_policy.h"
25#include "google/cloud/options.h"
26#include "google/cloud/status_or.h"
27#include "google/cloud/stream_range.h"
28#include "google/cloud/version.h"
29#include <google/pubsub/v1/schema.pb.h>
30#include <memory>
31
32namespace google {
33namespace cloud {
34namespace pubsub {
35GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN
36
37using SchemaServiceRetryPolicy =
38 ::google::cloud::internal::TraitBasedRetryPolicy<
39 pubsub_internal::SchemaServiceRetryTraits>;
40
41using SchemaServiceLimitedTimeRetryPolicy =
42 ::google::cloud::internal::LimitedTimeRetryPolicy<
43 pubsub_internal::SchemaServiceRetryTraits>;
44
45using SchemaServiceLimitedErrorCountRetryPolicy =
46 ::google::cloud::internal::LimitedErrorCountRetryPolicy<
47 pubsub_internal::SchemaServiceRetryTraits>;
48
49/**
50 * The `SchemaServiceConnection` object for `SchemaServiceClient`.
51 *
52 * This interface defines virtual methods for each of the user-facing overload
53 * sets in `SchemaServiceClient`. This allows users to inject custom behavior
54 * (e.g., with a Google Mock object) when writing tests that use objects of type
55 * `SchemaServiceClient`.
56 *
57 * To create a concrete instance, see `MakeSchemaServiceConnection()`.
58 *
59 * For mocking, see `pubsub_mocks::MockSchemaServiceConnection`.
60 */
62 public:
63 virtual ~SchemaServiceConnection() = 0;
64
65 virtual Options options() { return Options{}; }
66
67 virtual StatusOr<google::pubsub::v1::Schema> CreateSchema(
68 google::pubsub::v1::CreateSchemaRequest const& request);
69
70 virtual StatusOr<google::pubsub::v1::Schema> GetSchema(
71 google::pubsub::v1::GetSchemaRequest const& request);
72
73 virtual StreamRange<google::pubsub::v1::Schema> ListSchemas(
74 google::pubsub::v1::ListSchemasRequest request);
75
76 virtual StreamRange<google::pubsub::v1::Schema> ListSchemaRevisions(
77 google::pubsub::v1::ListSchemaRevisionsRequest request);
78
79 virtual StatusOr<google::pubsub::v1::Schema> CommitSchema(
80 google::pubsub::v1::CommitSchemaRequest const& request);
81
82 virtual StatusOr<google::pubsub::v1::Schema> RollbackSchema(
83 google::pubsub::v1::RollbackSchemaRequest const& request);
84
85 virtual StatusOr<google::pubsub::v1::Schema> DeleteSchemaRevision(
86 google::pubsub::v1::DeleteSchemaRevisionRequest const& request);
87
88 virtual Status DeleteSchema(
89 google::pubsub::v1::DeleteSchemaRequest const& request);
90
91 virtual StatusOr<google::pubsub::v1::ValidateSchemaResponse> ValidateSchema(
92 google::pubsub::v1::ValidateSchemaRequest const& request);
93
94 virtual StatusOr<google::pubsub::v1::ValidateMessageResponse> ValidateMessage(
95 google::pubsub::v1::ValidateMessageRequest const& request);
96};
97
98/**
99 * A factory function to construct an object of type `SchemaServiceConnection`.
100 *
101 * The returned connection object should not be used directly; instead it
102 * should be passed as an argument to the constructor of SchemaServiceClient.
103 *
104 * The optional @p options argument may be used to configure aspects of the
105 * returned `SchemaServiceConnection`. Expected options are any of the types in
106 * the following option lists:
107 *
108 * - `google::cloud::CommonOptionList`
109 * - `google::cloud::GrpcOptionList`
110 * - `google::cloud::UnifiedCredentialsOptionList`
111 * - `google::cloud::pubsub::SchemaServicePolicyOptionList`
112 *
113 * @note Unexpected options will be ignored. To log unexpected options instead,
114 * set `GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes` in the environment.
115 *
116 * @param options (optional) Configure the `SchemaServiceConnection` created by
117 * this function.
118 */
120 Options options = {});
121
122GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END
123} // namespace pubsub
124} // namespace cloud
125} // namespace google
126
127#endif // GOOGLE_CLOUD_CPP_GOOGLE_CLOUD_PUBSUB_SCHEMA_CONNECTION_H
The SchemaServiceConnection object for SchemaServiceClient.
Definition: schema_connection.h:61
virtual StatusOr< google::pubsub::v1::Schema > DeleteSchemaRevision(google::pubsub::v1::DeleteSchemaRevisionRequest const &request)
virtual StatusOr< google::pubsub::v1::Schema > RollbackSchema(google::pubsub::v1::RollbackSchemaRequest const &request)
virtual StatusOr< google::pubsub::v1::ValidateSchemaResponse > ValidateSchema(google::pubsub::v1::ValidateSchemaRequest const &request)
virtual Status DeleteSchema(google::pubsub::v1::DeleteSchemaRequest const &request)
virtual Options options()
Definition: schema_connection.h:65
virtual StatusOr< google::pubsub::v1::ValidateMessageResponse > ValidateMessage(google::pubsub::v1::ValidateMessageRequest const &request)
virtual StatusOr< google::pubsub::v1::Schema > CommitSchema(google::pubsub::v1::CommitSchemaRequest const &request)
virtual StreamRange< google::pubsub::v1::Schema > ListSchemas(google::pubsub::v1::ListSchemasRequest request)
virtual StatusOr< google::pubsub::v1::Schema > CreateSchema(google::pubsub::v1::CreateSchemaRequest const &request)
virtual StreamRange< google::pubsub::v1::Schema > ListSchemaRevisions(google::pubsub::v1::ListSchemaRevisionsRequest request)
virtual StatusOr< google::pubsub::v1::Schema > GetSchema(google::pubsub::v1::GetSchemaRequest const &request)
Contains all the Cloud Pub/Sub C++ client types and functions.
Definition: ack_handler.h:25
std::shared_ptr< SchemaServiceConnection > MakeSchemaServiceConnection(Options options={})
A factory function to construct an object of type SchemaServiceConnection.
The namespace Google Cloud Platform C++ client libraries.