This shows how to override the retry policies for iam_admin_v1::IAMClient:
auto options =
.
set<google::cloud::iam_admin_v1::
IAMConnectionIdempotencyPolicyOption>(
CustomIdempotencyPolicy().clone())
.set<google::cloud::iam_admin_v1::IAMRetryPolicyOption>(
.clone())
.set<google::cloud::iam_admin_v1::IAMBackoffPolicyOption>(
std::chrono::milliseconds(200),
std::chrono::seconds(45),
2.0)
.clone());
connection,
std::chrono::minutes(5))
.clone()));
Options & set(ValueTypeT< T > v)
Creates and manages Identity and Access Management (IAM) resources.
Definition: iam_client.h:90
std::shared_ptr< IAMConnection > MakeIAMConnection(Options options={})
A factory function to construct an object of type IAMConnection.
::google::cloud::internal::LimitedTimeRetryPolicy< iam_admin_v1_internal::IAMRetryTraits > IAMLimitedTimeRetryPolicy
Definition: iam_connection.h:42
::google::cloud::internal::LimitedErrorCountRetryPolicy< iam_admin_v1_internal::IAMRetryTraits > IAMLimitedErrorCountRetryPolicy
Definition: iam_connection.h:46
google::cloud::internal::ExponentialBackoffPolicy ExponentialBackoffPolicy
Use with google::cloud::Options to configure the retry policy.
Definition: iam_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_admin_v1::IAMConnectionIdempotencyPolicy>
return std::make_unique<CustomIdempotencyPolicy>(*this);
}
};
Definition: iam_connection_idempotency_policy.h:33
virtual std::unique_ptr< IAMConnectionIdempotencyPolicy > clone() const
Create a new copy of this object.