diff --git a/Redis/samples/V1beta1/CloudRedisClient/create_instance.php b/Redis/samples/V1beta1/CloudRedisClient/create_instance.php deleted file mode 100644 index c134ce494956..000000000000 --- a/Redis/samples/V1beta1/CloudRedisClient/create_instance.php +++ /dev/null @@ -1,132 +0,0 @@ -setName($instanceName) - ->setTier($instanceTier) - ->setMemorySizeGb($instanceMemorySizeGb); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $cloudRedisClient->createInstance($formattedParent, $instanceId, $instance); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CloudRedisClient::locationName('[PROJECT]', '[LOCATION]'); - $instanceId = '[INSTANCE_ID]'; - $instanceName = '[NAME]'; - $instanceTier = Tier::TIER_UNSPECIFIED; - $instanceMemorySizeGb = 0; - - create_instance_sample( - $formattedParent, - $instanceId, - $instanceName, - $instanceTier, - $instanceMemorySizeGb - ); -} -// [END redis_v1beta1_generated_CloudRedis_CreateInstance_sync] diff --git a/Redis/samples/V1beta1/CloudRedisClient/delete_instance.php b/Redis/samples/V1beta1/CloudRedisClient/delete_instance.php deleted file mode 100644 index f4d00130d374..000000000000 --- a/Redis/samples/V1beta1/CloudRedisClient/delete_instance.php +++ /dev/null @@ -1,78 +0,0 @@ -deleteInstance($formattedName); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - printf('Operation completed successfully.' . PHP_EOL); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudRedisClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - - delete_instance_sample($formattedName); -} -// [END redis_v1beta1_generated_CloudRedis_DeleteInstance_sync] diff --git a/Redis/samples/V1beta1/CloudRedisClient/export_instance.php b/Redis/samples/V1beta1/CloudRedisClient/export_instance.php deleted file mode 100644 index 5b4153068cea..000000000000 --- a/Redis/samples/V1beta1/CloudRedisClient/export_instance.php +++ /dev/null @@ -1,88 +0,0 @@ -exportInstance($name, $outputConfig); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - export_instance_sample($name); -} -// [END redis_v1beta1_generated_CloudRedis_ExportInstance_sync] diff --git a/Redis/samples/V1beta1/CloudRedisClient/failover_instance.php b/Redis/samples/V1beta1/CloudRedisClient/failover_instance.php deleted file mode 100644 index 683231b29602..000000000000 --- a/Redis/samples/V1beta1/CloudRedisClient/failover_instance.php +++ /dev/null @@ -1,81 +0,0 @@ -failoverInstance($formattedName); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudRedisClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - - failover_instance_sample($formattedName); -} -// [END redis_v1beta1_generated_CloudRedis_FailoverInstance_sync] diff --git a/Redis/samples/V1beta1/CloudRedisClient/get_instance.php b/Redis/samples/V1beta1/CloudRedisClient/get_instance.php deleted file mode 100644 index 0ab2471fb208..000000000000 --- a/Redis/samples/V1beta1/CloudRedisClient/get_instance.php +++ /dev/null @@ -1,68 +0,0 @@ -getInstance($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudRedisClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - - get_instance_sample($formattedName); -} -// [END redis_v1beta1_generated_CloudRedis_GetInstance_sync] diff --git a/Redis/samples/V1beta1/CloudRedisClient/get_instance_auth_string.php b/Redis/samples/V1beta1/CloudRedisClient/get_instance_auth_string.php deleted file mode 100644 index 1cf0b1096907..000000000000 --- a/Redis/samples/V1beta1/CloudRedisClient/get_instance_auth_string.php +++ /dev/null @@ -1,70 +0,0 @@ -getInstanceAuthString($formattedName); - printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudRedisClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - - get_instance_auth_string_sample($formattedName); -} -// [END redis_v1beta1_generated_CloudRedis_GetInstanceAuthString_sync] diff --git a/Redis/samples/V1beta1/CloudRedisClient/import_instance.php b/Redis/samples/V1beta1/CloudRedisClient/import_instance.php deleted file mode 100644 index 7866ef0a6880..000000000000 --- a/Redis/samples/V1beta1/CloudRedisClient/import_instance.php +++ /dev/null @@ -1,90 +0,0 @@ -importInstance($name, $inputConfig); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $name = '[NAME]'; - - import_instance_sample($name); -} -// [END redis_v1beta1_generated_CloudRedis_ImportInstance_sync] diff --git a/Redis/samples/V1beta1/CloudRedisClient/list_instances.php b/Redis/samples/V1beta1/CloudRedisClient/list_instances.php deleted file mode 100644 index d854f22456ab..000000000000 --- a/Redis/samples/V1beta1/CloudRedisClient/list_instances.php +++ /dev/null @@ -1,81 +0,0 @@ -listInstances($formattedParent); - - /** @var Instance $element */ - foreach ($response as $element) { - printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedParent = CloudRedisClient::locationName('[PROJECT]', '[LOCATION]'); - - list_instances_sample($formattedParent); -} -// [END redis_v1beta1_generated_CloudRedis_ListInstances_sync] diff --git a/Redis/samples/V1beta1/CloudRedisClient/reschedule_maintenance.php b/Redis/samples/V1beta1/CloudRedisClient/reschedule_maintenance.php deleted file mode 100644 index 6b42eaa5e39c..000000000000 --- a/Redis/samples/V1beta1/CloudRedisClient/reschedule_maintenance.php +++ /dev/null @@ -1,84 +0,0 @@ -rescheduleMaintenance($formattedName, $rescheduleType); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudRedisClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $rescheduleType = RescheduleType::RESCHEDULE_TYPE_UNSPECIFIED; - - reschedule_maintenance_sample($formattedName, $rescheduleType); -} -// [END redis_v1beta1_generated_CloudRedis_RescheduleMaintenance_sync] diff --git a/Redis/samples/V1beta1/CloudRedisClient/update_instance.php b/Redis/samples/V1beta1/CloudRedisClient/update_instance.php deleted file mode 100644 index 42d369e1e47c..000000000000 --- a/Redis/samples/V1beta1/CloudRedisClient/update_instance.php +++ /dev/null @@ -1,105 +0,0 @@ -setName($instanceName) - ->setTier($instanceTier) - ->setMemorySizeGb($instanceMemorySizeGb); - - // Call the API and handle any network failures. - try { - /** @var OperationResponse $response */ - $response = $cloudRedisClient->updateInstance($updateMask, $instance); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $instanceName = '[NAME]'; - $instanceTier = Tier::TIER_UNSPECIFIED; - $instanceMemorySizeGb = 0; - - update_instance_sample($instanceName, $instanceTier, $instanceMemorySizeGb); -} -// [END redis_v1beta1_generated_CloudRedis_UpdateInstance_sync] diff --git a/Redis/samples/V1beta1/CloudRedisClient/upgrade_instance.php b/Redis/samples/V1beta1/CloudRedisClient/upgrade_instance.php deleted file mode 100644 index 8ce69d89e424..000000000000 --- a/Redis/samples/V1beta1/CloudRedisClient/upgrade_instance.php +++ /dev/null @@ -1,83 +0,0 @@ -upgradeInstance($formattedName, $redisVersion); - $response->pollUntilComplete(); - - if ($response->operationSucceeded()) { - /** @var Instance $result */ - $result = $response->getResult(); - printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString()); - } else { - /** @var Status $error */ - $error = $response->getError(); - printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString()); - } - } catch (ApiException $ex) { - printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); - } -} - -/** - * Helper to execute the sample. - * - * This sample has been automatically generated and should be regarded as a code - * template only. It will require modifications to work: - * - It may require correct/in-range values for request initialization. - * - It may require specifying regional endpoints when creating the service client, - * please see the apiEndpoint client configuration option for more details. - */ -function callSample(): void -{ - $formattedName = CloudRedisClient::instanceName('[PROJECT]', '[LOCATION]', '[INSTANCE]'); - $redisVersion = '[REDIS_VERSION]'; - - upgrade_instance_sample($formattedName, $redisVersion); -} -// [END redis_v1beta1_generated_CloudRedis_UpgradeInstance_sync]