# Class RestGrpcAdapter (4.10.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [4.10.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.Rest.RestGrpcAdapter)
- [4.8.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/4.8.0/Google.Api.Gax.Grpc.Rest.RestGrpcAdapter)
- [4.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/4.4.0/Google.Api.Gax.Grpc.Rest.RestGrpcAdapter)
- [4.3.1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/4.3.1/Google.Api.Gax.Grpc.Rest.RestGrpcAdapter)
- [4.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/4.2.0/Google.Api.Gax.Grpc.Rest.RestGrpcAdapter)
- [4.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/4.0.0/Google.Api.Gax.Grpc.Rest.RestGrpcAdapter)
- [3.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/3.2.0/Google.Api.Gax.Grpc.Rest.RestGrpcAdapter)

    public sealed class RestGrpcAdapter : GrpcAdapter

Implementation of [GrpcAdapter](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.GrpcAdapter) that uses HTTP/1.1 and JSON,
but via a gRPC [CallInvoker](https://github.com/grpc/grpc-dotnet/blob/7c43ddb5d68008782dc0dba2d0feaa3ed91a9fb2/src/Grpc.Core.Api/CallInvoker.cs).

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> [GrpcAdapter](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.GrpcAdapter) \> RestGrpcAdapter

## Inherited Members

[GrpcAdapter.GetFallbackAdapter(ServiceMetadata)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.GrpcAdapter#Google_Api_Gax_Grpc_GrpcAdapter_GetFallbackAdapter_Google_Api_Gax_Grpc_ServiceMetadata_) [object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Api.Gax.Grpc.Rest](https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.Rest)

## Assembly

Google.Api.Gax.Grpc.dll

## Properties

### Default

    public static RestGrpcAdapter Default { get; }

Returns the default gRPC adapter for the REST transport.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.Rest.RestGrpcAdapter` |   |

## Methods

### ConvertHttpStatusCode(int)

    public static StatusCode ConvertHttpStatusCode(int httpStatusCode)

Converts an HTTP status code into the corresponding gRPC status code.
Note that there is not a 1:1 correspondence between status code; multiple
HTTP status codes can map to the same gRPC status code.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `httpStatusCode` | `https://learn.microsoft.com/dotnet/api/system.int32` The HTTP status code to convert |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://github.com/grpc/grpc-dotnet/blob/7c43ddb5d68008782dc0dba2d0feaa3ed91a9fb2/src/Grpc.Core.Api/StatusCode.cs` | The converted gRPC status code. |