# Google API Core Client - Class GrpcTransport (1.43.0)

1.43.0 (latest) 1.42.5 1.40.0 1.38.2 1.36.1 1.35.1 Reference documentation and code samples for the Google API Core Client class GrpcTransport.

A gRPC based transport implementation.

## Namespace

Google \\ ApiCore \\ Transport

## Methods

### __construct

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `hostname` | `string` |
| `opts` | `array` - 'update_metadata': (optional) a callback function which takes in a metadata array, and returns an updated metadata array - 'grpc.primary_user_agent': (optional) a user-agent string |
| `channel` | `Grpc\Channel` An already created Channel object (optional) |
| `interceptors` | `array<Grpc\Interceptor>|array<https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.Grpc.UnaryInterceptorInterface>` *EXPERIMENTAL* Interceptors used to intercept RPC invocations before a call starts. Please note that implementations of [Grpc\\UnaryInterceptorInterface](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.Grpc.UnaryInterceptorInterface) are considered deprecated and support will be removed in a future release. To prepare for this, please take the time to convert `UnaryInterceptorInterface` implementations over to a class which extends Grpc\\Interceptor. |
| `logger` | `null|false|Psr\Log\LoggerInterface` A PSR-3 Compliant logger. |

### startBidiStreamingCall

Starts a bidi streaming call.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `call` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/Call` |
| `options` | `array` |

### startClientStreamingCall

Starts a client streaming call.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `call` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/Call` |
| `options` | `array` |

### startServerStreamingCall

Starts a server streaming call.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `call` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/Call` |
| `options` | `array` |

### startUnaryCall

Returns a promise used to execute network requests.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `call` | `https://docs.cloud.google.com/php/docs/reference/gax/latest/Call` |
| `options` | `array` |

### static::build

Builds a GrpcTransport.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `apiEndpoint` | `string` The address of the API remote host, for example "example.googleapis.com. May also include the port, for example "example.googleapis.com:443" |
| `config` | `array` Config options used to construct the gRPC transport. |
| `↳ stubOpts` | `array` Options used to construct the gRPC stub (see {@link https://grpc.github.io/grpc/core/group__grpc__arg__keys.html}). |
| `↳ channel` | `Grpc\Channel` Grpc channel to be used. |
| `↳ interceptors` | `array<Grpc\Interceptor>|array<https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.Grpc.UnaryInterceptorInterface>` *EXPERIMENTAL* Interceptors used to intercept RPC invocations before a call starts. Please note that implementations of [Grpc\\UnaryInterceptorInterface](https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.Grpc.UnaryInterceptorInterface) are considered deprecated and support will be removed in a future release. To prepare for this, please take the time to convert `UnaryInterceptorInterface` implementations over to a class which extends Grpc\\Interceptor. |
| `↳ clientCertSource` | `callable` A callable which returns the client cert as a string. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/gax/latest/Transport.GrpcTransport` |   |