5.0.0 (latest) 4.16.0 4.15.0 4.14.0 4.13.0 4.11.0 4.10.0 4.9.0 4.8.0 4.7.0 4.6.0 4.5.0 4.4.0 4.3.0 4.2.0 4.1.0 4.0.0 3.7.0 3.6.0 3.5.0 3.4.0

    public sealed class RetryPredicate

Reference documentation and code samples for the Google Cloud Storage v1 API class RetryPredicate.

Specifies the conditions under which a failed operation is retried. This class is immutable.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> RetryPredicate

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Storage.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1)

## Assembly

Google.Cloud.Storage.V1.dll

## Properties

### Never

    public static RetryPredicate Never { get; }

Returns a Retry Predicate which will ensure that the operation will never retry in case of failure.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.RetryPredicate` |   |

### RetriableIdempotentErrors

    public static RetryPredicate RetriableIdempotentErrors { get; }

Default retriable error codes for which the operation would retry unless otherwise specified by the user.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.RetryPredicate` |   |

## Methods

### FromErrorCodePredicate(Func\<int, bool\>)

    public static RetryPredicate FromErrorCodePredicate(Func<int, bool> predicate)

Returns a predicate which will retry based on the result of the specified delegate, which is provided with
the HTTP error code for the response.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `predicate` | `https://learn.microsoft.com/dotnet/api/system.func-2https://learn.microsoft.com/dotnet/api/system.int32https://learn.microsoft.com/dotnet/api/system.boolean` Predicate used to determine whether or not to retry. May be null, in which case [Never](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.RetryPredicate#Google_Cloud_Storage_V1_RetryPredicate_Never) will be returned. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.RetryPredicate` | Returns the retry predicate with the conditions specified for retrying. |

### FromErrorCodes(params int\[\])

    public static RetryPredicate FromErrorCodes(params int[] errorCodes)

Returns a predicate which will retry on the specified HTTP error codes.
Note that only these error codes will be retried; the default error codes are not used by the returned predicate.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `errorCodes` | `https://learn.microsoft.com/dotnet/api/system.int32` Error codes on which to retry. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Storage.V1/latest/Google.Cloud.Storage.V1.RetryPredicate` | Returns a predicate which retries on the specified error codes. |