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>(
std::chrono::milliseconds(200),
std::chrono::seconds(45),
2.0)
.clone());
connection,
std::chrono::minutes(5))
.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>
return std::make_unique<CustomIdempotencyPolicy>(*this);
}
};
Definition: iam_policy_connection_idempotency_policy.h:33
virtual std::unique_ptr< IAMPolicyConnectionIdempotencyPolicy > clone() const
Create a new copy of this object.