Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
// [START memorystore_v1_generated_Memorystore_ListBackupCollections_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Memorystore\V1\BackupCollection;
use Google\Cloud\Memorystore\V1\Client\MemorystoreClient;
use Google\Cloud\Memorystore\V1\ListBackupCollectionsRequest;

Expand Down Expand Up @@ -55,6 +56,7 @@ function list_backup_collections_sample(string $formattedParent): void
/** @var PagedListResponse $response */
$response = $memorystoreClient->listBackupCollections($request);

/** @var BackupCollection $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
Expand Down
2 changes: 2 additions & 0 deletions Memorystore/samples/V1/MemorystoreClient/list_backups.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
// [START memorystore_v1_generated_Memorystore_ListBackups_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Memorystore\V1\Backup;
use Google\Cloud\Memorystore\V1\Client\MemorystoreClient;
use Google\Cloud\Memorystore\V1\ListBackupsRequest;

Expand All @@ -49,6 +50,7 @@ function list_backups_sample(string $formattedParent): void
/** @var PagedListResponse $response */
$response = $memorystoreClient->listBackups($request);

/** @var Backup $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
Expand Down
2 changes: 2 additions & 0 deletions Memorystore/samples/V1/MemorystoreClient/list_instances.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Memorystore\V1\Client\MemorystoreClient;
use Google\Cloud\Memorystore\V1\Instance;
use Google\Cloud\Memorystore\V1\ListInstancesRequest;

/**
Expand All @@ -49,6 +50,7 @@ function list_instances_sample(string $formattedParent): void
/** @var PagedListResponse $response */
$response = $memorystoreClient->listInstances($request);

/** @var Instance $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
Expand Down
2 changes: 2 additions & 0 deletions Memorystore/samples/V1/MemorystoreClient/list_locations.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Location\ListLocationsRequest;
use Google\Cloud\Location\Location;
use Google\Cloud\Memorystore\V1\Client\MemorystoreClient;

/**
Expand All @@ -50,6 +51,7 @@ function list_locations_sample(): void
/** @var PagedListResponse $response */
$response = $memorystoreClient->listLocations($request);

/** @var Location $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Memorystore\V1beta\Client\MemorystoreClient;
use Google\Cloud\Memorystore\V1beta\Instance;
use Google\Cloud\Memorystore\V1beta\ListInstancesRequest;

/**
Expand All @@ -49,6 +50,7 @@ function list_instances_sample(string $formattedParent): void
/** @var PagedListResponse $response */
$response = $memorystoreClient->listInstances($request);

/** @var Instance $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Location\ListLocationsRequest;
use Google\Cloud\Location\Location;
use Google\Cloud\Memorystore\V1beta\Client\MemorystoreClient;

/**
Expand All @@ -50,6 +51,7 @@ function list_locations_sample(): void
/** @var PagedListResponse $response */
$response = $memorystoreClient->listLocations($request);

/** @var Location $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
Expand Down
23 changes: 7 additions & 16 deletions Memorystore/src/V1/Client/MemorystoreClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ private static function getClientDefaults()
'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT,
'clientConfig' => __DIR__ . '/../resources/memorystore_client_config.json',
'descriptorsConfigPath' => __DIR__ . '/../resources/memorystore_descriptor_config.php',
'gcpApiConfigPath' => __DIR__ . '/../resources/memorystore_grpc_config.json',
'credentialsConfig' => [
'defaultScopes' => self::$serviceScopes,
'useJwtAccessWithScope' => false,
],
'transportConfig' => [
'rest' => [
Expand All @@ -140,18 +140,6 @@ private static function getClientDefaults()
];
}

/** Implements GapicClientTrait::defaultTransport. */
private static function defaultTransport()
{
return 'rest';
}

/** Implements ClientOptionsTrait::supportedTransports. */
private static function supportedTransports()
{
return ['rest'];
}

/**
* Return an OperationsClient object with the same endpoint as $this.
*
Expand Down Expand Up @@ -493,8 +481,9 @@ public static function parseName(string $formattedName, ?string $template = null
* default this settings points to the default client config file, which is
* provided in the resources folder.
* @type string|TransportInterface $transport
* The transport used for executing network requests. At the moment, supports only
* `rest`. *Advanced usage*: Additionally, it is possible to pass in an already
* 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
* $apiEndpoint setting, will be ignored.
Expand All @@ -503,9 +492,11 @@ public static function parseName(string $formattedName, ?string $template = null
* each supported transport type should be passed in a key for that transport. For
* example:
* $transportConfig = [
* 'grpc' => [...],
* 'rest' => [...],
* ];
* See the {@see \Google\ApiCore\Transport\RestTransport::build()} method for the
* See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and
* {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the
* supported options.
* @type callable $clientCertSource
* A callable which returns the client cert as a string. This can be used to
Expand Down
23 changes: 7 additions & 16 deletions Memorystore/src/V1beta/Client/MemorystoreClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ private static function getClientDefaults()
'apiEndpoint' => self::SERVICE_ADDRESS . ':' . self::DEFAULT_SERVICE_PORT,
'clientConfig' => __DIR__ . '/../resources/memorystore_client_config.json',
'descriptorsConfigPath' => __DIR__ . '/../resources/memorystore_descriptor_config.php',
'gcpApiConfigPath' => __DIR__ . '/../resources/memorystore_grpc_config.json',
'credentialsConfig' => [
'defaultScopes' => self::$serviceScopes,
'useJwtAccessWithScope' => false,
],
'transportConfig' => [
'rest' => [
Expand All @@ -126,18 +126,6 @@ private static function getClientDefaults()
];
}

/** Implements GapicClientTrait::defaultTransport. */
private static function defaultTransport()
{
return 'rest';
}

/** Implements ClientOptionsTrait::supportedTransports. */
private static function supportedTransports()
{
return ['rest'];
}

/**
* Return an OperationsClient object with the same endpoint as $this.
*
Expand Down Expand Up @@ -402,8 +390,9 @@ public static function parseName(string $formattedName, ?string $template = null
* default this settings points to the default client config file, which is
* provided in the resources folder.
* @type string|TransportInterface $transport
* The transport used for executing network requests. At the moment, supports only
* `rest`. *Advanced usage*: Additionally, it is possible to pass in an already
* 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
* $apiEndpoint setting, will be ignored.
Expand All @@ -412,9 +401,11 @@ public static function parseName(string $formattedName, ?string $template = null
* each supported transport type should be passed in a key for that transport. For
* example:
* $transportConfig = [
* 'grpc' => [...],
* 'rest' => [...],
* ];
* See the {@see \Google\ApiCore\Transport\RestTransport::build()} method for the
* See the {@see \Google\ApiCore\Transport\GrpcTransport::build()} and
* {@see \Google\ApiCore\Transport\RestTransport::build()} methods for the
* supported options.
* @type callable $clientCertSource
* A callable which returns the client cert as a string. This can be used to
Expand Down
Loading