Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update constructor args #1045

Merged
merged 12 commits into from May 24, 2018
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,6 +5,7 @@ composer.lock
docs/json/**/*
vendor/
.idea/
*.iml

# do not delete
keys/
Expand Down
2 changes: 1 addition & 1 deletion BigQueryDataTransfer/composer.json
Expand Up @@ -18,7 +18,7 @@
},
"require": {
"google/proto-client": "^0.38.0",
"google/gax": "^0.31.1"
"google/gax": "^0.32"
},
"require-dev": {
"phpunit/phpunit": "^4.8|^5.0",
Expand Down
2 changes: 1 addition & 1 deletion BigQueryDataTransfer/src/V1/DataTransferServiceClient.php
Expand Up @@ -38,5 +38,5 @@
class DataTransferServiceClient extends DataTransferServiceGapicClient
{
// This class is intentionally empty, and is intended to hold manual
// additions to the generated {@see DataTransferServiceClientImpl} class.
// additions to the generated {@see DataTransferServiceGapicClient} class.
}
121 changes: 61 additions & 60 deletions BigQueryDataTransfer/src/V1/Gapic/DataTransferServiceGapicClient.php
Expand Up @@ -31,13 +31,13 @@
namespace Google\Cloud\BigQuery\DataTransfer\V1\Gapic;

use Google\ApiCore\ApiException;
use Google\ApiCore\Call;
use Google\ApiCore\CredentialsWrapper;
use Google\ApiCore\FetchAuthTokenInterface;
use Google\ApiCore\GapicClientTrait;
use Google\ApiCore\PathTemplate;
use Google\ApiCore\RetrySettings;
use Google\ApiCore\Transport\TransportInterface;
use Google\ApiCore\ValidationException;
use Google\Auth\CredentialsLoader;
use Google\Cloud\BigQuery\DataTransfer\V1\CheckValidCredsRequest;
use Google\Cloud\BigQuery\DataTransfer\V1\CheckValidCredsResponse;
use Google\Cloud\BigQuery\DataTransfer\V1\CreateTransferConfigRequest;
Expand All @@ -63,8 +63,6 @@
use Google\Protobuf\FieldMask;
use Google\Protobuf\GPBEmpty;
use Google\Protobuf\Timestamp;
use Grpc\Channel;
use Grpc\ChannelCredentials;

/**
* Service Description: The Google BigQuery Data Transfer Service API enables BigQuery users to
Expand Down Expand Up @@ -121,10 +119,11 @@ class DataTransferServiceGapicClient
const CODEGEN_NAME = 'gapic';

/**
* The code generator version, to be included in the agent header.
* The default scopes required by the service.
*/
const CODEGEN_VERSION = '0.0.5';

public static $serviceScopes = [
'https://www.googleapis.com/auth/cloud-platform',
];
private static $projectDataSourceNameTemplate;
private static $projectNameTemplate;
private static $projectTransferConfigNameTemplate;
Expand All @@ -135,15 +134,18 @@ private static function getClientDefaults()
{
return [
'serviceName' => self::SERVICE_NAME,
'serviceAddress' => self::SERVICE_ADDRESS,
'port' => self::DEFAULT_SERVICE_PORT,
'scopes' => [
'https://www.googleapis.com/auth/cloud-platform',
],
'clientConfigPath' => __DIR__.'/../resources/data_transfer_service_client_config.json',
'restClientConfigPath' => __DIR__.'/../resources/data_transfer_service_rest_client_config.php',
'serviceAddress' => self::SERVICE_ADDRESS.':'.self::DEFAULT_SERVICE_PORT,
'clientConfig' => __DIR__.'/../resources/data_transfer_service_client_config.json',
'descriptorsConfigPath' => __DIR__.'/../resources/data_transfer_service_descriptor_config.php',
'versionFile' => __DIR__.'/../../VERSION',
'credentialsConfig' => [
'scopes' => self::$serviceScopes,
],
'transportConfig' => [
'rest' => [
'restClientConfigPath' => __DIR__.'/../resources/data_transfer_service_rest_client_config.php',
],
],
'versionFile' => __DIR__.'/../../../VERSION',
];
}

Expand Down Expand Up @@ -319,57 +321,56 @@ public static function parseName($formattedName, $template = null)
* @param array $options {
* Optional. Options for configuring the service API wrapper.
*
* @type string $serviceAddress The domain name of the API remote host.
* Default 'bigquerydatatransfer.googleapis.com'.
* @type mixed $port The port on which to connect to the remote host. Default 443.
* @type Channel $channel
* A `Channel` object. If not specified, a channel will be constructed.
* NOTE: This option is only valid when utilizing the gRPC transport.
* @type ChannelCredentials $sslCreds
* A `ChannelCredentials` object for use with an SSL-enabled channel.
* Default: a credentials object returned from
* \Grpc\ChannelCredentials::createSsl().
* NOTE: This option is only valid when utilizing the gRPC transport. Also, if the $channel
* optional argument is specified, then this argument is unused.
* @type bool $forceNewChannel
* If true, this forces gRPC to create a new channel instead of using a persistent channel.
* Defaults to false.
* NOTE: This option is only valid when utilizing the gRPC transport. Also, if the $channel
* optional argument is specified, then this option is unused.
* @type CredentialsLoader $credentialsLoader
* A CredentialsLoader object created using the Google\Auth library.
* @type string[] $scopes A string array of scopes to use when acquiring credentials.
* Defaults to the scopes for the BigQuery Data Transfer API.
* @type string $clientConfigPath
* Path to a JSON file containing client method configuration, including retry settings.
* Specify this setting to specify the retry behavior of all methods on the client.
* @type string $serviceAddress
* The address of the API remote host. May optionally include the port, formatted
* as "<uri>:<port>". Default 'bigquerydatatransfer.googleapis.com:443'.
* @type string|array|FetchAuthTokenInterface|CredentialsWrapper $credentials
* The credentials to be used by the client to authorize API calls. This option
* accepts either a path to a credentials file, or a decoded credentials file as a
* PHP array.
* *Advanced usage*: In addition, this option can also accept a pre-constructed
* {@see \Google\Auth\FetchAuthTokenInterface} object or
* {@see \Google\ApiCore\CredentialsWrapper} object. Note that when one of these
* objects are provided, any settings in $credentialsConfig will be ignored.
* @type array $credentialsConfig

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

* Options used to configure credentials, including auth token caching, for the client.
* For a full list of supporting configuration options, see
* {@see \Google\ApiCore\CredentialsWrapper::build()}.
* @type bool $disableRetries
* Determines whether or not retries defined by the client configuration should be
* disabled. Defaults to `false`.
* @type string|array $clientConfig
* Client method configuration, including retry settings. This option can be either a
* path to a JSON file, or a PHP array containing the decoded JSON data.
* By default this settings points to the default client config file, which is provided
* in the resources folder. The retry settings provided in this option can be overridden
* by settings in $retryingOverride
* @type array $retryingOverride
* An associative array in which the keys are method names (e.g. 'createFoo'), and
* the values are retry settings to use for that method. The retry settings for each
* method can be a {@see Google\ApiCore\RetrySettings} object, or an associative array
* of retry settings parameters. See the documentation on {@see Google\ApiCore\RetrySettings}
* for example usage. Passing a value of null is equivalent to a value of
* ['retriesEnabled' => false]. Retry settings provided in this setting override the
* settings in $clientConfigPath.
* @type callable $authHttpHandler A handler used to deliver PSR-7 requests specifically
* for authentication. Should match a signature of
* `function (RequestInterface $request, array $options) : ResponseInterface`.
* @type callable $httpHandler A handler used to deliver PSR-7 requests. Should match a
* signature of `function (RequestInterface $request, array $options) : PromiseInterface`.
* NOTE: This option is only valid when utilizing the REST transport.
* @type string|TransportInterface $transport The transport used for executing network
* requests. May be either the string `rest` or `grpc`. Additionally, it is possible
* to pass in an already instantiated transport. Defaults to `grpc` if gRPC support is
* detected on the system.
* in the resources folder.
* @type string|TransportInterface $transport
* The transport used for executing network requests. May be either the string `rest`
* or `grpc`. Defaults to `grpc` if gRPC support is detected on the system.
* *Advanced usage*: Additionally, it is possible to pass in an already instantiated
* {@see \Google\ApiCore\Transport\TransportInterface} object. Note that when this
* object is provided, any settings in $transportConfig, and any $serviceAddress
* setting, will be ignored.
* @type array $transportConfig
* Configuration options that will be used to construct the transport. Options for
* each supported transport type should be passed in a key for that transport. For
* example:
* $transportConfig = [
* 'grpc' => [...],
* 'rest' => [...]
* ];
* See the {@see \Google\Cloud\ApiCore\Transport\GrpcTransport::build()} and
* {@see \Google\Cloud\ApiCore\Transport\RestTransport::build()} methods for the
* supported options.
* }
*
* @throws ValidationException
* @experimental
*/
public function __construct($options = [])
{
$this->setClientOptions($options + self::getClientDefaults());
$clientOptions = $this->buildClientOptions($options);
$this->setClientOptions($clientOptions);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Bigtable/composer.json
Expand Up @@ -5,7 +5,7 @@
"minimum-stability": "stable",
"require": {
"google/proto-client": "^0.38.0",
"google/gax": "^0.31.1"
"google/gax": "^0.32"
},
"require-dev": {
"phpunit/phpunit": "^4.8|^5.0",
Expand Down
2 changes: 1 addition & 1 deletion Bigtable/src/Admin/V2/BigtableInstanceAdminClient.php
Expand Up @@ -38,5 +38,5 @@
class BigtableInstanceAdminClient extends BigtableInstanceAdminGapicClient
{
// This class is intentionally empty, and is intended to hold manual
// additions to the generated {@see BigtableInstanceAdminClientImpl} class.
// additions to the generated {@see BigtableInstanceAdminGapicClient} class.
}
2 changes: 1 addition & 1 deletion Bigtable/src/Admin/V2/BigtableTableAdminClient.php
Expand Up @@ -38,5 +38,5 @@
class BigtableTableAdminClient extends BigtableTableAdminGapicClient
{
// This class is intentionally empty, and is intended to hold manual
// additions to the generated {@see BigtableTableAdminClientImpl} class.
// additions to the generated {@see BigtableTableAdminGapicClient} class.
}