Copied!

The CallOptions class provides typing to the associative array of options passed to transport RPC methods. See {@see \Google\ApiCore\Transport\TransportInterface::startUnaryCall()}, {@see \Google\ApiCore\Transport\TransportInterface::startBidiStreamingCall()}, {@see \Google\ApiCore\Transport\TransportInterface::startClientStreamingCall()}, and {@see \Google\ApiCore\Transport\TransportInterface::startServerStreamingCall()}.

CloneableInstantiable
Methods
public __construct(array $options)
 
  • param array $options { Call options
    @type array<string, array<string>> $headers
          Key-value array containing headers.
    @type int $timeoutMillis
          The timeout in milliseconds for the call.
    @type array $transportOptions
          Transport-specific call options. See {@see \CallOptions::setTransportOptions}.
    @type RetrySettings|array $retrySettings
          A retry settings override for the call. If $retrySettings is an
          array, the settings will be merged with the method's default
          retry settings. If $retrySettings is a RetrySettings object,
          that object will be used instead of the method defaults.
    
    }
public offsetExists( $offset) : bool
public offsetGet( $offset)
 
  • return mixed
  • attribute ReturnTypeWillChange
public offsetSet( $offset, $value) : void
 
  • throws \BadMethodCallException
public offsetUnset( $offset) : void
 
  • throws \BadMethodCallException
public setHeaders(array $headers) : self
 
  • param array $headers
public setRetrySettings( $retrySettings) : self
 
  • param \RetrySettings|array|null $retrySettings
  • return $this
public setTimeoutMillis(?int $timeoutMillis) : self
 
  • param int|null $timeoutMillis
public setTransportOptions(array $transportOptions) : self
 
  • param array $transportOptions { Transport-specific call-time options.
    @type array $grpcOptions
          Key-value pairs for gRPC-specific options passed as the `$options` argument to {@see \Grpc\BaseStub}
          request methods. Current options are `call_credentials_callback` and `timeout`.
          **NOTE**: This library sets `call_credentials_callback` using {@see \CredentialsWrapper}, and `timeout`
          using the `timeoutMillis` call option, so these options are not very useful.
    @type array $grpcFallbackOptions
          Key-value pairs for gRPC fallback specific options passed as the `$options` argument to the
          `$httpHandler` callable. By default these are passed to {@see \GuzzleHttp\Client} as request options.
          See {@link https://docs.guzzlephp.org/en/stable/request-options.html}.
    @type array $restOptions
          Key-value pairs for REST-specific options passed as the `$options` argument to the `$httpHandler`
          callable. By default these are passed to {@see \GuzzleHttp\Client} as request options.
          See {@link https://docs.guzzlephp.org/en/stable/request-options.html}.
    
    }
public setTransportSpecificOptions(array $transportSpecificOptions) : self
 
  • deprecated use CallOptions::setTransportOptions
public toArray() : array
Properties
private array $headers
private $retrySettings = NULL
 
  • var \RetrySettings|array|null $retrySettings
private ?int $timeoutMillis
private array $transportOptions
Methods
private fromArray(array $arr) : void
 

Sets the array of options as class properites.

  • param array $arr See the constructor for the list of supported options.
private static validateFileExists(string $filePath)
 
  • param string $filePath
  • throws \ValidationException
Methods
private static validateFileExists(string $filePath)
 
  • param string $filePath
  • throws \ValidationException
© 2025 Bruce Wells
Search Namespaces \ Classes
Configuration