Google Cloud IAM C++ Client 2.13.0
A C++ Client Library for Google Cloud IAM
Loading...
Searching...
No Matches
Override iam_v1::IAMPolicyClient Retry Policies

This shows how to override the retry policies for iam_v1::IAMPolicyClient:

auto options =
.set<google::cloud::iam_v1::
IAMPolicyConnectionIdempotencyPolicyOption>(
CustomIdempotencyPolicy().clone())
.set<google::cloud::iam_v1::IAMPolicyRetryPolicyOption>(
.clone())
.set<google::cloud::iam_v1::IAMPolicyBackoffPolicyOption>(
/*initial_delay=*/std::chrono::milliseconds(200),
/*maximum_delay=*/std::chrono::seconds(45),
/*scaling=*/2.0)
.clone());
// c1 and c2 share the same retry policies
// You can override any of the policies in a new client. This new client
// will share the policies from c1 (or c2) *except* from the retry policy.
connection,
std::chrono::minutes(5))
.clone()));
// You can also override the policies in a single call:
// c3.SomeRpc(..., google::cloud::Options{}
// .set<google::cloud::iam_v1::IAMPolicyRetryPolicyOption>(
// google::cloud::iam_v1::IAMPolicyLimitedErrorCountRetryPolicy(10).clone()));
Options & set(ValueTypeT< T > v)
API Overview.
Definition: iam_policy_client.h:86
::google::cloud::internal::LimitedErrorCountRetryPolicy< iam_v1_internal::IAMPolicyRetryTraits > IAMPolicyLimitedErrorCountRetryPolicy
Definition: iam_policy_connection.h:45
::google::cloud::internal::LimitedTimeRetryPolicy< iam_v1_internal::IAMPolicyRetryTraits > IAMPolicyLimitedTimeRetryPolicy
Definition: iam_policy_connection.h:41
std::shared_ptr< IAMPolicyConnection > MakeIAMPolicyConnection(Options options={})
A factory function to construct an object of type IAMPolicyConnection.
google::cloud::internal::ExponentialBackoffPolicy ExponentialBackoffPolicy
Use with google::cloud::Options to configure the retry policy.
Definition: iam_policy_options.h:39

Assuming you have created a custom idempotency policy. Such as:

class CustomIdempotencyPolicy
public:
~CustomIdempotencyPolicy() override = default;
std::unique_ptr<google::cloud::iam_v1::IAMPolicyConnectionIdempotencyPolicy>
clone() const override {
return std::make_unique<CustomIdempotencyPolicy>(*this);
}
// Override inherited functions to define as needed.
};
Definition: iam_policy_connection_idempotency_policy.h:33
virtual std::unique_ptr< IAMPolicyConnectionIdempotencyPolicy > clone() const
Create a new copy of this object.