Copied!

A REST based transport implementation.

CloneableInstantiable
Methods
public __construct(Google\ApiCore\RequestBuilder $requestBuilder, callable $httpHandler)
 
  • param \RequestBuilder $requestBuilder A builder responsible for creating a PSR-7 request from a set of request information.
  • param callable $httpHandler A handler used to deliver PSR-7 requests.
public static build(string $apiEndpoint, string $restConfigPath, array $config = [])
 

Builds a RestTransport.

  • param string $apiEndpoint The address of the API remote host, for example "example.googleapis.com".
  • param string $restConfigPath Path to rest config file.
  • param mixed[] $config { Config options used to construct the gRPC transport. @type callable $httpHandler A handler used to deliver PSR-7 requests. @type callable $clientCertSource A callable which returns the client cert as a string. @type bool $hasEmulator True if the emulator is enabled. }
  • return \RestTransport
  • throws \ValidationException
public close()
 
    public startBidiStreamingCall(Google\ApiCore\Call $call, array $options)
     
    • return never
    • throws \BadMethodCallException
    public startClientStreamingCall(Google\ApiCore\Call $call, array $options)
     
    • return never
    • throws \BadMethodCallException
    public startServerStreamingCall(Google\ApiCore\Call $call, array $options)
     
    • throws \BadMethodCallException for forwards compatibility with older GAPIC clients
    public startUnaryCall(Google\ApiCore\Call $call, array $options)
     
      public static validate(array $arr, array $requiredKeys)
       
      • param array $arr Associative array
      • param array $requiredKeys List of keys to check for in $arr
      • return array Returns $arr for fluent use
      public static validateNotNull(array $arr, array $requiredKeys)
       
      • param array $arr Associative array
      • param array $requiredKeys List of keys to check for in $arr
      • return array Returns $arr for fluent use
      Methods
      protected unsupportedServerStreamingCall(Google\ApiCore\Call $call, array $options)
       
      • return never
      • throws \BadMethodCallException
      Properties
      private $clientCertSource = NULL
      private static $defaultPort = 443
      private $httpHandler = NULL
      private Google\ApiCore\RequestBuilder $requestBuilder
      private $transportName = NULL
      Methods
      private _serverStreamRequest( $httpHandler, $request, $headers, $decodeType, $callOptions, $decoderOptions = [])
       

      Creates and starts a RestServerStreamingCall.

      • param callable $httpHandler The HTTP Handler to invoke the request with.
      • param \RequestInterface $request The request to invoke.
      • param mixed[] $headers The headers to include in the request.
      • param string $decodeType The response stream message type to decode.
      • param mixed[] $callOptions The call options to use when making the call.
      • param mixed[] $decoderOptions The options to use for the JsonStreamDecoder.
      • return \RestServerStreamingCall
      private static buildCommonHeaders(array $options)
       
      • param array $options
      • return array
      private static buildHttpHandlerAsync(Psr\Log\LoggerInterface|false|?null $logger = NULL)
       
      • return callable
      • throws \ValidationException
      private configureMtlsChannel(callable $clientCertSource)
       

      Set the path to a client certificate.

      • param callable $clientCertSource
      private getCallOptions(array $options)
       
      • param mixed[] $options
      • return mixed[]
      private static loadClientCertSource(callable $clientCertSource)
      private static normalizeServiceAddress(string $apiEndpoint)
       
      • param string $apiEndpoint
      • return array
      • throws \ValidationException
      private throwUnsupportedException()
       
      • return never
      • throws \BadMethodCallException
      private static validateFileExists(string $filePath)
       
      • param string $filePath
      • throws \ValidationException
      private static validateImpl( $arr, $requiredKeys, $allowNull)
      Properties
      private static $defaultPort = 443
      Methods
      public static build(string $apiEndpoint, string $restConfigPath, array $config = [])
       

      Builds a RestTransport.

      • param string $apiEndpoint The address of the API remote host, for example "example.googleapis.com".
      • param string $restConfigPath Path to rest config file.
      • param mixed[] $config { Config options used to construct the gRPC transport. @type callable $httpHandler A handler used to deliver PSR-7 requests. @type callable $clientCertSource A callable which returns the client cert as a string. @type bool $hasEmulator True if the emulator is enabled. }
      • return \RestTransport
      • throws \ValidationException
      private static buildCommonHeaders(array $options)
       
      • param array $options
      • return array
      private static buildHttpHandlerAsync(Psr\Log\LoggerInterface|false|?null $logger = NULL)
       
      • return callable
      • throws \ValidationException
      private static loadClientCertSource(callable $clientCertSource)
      private static normalizeServiceAddress(string $apiEndpoint)
       
      • param string $apiEndpoint
      • return array
      • throws \ValidationException
      public static validate(array $arr, array $requiredKeys)
       
      • param array $arr Associative array
      • param array $requiredKeys List of keys to check for in $arr
      • return array Returns $arr for fluent use
      private static validateFileExists(string $filePath)
       
      • param string $filePath
      • throws \ValidationException
      private static validateImpl( $arr, $requiredKeys, $allowNull)
      public static validateNotNull(array $arr, array $requiredKeys)
       
      • param array $arr Associative array
      • param array $requiredKeys List of keys to check for in $arr
      • return array Returns $arr for fluent use
      © 2026 Bruce Wells
      Search Namespaces \ Classes
      Configuration