diff --git a/VmMigration/metadata/V1/Vmmigration.php b/VmMigration/metadata/V1/Vmmigration.php index 19f7cd9db63d..661d359c144b 100644 Binary files a/VmMigration/metadata/V1/Vmmigration.php and b/VmMigration/metadata/V1/Vmmigration.php differ diff --git a/VmMigration/samples/V1/VmMigrationClient/cancel_disk_migration_job.php b/VmMigration/samples/V1/VmMigrationClient/cancel_disk_migration_job.php new file mode 100644 index 000000000000..fc399447f18a --- /dev/null +++ b/VmMigration/samples/V1/VmMigrationClient/cancel_disk_migration_job.php @@ -0,0 +1,88 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $vmMigrationClient->cancelDiskMigrationJob($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var CancelDiskMigrationJobResponse $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 = VmMigrationClient::diskMigrationJobName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[DISK_MIGRATION_JOB]' + ); + + cancel_disk_migration_job_sample($formattedName); +} +// [END vmmigration_v1_generated_VmMigration_CancelDiskMigrationJob_sync] diff --git a/VmMigration/samples/V1/VmMigrationClient/cancel_image_import_job.php b/VmMigration/samples/V1/VmMigrationClient/cancel_image_import_job.php new file mode 100644 index 000000000000..afd9642a2069 --- /dev/null +++ b/VmMigration/samples/V1/VmMigrationClient/cancel_image_import_job.php @@ -0,0 +1,88 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $vmMigrationClient->cancelImageImportJob($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var CancelImageImportJobResponse $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 = VmMigrationClient::imageImportJobName( + '[PROJECT]', + '[LOCATION]', + '[JOB]', + '[RESULT]' + ); + + cancel_image_import_job_sample($formattedName); +} +// [END vmmigration_v1_generated_VmMigration_CancelImageImportJob_sync] diff --git a/VmMigration/samples/V1/VmMigrationClient/create_disk_migration_job.php b/VmMigration/samples/V1/VmMigrationClient/create_disk_migration_job.php new file mode 100644 index 000000000000..2e9762ce397b --- /dev/null +++ b/VmMigration/samples/V1/VmMigrationClient/create_disk_migration_job.php @@ -0,0 +1,130 @@ +setZone($formattedDiskMigrationJobTargetDetailsTargetDiskZone) + ->setDiskType($diskMigrationJobTargetDetailsTargetDiskDiskType); + $diskMigrationJobTargetDetails = (new DiskMigrationJobTargetDetails()) + ->setTargetDisk($diskMigrationJobTargetDetailsTargetDisk) + ->setTargetProject($formattedDiskMigrationJobTargetDetailsTargetProject); + $diskMigrationJob = (new DiskMigrationJob()) + ->setTargetDetails($diskMigrationJobTargetDetails); + $request = (new CreateDiskMigrationJobRequest()) + ->setParent($formattedParent) + ->setDiskMigrationJobId($diskMigrationJobId) + ->setDiskMigrationJob($diskMigrationJob); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $vmMigrationClient->createDiskMigrationJob($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var DiskMigrationJob $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 = VmMigrationClient::sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); + $diskMigrationJobId = '[DISK_MIGRATION_JOB_ID]'; + $formattedDiskMigrationJobTargetDetailsTargetDiskZone = VmMigrationClient::locationName( + '[PROJECT]', + '[LOCATION]' + ); + $diskMigrationJobTargetDetailsTargetDiskDiskType = ComputeEngineDiskType::COMPUTE_ENGINE_DISK_TYPE_UNSPECIFIED; + $formattedDiskMigrationJobTargetDetailsTargetProject = VmMigrationClient::targetProjectName( + '[PROJECT]', + '[LOCATION]', + '[TARGET_PROJECT]' + ); + + create_disk_migration_job_sample( + $formattedParent, + $diskMigrationJobId, + $formattedDiskMigrationJobTargetDetailsTargetDiskZone, + $diskMigrationJobTargetDetailsTargetDiskDiskType, + $formattedDiskMigrationJobTargetDetailsTargetProject + ); +} +// [END vmmigration_v1_generated_VmMigration_CreateDiskMigrationJob_sync] diff --git a/VmMigration/samples/V1/VmMigrationClient/create_image_import.php b/VmMigration/samples/V1/VmMigrationClient/create_image_import.php new file mode 100644 index 000000000000..d6a24fb67479 --- /dev/null +++ b/VmMigration/samples/V1/VmMigrationClient/create_image_import.php @@ -0,0 +1,91 @@ +setParent($formattedParent) + ->setImageImportId($imageImportId) + ->setImageImport($imageImport); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $vmMigrationClient->createImageImport($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ImageImport $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 = VmMigrationClient::locationName('[PROJECT]', '[LOCATION]'); + $imageImportId = '[IMAGE_IMPORT_ID]'; + + create_image_import_sample($formattedParent, $imageImportId); +} +// [END vmmigration_v1_generated_VmMigration_CreateImageImport_sync] diff --git a/VmMigration/samples/V1/VmMigrationClient/create_target_project.php b/VmMigration/samples/V1/VmMigrationClient/create_target_project.php index 7b290dc3d393..95eac6bcfefb 100644 --- a/VmMigration/samples/V1/VmMigrationClient/create_target_project.php +++ b/VmMigration/samples/V1/VmMigrationClient/create_target_project.php @@ -36,17 +36,22 @@ * NOTE: TargetProject is a global resource; hence the only supported value * for location is `global`. * - * @param string $formattedParent The TargetProject's parent. Please see - * {@see VmMigrationClient::locationName()} for help formatting this field. - * @param string $targetProjectId The target_project identifier. + * @param string $formattedParent The TargetProject's parent. Please see + * {@see VmMigrationClient::locationName()} for help formatting this field. + * @param string $targetProjectId The target_project identifier. + * @param string $targetProjectProject The target project ID (number) or project name. */ -function create_target_project_sample(string $formattedParent, string $targetProjectId): void -{ +function create_target_project_sample( + string $formattedParent, + string $targetProjectId, + string $targetProjectProject +): void { // Create a client. $vmMigrationClient = new VmMigrationClient(); // Prepare the request message. - $targetProject = new TargetProject(); + $targetProject = (new TargetProject()) + ->setProject($targetProjectProject); $request = (new CreateTargetProjectRequest()) ->setParent($formattedParent) ->setTargetProjectId($targetProjectId) @@ -85,7 +90,8 @@ function callSample(): void { $formattedParent = VmMigrationClient::locationName('[PROJECT]', '[LOCATION]'); $targetProjectId = '[TARGET_PROJECT_ID]'; + $targetProjectProject = '[PROJECT]'; - create_target_project_sample($formattedParent, $targetProjectId); + create_target_project_sample($formattedParent, $targetProjectId, $targetProjectProject); } // [END vmmigration_v1_generated_VmMigration_CreateTargetProject_sync] diff --git a/VmMigration/samples/V1/VmMigrationClient/delete_disk_migration_job.php b/VmMigration/samples/V1/VmMigrationClient/delete_disk_migration_job.php new file mode 100644 index 000000000000..bbee4807c623 --- /dev/null +++ b/VmMigration/samples/V1/VmMigrationClient/delete_disk_migration_job.php @@ -0,0 +1,85 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $vmMigrationClient->deleteDiskMigrationJob($request); + $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 = VmMigrationClient::diskMigrationJobName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[DISK_MIGRATION_JOB]' + ); + + delete_disk_migration_job_sample($formattedName); +} +// [END vmmigration_v1_generated_VmMigration_DeleteDiskMigrationJob_sync] diff --git a/VmMigration/samples/V1/VmMigrationClient/delete_image_import.php b/VmMigration/samples/V1/VmMigrationClient/delete_image_import.php new file mode 100644 index 000000000000..b5f38fe3ea45 --- /dev/null +++ b/VmMigration/samples/V1/VmMigrationClient/delete_image_import.php @@ -0,0 +1,80 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $vmMigrationClient->deleteImageImport($request); + $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 = VmMigrationClient::imageImportName('[PROJECT]', '[LOCATION]', '[JOB]'); + + delete_image_import_sample($formattedName); +} +// [END vmmigration_v1_generated_VmMigration_DeleteImageImport_sync] diff --git a/VmMigration/samples/V1/VmMigrationClient/extend_migration.php b/VmMigration/samples/V1/VmMigrationClient/extend_migration.php new file mode 100644 index 000000000000..72d125747855 --- /dev/null +++ b/VmMigration/samples/V1/VmMigrationClient/extend_migration.php @@ -0,0 +1,88 @@ +setMigratingVm($formattedMigratingVm); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $vmMigrationClient->extendMigration($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var ExtendMigrationResponse $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 +{ + $formattedMigratingVm = VmMigrationClient::migratingVmName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[MIGRATING_VM]' + ); + + extend_migration_sample($formattedMigratingVm); +} +// [END vmmigration_v1_generated_VmMigration_ExtendMigration_sync] diff --git a/VmMigration/samples/V1/VmMigrationClient/fetch_storage_inventory.php b/VmMigration/samples/V1/VmMigrationClient/fetch_storage_inventory.php new file mode 100644 index 000000000000..c5e9b8d77a15 --- /dev/null +++ b/VmMigration/samples/V1/VmMigrationClient/fetch_storage_inventory.php @@ -0,0 +1,85 @@ +setSource($formattedSource) + ->setType($type); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $vmMigrationClient->fetchStorageInventory($request); + + /** @var SourceStorageResource $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 +{ + $formattedSource = VmMigrationClient::sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); + $type = StorageType::STORAGE_TYPE_UNSPECIFIED; + + fetch_storage_inventory_sample($formattedSource, $type); +} +// [END vmmigration_v1_generated_VmMigration_FetchStorageInventory_sync] diff --git a/VmMigration/samples/V1/VmMigrationClient/get_disk_migration_job.php b/VmMigration/samples/V1/VmMigrationClient/get_disk_migration_job.php new file mode 100644 index 000000000000..d365ee748488 --- /dev/null +++ b/VmMigration/samples/V1/VmMigrationClient/get_disk_migration_job.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var DiskMigrationJob $response */ + $response = $vmMigrationClient->getDiskMigrationJob($request); + 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 = VmMigrationClient::diskMigrationJobName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[DISK_MIGRATION_JOB]' + ); + + get_disk_migration_job_sample($formattedName); +} +// [END vmmigration_v1_generated_VmMigration_GetDiskMigrationJob_sync] diff --git a/VmMigration/samples/V1/VmMigrationClient/get_image_import.php b/VmMigration/samples/V1/VmMigrationClient/get_image_import.php new file mode 100644 index 000000000000..c3de45debba3 --- /dev/null +++ b/VmMigration/samples/V1/VmMigrationClient/get_image_import.php @@ -0,0 +1,71 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var ImageImport $response */ + $response = $vmMigrationClient->getImageImport($request); + 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 = VmMigrationClient::imageImportName('[PROJECT]', '[LOCATION]', '[JOB]'); + + get_image_import_sample($formattedName); +} +// [END vmmigration_v1_generated_VmMigration_GetImageImport_sync] diff --git a/VmMigration/samples/V1/VmMigrationClient/get_image_import_job.php b/VmMigration/samples/V1/VmMigrationClient/get_image_import_job.php new file mode 100644 index 000000000000..293f28addad6 --- /dev/null +++ b/VmMigration/samples/V1/VmMigrationClient/get_image_import_job.php @@ -0,0 +1,76 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var ImageImportJob $response */ + $response = $vmMigrationClient->getImageImportJob($request); + 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 = VmMigrationClient::imageImportJobName( + '[PROJECT]', + '[LOCATION]', + '[JOB]', + '[RESULT]' + ); + + get_image_import_job_sample($formattedName); +} +// [END vmmigration_v1_generated_VmMigration_GetImageImportJob_sync] diff --git a/VmMigration/samples/V1/VmMigrationClient/list_clone_jobs.php b/VmMigration/samples/V1/VmMigrationClient/list_clone_jobs.php index 78172d4e1e1a..76b59b90ef2c 100644 --- a/VmMigration/samples/V1/VmMigrationClient/list_clone_jobs.php +++ b/VmMigration/samples/V1/VmMigrationClient/list_clone_jobs.php @@ -30,7 +30,8 @@ use Google\Cloud\VMMigration\V1\ListCloneJobsRequest; /** - * Lists CloneJobs of a given migrating VM. + * Lists the CloneJobs of a migrating VM. Only 25 most recent CloneJobs are + * listed. * * @param string $formattedParent The parent, which owns this collection of source VMs. Please see * {@see VmMigrationClient::migratingVmName()} for help formatting this field. diff --git a/VmMigration/samples/V1/VmMigrationClient/list_cutover_jobs.php b/VmMigration/samples/V1/VmMigrationClient/list_cutover_jobs.php index 1eb3ebbd189d..7ff33341e57a 100644 --- a/VmMigration/samples/V1/VmMigrationClient/list_cutover_jobs.php +++ b/VmMigration/samples/V1/VmMigrationClient/list_cutover_jobs.php @@ -30,7 +30,8 @@ use Google\Cloud\VMMigration\V1\ListCutoverJobsRequest; /** - * Lists CutoverJobs of a given migrating VM. + * Lists the CutoverJobs of a migrating VM. Only 25 most recent CutoverJobs + * are listed. * * @param string $formattedParent The parent, which owns this collection of migrating VMs. Please see * {@see VmMigrationClient::migratingVmName()} for help formatting this field. diff --git a/VmMigration/samples/V1/VmMigrationClient/list_disk_migration_jobs.php b/VmMigration/samples/V1/VmMigrationClient/list_disk_migration_jobs.php new file mode 100644 index 000000000000..78169cc53d38 --- /dev/null +++ b/VmMigration/samples/V1/VmMigrationClient/list_disk_migration_jobs.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $vmMigrationClient->listDiskMigrationJobs($request); + + /** @var DiskMigrationJob $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 = VmMigrationClient::sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); + + list_disk_migration_jobs_sample($formattedParent); +} +// [END vmmigration_v1_generated_VmMigration_ListDiskMigrationJobs_sync] diff --git a/VmMigration/samples/V1/VmMigrationClient/list_image_import_jobs.php b/VmMigration/samples/V1/VmMigrationClient/list_image_import_jobs.php new file mode 100644 index 000000000000..b244d70d2f48 --- /dev/null +++ b/VmMigration/samples/V1/VmMigrationClient/list_image_import_jobs.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $vmMigrationClient->listImageImportJobs($request); + + /** @var ImageImportJob $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 = VmMigrationClient::imageImportName('[PROJECT]', '[LOCATION]', '[JOB]'); + + list_image_import_jobs_sample($formattedParent); +} +// [END vmmigration_v1_generated_VmMigration_ListImageImportJobs_sync] diff --git a/VmMigration/samples/V1/VmMigrationClient/list_image_imports.php b/VmMigration/samples/V1/VmMigrationClient/list_image_imports.php new file mode 100644 index 000000000000..7fa2851ba5a9 --- /dev/null +++ b/VmMigration/samples/V1/VmMigrationClient/list_image_imports.php @@ -0,0 +1,76 @@ +setParent($formattedParent); + + // Call the API and handle any network failures. + try { + /** @var PagedListResponse $response */ + $response = $vmMigrationClient->listImageImports($request); + + /** @var ImageImport $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 = VmMigrationClient::locationName('[PROJECT]', '[LOCATION]'); + + list_image_imports_sample($formattedParent); +} +// [END vmmigration_v1_generated_VmMigration_ListImageImports_sync] diff --git a/VmMigration/samples/V1/VmMigrationClient/run_disk_migration_job.php b/VmMigration/samples/V1/VmMigrationClient/run_disk_migration_job.php new file mode 100644 index 000000000000..a53240b47cbd --- /dev/null +++ b/VmMigration/samples/V1/VmMigrationClient/run_disk_migration_job.php @@ -0,0 +1,88 @@ +setName($formattedName); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $vmMigrationClient->runDiskMigrationJob($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var RunDiskMigrationJobResponse $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 = VmMigrationClient::diskMigrationJobName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[DISK_MIGRATION_JOB]' + ); + + run_disk_migration_job_sample($formattedName); +} +// [END vmmigration_v1_generated_VmMigration_RunDiskMigrationJob_sync] diff --git a/VmMigration/samples/V1/VmMigrationClient/update_disk_migration_job.php b/VmMigration/samples/V1/VmMigrationClient/update_disk_migration_job.php new file mode 100644 index 000000000000..6338320b64a8 --- /dev/null +++ b/VmMigration/samples/V1/VmMigrationClient/update_disk_migration_job.php @@ -0,0 +1,116 @@ +setZone($formattedDiskMigrationJobTargetDetailsTargetDiskZone) + ->setDiskType($diskMigrationJobTargetDetailsTargetDiskDiskType); + $diskMigrationJobTargetDetails = (new DiskMigrationJobTargetDetails()) + ->setTargetDisk($diskMigrationJobTargetDetailsTargetDisk) + ->setTargetProject($formattedDiskMigrationJobTargetDetailsTargetProject); + $diskMigrationJob = (new DiskMigrationJob()) + ->setTargetDetails($diskMigrationJobTargetDetails); + $request = (new UpdateDiskMigrationJobRequest()) + ->setDiskMigrationJob($diskMigrationJob); + + // Call the API and handle any network failures. + try { + /** @var OperationResponse $response */ + $response = $vmMigrationClient->updateDiskMigrationJob($request); + $response->pollUntilComplete(); + + if ($response->operationSucceeded()) { + /** @var DiskMigrationJob $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 +{ + $formattedDiskMigrationJobTargetDetailsTargetDiskZone = VmMigrationClient::locationName( + '[PROJECT]', + '[LOCATION]' + ); + $diskMigrationJobTargetDetailsTargetDiskDiskType = ComputeEngineDiskType::COMPUTE_ENGINE_DISK_TYPE_UNSPECIFIED; + $formattedDiskMigrationJobTargetDetailsTargetProject = VmMigrationClient::targetProjectName( + '[PROJECT]', + '[LOCATION]', + '[TARGET_PROJECT]' + ); + + update_disk_migration_job_sample( + $formattedDiskMigrationJobTargetDetailsTargetDiskZone, + $diskMigrationJobTargetDetailsTargetDiskDiskType, + $formattedDiskMigrationJobTargetDetailsTargetProject + ); +} +// [END vmmigration_v1_generated_VmMigration_UpdateDiskMigrationJob_sync] diff --git a/VmMigration/samples/V1/VmMigrationClient/update_target_project.php b/VmMigration/samples/V1/VmMigrationClient/update_target_project.php index 28f20a611404..dc26476d581c 100644 --- a/VmMigration/samples/V1/VmMigrationClient/update_target_project.php +++ b/VmMigration/samples/V1/VmMigrationClient/update_target_project.php @@ -36,19 +36,16 @@ * NOTE: TargetProject is a global resource; hence the only supported value * for location is `global`. * - * 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. + * @param string $targetProjectProject The target project ID (number) or project name. */ -function update_target_project_sample(): void +function update_target_project_sample(string $targetProjectProject): void { // Create a client. $vmMigrationClient = new VmMigrationClient(); // Prepare the request message. - $targetProject = new TargetProject(); + $targetProject = (new TargetProject()) + ->setProject($targetProjectProject); $request = (new UpdateTargetProjectRequest()) ->setTargetProject($targetProject); @@ -71,4 +68,20 @@ function update_target_project_sample(): void 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 +{ + $targetProjectProject = '[PROJECT]'; + + update_target_project_sample($targetProjectProject); +} // [END vmmigration_v1_generated_VmMigration_UpdateTargetProject_sync] diff --git a/VmMigration/src/V1/AvailableUpdates.php b/VmMigration/src/V1/AvailableUpdates.php index a32202170f8c..d46819537554 100644 --- a/VmMigration/src/V1/AvailableUpdates.php +++ b/VmMigration/src/V1/AvailableUpdates.php @@ -9,7 +9,7 @@ use Google\Protobuf\Internal\GPBUtil; /** - * Holds informatiom about the available versions for upgrade. + * Holds information about the available versions for upgrade. * * Generated from protobuf message google.cloud.vmmigration.v1.AvailableUpdates */ diff --git a/VmMigration/src/V1/AwsSourceDetails/AccessKeyCredentials.php b/VmMigration/src/V1/AwsSourceDetails/AccessKeyCredentials.php index 6833136f1cfb..713ef487f336 100644 --- a/VmMigration/src/V1/AwsSourceDetails/AccessKeyCredentials.php +++ b/VmMigration/src/V1/AwsSourceDetails/AccessKeyCredentials.php @@ -27,6 +27,14 @@ class AccessKeyCredentials extends \Google\Protobuf\Internal\Message * Generated from protobuf field string secret_access_key = 2 [(.google.api.field_behavior) = INPUT_ONLY]; */ protected $secret_access_key = ''; + /** + * Input only. AWS session token. + * Used only when AWS security token service (STS) is responsible for + * creating the temporary credentials. + * + * Generated from protobuf field string session_token = 3 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $session_token = ''; /** * Constructor. @@ -38,6 +46,10 @@ class AccessKeyCredentials extends \Google\Protobuf\Internal\Message * AWS access key ID. * @type string $secret_access_key * Input only. AWS secret access key. + * @type string $session_token + * Input only. AWS session token. + * Used only when AWS security token service (STS) is responsible for + * creating the temporary credentials. * } */ public function __construct($data = NULL) { @@ -97,6 +109,36 @@ public function setSecretAccessKey($var) return $this; } + /** + * Input only. AWS session token. + * Used only when AWS security token service (STS) is responsible for + * creating the temporary credentials. + * + * Generated from protobuf field string session_token = 3 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return string + */ + public function getSessionToken() + { + return $this->session_token; + } + + /** + * Input only. AWS session token. + * Used only when AWS security token service (STS) is responsible for + * creating the temporary credentials. + * + * Generated from protobuf field string session_token = 3 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setSessionToken($var) + { + GPBUtil::checkString($var, True); + $this->session_token = $var; + + return $this; + } + } diff --git a/VmMigration/src/V1/AwsSourceDetails/Tag.php b/VmMigration/src/V1/AwsSourceDetails/Tag.php index 2c366e5c7613..5bc1709e767a 100644 --- a/VmMigration/src/V1/AwsSourceDetails/Tag.php +++ b/VmMigration/src/V1/AwsSourceDetails/Tag.php @@ -16,15 +16,15 @@ class Tag extends \Google\Protobuf\Internal\Message { /** - * Key of tag. + * Required. Key of tag. * - * Generated from protobuf field string key = 1; + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; */ protected $key = ''; /** - * Value of tag. + * Required. Value of tag. * - * Generated from protobuf field string value = 2; + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = REQUIRED]; */ protected $value = ''; @@ -35,9 +35,9 @@ class Tag extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $key - * Key of tag. + * Required. Key of tag. * @type string $value - * Value of tag. + * Required. Value of tag. * } */ public function __construct($data = NULL) { @@ -46,9 +46,9 @@ public function __construct($data = NULL) { } /** - * Key of tag. + * Required. Key of tag. * - * Generated from protobuf field string key = 1; + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; * @return string */ public function getKey() @@ -57,9 +57,9 @@ public function getKey() } /** - * Key of tag. + * Required. Key of tag. * - * Generated from protobuf field string key = 1; + * Generated from protobuf field string key = 1 [(.google.api.field_behavior) = REQUIRED]; * @param string $var * @return $this */ @@ -72,9 +72,9 @@ public function setKey($var) } /** - * Value of tag. + * Required. Value of tag. * - * Generated from protobuf field string value = 2; + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = REQUIRED]; * @return string */ public function getValue() @@ -83,9 +83,9 @@ public function getValue() } /** - * Value of tag. + * Required. Value of tag. * - * Generated from protobuf field string value = 2; + * Generated from protobuf field string value = 2 [(.google.api.field_behavior) = REQUIRED]; * @param string $var * @return $this */ diff --git a/VmMigration/src/V1/AwsSourceDiskDetails.php b/VmMigration/src/V1/AwsSourceDiskDetails.php new file mode 100644 index 000000000000..5788e1a55a8f --- /dev/null +++ b/VmMigration/src/V1/AwsSourceDiskDetails.php @@ -0,0 +1,169 @@ +google.cloud.vmmigration.v1.AwsSourceDiskDetails + */ +class AwsSourceDiskDetails extends \Google\Protobuf\Internal\Message +{ + /** + * Required. AWS volume ID. + * + * Generated from protobuf field string volume_id = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $volume_id = ''; + /** + * Output only. Size in GiB. + * + * Generated from protobuf field int64 size_gib = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $size_gib = 0; + /** + * Optional. Output only. Disk type. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AwsSourceDiskDetails.Type disk_type = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $disk_type = 0; + /** + * Optional. Output only. A map of AWS volume tags. + * + * Generated from protobuf field map tags = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $tags; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $volume_id + * Required. AWS volume ID. + * @type int|string $size_gib + * Output only. Size in GiB. + * @type int $disk_type + * Optional. Output only. Disk type. + * @type array|\Google\Protobuf\Internal\MapField $tags + * Optional. Output only. A map of AWS volume tags. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Required. AWS volume ID. + * + * Generated from protobuf field string volume_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getVolumeId() + { + return $this->volume_id; + } + + /** + * Required. AWS volume ID. + * + * Generated from protobuf field string volume_id = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setVolumeId($var) + { + GPBUtil::checkString($var, True); + $this->volume_id = $var; + + return $this; + } + + /** + * Output only. Size in GiB. + * + * Generated from protobuf field int64 size_gib = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getSizeGib() + { + return $this->size_gib; + } + + /** + * Output only. Size in GiB. + * + * Generated from protobuf field int64 size_gib = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setSizeGib($var) + { + GPBUtil::checkInt64($var); + $this->size_gib = $var; + + return $this; + } + + /** + * Optional. Output only. Disk type. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AwsSourceDiskDetails.Type disk_type = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getDiskType() + { + return $this->disk_type; + } + + /** + * Optional. Output only. Disk type. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AwsSourceDiskDetails.Type disk_type = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setDiskType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\AwsSourceDiskDetails\Type::class); + $this->disk_type = $var; + + return $this; + } + + /** + * Optional. Output only. A map of AWS volume tags. + * + * Generated from protobuf field map tags = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getTags() + { + return $this->tags; + } + + /** + * Optional. Output only. A map of AWS volume tags. + * + * Generated from protobuf field map tags = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setTags($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->tags = $arr; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/AwsSourceDiskDetails/Type.php b/VmMigration/src/V1/AwsSourceDiskDetails/Type.php new file mode 100644 index 000000000000..a435952ad7b8 --- /dev/null +++ b/VmMigration/src/V1/AwsSourceDiskDetails/Type.php @@ -0,0 +1,97 @@ +google.cloud.vmmigration.v1.AwsSourceDiskDetails.Type + */ +class Type +{ + /** + * Unspecified AWS disk type. Should not be used. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * GP2 disk type. + * + * Generated from protobuf enum GP2 = 1; + */ + const GP2 = 1; + /** + * GP3 disk type. + * + * Generated from protobuf enum GP3 = 2; + */ + const GP3 = 2; + /** + * IO1 disk type. + * + * Generated from protobuf enum IO1 = 3; + */ + const IO1 = 3; + /** + * IO2 disk type. + * + * Generated from protobuf enum IO2 = 4; + */ + const IO2 = 4; + /** + * ST1 disk type. + * + * Generated from protobuf enum ST1 = 5; + */ + const ST1 = 5; + /** + * SC1 disk type. + * + * Generated from protobuf enum SC1 = 6; + */ + const SC1 = 6; + /** + * Standard disk type. + * + * Generated from protobuf enum STANDARD = 7; + */ + const STANDARD = 7; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::GP2 => 'GP2', + self::GP3 => 'GP3', + self::IO1 => 'IO1', + self::IO2 => 'IO2', + self::ST1 => 'ST1', + self::SC1 => 'SC1', + self::STANDARD => 'STANDARD', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/VmMigration/src/V1/AwsSourceVmDetails.php b/VmMigration/src/V1/AwsSourceVmDetails.php index b8365eebfd4d..eaf005a088c3 100644 --- a/VmMigration/src/V1/AwsSourceVmDetails.php +++ b/VmMigration/src/V1/AwsSourceVmDetails.php @@ -16,17 +16,36 @@ class AwsSourceVmDetails extends \Google\Protobuf\Internal\Message { /** - * The firmware type of the source VM. + * Output only. The firmware type of the source VM. * - * Generated from protobuf field .google.cloud.vmmigration.v1.AwsSourceVmDetails.Firmware firmware = 1; + * Generated from protobuf field .google.cloud.vmmigration.v1.AwsSourceVmDetails.Firmware firmware = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $firmware = 0; /** - * The total size of the disks being migrated in bytes. + * Output only. The total size of the disks being migrated in bytes. * - * Generated from protobuf field int64 committed_storage_bytes = 2; + * Generated from protobuf field int64 committed_storage_bytes = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $committed_storage_bytes = 0; + /** + * Output only. The disks attached to the source VM. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.AwsSourceVmDetails.AwsDiskDetails disks = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $disks; + /** + * Output only. Information about VM capabilities needed for some Compute + * Engine features. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmCapabilities vm_capabilities_info = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $vm_capabilities_info = null; + /** + * Output only. The VM architecture. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmArchitecture architecture = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $architecture = 0; /** * Constructor. @@ -35,9 +54,16 @@ class AwsSourceVmDetails extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type int $firmware - * The firmware type of the source VM. + * Output only. The firmware type of the source VM. * @type int|string $committed_storage_bytes - * The total size of the disks being migrated in bytes. + * Output only. The total size of the disks being migrated in bytes. + * @type array<\Google\Cloud\VMMigration\V1\AwsSourceVmDetails\AwsDiskDetails>|\Google\Protobuf\Internal\RepeatedField $disks + * Output only. The disks attached to the source VM. + * @type \Google\Cloud\VMMigration\V1\VmCapabilities $vm_capabilities_info + * Output only. Information about VM capabilities needed for some Compute + * Engine features. + * @type int $architecture + * Output only. The VM architecture. * } */ public function __construct($data = NULL) { @@ -46,9 +72,9 @@ public function __construct($data = NULL) { } /** - * The firmware type of the source VM. + * Output only. The firmware type of the source VM. * - * Generated from protobuf field .google.cloud.vmmigration.v1.AwsSourceVmDetails.Firmware firmware = 1; + * Generated from protobuf field .google.cloud.vmmigration.v1.AwsSourceVmDetails.Firmware firmware = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return int */ public function getFirmware() @@ -57,9 +83,9 @@ public function getFirmware() } /** - * The firmware type of the source VM. + * Output only. The firmware type of the source VM. * - * Generated from protobuf field .google.cloud.vmmigration.v1.AwsSourceVmDetails.Firmware firmware = 1; + * Generated from protobuf field .google.cloud.vmmigration.v1.AwsSourceVmDetails.Firmware firmware = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param int $var * @return $this */ @@ -72,9 +98,9 @@ public function setFirmware($var) } /** - * The total size of the disks being migrated in bytes. + * Output only. The total size of the disks being migrated in bytes. * - * Generated from protobuf field int64 committed_storage_bytes = 2; + * Generated from protobuf field int64 committed_storage_bytes = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return int|string */ public function getCommittedStorageBytes() @@ -83,9 +109,9 @@ public function getCommittedStorageBytes() } /** - * The total size of the disks being migrated in bytes. + * Output only. The total size of the disks being migrated in bytes. * - * Generated from protobuf field int64 committed_storage_bytes = 2; + * Generated from protobuf field int64 committed_storage_bytes = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param int|string $var * @return $this */ @@ -97,5 +123,95 @@ public function setCommittedStorageBytes($var) return $this; } + /** + * Output only. The disks attached to the source VM. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.AwsSourceVmDetails.AwsDiskDetails disks = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDisks() + { + return $this->disks; + } + + /** + * Output only. The disks attached to the source VM. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.AwsSourceVmDetails.AwsDiskDetails disks = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\VMMigration\V1\AwsSourceVmDetails\AwsDiskDetails>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDisks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VMMigration\V1\AwsSourceVmDetails\AwsDiskDetails::class); + $this->disks = $arr; + + return $this; + } + + /** + * Output only. Information about VM capabilities needed for some Compute + * Engine features. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmCapabilities vm_capabilities_info = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\VMMigration\V1\VmCapabilities|null + */ + public function getVmCapabilitiesInfo() + { + return $this->vm_capabilities_info; + } + + public function hasVmCapabilitiesInfo() + { + return isset($this->vm_capabilities_info); + } + + public function clearVmCapabilitiesInfo() + { + unset($this->vm_capabilities_info); + } + + /** + * Output only. Information about VM capabilities needed for some Compute + * Engine features. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmCapabilities vm_capabilities_info = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\VMMigration\V1\VmCapabilities $var + * @return $this + */ + public function setVmCapabilitiesInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\VmCapabilities::class); + $this->vm_capabilities_info = $var; + + return $this; + } + + /** + * Output only. The VM architecture. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmArchitecture architecture = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getArchitecture() + { + return $this->architecture; + } + + /** + * Output only. The VM architecture. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmArchitecture architecture = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setArchitecture($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\VmArchitecture::class); + $this->architecture = $var; + + return $this; + } + } diff --git a/VmMigration/src/V1/AwsSourceVmDetails/AwsDiskDetails.php b/VmMigration/src/V1/AwsSourceVmDetails/AwsDiskDetails.php new file mode 100644 index 000000000000..fd1ccb14b26a --- /dev/null +++ b/VmMigration/src/V1/AwsSourceVmDetails/AwsDiskDetails.php @@ -0,0 +1,136 @@ +google.cloud.vmmigration.v1.AwsSourceVmDetails.AwsDiskDetails + */ +class AwsDiskDetails extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The ordinal number of the disk. + * + * Generated from protobuf field int32 disk_number = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $disk_number = 0; + /** + * Output only. AWS volume ID. + * + * Generated from protobuf field string volume_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $volume_id = ''; + /** + * Output only. Size in GB. + * + * Generated from protobuf field int64 size_gb = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $size_gb = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $disk_number + * Output only. The ordinal number of the disk. + * @type string $volume_id + * Output only. AWS volume ID. + * @type int|string $size_gb + * Output only. Size in GB. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The ordinal number of the disk. + * + * Generated from protobuf field int32 disk_number = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getDiskNumber() + { + return $this->disk_number; + } + + /** + * Output only. The ordinal number of the disk. + * + * Generated from protobuf field int32 disk_number = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setDiskNumber($var) + { + GPBUtil::checkInt32($var); + $this->disk_number = $var; + + return $this; + } + + /** + * Output only. AWS volume ID. + * + * Generated from protobuf field string volume_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVolumeId() + { + return $this->volume_id; + } + + /** + * Output only. AWS volume ID. + * + * Generated from protobuf field string volume_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVolumeId($var) + { + GPBUtil::checkString($var, True); + $this->volume_id = $var; + + return $this; + } + + /** + * Output only. Size in GB. + * + * Generated from protobuf field int64 size_gb = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getSizeGb() + { + return $this->size_gb; + } + + /** + * Output only. Size in GB. + * + * Generated from protobuf field int64 size_gb = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setSizeGb($var) + { + GPBUtil::checkInt64($var); + $this->size_gb = $var; + + return $this; + } + +} + + diff --git a/VmMigration/src/V1/AwsVmDetails.php b/VmMigration/src/V1/AwsVmDetails.php index 7535504cdd78..07d9150484c6 100644 --- a/VmMigration/src/V1/AwsVmDetails.php +++ b/VmMigration/src/V1/AwsVmDetails.php @@ -46,7 +46,7 @@ class AwsVmDetails extends \Google\Protobuf\Internal\Message */ protected $power_state = 0; /** - * The number of cpus the VM has. + * The number of CPU cores the VM has. * * Generated from protobuf field int32 cpu_count = 6; */ @@ -123,6 +123,13 @@ class AwsVmDetails extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.vmmigration.v1.AwsVmDetails.VmArchitecture architecture = 18; */ protected $architecture = 0; + /** + * The number of vCPUs the VM has. It is calculated as the + * number of CPU cores * threads per CPU the VM has. + * + * Generated from protobuf field int32 vcpu_count = 19; + */ + protected $vcpu_count = 0; /** * Constructor. @@ -141,7 +148,7 @@ class AwsVmDetails extends \Google\Protobuf\Internal\Message * @type int $power_state * Output only. The power state of the VM at the moment list was taken. * @type int $cpu_count - * The number of cpus the VM has. + * The number of CPU cores the VM has. * @type int $memory_mb * The memory size of the VM in MB. * @type int $disk_count @@ -166,6 +173,9 @@ class AwsVmDetails extends \Google\Protobuf\Internal\Message * The virtualization type. * @type int $architecture * The CPU architecture. + * @type int $vcpu_count + * The number of vCPUs the VM has. It is calculated as the + * number of CPU cores * threads per CPU the VM has. * } */ public function __construct($data = NULL) { @@ -304,7 +314,7 @@ public function setPowerState($var) } /** - * The number of cpus the VM has. + * The number of CPU cores the VM has. * * Generated from protobuf field int32 cpu_count = 6; * @return int @@ -315,7 +325,7 @@ public function getCpuCount() } /** - * The number of cpus the VM has. + * The number of CPU cores the VM has. * * Generated from protobuf field int32 cpu_count = 6; * @param int $var @@ -641,5 +651,33 @@ public function setArchitecture($var) return $this; } + /** + * The number of vCPUs the VM has. It is calculated as the + * number of CPU cores * threads per CPU the VM has. + * + * Generated from protobuf field int32 vcpu_count = 19; + * @return int + */ + public function getVcpuCount() + { + return $this->vcpu_count; + } + + /** + * The number of vCPUs the VM has. It is calculated as the + * number of CPU cores * threads per CPU the VM has. + * + * Generated from protobuf field int32 vcpu_count = 19; + * @param int $var + * @return $this + */ + public function setVcpuCount($var) + { + GPBUtil::checkInt32($var); + $this->vcpu_count = $var; + + return $this; + } + } diff --git a/VmMigration/src/V1/AzureSourceDetails.php b/VmMigration/src/V1/AzureSourceDetails.php new file mode 100644 index 000000000000..6dbd2de3621c --- /dev/null +++ b/VmMigration/src/V1/AzureSourceDetails.php @@ -0,0 +1,314 @@ +google.cloud.vmmigration.v1.AzureSourceDetails + */ +class AzureSourceDetails extends \Google\Protobuf\Internal\Message +{ + /** + * Immutable. Azure subscription ID. + * + * Generated from protobuf field string subscription_id = 1 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $subscription_id = ''; + /** + * Immutable. The Azure location (region) that the source VMs will be migrated + * from. + * + * Generated from protobuf field string azure_location = 5 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $azure_location = ''; + /** + * Output only. State of the source as determined by the health check. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureSourceDetails.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. Provides details on the state of the Source in case of an + * error. + * + * Generated from protobuf field .google.rpc.Status error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $error = null; + /** + * User specified tags to add to every M2VM generated resource in Azure. + * These tags will be set in addition to the default tags that are set as part + * of the migration process. The tags must not begin with the reserved prefix + * `m4ce` or `m2vm`. + * + * Generated from protobuf field map migration_resources_user_tags = 8; + */ + private $migration_resources_user_tags; + /** + * Output only. The ID of the Azure resource group that contains all resources + * related to the migration process of this source. + * + * Generated from protobuf field string resource_group_id = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $resource_group_id = ''; + protected $credentials_type; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\VMMigration\V1\AzureSourceDetails\ClientSecretCredentials $client_secret_creds + * Azure Credentials using tenant ID, client ID and secret. + * @type string $subscription_id + * Immutable. Azure subscription ID. + * @type string $azure_location + * Immutable. The Azure location (region) that the source VMs will be migrated + * from. + * @type int $state + * Output only. State of the source as determined by the health check. + * @type \Google\Rpc\Status $error + * Output only. Provides details on the state of the Source in case of an + * error. + * @type array|\Google\Protobuf\Internal\MapField $migration_resources_user_tags + * User specified tags to add to every M2VM generated resource in Azure. + * These tags will be set in addition to the default tags that are set as part + * of the migration process. The tags must not begin with the reserved prefix + * `m4ce` or `m2vm`. + * @type string $resource_group_id + * Output only. The ID of the Azure resource group that contains all resources + * related to the migration process of this source. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Azure Credentials using tenant ID, client ID and secret. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureSourceDetails.ClientSecretCredentials client_secret_creds = 9; + * @return \Google\Cloud\VMMigration\V1\AzureSourceDetails\ClientSecretCredentials|null + */ + public function getClientSecretCreds() + { + return $this->readOneof(9); + } + + public function hasClientSecretCreds() + { + return $this->hasOneof(9); + } + + /** + * Azure Credentials using tenant ID, client ID and secret. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureSourceDetails.ClientSecretCredentials client_secret_creds = 9; + * @param \Google\Cloud\VMMigration\V1\AzureSourceDetails\ClientSecretCredentials $var + * @return $this + */ + public function setClientSecretCreds($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\AzureSourceDetails\ClientSecretCredentials::class); + $this->writeOneof(9, $var); + + return $this; + } + + /** + * Immutable. Azure subscription ID. + * + * Generated from protobuf field string subscription_id = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getSubscriptionId() + { + return $this->subscription_id; + } + + /** + * Immutable. Azure subscription ID. + * + * Generated from protobuf field string subscription_id = 1 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setSubscriptionId($var) + { + GPBUtil::checkString($var, True); + $this->subscription_id = $var; + + return $this; + } + + /** + * Immutable. The Azure location (region) that the source VMs will be migrated + * from. + * + * Generated from protobuf field string azure_location = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getAzureLocation() + { + return $this->azure_location; + } + + /** + * Immutable. The Azure location (region) that the source VMs will be migrated + * from. + * + * Generated from protobuf field string azure_location = 5 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setAzureLocation($var) + { + GPBUtil::checkString($var, True); + $this->azure_location = $var; + + return $this; + } + + /** + * Output only. State of the source as determined by the health check. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureSourceDetails.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. State of the source as determined by the health check. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureSourceDetails.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\AzureSourceDetails\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. Provides details on the state of the Source in case of an + * error. + * + * Generated from protobuf field .google.rpc.Status error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Rpc\Status|null + */ + public function getError() + { + return $this->error; + } + + public function hasError() + { + return isset($this->error); + } + + public function clearError() + { + unset($this->error); + } + + /** + * Output only. Provides details on the state of the Source in case of an + * error. + * + * Generated from protobuf field .google.rpc.Status error = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Rpc\Status $var + * @return $this + */ + public function setError($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\Status::class); + $this->error = $var; + + return $this; + } + + /** + * User specified tags to add to every M2VM generated resource in Azure. + * These tags will be set in addition to the default tags that are set as part + * of the migration process. The tags must not begin with the reserved prefix + * `m4ce` or `m2vm`. + * + * Generated from protobuf field map migration_resources_user_tags = 8; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMigrationResourcesUserTags() + { + return $this->migration_resources_user_tags; + } + + /** + * User specified tags to add to every M2VM generated resource in Azure. + * These tags will be set in addition to the default tags that are set as part + * of the migration process. The tags must not begin with the reserved prefix + * `m4ce` or `m2vm`. + * + * Generated from protobuf field map migration_resources_user_tags = 8; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMigrationResourcesUserTags($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->migration_resources_user_tags = $arr; + + return $this; + } + + /** + * Output only. The ID of the Azure resource group that contains all resources + * related to the migration process of this source. + * + * Generated from protobuf field string resource_group_id = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getResourceGroupId() + { + return $this->resource_group_id; + } + + /** + * Output only. The ID of the Azure resource group that contains all resources + * related to the migration process of this source. + * + * Generated from protobuf field string resource_group_id = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setResourceGroupId($var) + { + GPBUtil::checkString($var, True); + $this->resource_group_id = $var; + + return $this; + } + + /** + * @return string + */ + public function getCredentialsType() + { + return $this->whichOneof("credentials_type"); + } + +} + diff --git a/VmMigration/src/V1/AzureSourceDetails/ClientSecretCredentials.php b/VmMigration/src/V1/AzureSourceDetails/ClientSecretCredentials.php new file mode 100644 index 000000000000..6d0624410363 --- /dev/null +++ b/VmMigration/src/V1/AzureSourceDetails/ClientSecretCredentials.php @@ -0,0 +1,136 @@ +google.cloud.vmmigration.v1.AzureSourceDetails.ClientSecretCredentials + */ +class ClientSecretCredentials extends \Google\Protobuf\Internal\Message +{ + /** + * Azure tenant ID. + * + * Generated from protobuf field string tenant_id = 1; + */ + protected $tenant_id = ''; + /** + * Azure client ID. + * + * Generated from protobuf field string client_id = 2; + */ + protected $client_id = ''; + /** + * Input only. Azure client secret. + * + * Generated from protobuf field string client_secret = 3 [(.google.api.field_behavior) = INPUT_ONLY]; + */ + protected $client_secret = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $tenant_id + * Azure tenant ID. + * @type string $client_id + * Azure client ID. + * @type string $client_secret + * Input only. Azure client secret. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Azure tenant ID. + * + * Generated from protobuf field string tenant_id = 1; + * @return string + */ + public function getTenantId() + { + return $this->tenant_id; + } + + /** + * Azure tenant ID. + * + * Generated from protobuf field string tenant_id = 1; + * @param string $var + * @return $this + */ + public function setTenantId($var) + { + GPBUtil::checkString($var, True); + $this->tenant_id = $var; + + return $this; + } + + /** + * Azure client ID. + * + * Generated from protobuf field string client_id = 2; + * @return string + */ + public function getClientId() + { + return $this->client_id; + } + + /** + * Azure client ID. + * + * Generated from protobuf field string client_id = 2; + * @param string $var + * @return $this + */ + public function setClientId($var) + { + GPBUtil::checkString($var, True); + $this->client_id = $var; + + return $this; + } + + /** + * Input only. Azure client secret. + * + * Generated from protobuf field string client_secret = 3 [(.google.api.field_behavior) = INPUT_ONLY]; + * @return string + */ + public function getClientSecret() + { + return $this->client_secret; + } + + /** + * Input only. Azure client secret. + * + * Generated from protobuf field string client_secret = 3 [(.google.api.field_behavior) = INPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setClientSecret($var) + { + GPBUtil::checkString($var, True); + $this->client_secret = $var; + + return $this; + } + +} + + diff --git a/VmMigration/src/V1/AzureSourceDetails/State.php b/VmMigration/src/V1/AzureSourceDetails/State.php new file mode 100644 index 000000000000..a95f7d5c4b06 --- /dev/null +++ b/VmMigration/src/V1/AzureSourceDetails/State.php @@ -0,0 +1,72 @@ +google.cloud.vmmigration.v1.AzureSourceDetails.State + */ +class State +{ + /** + * The state is unknown. This is used for API compatibility only and is not + * used by the system. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The state was not sampled by the health checks yet. + * + * Generated from protobuf enum PENDING = 1; + */ + const PENDING = 1; + /** + * The source is available but might not be usable yet due to invalid + * credentials or another reason. + * The error message will contain further details. + * + * Generated from protobuf enum FAILED = 2; + */ + const FAILED = 2; + /** + * The source exists and its credentials were verified. + * + * Generated from protobuf enum ACTIVE = 3; + */ + const ACTIVE = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PENDING => 'PENDING', + self::FAILED => 'FAILED', + self::ACTIVE => 'ACTIVE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/VmMigration/src/V1/AzureSourceVmDetails.php b/VmMigration/src/V1/AzureSourceVmDetails.php new file mode 100644 index 000000000000..3cb39a88c439 --- /dev/null +++ b/VmMigration/src/V1/AzureSourceVmDetails.php @@ -0,0 +1,217 @@ +google.cloud.vmmigration.v1.AzureSourceVmDetails + */ +class AzureSourceVmDetails extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The firmware type of the source VM. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureSourceVmDetails.Firmware firmware = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $firmware = 0; + /** + * Output only. The total size of the disks being migrated in bytes. + * + * Generated from protobuf field int64 committed_storage_bytes = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $committed_storage_bytes = 0; + /** + * Output only. The disks attached to the source VM. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.AzureSourceVmDetails.AzureDiskDetails disks = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $disks; + /** + * Output only. Information about VM capabilities needed for some Compute + * Engine features. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmCapabilities vm_capabilities_info = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $vm_capabilities_info = null; + /** + * Output only. The VM architecture. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmArchitecture architecture = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $architecture = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $firmware + * Output only. The firmware type of the source VM. + * @type int|string $committed_storage_bytes + * Output only. The total size of the disks being migrated in bytes. + * @type array<\Google\Cloud\VMMigration\V1\AzureSourceVmDetails\AzureDiskDetails>|\Google\Protobuf\Internal\RepeatedField $disks + * Output only. The disks attached to the source VM. + * @type \Google\Cloud\VMMigration\V1\VmCapabilities $vm_capabilities_info + * Output only. Information about VM capabilities needed for some Compute + * Engine features. + * @type int $architecture + * Output only. The VM architecture. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The firmware type of the source VM. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureSourceVmDetails.Firmware firmware = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getFirmware() + { + return $this->firmware; + } + + /** + * Output only. The firmware type of the source VM. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureSourceVmDetails.Firmware firmware = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setFirmware($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\AzureSourceVmDetails\Firmware::class); + $this->firmware = $var; + + return $this; + } + + /** + * Output only. The total size of the disks being migrated in bytes. + * + * Generated from protobuf field int64 committed_storage_bytes = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getCommittedStorageBytes() + { + return $this->committed_storage_bytes; + } + + /** + * Output only. The total size of the disks being migrated in bytes. + * + * Generated from protobuf field int64 committed_storage_bytes = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setCommittedStorageBytes($var) + { + GPBUtil::checkInt64($var); + $this->committed_storage_bytes = $var; + + return $this; + } + + /** + * Output only. The disks attached to the source VM. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.AzureSourceVmDetails.AzureDiskDetails disks = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDisks() + { + return $this->disks; + } + + /** + * Output only. The disks attached to the source VM. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.AzureSourceVmDetails.AzureDiskDetails disks = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\VMMigration\V1\AzureSourceVmDetails\AzureDiskDetails>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDisks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VMMigration\V1\AzureSourceVmDetails\AzureDiskDetails::class); + $this->disks = $arr; + + return $this; + } + + /** + * Output only. Information about VM capabilities needed for some Compute + * Engine features. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmCapabilities vm_capabilities_info = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\VMMigration\V1\VmCapabilities|null + */ + public function getVmCapabilitiesInfo() + { + return $this->vm_capabilities_info; + } + + public function hasVmCapabilitiesInfo() + { + return isset($this->vm_capabilities_info); + } + + public function clearVmCapabilitiesInfo() + { + unset($this->vm_capabilities_info); + } + + /** + * Output only. Information about VM capabilities needed for some Compute + * Engine features. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmCapabilities vm_capabilities_info = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\VMMigration\V1\VmCapabilities $var + * @return $this + */ + public function setVmCapabilitiesInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\VmCapabilities::class); + $this->vm_capabilities_info = $var; + + return $this; + } + + /** + * Output only. The VM architecture. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmArchitecture architecture = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getArchitecture() + { + return $this->architecture; + } + + /** + * Output only. The VM architecture. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmArchitecture architecture = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setArchitecture($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\VmArchitecture::class); + $this->architecture = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/AzureSourceVmDetails/AzureDiskDetails.php b/VmMigration/src/V1/AzureSourceVmDetails/AzureDiskDetails.php new file mode 100644 index 000000000000..fb9899f2118d --- /dev/null +++ b/VmMigration/src/V1/AzureSourceVmDetails/AzureDiskDetails.php @@ -0,0 +1,136 @@ +google.cloud.vmmigration.v1.AzureSourceVmDetails.AzureDiskDetails + */ +class AzureDiskDetails extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The ordinal number of the disk. + * + * Generated from protobuf field int32 disk_number = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $disk_number = 0; + /** + * Output only. Azure disk ID. + * + * Generated from protobuf field string disk_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $disk_id = ''; + /** + * Output only. Size in GB. + * + * Generated from protobuf field int64 size_gb = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $size_gb = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $disk_number + * Output only. The ordinal number of the disk. + * @type string $disk_id + * Output only. Azure disk ID. + * @type int|string $size_gb + * Output only. Size in GB. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The ordinal number of the disk. + * + * Generated from protobuf field int32 disk_number = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getDiskNumber() + { + return $this->disk_number; + } + + /** + * Output only. The ordinal number of the disk. + * + * Generated from protobuf field int32 disk_number = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setDiskNumber($var) + { + GPBUtil::checkInt32($var); + $this->disk_number = $var; + + return $this; + } + + /** + * Output only. Azure disk ID. + * + * Generated from protobuf field string disk_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getDiskId() + { + return $this->disk_id; + } + + /** + * Output only. Azure disk ID. + * + * Generated from protobuf field string disk_id = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setDiskId($var) + { + GPBUtil::checkString($var, True); + $this->disk_id = $var; + + return $this; + } + + /** + * Output only. Size in GB. + * + * Generated from protobuf field int64 size_gb = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getSizeGb() + { + return $this->size_gb; + } + + /** + * Output only. Size in GB. + * + * Generated from protobuf field int64 size_gb = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setSizeGb($var) + { + GPBUtil::checkInt64($var); + $this->size_gb = $var; + + return $this; + } + +} + + diff --git a/VmMigration/src/V1/AzureSourceVmDetails/Firmware.php b/VmMigration/src/V1/AzureSourceVmDetails/Firmware.php new file mode 100644 index 000000000000..3b5439b309ed --- /dev/null +++ b/VmMigration/src/V1/AzureSourceVmDetails/Firmware.php @@ -0,0 +1,62 @@ +google.cloud.vmmigration.v1.AzureSourceVmDetails.Firmware + */ +class Firmware +{ + /** + * The firmware is unknown. + * + * Generated from protobuf enum FIRMWARE_UNSPECIFIED = 0; + */ + const FIRMWARE_UNSPECIFIED = 0; + /** + * The firmware is EFI. + * + * Generated from protobuf enum EFI = 1; + */ + const EFI = 1; + /** + * The firmware is BIOS. + * + * Generated from protobuf enum BIOS = 2; + */ + const BIOS = 2; + + private static $valueToName = [ + self::FIRMWARE_UNSPECIFIED => 'FIRMWARE_UNSPECIFIED', + self::EFI => 'EFI', + self::BIOS => 'BIOS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/VmMigration/src/V1/AzureVmDetails.php b/VmMigration/src/V1/AzureVmDetails.php new file mode 100644 index 000000000000..8f1b25e5decd --- /dev/null +++ b/VmMigration/src/V1/AzureVmDetails.php @@ -0,0 +1,529 @@ +google.cloud.vmmigration.v1.AzureVmDetails + */ +class AzureVmDetails extends \Google\Protobuf\Internal\Message +{ + /** + * The VM full path in Azure. + * + * Generated from protobuf field string vm_id = 1; + */ + protected $vm_id = ''; + /** + * The power state of the VM at the moment list was taken. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureVmDetails.PowerState power_state = 2; + */ + protected $power_state = 0; + /** + * VM size as configured in Azure. Determines the VM's hardware spec. + * + * Generated from protobuf field string vm_size = 3; + */ + protected $vm_size = ''; + /** + * The number of cpus the VM has. + * + * Generated from protobuf field int32 cpu_count = 4; + */ + protected $cpu_count = 0; + /** + * The memory size of the VM in MB. + * + * Generated from protobuf field int32 memory_mb = 5; + */ + protected $memory_mb = 0; + /** + * The number of disks the VM has, including OS disk. + * + * Generated from protobuf field int32 disk_count = 6; + */ + protected $disk_count = 0; + /** + * The total size of the storage allocated to the VM in MB. + * + * Generated from protobuf field int64 committed_storage_mb = 7; + */ + protected $committed_storage_mb = 0; + /** + * Description of the OS disk. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureVmDetails.OSDisk os_disk = 8; + */ + protected $os_disk = null; + /** + * Description of the data disks. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.AzureVmDetails.Disk disks = 9; + */ + private $disks; + /** + * Description of the OS. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureVmDetails.OSDescription os_description = 10; + */ + protected $os_description = null; + /** + * The VM Boot Option. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureVmDetails.BootOption boot_option = 11; + */ + protected $boot_option = 0; + /** + * The tags of the VM. + * + * Generated from protobuf field map tags = 12; + */ + private $tags; + /** + * The VM's ComputerName. + * + * Generated from protobuf field string computer_name = 13; + */ + protected $computer_name = ''; + /** + * The CPU architecture. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureVmDetails.VmArchitecture architecture = 14; + */ + protected $architecture = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $vm_id + * The VM full path in Azure. + * @type int $power_state + * The power state of the VM at the moment list was taken. + * @type string $vm_size + * VM size as configured in Azure. Determines the VM's hardware spec. + * @type int $cpu_count + * The number of cpus the VM has. + * @type int $memory_mb + * The memory size of the VM in MB. + * @type int $disk_count + * The number of disks the VM has, including OS disk. + * @type int|string $committed_storage_mb + * The total size of the storage allocated to the VM in MB. + * @type \Google\Cloud\VMMigration\V1\AzureVmDetails\OSDisk $os_disk + * Description of the OS disk. + * @type array<\Google\Cloud\VMMigration\V1\AzureVmDetails\Disk>|\Google\Protobuf\Internal\RepeatedField $disks + * Description of the data disks. + * @type \Google\Cloud\VMMigration\V1\AzureVmDetails\OSDescription $os_description + * Description of the OS. + * @type int $boot_option + * The VM Boot Option. + * @type array|\Google\Protobuf\Internal\MapField $tags + * The tags of the VM. + * @type string $computer_name + * The VM's ComputerName. + * @type int $architecture + * The CPU architecture. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * The VM full path in Azure. + * + * Generated from protobuf field string vm_id = 1; + * @return string + */ + public function getVmId() + { + return $this->vm_id; + } + + /** + * The VM full path in Azure. + * + * Generated from protobuf field string vm_id = 1; + * @param string $var + * @return $this + */ + public function setVmId($var) + { + GPBUtil::checkString($var, True); + $this->vm_id = $var; + + return $this; + } + + /** + * The power state of the VM at the moment list was taken. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureVmDetails.PowerState power_state = 2; + * @return int + */ + public function getPowerState() + { + return $this->power_state; + } + + /** + * The power state of the VM at the moment list was taken. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureVmDetails.PowerState power_state = 2; + * @param int $var + * @return $this + */ + public function setPowerState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\AzureVmDetails\PowerState::class); + $this->power_state = $var; + + return $this; + } + + /** + * VM size as configured in Azure. Determines the VM's hardware spec. + * + * Generated from protobuf field string vm_size = 3; + * @return string + */ + public function getVmSize() + { + return $this->vm_size; + } + + /** + * VM size as configured in Azure. Determines the VM's hardware spec. + * + * Generated from protobuf field string vm_size = 3; + * @param string $var + * @return $this + */ + public function setVmSize($var) + { + GPBUtil::checkString($var, True); + $this->vm_size = $var; + + return $this; + } + + /** + * The number of cpus the VM has. + * + * Generated from protobuf field int32 cpu_count = 4; + * @return int + */ + public function getCpuCount() + { + return $this->cpu_count; + } + + /** + * The number of cpus the VM has. + * + * Generated from protobuf field int32 cpu_count = 4; + * @param int $var + * @return $this + */ + public function setCpuCount($var) + { + GPBUtil::checkInt32($var); + $this->cpu_count = $var; + + return $this; + } + + /** + * The memory size of the VM in MB. + * + * Generated from protobuf field int32 memory_mb = 5; + * @return int + */ + public function getMemoryMb() + { + return $this->memory_mb; + } + + /** + * The memory size of the VM in MB. + * + * Generated from protobuf field int32 memory_mb = 5; + * @param int $var + * @return $this + */ + public function setMemoryMb($var) + { + GPBUtil::checkInt32($var); + $this->memory_mb = $var; + + return $this; + } + + /** + * The number of disks the VM has, including OS disk. + * + * Generated from protobuf field int32 disk_count = 6; + * @return int + */ + public function getDiskCount() + { + return $this->disk_count; + } + + /** + * The number of disks the VM has, including OS disk. + * + * Generated from protobuf field int32 disk_count = 6; + * @param int $var + * @return $this + */ + public function setDiskCount($var) + { + GPBUtil::checkInt32($var); + $this->disk_count = $var; + + return $this; + } + + /** + * The total size of the storage allocated to the VM in MB. + * + * Generated from protobuf field int64 committed_storage_mb = 7; + * @return int|string + */ + public function getCommittedStorageMb() + { + return $this->committed_storage_mb; + } + + /** + * The total size of the storage allocated to the VM in MB. + * + * Generated from protobuf field int64 committed_storage_mb = 7; + * @param int|string $var + * @return $this + */ + public function setCommittedStorageMb($var) + { + GPBUtil::checkInt64($var); + $this->committed_storage_mb = $var; + + return $this; + } + + /** + * Description of the OS disk. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureVmDetails.OSDisk os_disk = 8; + * @return \Google\Cloud\VMMigration\V1\AzureVmDetails\OSDisk|null + */ + public function getOsDisk() + { + return $this->os_disk; + } + + public function hasOsDisk() + { + return isset($this->os_disk); + } + + public function clearOsDisk() + { + unset($this->os_disk); + } + + /** + * Description of the OS disk. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureVmDetails.OSDisk os_disk = 8; + * @param \Google\Cloud\VMMigration\V1\AzureVmDetails\OSDisk $var + * @return $this + */ + public function setOsDisk($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\AzureVmDetails\OSDisk::class); + $this->os_disk = $var; + + return $this; + } + + /** + * Description of the data disks. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.AzureVmDetails.Disk disks = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDisks() + { + return $this->disks; + } + + /** + * Description of the data disks. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.AzureVmDetails.Disk disks = 9; + * @param array<\Google\Cloud\VMMigration\V1\AzureVmDetails\Disk>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDisks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VMMigration\V1\AzureVmDetails\Disk::class); + $this->disks = $arr; + + return $this; + } + + /** + * Description of the OS. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureVmDetails.OSDescription os_description = 10; + * @return \Google\Cloud\VMMigration\V1\AzureVmDetails\OSDescription|null + */ + public function getOsDescription() + { + return $this->os_description; + } + + public function hasOsDescription() + { + return isset($this->os_description); + } + + public function clearOsDescription() + { + unset($this->os_description); + } + + /** + * Description of the OS. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureVmDetails.OSDescription os_description = 10; + * @param \Google\Cloud\VMMigration\V1\AzureVmDetails\OSDescription $var + * @return $this + */ + public function setOsDescription($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\AzureVmDetails\OSDescription::class); + $this->os_description = $var; + + return $this; + } + + /** + * The VM Boot Option. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureVmDetails.BootOption boot_option = 11; + * @return int + */ + public function getBootOption() + { + return $this->boot_option; + } + + /** + * The VM Boot Option. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureVmDetails.BootOption boot_option = 11; + * @param int $var + * @return $this + */ + public function setBootOption($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\AzureVmDetails\BootOption::class); + $this->boot_option = $var; + + return $this; + } + + /** + * The tags of the VM. + * + * Generated from protobuf field map tags = 12; + * @return \Google\Protobuf\Internal\MapField + */ + public function getTags() + { + return $this->tags; + } + + /** + * The tags of the VM. + * + * Generated from protobuf field map tags = 12; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setTags($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->tags = $arr; + + return $this; + } + + /** + * The VM's ComputerName. + * + * Generated from protobuf field string computer_name = 13; + * @return string + */ + public function getComputerName() + { + return $this->computer_name; + } + + /** + * The VM's ComputerName. + * + * Generated from protobuf field string computer_name = 13; + * @param string $var + * @return $this + */ + public function setComputerName($var) + { + GPBUtil::checkString($var, True); + $this->computer_name = $var; + + return $this; + } + + /** + * The CPU architecture. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureVmDetails.VmArchitecture architecture = 14; + * @return int + */ + public function getArchitecture() + { + return $this->architecture; + } + + /** + * The CPU architecture. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureVmDetails.VmArchitecture architecture = 14; + * @param int $var + * @return $this + */ + public function setArchitecture($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\AzureVmDetails\VmArchitecture::class); + $this->architecture = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/AzureVmDetails/BootOption.php b/VmMigration/src/V1/AzureVmDetails/BootOption.php new file mode 100644 index 000000000000..d923fa9c3289 --- /dev/null +++ b/VmMigration/src/V1/AzureVmDetails/BootOption.php @@ -0,0 +1,62 @@ +google.cloud.vmmigration.v1.AzureVmDetails.BootOption + */ +class BootOption +{ + /** + * The boot option is unknown. + * + * Generated from protobuf enum BOOT_OPTION_UNSPECIFIED = 0; + */ + const BOOT_OPTION_UNSPECIFIED = 0; + /** + * The boot option is UEFI. + * + * Generated from protobuf enum EFI = 1; + */ + const EFI = 1; + /** + * The boot option is BIOS. + * + * Generated from protobuf enum BIOS = 2; + */ + const BIOS = 2; + + private static $valueToName = [ + self::BOOT_OPTION_UNSPECIFIED => 'BOOT_OPTION_UNSPECIFIED', + self::EFI => 'EFI', + self::BIOS => 'BIOS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/VmMigration/src/V1/AzureVmDetails/Disk.php b/VmMigration/src/V1/AzureVmDetails/Disk.php new file mode 100644 index 000000000000..952ebfa93769 --- /dev/null +++ b/VmMigration/src/V1/AzureVmDetails/Disk.php @@ -0,0 +1,136 @@ +google.cloud.vmmigration.v1.AzureVmDetails.Disk + */ +class Disk extends \Google\Protobuf\Internal\Message +{ + /** + * The disk name. + * + * Generated from protobuf field string name = 1; + */ + protected $name = ''; + /** + * The disk size in GB. + * + * Generated from protobuf field int32 size_gb = 2; + */ + protected $size_gb = 0; + /** + * The disk's Logical Unit Number (LUN). + * + * Generated from protobuf field int32 lun = 3; + */ + protected $lun = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * The disk name. + * @type int $size_gb + * The disk size in GB. + * @type int $lun + * The disk's Logical Unit Number (LUN). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * The disk name. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The disk name. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The disk size in GB. + * + * Generated from protobuf field int32 size_gb = 2; + * @return int + */ + public function getSizeGb() + { + return $this->size_gb; + } + + /** + * The disk size in GB. + * + * Generated from protobuf field int32 size_gb = 2; + * @param int $var + * @return $this + */ + public function setSizeGb($var) + { + GPBUtil::checkInt32($var); + $this->size_gb = $var; + + return $this; + } + + /** + * The disk's Logical Unit Number (LUN). + * + * Generated from protobuf field int32 lun = 3; + * @return int + */ + public function getLun() + { + return $this->lun; + } + + /** + * The disk's Logical Unit Number (LUN). + * + * Generated from protobuf field int32 lun = 3; + * @param int $var + * @return $this + */ + public function setLun($var) + { + GPBUtil::checkInt32($var); + $this->lun = $var; + + return $this; + } + +} + + diff --git a/VmMigration/src/V1/AzureVmDetails/OSDescription.php b/VmMigration/src/V1/AzureVmDetails/OSDescription.php new file mode 100644 index 000000000000..8cb31e2317af --- /dev/null +++ b/VmMigration/src/V1/AzureVmDetails/OSDescription.php @@ -0,0 +1,171 @@ +google.cloud.vmmigration.v1.AzureVmDetails.OSDescription + */ +class OSDescription extends \Google\Protobuf\Internal\Message +{ + /** + * OS type. + * + * Generated from protobuf field string type = 1; + */ + protected $type = ''; + /** + * OS publisher. + * + * Generated from protobuf field string publisher = 2; + */ + protected $publisher = ''; + /** + * OS offer. + * + * Generated from protobuf field string offer = 3; + */ + protected $offer = ''; + /** + * OS plan. + * + * Generated from protobuf field string plan = 4; + */ + protected $plan = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $type + * OS type. + * @type string $publisher + * OS publisher. + * @type string $offer + * OS offer. + * @type string $plan + * OS plan. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * OS type. + * + * Generated from protobuf field string type = 1; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * OS type. + * + * Generated from protobuf field string type = 1; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * OS publisher. + * + * Generated from protobuf field string publisher = 2; + * @return string + */ + public function getPublisher() + { + return $this->publisher; + } + + /** + * OS publisher. + * + * Generated from protobuf field string publisher = 2; + * @param string $var + * @return $this + */ + public function setPublisher($var) + { + GPBUtil::checkString($var, True); + $this->publisher = $var; + + return $this; + } + + /** + * OS offer. + * + * Generated from protobuf field string offer = 3; + * @return string + */ + public function getOffer() + { + return $this->offer; + } + + /** + * OS offer. + * + * Generated from protobuf field string offer = 3; + * @param string $var + * @return $this + */ + public function setOffer($var) + { + GPBUtil::checkString($var, True); + $this->offer = $var; + + return $this; + } + + /** + * OS plan. + * + * Generated from protobuf field string plan = 4; + * @return string + */ + public function getPlan() + { + return $this->plan; + } + + /** + * OS plan. + * + * Generated from protobuf field string plan = 4; + * @param string $var + * @return $this + */ + public function setPlan($var) + { + GPBUtil::checkString($var, True); + $this->plan = $var; + + return $this; + } + +} + + diff --git a/VmMigration/src/V1/AzureVmDetails/OSDisk.php b/VmMigration/src/V1/AzureVmDetails/OSDisk.php new file mode 100644 index 000000000000..1d87ef59fd31 --- /dev/null +++ b/VmMigration/src/V1/AzureVmDetails/OSDisk.php @@ -0,0 +1,136 @@ +google.cloud.vmmigration.v1.AzureVmDetails.OSDisk + */ +class OSDisk extends \Google\Protobuf\Internal\Message +{ + /** + * The disk's type. + * + * Generated from protobuf field string type = 1; + */ + protected $type = ''; + /** + * The disk's full name. + * + * Generated from protobuf field string name = 2; + */ + protected $name = ''; + /** + * The disk's size in GB. + * + * Generated from protobuf field int32 size_gb = 3; + */ + protected $size_gb = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $type + * The disk's type. + * @type string $name + * The disk's full name. + * @type int $size_gb + * The disk's size in GB. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * The disk's type. + * + * Generated from protobuf field string type = 1; + * @return string + */ + public function getType() + { + return $this->type; + } + + /** + * The disk's type. + * + * Generated from protobuf field string type = 1; + * @param string $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkString($var, True); + $this->type = $var; + + return $this; + } + + /** + * The disk's full name. + * + * Generated from protobuf field string name = 2; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The disk's full name. + * + * Generated from protobuf field string name = 2; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The disk's size in GB. + * + * Generated from protobuf field int32 size_gb = 3; + * @return int + */ + public function getSizeGb() + { + return $this->size_gb; + } + + /** + * The disk's size in GB. + * + * Generated from protobuf field int32 size_gb = 3; + * @param int $var + * @return $this + */ + public function setSizeGb($var) + { + GPBUtil::checkInt32($var); + $this->size_gb = $var; + + return $this; + } + +} + + diff --git a/VmMigration/src/V1/AzureVmDetails/PowerState.php b/VmMigration/src/V1/AzureVmDetails/PowerState.php new file mode 100644 index 000000000000..b9e846a9305f --- /dev/null +++ b/VmMigration/src/V1/AzureVmDetails/PowerState.php @@ -0,0 +1,97 @@ +google.cloud.vmmigration.v1.AzureVmDetails.PowerState + */ +class PowerState +{ + /** + * Power state is not specified. + * + * Generated from protobuf enum POWER_STATE_UNSPECIFIED = 0; + */ + const POWER_STATE_UNSPECIFIED = 0; + /** + * The VM is starting. + * + * Generated from protobuf enum STARTING = 1; + */ + const STARTING = 1; + /** + * The VM is running. + * + * Generated from protobuf enum RUNNING = 2; + */ + const RUNNING = 2; + /** + * The VM is stopping. + * + * Generated from protobuf enum STOPPING = 3; + */ + const STOPPING = 3; + /** + * The VM is stopped. + * + * Generated from protobuf enum STOPPED = 4; + */ + const STOPPED = 4; + /** + * The VM is deallocating. + * + * Generated from protobuf enum DEALLOCATING = 5; + */ + const DEALLOCATING = 5; + /** + * The VM is deallocated. + * + * Generated from protobuf enum DEALLOCATED = 6; + */ + const DEALLOCATED = 6; + /** + * The VM's power state is unknown. + * + * Generated from protobuf enum UNKNOWN = 7; + */ + const UNKNOWN = 7; + + private static $valueToName = [ + self::POWER_STATE_UNSPECIFIED => 'POWER_STATE_UNSPECIFIED', + self::STARTING => 'STARTING', + self::RUNNING => 'RUNNING', + self::STOPPING => 'STOPPING', + self::STOPPED => 'STOPPED', + self::DEALLOCATING => 'DEALLOCATING', + self::DEALLOCATED => 'DEALLOCATED', + self::UNKNOWN => 'UNKNOWN', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/VmMigration/src/V1/AzureVmDetails/VmArchitecture.php b/VmMigration/src/V1/AzureVmDetails/VmArchitecture.php new file mode 100644 index 000000000000..2268673ce8c2 --- /dev/null +++ b/VmMigration/src/V1/AzureVmDetails/VmArchitecture.php @@ -0,0 +1,62 @@ +google.cloud.vmmigration.v1.AzureVmDetails.VmArchitecture + */ +class VmArchitecture +{ + /** + * The architecture is unknown. + * + * Generated from protobuf enum VM_ARCHITECTURE_UNSPECIFIED = 0; + */ + const VM_ARCHITECTURE_UNSPECIFIED = 0; + /** + * The architecture is one of the x86 architectures. + * + * Generated from protobuf enum VM_ARCHITECTURE_X86_FAMILY = 1; + */ + const VM_ARCHITECTURE_X86_FAMILY = 1; + /** + * The architecture is ARM64. + * + * Generated from protobuf enum VM_ARCHITECTURE_ARM64 = 2; + */ + const VM_ARCHITECTURE_ARM64 = 2; + + private static $valueToName = [ + self::VM_ARCHITECTURE_UNSPECIFIED => 'VM_ARCHITECTURE_UNSPECIFIED', + self::VM_ARCHITECTURE_X86_FAMILY => 'VM_ARCHITECTURE_X86_FAMILY', + self::VM_ARCHITECTURE_ARM64 => 'VM_ARCHITECTURE_ARM64', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/VmMigration/src/V1/AzureVmsDetails.php b/VmMigration/src/V1/AzureVmsDetails.php new file mode 100644 index 000000000000..8f1c81fa9388 --- /dev/null +++ b/VmMigration/src/V1/AzureVmsDetails.php @@ -0,0 +1,67 @@ +google.cloud.vmmigration.v1.AzureVmsDetails + */ +class AzureVmsDetails extends \Google\Protobuf\Internal\Message +{ + /** + * The details of the Azure VMs. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.AzureVmDetails details = 1; + */ + private $details; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\VMMigration\V1\AzureVmDetails>|\Google\Protobuf\Internal\RepeatedField $details + * The details of the Azure VMs. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * The details of the Azure VMs. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.AzureVmDetails details = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDetails() + { + return $this->details; + } + + /** + * The details of the Azure VMs. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.AzureVmDetails details = 1; + * @param array<\Google\Cloud\VMMigration\V1\AzureVmDetails>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDetails($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VMMigration\V1\AzureVmDetails::class); + $this->details = $arr; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/BootConversion.php b/VmMigration/src/V1/BootConversion.php new file mode 100644 index 000000000000..1e75432ce83e --- /dev/null +++ b/VmMigration/src/V1/BootConversion.php @@ -0,0 +1,61 @@ +google.cloud.vmmigration.v1.BootConversion + */ +class BootConversion +{ + /** + * Unspecified conversion type. + * + * Generated from protobuf enum BOOT_CONVERSION_UNSPECIFIED = 0; + */ + const BOOT_CONVERSION_UNSPECIFIED = 0; + /** + * No conversion. + * + * Generated from protobuf enum NONE = 1; + */ + const NONE = 1; + /** + * Convert from BIOS to EFI. + * + * Generated from protobuf enum BIOS_TO_EFI = 2; + */ + const BIOS_TO_EFI = 2; + + private static $valueToName = [ + self::BOOT_CONVERSION_UNSPECIFIED => 'BOOT_CONVERSION_UNSPECIFIED', + self::NONE => 'NONE', + self::BIOS_TO_EFI => 'BIOS_TO_EFI', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/VmMigration/src/V1/BootDiskDefaults.php b/VmMigration/src/V1/BootDiskDefaults.php new file mode 100644 index 000000000000..52ed5521fe22 --- /dev/null +++ b/VmMigration/src/V1/BootDiskDefaults.php @@ -0,0 +1,241 @@ +google.cloud.vmmigration.v1.BootDiskDefaults + */ +class BootDiskDefaults extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The name of the disk. + * + * Generated from protobuf field string disk_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disk_name = ''; + /** + * Optional. The type of disk provisioning to use for the VM. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineDiskType disk_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disk_type = 0; + /** + * Optional. Specifies a unique device name of your choice that is reflected + * into the /dev/disk/by-id/google-* tree of a Linux operating system running + * within the instance. If not specified, the server chooses a default device + * name to apply to this disk, in the form persistent-disk-x, where x is a + * number assigned by Google Compute Engine. This field is only applicable for + * persistent disks. + * + * Generated from protobuf field string device_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $device_name = ''; + /** + * Optional. The encryption to apply to the boot disk. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $encryption = null; + protected $source; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\VMMigration\V1\BootDiskDefaults\DiskImageDefaults $image + * The image to use when creating the disk. + * @type string $disk_name + * Optional. The name of the disk. + * @type int $disk_type + * Optional. The type of disk provisioning to use for the VM. + * @type string $device_name + * Optional. Specifies a unique device name of your choice that is reflected + * into the /dev/disk/by-id/google-* tree of a Linux operating system running + * within the instance. If not specified, the server chooses a default device + * name to apply to this disk, in the form persistent-disk-x, where x is a + * number assigned by Google Compute Engine. This field is only applicable for + * persistent disks. + * @type \Google\Cloud\VMMigration\V1\Encryption $encryption + * Optional. The encryption to apply to the boot disk. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * The image to use when creating the disk. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.BootDiskDefaults.DiskImageDefaults image = 3; + * @return \Google\Cloud\VMMigration\V1\BootDiskDefaults\DiskImageDefaults|null + */ + public function getImage() + { + return $this->readOneof(3); + } + + public function hasImage() + { + return $this->hasOneof(3); + } + + /** + * The image to use when creating the disk. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.BootDiskDefaults.DiskImageDefaults image = 3; + * @param \Google\Cloud\VMMigration\V1\BootDiskDefaults\DiskImageDefaults $var + * @return $this + */ + public function setImage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\BootDiskDefaults\DiskImageDefaults::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. The name of the disk. + * + * Generated from protobuf field string disk_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDiskName() + { + return $this->disk_name; + } + + /** + * Optional. The name of the disk. + * + * Generated from protobuf field string disk_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDiskName($var) + { + GPBUtil::checkString($var, True); + $this->disk_name = $var; + + return $this; + } + + /** + * Optional. The type of disk provisioning to use for the VM. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineDiskType disk_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getDiskType() + { + return $this->disk_type; + } + + /** + * Optional. The type of disk provisioning to use for the VM. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineDiskType disk_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setDiskType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\ComputeEngineDiskType::class); + $this->disk_type = $var; + + return $this; + } + + /** + * Optional. Specifies a unique device name of your choice that is reflected + * into the /dev/disk/by-id/google-* tree of a Linux operating system running + * within the instance. If not specified, the server chooses a default device + * name to apply to this disk, in the form persistent-disk-x, where x is a + * number assigned by Google Compute Engine. This field is only applicable for + * persistent disks. + * + * Generated from protobuf field string device_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDeviceName() + { + return $this->device_name; + } + + /** + * Optional. Specifies a unique device name of your choice that is reflected + * into the /dev/disk/by-id/google-* tree of a Linux operating system running + * within the instance. If not specified, the server chooses a default device + * name to apply to this disk, in the form persistent-disk-x, where x is a + * number assigned by Google Compute Engine. This field is only applicable for + * persistent disks. + * + * Generated from protobuf field string device_name = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDeviceName($var) + { + GPBUtil::checkString($var, True); + $this->device_name = $var; + + return $this; + } + + /** + * Optional. The encryption to apply to the boot disk. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\VMMigration\V1\Encryption|null + */ + public function getEncryption() + { + return $this->encryption; + } + + public function hasEncryption() + { + return isset($this->encryption); + } + + public function clearEncryption() + { + unset($this->encryption); + } + + /** + * Optional. The encryption to apply to the boot disk. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\VMMigration\V1\Encryption $var + * @return $this + */ + public function setEncryption($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\Encryption::class); + $this->encryption = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + +} + diff --git a/VmMigration/src/V1/BootDiskDefaults/DiskImageDefaults.php b/VmMigration/src/V1/BootDiskDefaults/DiskImageDefaults.php new file mode 100644 index 000000000000..49df77d44a7d --- /dev/null +++ b/VmMigration/src/V1/BootDiskDefaults/DiskImageDefaults.php @@ -0,0 +1,68 @@ +google.cloud.vmmigration.v1.BootDiskDefaults.DiskImageDefaults + */ +class DiskImageDefaults extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The Image resource used when creating the disk. + * + * Generated from protobuf field string source_image = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $source_image = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $source_image + * Required. The Image resource used when creating the disk. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Required. The Image resource used when creating the disk. + * + * Generated from protobuf field string source_image = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSourceImage() + { + return $this->source_image; + } + + /** + * Required. The Image resource used when creating the disk. + * + * Generated from protobuf field string source_image = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSourceImage($var) + { + GPBUtil::checkString($var, True); + $this->source_image = $var; + + return $this; + } + +} + + diff --git a/VmMigration/src/V1/CancelDiskMigrationJobRequest.php b/VmMigration/src/V1/CancelDiskMigrationJobRequest.php new file mode 100644 index 000000000000..33e99e09a194 --- /dev/null +++ b/VmMigration/src/V1/CancelDiskMigrationJobRequest.php @@ -0,0 +1,67 @@ +google.cloud.vmmigration.v1.CancelDiskMigrationJobRequest + */ +class CancelDiskMigrationJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the DiskMigrationJob. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the DiskMigrationJob. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the DiskMigrationJob. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the DiskMigrationJob. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/CancelDiskMigrationJobResponse.php b/VmMigration/src/V1/CancelDiskMigrationJobResponse.php new file mode 100644 index 000000000000..0fe0cd402312 --- /dev/null +++ b/VmMigration/src/V1/CancelDiskMigrationJobResponse.php @@ -0,0 +1,33 @@ +google.cloud.vmmigration.v1.CancelDiskMigrationJobResponse + */ +class CancelDiskMigrationJobResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + +} + diff --git a/VmMigration/src/V1/CancelImageImportJobRequest.php b/VmMigration/src/V1/CancelImageImportJobRequest.php new file mode 100644 index 000000000000..918dd623d421 --- /dev/null +++ b/VmMigration/src/V1/CancelImageImportJobRequest.php @@ -0,0 +1,81 @@ +google.cloud.vmmigration.v1.CancelImageImportJobRequest + */ +class CancelImageImportJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The image import job id. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The image import job id. Please see + * {@see VmMigrationClient::imageImportJobName()} for help formatting this field. + * + * @return \Google\Cloud\VMMigration\V1\CancelImageImportJobRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The image import job id. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Required. The image import job id. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The image import job id. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/CancelImageImportJobResponse.php b/VmMigration/src/V1/CancelImageImportJobResponse.php new file mode 100644 index 000000000000..3a713004b420 --- /dev/null +++ b/VmMigration/src/V1/CancelImageImportJobResponse.php @@ -0,0 +1,33 @@ +google.cloud.vmmigration.v1.CancelImageImportJobResponse + */ +class CancelImageImportJobResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + +} + diff --git a/VmMigration/src/V1/Client/VmMigrationClient.php b/VmMigration/src/V1/Client/VmMigrationClient.php index d1054cffa28d..0e542912efb8 100644 --- a/VmMigration/src/V1/Client/VmMigrationClient.php +++ b/VmMigration/src/V1/Client/VmMigrationClient.php @@ -40,11 +40,15 @@ use Google\Cloud\VMMigration\V1\AddGroupMigrationRequest; use Google\Cloud\VMMigration\V1\CancelCloneJobRequest; use Google\Cloud\VMMigration\V1\CancelCutoverJobRequest; +use Google\Cloud\VMMigration\V1\CancelDiskMigrationJobRequest; +use Google\Cloud\VMMigration\V1\CancelImageImportJobRequest; use Google\Cloud\VMMigration\V1\CloneJob; use Google\Cloud\VMMigration\V1\CreateCloneJobRequest; use Google\Cloud\VMMigration\V1\CreateCutoverJobRequest; use Google\Cloud\VMMigration\V1\CreateDatacenterConnectorRequest; +use Google\Cloud\VMMigration\V1\CreateDiskMigrationJobRequest; use Google\Cloud\VMMigration\V1\CreateGroupRequest; +use Google\Cloud\VMMigration\V1\CreateImageImportRequest; use Google\Cloud\VMMigration\V1\CreateMigratingVmRequest; use Google\Cloud\VMMigration\V1\CreateSourceRequest; use Google\Cloud\VMMigration\V1\CreateTargetProjectRequest; @@ -52,28 +56,41 @@ use Google\Cloud\VMMigration\V1\CutoverJob; use Google\Cloud\VMMigration\V1\DatacenterConnector; use Google\Cloud\VMMigration\V1\DeleteDatacenterConnectorRequest; +use Google\Cloud\VMMigration\V1\DeleteDiskMigrationJobRequest; use Google\Cloud\VMMigration\V1\DeleteGroupRequest; +use Google\Cloud\VMMigration\V1\DeleteImageImportRequest; use Google\Cloud\VMMigration\V1\DeleteMigratingVmRequest; use Google\Cloud\VMMigration\V1\DeleteSourceRequest; use Google\Cloud\VMMigration\V1\DeleteTargetProjectRequest; use Google\Cloud\VMMigration\V1\DeleteUtilizationReportRequest; +use Google\Cloud\VMMigration\V1\DiskMigrationJob; +use Google\Cloud\VMMigration\V1\ExtendMigrationRequest; use Google\Cloud\VMMigration\V1\FetchInventoryRequest; use Google\Cloud\VMMigration\V1\FetchInventoryResponse; +use Google\Cloud\VMMigration\V1\FetchStorageInventoryRequest; use Google\Cloud\VMMigration\V1\FinalizeMigrationRequest; use Google\Cloud\VMMigration\V1\GetCloneJobRequest; use Google\Cloud\VMMigration\V1\GetCutoverJobRequest; use Google\Cloud\VMMigration\V1\GetDatacenterConnectorRequest; +use Google\Cloud\VMMigration\V1\GetDiskMigrationJobRequest; use Google\Cloud\VMMigration\V1\GetGroupRequest; +use Google\Cloud\VMMigration\V1\GetImageImportJobRequest; +use Google\Cloud\VMMigration\V1\GetImageImportRequest; use Google\Cloud\VMMigration\V1\GetMigratingVmRequest; use Google\Cloud\VMMigration\V1\GetReplicationCycleRequest; use Google\Cloud\VMMigration\V1\GetSourceRequest; use Google\Cloud\VMMigration\V1\GetTargetProjectRequest; use Google\Cloud\VMMigration\V1\GetUtilizationReportRequest; use Google\Cloud\VMMigration\V1\Group; +use Google\Cloud\VMMigration\V1\ImageImport; +use Google\Cloud\VMMigration\V1\ImageImportJob; use Google\Cloud\VMMigration\V1\ListCloneJobsRequest; use Google\Cloud\VMMigration\V1\ListCutoverJobsRequest; use Google\Cloud\VMMigration\V1\ListDatacenterConnectorsRequest; +use Google\Cloud\VMMigration\V1\ListDiskMigrationJobsRequest; use Google\Cloud\VMMigration\V1\ListGroupsRequest; +use Google\Cloud\VMMigration\V1\ListImageImportJobsRequest; +use Google\Cloud\VMMigration\V1\ListImageImportsRequest; use Google\Cloud\VMMigration\V1\ListMigratingVmsRequest; use Google\Cloud\VMMigration\V1\ListReplicationCyclesRequest; use Google\Cloud\VMMigration\V1\ListSourcesRequest; @@ -84,9 +101,11 @@ use Google\Cloud\VMMigration\V1\RemoveGroupMigrationRequest; use Google\Cloud\VMMigration\V1\ReplicationCycle; use Google\Cloud\VMMigration\V1\ResumeMigrationRequest; +use Google\Cloud\VMMigration\V1\RunDiskMigrationJobRequest; use Google\Cloud\VMMigration\V1\Source; use Google\Cloud\VMMigration\V1\StartMigrationRequest; use Google\Cloud\VMMigration\V1\TargetProject; +use Google\Cloud\VMMigration\V1\UpdateDiskMigrationJobRequest; use Google\Cloud\VMMigration\V1\UpdateGroupRequest; use Google\Cloud\VMMigration\V1\UpdateMigratingVmRequest; use Google\Cloud\VMMigration\V1\UpdateSourceRequest; @@ -112,26 +131,37 @@ * @method PromiseInterface addGroupMigrationAsync(AddGroupMigrationRequest $request, array $optionalArgs = []) * @method PromiseInterface cancelCloneJobAsync(CancelCloneJobRequest $request, array $optionalArgs = []) * @method PromiseInterface cancelCutoverJobAsync(CancelCutoverJobRequest $request, array $optionalArgs = []) + * @method PromiseInterface cancelDiskMigrationJobAsync(CancelDiskMigrationJobRequest $request, array $optionalArgs = []) + * @method PromiseInterface cancelImageImportJobAsync(CancelImageImportJobRequest $request, array $optionalArgs = []) * @method PromiseInterface createCloneJobAsync(CreateCloneJobRequest $request, array $optionalArgs = []) * @method PromiseInterface createCutoverJobAsync(CreateCutoverJobRequest $request, array $optionalArgs = []) * @method PromiseInterface createDatacenterConnectorAsync(CreateDatacenterConnectorRequest $request, array $optionalArgs = []) + * @method PromiseInterface createDiskMigrationJobAsync(CreateDiskMigrationJobRequest $request, array $optionalArgs = []) * @method PromiseInterface createGroupAsync(CreateGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface createImageImportAsync(CreateImageImportRequest $request, array $optionalArgs = []) * @method PromiseInterface createMigratingVmAsync(CreateMigratingVmRequest $request, array $optionalArgs = []) * @method PromiseInterface createSourceAsync(CreateSourceRequest $request, array $optionalArgs = []) * @method PromiseInterface createTargetProjectAsync(CreateTargetProjectRequest $request, array $optionalArgs = []) * @method PromiseInterface createUtilizationReportAsync(CreateUtilizationReportRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteDatacenterConnectorAsync(DeleteDatacenterConnectorRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteDiskMigrationJobAsync(DeleteDiskMigrationJobRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteGroupAsync(DeleteGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface deleteImageImportAsync(DeleteImageImportRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteMigratingVmAsync(DeleteMigratingVmRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteSourceAsync(DeleteSourceRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteTargetProjectAsync(DeleteTargetProjectRequest $request, array $optionalArgs = []) * @method PromiseInterface deleteUtilizationReportAsync(DeleteUtilizationReportRequest $request, array $optionalArgs = []) + * @method PromiseInterface extendMigrationAsync(ExtendMigrationRequest $request, array $optionalArgs = []) * @method PromiseInterface fetchInventoryAsync(FetchInventoryRequest $request, array $optionalArgs = []) + * @method PromiseInterface fetchStorageInventoryAsync(FetchStorageInventoryRequest $request, array $optionalArgs = []) * @method PromiseInterface finalizeMigrationAsync(FinalizeMigrationRequest $request, array $optionalArgs = []) * @method PromiseInterface getCloneJobAsync(GetCloneJobRequest $request, array $optionalArgs = []) * @method PromiseInterface getCutoverJobAsync(GetCutoverJobRequest $request, array $optionalArgs = []) * @method PromiseInterface getDatacenterConnectorAsync(GetDatacenterConnectorRequest $request, array $optionalArgs = []) + * @method PromiseInterface getDiskMigrationJobAsync(GetDiskMigrationJobRequest $request, array $optionalArgs = []) * @method PromiseInterface getGroupAsync(GetGroupRequest $request, array $optionalArgs = []) + * @method PromiseInterface getImageImportAsync(GetImageImportRequest $request, array $optionalArgs = []) + * @method PromiseInterface getImageImportJobAsync(GetImageImportJobRequest $request, array $optionalArgs = []) * @method PromiseInterface getMigratingVmAsync(GetMigratingVmRequest $request, array $optionalArgs = []) * @method PromiseInterface getReplicationCycleAsync(GetReplicationCycleRequest $request, array $optionalArgs = []) * @method PromiseInterface getSourceAsync(GetSourceRequest $request, array $optionalArgs = []) @@ -140,7 +170,10 @@ * @method PromiseInterface listCloneJobsAsync(ListCloneJobsRequest $request, array $optionalArgs = []) * @method PromiseInterface listCutoverJobsAsync(ListCutoverJobsRequest $request, array $optionalArgs = []) * @method PromiseInterface listDatacenterConnectorsAsync(ListDatacenterConnectorsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listDiskMigrationJobsAsync(ListDiskMigrationJobsRequest $request, array $optionalArgs = []) * @method PromiseInterface listGroupsAsync(ListGroupsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listImageImportJobsAsync(ListImageImportJobsRequest $request, array $optionalArgs = []) + * @method PromiseInterface listImageImportsAsync(ListImageImportsRequest $request, array $optionalArgs = []) * @method PromiseInterface listMigratingVmsAsync(ListMigratingVmsRequest $request, array $optionalArgs = []) * @method PromiseInterface listReplicationCyclesAsync(ListReplicationCyclesRequest $request, array $optionalArgs = []) * @method PromiseInterface listSourcesAsync(ListSourcesRequest $request, array $optionalArgs = []) @@ -149,7 +182,9 @@ * @method PromiseInterface pauseMigrationAsync(PauseMigrationRequest $request, array $optionalArgs = []) * @method PromiseInterface removeGroupMigrationAsync(RemoveGroupMigrationRequest $request, array $optionalArgs = []) * @method PromiseInterface resumeMigrationAsync(ResumeMigrationRequest $request, array $optionalArgs = []) + * @method PromiseInterface runDiskMigrationJobAsync(RunDiskMigrationJobRequest $request, array $optionalArgs = []) * @method PromiseInterface startMigrationAsync(StartMigrationRequest $request, array $optionalArgs = []) + * @method PromiseInterface updateDiskMigrationJobAsync(UpdateDiskMigrationJobRequest $request, array $optionalArgs = []) * @method PromiseInterface updateGroupAsync(UpdateGroupRequest $request, array $optionalArgs = []) * @method PromiseInterface updateMigratingVmAsync(UpdateMigratingVmRequest $request, array $optionalArgs = []) * @method PromiseInterface updateSourceAsync(UpdateSourceRequest $request, array $optionalArgs = []) @@ -284,6 +319,27 @@ public static function cloneJobName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a crypto_key + * resource. + * + * @param string $project + * @param string $location + * @param string $keyRing + * @param string $cryptoKey + * + * @return string The formatted crypto_key resource. + */ + public static function cryptoKeyName(string $project, string $location, string $keyRing, string $cryptoKey): string + { + return self::getPathTemplate('cryptoKey')->render([ + 'project' => $project, + 'location' => $location, + 'key_ring' => $keyRing, + 'crypto_key' => $cryptoKey, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a cutover_job * resource. @@ -337,6 +393,31 @@ public static function datacenterConnectorName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * disk_migration_job resource. + * + * @param string $project + * @param string $location + * @param string $source + * @param string $diskMigrationJob + * + * @return string The formatted disk_migration_job resource. + */ + public static function diskMigrationJobName( + string $project, + string $location, + string $source, + string $diskMigrationJob + ): string { + return self::getPathTemplate('diskMigrationJob')->render([ + 'project' => $project, + 'location' => $location, + 'source' => $source, + 'disk_migration_job' => $diskMigrationJob, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a group * resource. @@ -356,6 +437,63 @@ public static function groupName(string $project, string $location, string $grou ]); } + /** + * Formats a string containing the fully-qualified path to represent a image + * resource. + * + * @param string $project + * @param string $image + * + * @return string The formatted image resource. + */ + public static function imageName(string $project, string $image): string + { + return self::getPathTemplate('image')->render([ + 'project' => $project, + 'image' => $image, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a image_import + * resource. + * + * @param string $project + * @param string $location + * @param string $job + * + * @return string The formatted image_import resource. + */ + public static function imageImportName(string $project, string $location, string $job): string + { + return self::getPathTemplate('imageImport')->render([ + 'project' => $project, + 'location' => $location, + 'job' => $job, + ]); + } + + /** + * Formats a string containing the fully-qualified path to represent a + * image_import_job resource. + * + * @param string $project + * @param string $location + * @param string $job + * @param string $result + * + * @return string The formatted image_import_job resource. + */ + public static function imageImportJobName(string $project, string $location, string $job, string $result): string + { + return self::getPathTemplate('imageImportJob')->render([ + 'project' => $project, + 'location' => $location, + 'job' => $job, + 'result' => $result, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a location * resource. @@ -426,6 +564,23 @@ public static function replicationCycleName( ]); } + /** + * Formats a string containing the fully-qualified path to represent a + * service_account resource. + * + * @param string $project + * @param string $serviceAccount + * + * @return string The formatted service_account resource. + */ + public static function serviceAccountName(string $project, string $serviceAccount): string + { + return self::getPathTemplate('serviceAccount')->render([ + 'project' => $project, + 'service_account' => $serviceAccount, + ]); + } + /** * Formats a string containing the fully-qualified path to represent a source * resource. @@ -494,12 +649,18 @@ public static function utilizationReportName( * The following name formats are supported: * Template: Pattern * - cloneJob: projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/cloneJobs/{clone_job} + * - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key} * - cutoverJob: projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/cutoverJobs/{cutover_job} * - datacenterConnector: projects/{project}/locations/{location}/sources/{source}/datacenterConnectors/{datacenter_connector} + * - diskMigrationJob: projects/{project}/locations/{location}/sources/{source}/diskMigrationJobs/{disk_migration_job} * - group: projects/{project}/locations/{location}/groups/{group} + * - image: projects/{project}/global/images/{image} + * - imageImport: projects/{project}/locations/{location}/imageImports/{job} + * - imageImportJob: projects/{project}/locations/{location}/imageImports/{job}/imageImportJobs/{result} * - location: projects/{project}/locations/{location} * - migratingVm: projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm} * - replicationCycle: projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/replicationCycles/{replication_cycle} + * - serviceAccount: projects/{project}/serviceAccounts/{service_account} * - source: projects/{project}/locations/{location}/sources/{source} * - targetProject: projects/{project}/locations/{location}/targetProjects/{target_project} * - utilizationReport: projects/{project}/locations/{location}/sources/{source}/utilizationReports/{utilization_report} @@ -681,6 +842,62 @@ public function cancelCutoverJob(CancelCutoverJobRequest $request, array $callOp return $this->startApiCall('CancelCutoverJob', $request, $callOptions)->wait(); } + /** + * Cancels the disk migration job. + * + * The async variant is {@see VmMigrationClient::cancelDiskMigrationJobAsync()} . + * + * @example samples/V1/VmMigrationClient/cancel_disk_migration_job.php + * + * @param CancelDiskMigrationJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function cancelDiskMigrationJob( + CancelDiskMigrationJobRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('CancelDiskMigrationJob', $request, $callOptions)->wait(); + } + + /** + * Initiates the cancellation of a running clone job. + * + * The async variant is {@see VmMigrationClient::cancelImageImportJobAsync()} . + * + * @example samples/V1/VmMigrationClient/cancel_image_import_job.php + * + * @param CancelImageImportJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function cancelImageImportJob( + CancelImageImportJobRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('CancelImageImportJob', $request, $callOptions)->wait(); + } + /** * Initiates a Clone of a specific migrating VM. * @@ -764,6 +981,34 @@ public function createDatacenterConnector( return $this->startApiCall('CreateDatacenterConnector', $request, $callOptions)->wait(); } + /** + * Creates a new disk migration job in a given Source. + * + * The async variant is {@see VmMigrationClient::createDiskMigrationJobAsync()} . + * + * @example samples/V1/VmMigrationClient/create_disk_migration_job.php + * + * @param CreateDiskMigrationJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createDiskMigrationJob( + CreateDiskMigrationJobRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('CreateDiskMigrationJob', $request, $callOptions)->wait(); + } + /** * Creates a new Group in a given project and location. * @@ -790,6 +1035,32 @@ public function createGroup(CreateGroupRequest $request, array $callOptions = [] return $this->startApiCall('CreateGroup', $request, $callOptions)->wait(); } + /** + * Creates a new ImageImport in a given project. + * + * The async variant is {@see VmMigrationClient::createImageImportAsync()} . + * + * @example samples/V1/VmMigrationClient/create_image_import.php + * + * @param CreateImageImportRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function createImageImport(CreateImageImportRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('CreateImageImport', $request, $callOptions)->wait(); + } + /** * Creates a new MigratingVm in a given Source. * @@ -928,6 +1199,34 @@ public function deleteDatacenterConnector( return $this->startApiCall('DeleteDatacenterConnector', $request, $callOptions)->wait(); } + /** + * Deletes a single DiskMigrationJob. + * + * The async variant is {@see VmMigrationClient::deleteDiskMigrationJobAsync()} . + * + * @example samples/V1/VmMigrationClient/delete_disk_migration_job.php + * + * @param DeleteDiskMigrationJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteDiskMigrationJob( + DeleteDiskMigrationJobRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('DeleteDiskMigrationJob', $request, $callOptions)->wait(); + } + /** * Deletes a single Group. * @@ -954,6 +1253,32 @@ public function deleteGroup(DeleteGroupRequest $request, array $callOptions = [] return $this->startApiCall('DeleteGroup', $request, $callOptions)->wait(); } + /** + * Deletes a single ImageImport. + * + * The async variant is {@see VmMigrationClient::deleteImageImportAsync()} . + * + * @example samples/V1/VmMigrationClient/delete_image_import.php + * + * @param DeleteImageImportRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function deleteImageImport(DeleteImageImportRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('DeleteImageImport', $request, $callOptions)->wait(); + } + /** * Deletes a single MigratingVm. * @@ -1063,6 +1388,32 @@ public function deleteUtilizationReport( return $this->startApiCall('DeleteUtilizationReport', $request, $callOptions)->wait(); } + /** + * Extend the migrating VM time to live. + * + * The async variant is {@see VmMigrationClient::extendMigrationAsync()} . + * + * @example samples/V1/VmMigrationClient/extend_migration.php + * + * @param ExtendMigrationRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function extendMigration(ExtendMigrationRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('ExtendMigration', $request, $callOptions)->wait(); + } + /** * List remote source's inventory of VMs. * The remote source is the onprem vCenter (remote in the sense it's not in @@ -1093,6 +1444,39 @@ public function fetchInventory(FetchInventoryRequest $request, array $callOption return $this->startApiCall('FetchInventory', $request, $callOptions)->wait(); } + /** + * List remote source's inventory of storage resources. + * The remote source is another cloud vendor (e.g. AWS, Azure). + * The inventory describes the list of existing storage resources in that + * source. Note that this operation lists the resources on the remote source, + * as opposed to listing the MigratingVms resources in the vmmigration + * service. + * + * The async variant is {@see VmMigrationClient::fetchStorageInventoryAsync()} . + * + * @example samples/V1/VmMigrationClient/fetch_storage_inventory.php + * + * @param FetchStorageInventoryRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function fetchStorageInventory( + FetchStorageInventoryRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('FetchStorageInventory', $request, $callOptions); + } + /** * Marks a migration as completed, deleting migration resources that are no * longer being used. Only applicable after cutover is done. @@ -1200,6 +1584,32 @@ public function getDatacenterConnector( return $this->startApiCall('GetDatacenterConnector', $request, $callOptions)->wait(); } + /** + * Gets details of a single DiskMigrationJob. + * + * The async variant is {@see VmMigrationClient::getDiskMigrationJobAsync()} . + * + * @example samples/V1/VmMigrationClient/get_disk_migration_job.php + * + * @param GetDiskMigrationJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return DiskMigrationJob + * + * @throws ApiException Thrown if the API call fails. + */ + public function getDiskMigrationJob(GetDiskMigrationJobRequest $request, array $callOptions = []): DiskMigrationJob + { + return $this->startApiCall('GetDiskMigrationJob', $request, $callOptions)->wait(); + } + /** * Gets details of a single Group. * @@ -1226,6 +1636,58 @@ public function getGroup(GetGroupRequest $request, array $callOptions = []): Gro return $this->startApiCall('GetGroup', $request, $callOptions)->wait(); } + /** + * Gets details of a single ImageImport. + * + * The async variant is {@see VmMigrationClient::getImageImportAsync()} . + * + * @example samples/V1/VmMigrationClient/get_image_import.php + * + * @param GetImageImportRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ImageImport + * + * @throws ApiException Thrown if the API call fails. + */ + public function getImageImport(GetImageImportRequest $request, array $callOptions = []): ImageImport + { + return $this->startApiCall('GetImageImport', $request, $callOptions)->wait(); + } + + /** + * Gets details of a single ImageImportJob. + * + * The async variant is {@see VmMigrationClient::getImageImportJobAsync()} . + * + * @example samples/V1/VmMigrationClient/get_image_import_job.php + * + * @param GetImageImportJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return ImageImportJob + * + * @throws ApiException Thrown if the API call fails. + */ + public function getImageImportJob(GetImageImportJobRequest $request, array $callOptions = []): ImageImportJob + { + return $this->startApiCall('GetImageImportJob', $request, $callOptions)->wait(); + } + /** * Gets details of a single MigratingVm. * @@ -1362,7 +1824,8 @@ public function getUtilizationReport( } /** - * Lists CloneJobs of a given migrating VM. + * Lists the CloneJobs of a migrating VM. Only 25 most recent CloneJobs are + * listed. * * The async variant is {@see VmMigrationClient::listCloneJobsAsync()} . * @@ -1388,7 +1851,8 @@ public function listCloneJobs(ListCloneJobsRequest $request, array $callOptions } /** - * Lists CutoverJobs of a given migrating VM. + * Lists the CutoverJobs of a migrating VM. Only 25 most recent CutoverJobs + * are listed. * * The async variant is {@see VmMigrationClient::listCutoverJobsAsync()} . * @@ -1441,6 +1905,34 @@ public function listDatacenterConnectors( return $this->startApiCall('ListDatacenterConnectors', $request, $callOptions); } + /** + * Lists DiskMigrationJobs in a given Source. + * + * The async variant is {@see VmMigrationClient::listDiskMigrationJobsAsync()} . + * + * @example samples/V1/VmMigrationClient/list_disk_migration_jobs.php + * + * @param ListDiskMigrationJobsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listDiskMigrationJobs( + ListDiskMigrationJobsRequest $request, + array $callOptions = [] + ): PagedListResponse { + return $this->startApiCall('ListDiskMigrationJobs', $request, $callOptions); + } + /** * Lists Groups in a given project and location. * @@ -1467,6 +1959,58 @@ public function listGroups(ListGroupsRequest $request, array $callOptions = []): return $this->startApiCall('ListGroups', $request, $callOptions); } + /** + * Lists ImageImportJobs in a given project. + * + * The async variant is {@see VmMigrationClient::listImageImportJobsAsync()} . + * + * @example samples/V1/VmMigrationClient/list_image_import_jobs.php + * + * @param ListImageImportJobsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listImageImportJobs(ListImageImportJobsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListImageImportJobs', $request, $callOptions); + } + + /** + * Lists ImageImports in a given project. + * + * The async variant is {@see VmMigrationClient::listImageImportsAsync()} . + * + * @example samples/V1/VmMigrationClient/list_image_imports.php + * + * @param ListImageImportsRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return PagedListResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function listImageImports(ListImageImportsRequest $request, array $callOptions = []): PagedListResponse + { + return $this->startApiCall('ListImageImports', $request, $callOptions); + } + /** * Lists MigratingVms in a given Source. * @@ -1689,6 +2233,32 @@ public function resumeMigration(ResumeMigrationRequest $request, array $callOpti return $this->startApiCall('ResumeMigration', $request, $callOptions)->wait(); } + /** + * Runs the disk migration job. + * + * The async variant is {@see VmMigrationClient::runDiskMigrationJobAsync()} . + * + * @example samples/V1/VmMigrationClient/run_disk_migration_job.php + * + * @param RunDiskMigrationJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function runDiskMigrationJob(RunDiskMigrationJobRequest $request, array $callOptions = []): OperationResponse + { + return $this->startApiCall('RunDiskMigrationJob', $request, $callOptions)->wait(); + } + /** * Starts migration for a VM. Starts the process of uploading * data and creating snapshots, in replication cycles scheduled by the policy. @@ -1716,6 +2286,34 @@ public function startMigration(StartMigrationRequest $request, array $callOption return $this->startApiCall('StartMigration', $request, $callOptions)->wait(); } + /** + * Updates the parameters of a single DiskMigrationJob. + * + * The async variant is {@see VmMigrationClient::updateDiskMigrationJobAsync()} . + * + * @example samples/V1/VmMigrationClient/update_disk_migration_job.php + * + * @param UpdateDiskMigrationJobRequest $request A request to house fields associated with the call. + * @param array $callOptions { + * Optional. + * + * @type RetrySettings|array $retrySettings + * Retry settings to use for this call. Can be a {@see RetrySettings} object, or an + * associative array of retry settings parameters. See the documentation on + * {@see RetrySettings} for example usage. + * } + * + * @return OperationResponse + * + * @throws ApiException Thrown if the API call fails. + */ + public function updateDiskMigrationJob( + UpdateDiskMigrationJobRequest $request, + array $callOptions = [] + ): OperationResponse { + return $this->startApiCall('UpdateDiskMigrationJob', $request, $callOptions)->wait(); + } + /** * Updates the parameters of a single Group. * diff --git a/VmMigration/src/V1/CloneJob.php b/VmMigration/src/V1/CloneJob.php index dd34db7de2c9..bf8700fea7bc 100644 --- a/VmMigration/src/V1/CloneJob.php +++ b/VmMigration/src/V1/CloneJob.php @@ -78,6 +78,8 @@ class CloneJob extends \Google\Protobuf\Internal\Message * * @type \Google\Cloud\VMMigration\V1\ComputeEngineTargetDetails $compute_engine_target_details * Output only. Details of the target VM in Compute Engine. + * @type \Google\Cloud\VMMigration\V1\ComputeEngineDisksTargetDetails $compute_engine_disks_target_details + * Output only. Details of the target Persistent Disks in Compute Engine. * @type \Google\Protobuf\Timestamp $create_time * Output only. The time the clone job was created (as an API call, not when * it was actually created in the target). @@ -132,6 +134,37 @@ public function setComputeEngineTargetDetails($var) return $this; } + /** + * Output only. Details of the target Persistent Disks in Compute Engine. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineDisksTargetDetails compute_engine_disks_target_details = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\VMMigration\V1\ComputeEngineDisksTargetDetails|null + */ + public function getComputeEngineDisksTargetDetails() + { + return $this->readOneof(25); + } + + public function hasComputeEngineDisksTargetDetails() + { + return $this->hasOneof(25); + } + + /** + * Output only. Details of the target Persistent Disks in Compute Engine. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineDisksTargetDetails compute_engine_disks_target_details = 25 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\VMMigration\V1\ComputeEngineDisksTargetDetails $var + * @return $this + */ + public function setComputeEngineDisksTargetDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\ComputeEngineDisksTargetDetails::class); + $this->writeOneof(25, $var); + + return $this; + } + /** * Output only. The time the clone job was created (as an API call, not when * it was actually created in the target). diff --git a/VmMigration/src/V1/ComputeEngineDisk.php b/VmMigration/src/V1/ComputeEngineDisk.php new file mode 100644 index 000000000000..188196a23b44 --- /dev/null +++ b/VmMigration/src/V1/ComputeEngineDisk.php @@ -0,0 +1,193 @@ +google.cloud.vmmigration.v1.ComputeEngineDisk + */ +class ComputeEngineDisk extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Target Compute Engine Disk ID. + * This is the resource ID segment of the Compute Engine Disk to create. + * In the resource name compute/v1/projects/{project}/zones/{zone}/disks/disk1 + * "disk1" is the resource ID for the disk. + * + * Generated from protobuf field string disk_id = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disk_id = ''; + /** + * Required. The Compute Engine zone in which to create the disk. Should be of + * the form: projects/{target-project}/locations/{zone} + * + * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $zone = ''; + /** + * Optional. Replication zones of the regional disk. Should be of the form: + * projects/{target-project}/locations/{replica-zone} + * Currently only one replica zone is supported. + * + * Generated from protobuf field repeated string replica_zones = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + */ + private $replica_zones; + /** + * Required. The disk type to use. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineDiskType disk_type = 4 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk_type = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $disk_id + * Optional. Target Compute Engine Disk ID. + * This is the resource ID segment of the Compute Engine Disk to create. + * In the resource name compute/v1/projects/{project}/zones/{zone}/disks/disk1 + * "disk1" is the resource ID for the disk. + * @type string $zone + * Required. The Compute Engine zone in which to create the disk. Should be of + * the form: projects/{target-project}/locations/{zone} + * @type array|\Google\Protobuf\Internal\RepeatedField $replica_zones + * Optional. Replication zones of the regional disk. Should be of the form: + * projects/{target-project}/locations/{replica-zone} + * Currently only one replica zone is supported. + * @type int $disk_type + * Required. The disk type to use. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Target Compute Engine Disk ID. + * This is the resource ID segment of the Compute Engine Disk to create. + * In the resource name compute/v1/projects/{project}/zones/{zone}/disks/disk1 + * "disk1" is the resource ID for the disk. + * + * Generated from protobuf field string disk_id = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDiskId() + { + return $this->disk_id; + } + + /** + * Optional. Target Compute Engine Disk ID. + * This is the resource ID segment of the Compute Engine Disk to create. + * In the resource name compute/v1/projects/{project}/zones/{zone}/disks/disk1 + * "disk1" is the resource ID for the disk. + * + * Generated from protobuf field string disk_id = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDiskId($var) + { + GPBUtil::checkString($var, True); + $this->disk_id = $var; + + return $this; + } + + /** + * Required. The Compute Engine zone in which to create the disk. Should be of + * the form: projects/{target-project}/locations/{zone} + * + * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getZone() + { + return $this->zone; + } + + /** + * Required. The Compute Engine zone in which to create the disk. Should be of + * the form: projects/{target-project}/locations/{zone} + * + * Generated from protobuf field string zone = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->zone = $var; + + return $this; + } + + /** + * Optional. Replication zones of the regional disk. Should be of the form: + * projects/{target-project}/locations/{replica-zone} + * Currently only one replica zone is supported. + * + * Generated from protobuf field repeated string replica_zones = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getReplicaZones() + { + return $this->replica_zones; + } + + /** + * Optional. Replication zones of the regional disk. Should be of the form: + * projects/{target-project}/locations/{replica-zone} + * Currently only one replica zone is supported. + * + * Generated from protobuf field repeated string replica_zones = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setReplicaZones($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->replica_zones = $arr; + + return $this; + } + + /** + * Required. The disk type to use. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineDiskType disk_type = 4 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getDiskType() + { + return $this->disk_type; + } + + /** + * Required. The disk type to use. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineDiskType disk_type = 4 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setDiskType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\ComputeEngineDiskType::class); + $this->disk_type = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/ComputeEngineDiskType.php b/VmMigration/src/V1/ComputeEngineDiskType.php index 6dd7104b8f4d..4126616e99b2 100644 --- a/VmMigration/src/V1/ComputeEngineDiskType.php +++ b/VmMigration/src/V1/ComputeEngineDiskType.php @@ -38,12 +38,19 @@ class ComputeEngineDiskType * Generated from protobuf enum COMPUTE_ENGINE_DISK_TYPE_BALANCED = 3; */ const COMPUTE_ENGINE_DISK_TYPE_BALANCED = 3; + /** + * Hyperdisk balanced disk type. + * + * Generated from protobuf enum COMPUTE_ENGINE_DISK_TYPE_HYPERDISK_BALANCED = 4; + */ + const COMPUTE_ENGINE_DISK_TYPE_HYPERDISK_BALANCED = 4; private static $valueToName = [ self::COMPUTE_ENGINE_DISK_TYPE_UNSPECIFIED => 'COMPUTE_ENGINE_DISK_TYPE_UNSPECIFIED', self::COMPUTE_ENGINE_DISK_TYPE_STANDARD => 'COMPUTE_ENGINE_DISK_TYPE_STANDARD', self::COMPUTE_ENGINE_DISK_TYPE_SSD => 'COMPUTE_ENGINE_DISK_TYPE_SSD', self::COMPUTE_ENGINE_DISK_TYPE_BALANCED => 'COMPUTE_ENGINE_DISK_TYPE_BALANCED', + self::COMPUTE_ENGINE_DISK_TYPE_HYPERDISK_BALANCED => 'COMPUTE_ENGINE_DISK_TYPE_HYPERDISK_BALANCED', ]; public static function name($value) diff --git a/VmMigration/src/V1/ComputeEngineDisksTargetDefaults.php b/VmMigration/src/V1/ComputeEngineDisksTargetDefaults.php new file mode 100644 index 000000000000..6766a6140667 --- /dev/null +++ b/VmMigration/src/V1/ComputeEngineDisksTargetDefaults.php @@ -0,0 +1,223 @@ +google.cloud.vmmigration.v1.ComputeEngineDisksTargetDefaults + */ +class ComputeEngineDisksTargetDefaults extends \Google\Protobuf\Internal\Message +{ + /** + * The full path of the resource of type TargetProject which represents the + * Compute Engine project in which to create the Persistent Disks. + * + * Generated from protobuf field string target_project = 1 [(.google.api.resource_reference) = { + */ + protected $target_project = ''; + /** + * The details of each Persistent Disk to create. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.PersistentDiskDefaults disks = 4; + */ + private $disks; + protected $location; + protected $vm_target; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $zone + * The zone in which to create the Persistent Disks. + * @type \Google\Cloud\VMMigration\V1\DisksMigrationDisksTargetDefaults $disks_target_defaults + * Details of the disk only migration target. + * @type \Google\Cloud\VMMigration\V1\DisksMigrationVmTargetDefaults $vm_target_defaults + * Details of the VM migration target. + * @type string $target_project + * The full path of the resource of type TargetProject which represents the + * Compute Engine project in which to create the Persistent Disks. + * @type array<\Google\Cloud\VMMigration\V1\PersistentDiskDefaults>|\Google\Protobuf\Internal\RepeatedField $disks + * The details of each Persistent Disk to create. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * The zone in which to create the Persistent Disks. + * + * Generated from protobuf field string zone = 2; + * @return string + */ + public function getZone() + { + return $this->readOneof(2); + } + + public function hasZone() + { + return $this->hasOneof(2); + } + + /** + * The zone in which to create the Persistent Disks. + * + * Generated from protobuf field string zone = 2; + * @param string $var + * @return $this + */ + public function setZone($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Details of the disk only migration target. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.DisksMigrationDisksTargetDefaults disks_target_defaults = 5; + * @return \Google\Cloud\VMMigration\V1\DisksMigrationDisksTargetDefaults|null + */ + public function getDisksTargetDefaults() + { + return $this->readOneof(5); + } + + public function hasDisksTargetDefaults() + { + return $this->hasOneof(5); + } + + /** + * Details of the disk only migration target. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.DisksMigrationDisksTargetDefaults disks_target_defaults = 5; + * @param \Google\Cloud\VMMigration\V1\DisksMigrationDisksTargetDefaults $var + * @return $this + */ + public function setDisksTargetDefaults($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\DisksMigrationDisksTargetDefaults::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Details of the VM migration target. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.DisksMigrationVmTargetDefaults vm_target_defaults = 6; + * @return \Google\Cloud\VMMigration\V1\DisksMigrationVmTargetDefaults|null + */ + public function getVmTargetDefaults() + { + return $this->readOneof(6); + } + + public function hasVmTargetDefaults() + { + return $this->hasOneof(6); + } + + /** + * Details of the VM migration target. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.DisksMigrationVmTargetDefaults vm_target_defaults = 6; + * @param \Google\Cloud\VMMigration\V1\DisksMigrationVmTargetDefaults $var + * @return $this + */ + public function setVmTargetDefaults($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\DisksMigrationVmTargetDefaults::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * The full path of the resource of type TargetProject which represents the + * Compute Engine project in which to create the Persistent Disks. + * + * Generated from protobuf field string target_project = 1 [(.google.api.resource_reference) = { + * @return string + */ + public function getTargetProject() + { + return $this->target_project; + } + + /** + * The full path of the resource of type TargetProject which represents the + * Compute Engine project in which to create the Persistent Disks. + * + * Generated from protobuf field string target_project = 1 [(.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTargetProject($var) + { + GPBUtil::checkString($var, True); + $this->target_project = $var; + + return $this; + } + + /** + * The details of each Persistent Disk to create. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.PersistentDiskDefaults disks = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDisks() + { + return $this->disks; + } + + /** + * The details of each Persistent Disk to create. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.PersistentDiskDefaults disks = 4; + * @param array<\Google\Cloud\VMMigration\V1\PersistentDiskDefaults>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDisks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VMMigration\V1\PersistentDiskDefaults::class); + $this->disks = $arr; + + return $this; + } + + /** + * @return string + */ + public function getLocation() + { + return $this->whichOneof("location"); + } + + /** + * @return string + */ + public function getVmTarget() + { + return $this->whichOneof("vm_target"); + } + +} + diff --git a/VmMigration/src/V1/ComputeEngineDisksTargetDetails.php b/VmMigration/src/V1/ComputeEngineDisksTargetDetails.php new file mode 100644 index 000000000000..de2205fb2a1d --- /dev/null +++ b/VmMigration/src/V1/ComputeEngineDisksTargetDetails.php @@ -0,0 +1,143 @@ +google.cloud.vmmigration.v1.ComputeEngineDisksTargetDetails + */ +class ComputeEngineDisksTargetDetails extends \Google\Protobuf\Internal\Message +{ + /** + * The details of each created Persistent Disk. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.PersistentDisk disks = 1; + */ + private $disks; + protected $vm_target; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\VMMigration\V1\DisksMigrationDisksTargetDetails $disks_target_details + * Details of the disks-only migration target. + * @type \Google\Cloud\VMMigration\V1\DisksMigrationVmTargetDetails $vm_target_details + * Details for the VM the migrated data disks are attached to. + * @type array<\Google\Cloud\VMMigration\V1\PersistentDisk>|\Google\Protobuf\Internal\RepeatedField $disks + * The details of each created Persistent Disk. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Details of the disks-only migration target. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.DisksMigrationDisksTargetDetails disks_target_details = 5; + * @return \Google\Cloud\VMMigration\V1\DisksMigrationDisksTargetDetails|null + */ + public function getDisksTargetDetails() + { + return $this->readOneof(5); + } + + public function hasDisksTargetDetails() + { + return $this->hasOneof(5); + } + + /** + * Details of the disks-only migration target. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.DisksMigrationDisksTargetDetails disks_target_details = 5; + * @param \Google\Cloud\VMMigration\V1\DisksMigrationDisksTargetDetails $var + * @return $this + */ + public function setDisksTargetDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\DisksMigrationDisksTargetDetails::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Details for the VM the migrated data disks are attached to. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.DisksMigrationVmTargetDetails vm_target_details = 6; + * @return \Google\Cloud\VMMigration\V1\DisksMigrationVmTargetDetails|null + */ + public function getVmTargetDetails() + { + return $this->readOneof(6); + } + + public function hasVmTargetDetails() + { + return $this->hasOneof(6); + } + + /** + * Details for the VM the migrated data disks are attached to. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.DisksMigrationVmTargetDetails vm_target_details = 6; + * @param \Google\Cloud\VMMigration\V1\DisksMigrationVmTargetDetails $var + * @return $this + */ + public function setVmTargetDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\DisksMigrationVmTargetDetails::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * The details of each created Persistent Disk. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.PersistentDisk disks = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDisks() + { + return $this->disks; + } + + /** + * The details of each created Persistent Disk. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.PersistentDisk disks = 1; + * @param array<\Google\Cloud\VMMigration\V1\PersistentDisk>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDisks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VMMigration\V1\PersistentDisk::class); + $this->disks = $arr; + + return $this; + } + + /** + * @return string + */ + public function getVmTarget() + { + return $this->whichOneof("vm_target"); + } + +} + diff --git a/VmMigration/src/V1/ComputeEngineNetworkTier.php b/VmMigration/src/V1/ComputeEngineNetworkTier.php new file mode 100644 index 000000000000..d1097ea59490 --- /dev/null +++ b/VmMigration/src/V1/ComputeEngineNetworkTier.php @@ -0,0 +1,62 @@ +google.cloud.vmmigration.v1.ComputeEngineNetworkTier + */ +class ComputeEngineNetworkTier +{ + /** + * An unspecified network tier. Will be used as PREMIUM. + * + * Generated from protobuf enum COMPUTE_ENGINE_NETWORK_TIER_UNSPECIFIED = 0; + */ + const COMPUTE_ENGINE_NETWORK_TIER_UNSPECIFIED = 0; + /** + * A standard network tier. + * + * Generated from protobuf enum NETWORK_TIER_STANDARD = 1; + */ + const NETWORK_TIER_STANDARD = 1; + /** + * A premium network tier. + * + * Generated from protobuf enum NETWORK_TIER_PREMIUM = 2; + */ + const NETWORK_TIER_PREMIUM = 2; + + private static $valueToName = [ + self::COMPUTE_ENGINE_NETWORK_TIER_UNSPECIFIED => 'COMPUTE_ENGINE_NETWORK_TIER_UNSPECIFIED', + self::NETWORK_TIER_STANDARD => 'NETWORK_TIER_STANDARD', + self::NETWORK_TIER_PREMIUM => 'NETWORK_TIER_PREMIUM', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/VmMigration/src/V1/ComputeEngineTargetDefaults.php b/VmMigration/src/V1/ComputeEngineTargetDefaults.php index 2745c0b602a8..1d991762eeac 100644 --- a/VmMigration/src/V1/ComputeEngineTargetDefaults.php +++ b/VmMigration/src/V1/ComputeEngineTargetDefaults.php @@ -48,7 +48,7 @@ class ComputeEngineTargetDefaults extends \Google\Protobuf\Internal\Message */ protected $machine_type = ''; /** - * A map of network tags to associate with the VM. + * A list of network tags to associate with the VM. * * Generated from protobuf field repeated string network_tags = 6; */ @@ -60,9 +60,9 @@ class ComputeEngineTargetDefaults extends \Google\Protobuf\Internal\Message */ private $network_interfaces; /** - * The service account to associate the VM with. + * Optional. The service account to associate the VM with. * - * Generated from protobuf field string service_account = 8; + * Generated from protobuf field string service_account = 8 [(.google.api.field_behavior) = OPTIONAL]; */ protected $service_account = ''; /** @@ -97,13 +97,28 @@ class ComputeEngineTargetDefaults extends \Google\Protobuf\Internal\Message protected $compute_scheduling = null; /** * Defines whether the instance has Secure Boot enabled. - * This can be set to true only if the vm boot option is EFI. + * This can be set to true only if the VM boot option is EFI. * * Generated from protobuf field bool secure_boot = 14; */ protected $secure_boot = false; /** - * Output only. The VM Boot Option, as set in the source vm. + * Optional. Defines whether the instance has vTPM enabled. + * This can be set to true only if the VM boot option is EFI. + * + * Generated from protobuf field bool enable_vtpm = 21 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_vtpm = false; + /** + * Optional. Defines whether the instance has integrity monitoring enabled. + * This can be set to true only if the VM boot option is EFI, and vTPM is + * enabled. + * + * Generated from protobuf field bool enable_integrity_monitoring = 22 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_integrity_monitoring = false; + /** + * Output only. The VM Boot Option, as set in the source VM. * * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineBootOption boot_option = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ @@ -126,6 +141,34 @@ class ComputeEngineTargetDefaults extends \Google\Protobuf\Internal\Message * Generated from protobuf field string hostname = 18; */ protected $hostname = ''; + /** + * Optional. Immutable. The encryption to apply to the VM disks. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 19 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $encryption = null; + /** + * Optional. By default the virtual machine will keep its existing boot + * option. Setting this property will trigger an internal process which will + * convert the virtual machine from using the existing boot option to another. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.BootConversion boot_conversion = 20 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $boot_conversion = 0; + /** + * Optional. Additional replica zones of the target regional disks. + * If this list is not empty a regional disk will be created. The first + * supported zone would be the one stated in the + * [zone][google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.zone] field. + * The rest are taken from this list. Please refer to the [regional disk + * creation + * API](https://cloud.google.com/compute/docs/regions-zones/global-regional-zonal-resources) + * for further details about regional vs zonal disks. If not specified, a + * zonal disk will be created in the same zone the VM is created. + * + * Generated from protobuf field repeated string disk_replica_zones = 24 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $disk_replica_zones; /** * Constructor. @@ -145,11 +188,11 @@ class ComputeEngineTargetDefaults extends \Google\Protobuf\Internal\Message * @type string $machine_type * The machine type to create the VM with. * @type array|\Google\Protobuf\Internal\RepeatedField $network_tags - * A map of network tags to associate with the VM. + * A list of network tags to associate with the VM. * @type array<\Google\Cloud\VMMigration\V1\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $network_interfaces * List of NICs connected to this VM. * @type string $service_account - * The service account to associate the VM with. + * Optional. The service account to associate the VM with. * @type int $disk_type * The disk type to use in the VM. * @type array|\Google\Protobuf\Internal\MapField $labels @@ -162,15 +205,38 @@ class ComputeEngineTargetDefaults extends \Google\Protobuf\Internal\Message * Compute instance scheduling information (if empty default is used). * @type bool $secure_boot * Defines whether the instance has Secure Boot enabled. - * This can be set to true only if the vm boot option is EFI. + * This can be set to true only if the VM boot option is EFI. + * @type bool $enable_vtpm + * Optional. Defines whether the instance has vTPM enabled. + * This can be set to true only if the VM boot option is EFI. + * @type bool $enable_integrity_monitoring + * Optional. Defines whether the instance has integrity monitoring enabled. + * This can be set to true only if the VM boot option is EFI, and vTPM is + * enabled. * @type int $boot_option - * Output only. The VM Boot Option, as set in the source vm. + * Output only. The VM Boot Option, as set in the source VM. * @type array|\Google\Protobuf\Internal\MapField $metadata * The metadata key/value pairs to assign to the VM. * @type array|\Google\Protobuf\Internal\RepeatedField $additional_licenses * Additional licenses to assign to the VM. * @type string $hostname * The hostname to assign to the VM. + * @type \Google\Cloud\VMMigration\V1\Encryption $encryption + * Optional. Immutable. The encryption to apply to the VM disks. + * @type int $boot_conversion + * Optional. By default the virtual machine will keep its existing boot + * option. Setting this property will trigger an internal process which will + * convert the virtual machine from using the existing boot option to another. + * @type array|\Google\Protobuf\Internal\RepeatedField $disk_replica_zones + * Optional. Additional replica zones of the target regional disks. + * If this list is not empty a regional disk will be created. The first + * supported zone would be the one stated in the + * [zone][google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.zone] field. + * The rest are taken from this list. Please refer to the [regional disk + * creation + * API](https://cloud.google.com/compute/docs/regions-zones/global-regional-zonal-resources) + * for further details about regional vs zonal disks. If not specified, a + * zonal disk will be created in the same zone the VM is created. * } */ public function __construct($data = NULL) { @@ -311,7 +377,7 @@ public function setMachineType($var) } /** - * A map of network tags to associate with the VM. + * A list of network tags to associate with the VM. * * Generated from protobuf field repeated string network_tags = 6; * @return \Google\Protobuf\Internal\RepeatedField @@ -322,7 +388,7 @@ public function getNetworkTags() } /** - * A map of network tags to associate with the VM. + * A list of network tags to associate with the VM. * * Generated from protobuf field repeated string network_tags = 6; * @param array|\Google\Protobuf\Internal\RepeatedField $var @@ -363,9 +429,9 @@ public function setNetworkInterfaces($var) } /** - * The service account to associate the VM with. + * Optional. The service account to associate the VM with. * - * Generated from protobuf field string service_account = 8; + * Generated from protobuf field string service_account = 8 [(.google.api.field_behavior) = OPTIONAL]; * @return string */ public function getServiceAccount() @@ -374,9 +440,9 @@ public function getServiceAccount() } /** - * The service account to associate the VM with. + * Optional. The service account to associate the VM with. * - * Generated from protobuf field string service_account = 8; + * Generated from protobuf field string service_account = 8 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var * @return $this */ @@ -540,7 +606,7 @@ public function setComputeScheduling($var) /** * Defines whether the instance has Secure Boot enabled. - * This can be set to true only if the vm boot option is EFI. + * This can be set to true only if the VM boot option is EFI. * * Generated from protobuf field bool secure_boot = 14; * @return bool @@ -552,7 +618,7 @@ public function getSecureBoot() /** * Defines whether the instance has Secure Boot enabled. - * This can be set to true only if the vm boot option is EFI. + * This can be set to true only if the VM boot option is EFI. * * Generated from protobuf field bool secure_boot = 14; * @param bool $var @@ -567,7 +633,65 @@ public function setSecureBoot($var) } /** - * Output only. The VM Boot Option, as set in the source vm. + * Optional. Defines whether the instance has vTPM enabled. + * This can be set to true only if the VM boot option is EFI. + * + * Generated from protobuf field bool enable_vtpm = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableVtpm() + { + return $this->enable_vtpm; + } + + /** + * Optional. Defines whether the instance has vTPM enabled. + * This can be set to true only if the VM boot option is EFI. + * + * Generated from protobuf field bool enable_vtpm = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableVtpm($var) + { + GPBUtil::checkBool($var); + $this->enable_vtpm = $var; + + return $this; + } + + /** + * Optional. Defines whether the instance has integrity monitoring enabled. + * This can be set to true only if the VM boot option is EFI, and vTPM is + * enabled. + * + * Generated from protobuf field bool enable_integrity_monitoring = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableIntegrityMonitoring() + { + return $this->enable_integrity_monitoring; + } + + /** + * Optional. Defines whether the instance has integrity monitoring enabled. + * This can be set to true only if the VM boot option is EFI, and vTPM is + * enabled. + * + * Generated from protobuf field bool enable_integrity_monitoring = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableIntegrityMonitoring($var) + { + GPBUtil::checkBool($var); + $this->enable_integrity_monitoring = $var; + + return $this; + } + + /** + * Output only. The VM Boot Option, as set in the source VM. * * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineBootOption boot_option = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return int @@ -578,7 +702,7 @@ public function getBootOption() } /** - * Output only. The VM Boot Option, as set in the source vm. + * Output only. The VM Boot Option, as set in the source VM. * * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineBootOption boot_option = 15 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param int $var @@ -670,5 +794,113 @@ public function setHostname($var) return $this; } + /** + * Optional. Immutable. The encryption to apply to the VM disks. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 19 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\VMMigration\V1\Encryption|null + */ + public function getEncryption() + { + return $this->encryption; + } + + public function hasEncryption() + { + return isset($this->encryption); + } + + public function clearEncryption() + { + unset($this->encryption); + } + + /** + * Optional. Immutable. The encryption to apply to the VM disks. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 19 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\VMMigration\V1\Encryption $var + * @return $this + */ + public function setEncryption($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\Encryption::class); + $this->encryption = $var; + + return $this; + } + + /** + * Optional. By default the virtual machine will keep its existing boot + * option. Setting this property will trigger an internal process which will + * convert the virtual machine from using the existing boot option to another. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.BootConversion boot_conversion = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getBootConversion() + { + return $this->boot_conversion; + } + + /** + * Optional. By default the virtual machine will keep its existing boot + * option. Setting this property will trigger an internal process which will + * convert the virtual machine from using the existing boot option to another. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.BootConversion boot_conversion = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setBootConversion($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\BootConversion::class); + $this->boot_conversion = $var; + + return $this; + } + + /** + * Optional. Additional replica zones of the target regional disks. + * If this list is not empty a regional disk will be created. The first + * supported zone would be the one stated in the + * [zone][google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.zone] field. + * The rest are taken from this list. Please refer to the [regional disk + * creation + * API](https://cloud.google.com/compute/docs/regions-zones/global-regional-zonal-resources) + * for further details about regional vs zonal disks. If not specified, a + * zonal disk will be created in the same zone the VM is created. + * + * Generated from protobuf field repeated string disk_replica_zones = 24 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDiskReplicaZones() + { + return $this->disk_replica_zones; + } + + /** + * Optional. Additional replica zones of the target regional disks. + * If this list is not empty a regional disk will be created. The first + * supported zone would be the one stated in the + * [zone][google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.zone] field. + * The rest are taken from this list. Please refer to the [regional disk + * creation + * API](https://cloud.google.com/compute/docs/regions-zones/global-regional-zonal-resources) + * for further details about regional vs zonal disks. If not specified, a + * zonal disk will be created in the same zone the VM is created. + * + * Generated from protobuf field repeated string disk_replica_zones = 24 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDiskReplicaZones($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->disk_replica_zones = $arr; + + return $this; + } + } diff --git a/VmMigration/src/V1/ComputeEngineTargetDetails.php b/VmMigration/src/V1/ComputeEngineTargetDetails.php index aaca78c78818..c014aa71e572 100644 --- a/VmMigration/src/V1/ComputeEngineTargetDetails.php +++ b/VmMigration/src/V1/ComputeEngineTargetDetails.php @@ -47,7 +47,7 @@ class ComputeEngineTargetDetails extends \Google\Protobuf\Internal\Message */ protected $machine_type = ''; /** - * A map of network tags to associate with the VM. + * A list of network tags to associate with the VM. * * Generated from protobuf field repeated string network_tags = 6; */ @@ -96,13 +96,25 @@ class ComputeEngineTargetDetails extends \Google\Protobuf\Internal\Message protected $compute_scheduling = null; /** * Defines whether the instance has Secure Boot enabled. - * This can be set to true only if the vm boot option is EFI. + * This can be set to true only if the VM boot option is EFI. * * Generated from protobuf field bool secure_boot = 14; */ protected $secure_boot = false; /** - * The VM Boot Option, as set in the source vm. + * Optional. Defines whether the instance has vTPM enabled. + * + * Generated from protobuf field bool enable_vtpm = 21 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_vtpm = false; + /** + * Optional. Defines whether the instance has integrity monitoring enabled. + * + * Generated from protobuf field bool enable_integrity_monitoring = 22 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_integrity_monitoring = false; + /** + * The VM Boot Option, as set in the source VM. * * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineBootOption boot_option = 15; */ @@ -125,6 +137,34 @@ class ComputeEngineTargetDetails extends \Google\Protobuf\Internal\Message * Generated from protobuf field string hostname = 18; */ protected $hostname = ''; + /** + * Optional. The encryption to apply to the VM disks. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 19 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $encryption = null; + /** + * Optional. By default the virtual machine will keep its existing boot + * option. Setting this property will trigger an internal process which will + * convert the virtual machine from using the existing boot option to another. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.BootConversion boot_conversion = 20 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $boot_conversion = 0; + /** + * Optional. Additional replica zones of the target regional disks. + * If this list is not empty a regional disk will be created. The first + * supported zone would be the one stated in the + * [zone][google.cloud.vmmigration.v1.ComputeEngineTargetDetails.zone] field. + * The rest are taken from this list. Please refer to the [regional disk + * creation + * API](https://cloud.google.com/compute/docs/regions-zones/global-regional-zonal-resources) + * for further details about regional vs zonal disks. If not specified, a + * zonal disk will be created in the same zone the VM is created. + * + * Generated from protobuf field repeated string disk_replica_zones = 24 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $disk_replica_zones; /** * Constructor. @@ -143,7 +183,7 @@ class ComputeEngineTargetDetails extends \Google\Protobuf\Internal\Message * @type string $machine_type * The machine type to create the VM with. * @type array|\Google\Protobuf\Internal\RepeatedField $network_tags - * A map of network tags to associate with the VM. + * A list of network tags to associate with the VM. * @type array<\Google\Cloud\VMMigration\V1\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $network_interfaces * List of NICs connected to this VM. * @type string $service_account @@ -160,15 +200,35 @@ class ComputeEngineTargetDetails extends \Google\Protobuf\Internal\Message * Compute instance scheduling information (if empty default is used). * @type bool $secure_boot * Defines whether the instance has Secure Boot enabled. - * This can be set to true only if the vm boot option is EFI. + * This can be set to true only if the VM boot option is EFI. + * @type bool $enable_vtpm + * Optional. Defines whether the instance has vTPM enabled. + * @type bool $enable_integrity_monitoring + * Optional. Defines whether the instance has integrity monitoring enabled. * @type int $boot_option - * The VM Boot Option, as set in the source vm. + * The VM Boot Option, as set in the source VM. * @type array|\Google\Protobuf\Internal\MapField $metadata * The metadata key/value pairs to assign to the VM. * @type array|\Google\Protobuf\Internal\RepeatedField $additional_licenses * Additional licenses to assign to the VM. * @type string $hostname * The hostname to assign to the VM. + * @type \Google\Cloud\VMMigration\V1\Encryption $encryption + * Optional. The encryption to apply to the VM disks. + * @type int $boot_conversion + * Optional. By default the virtual machine will keep its existing boot + * option. Setting this property will trigger an internal process which will + * convert the virtual machine from using the existing boot option to another. + * @type array|\Google\Protobuf\Internal\RepeatedField $disk_replica_zones + * Optional. Additional replica zones of the target regional disks. + * If this list is not empty a regional disk will be created. The first + * supported zone would be the one stated in the + * [zone][google.cloud.vmmigration.v1.ComputeEngineTargetDetails.zone] field. + * The rest are taken from this list. Please refer to the [regional disk + * creation + * API](https://cloud.google.com/compute/docs/regions-zones/global-regional-zonal-resources) + * for further details about regional vs zonal disks. If not specified, a + * zonal disk will be created in the same zone the VM is created. * } */ public function __construct($data = NULL) { @@ -307,7 +367,7 @@ public function setMachineType($var) } /** - * A map of network tags to associate with the VM. + * A list of network tags to associate with the VM. * * Generated from protobuf field repeated string network_tags = 6; * @return \Google\Protobuf\Internal\RepeatedField @@ -318,7 +378,7 @@ public function getNetworkTags() } /** - * A map of network tags to associate with the VM. + * A list of network tags to associate with the VM. * * Generated from protobuf field repeated string network_tags = 6; * @param array|\Google\Protobuf\Internal\RepeatedField $var @@ -536,7 +596,7 @@ public function setComputeScheduling($var) /** * Defines whether the instance has Secure Boot enabled. - * This can be set to true only if the vm boot option is EFI. + * This can be set to true only if the VM boot option is EFI. * * Generated from protobuf field bool secure_boot = 14; * @return bool @@ -548,7 +608,7 @@ public function getSecureBoot() /** * Defines whether the instance has Secure Boot enabled. - * This can be set to true only if the vm boot option is EFI. + * This can be set to true only if the VM boot option is EFI. * * Generated from protobuf field bool secure_boot = 14; * @param bool $var @@ -563,7 +623,59 @@ public function setSecureBoot($var) } /** - * The VM Boot Option, as set in the source vm. + * Optional. Defines whether the instance has vTPM enabled. + * + * Generated from protobuf field bool enable_vtpm = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableVtpm() + { + return $this->enable_vtpm; + } + + /** + * Optional. Defines whether the instance has vTPM enabled. + * + * Generated from protobuf field bool enable_vtpm = 21 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableVtpm($var) + { + GPBUtil::checkBool($var); + $this->enable_vtpm = $var; + + return $this; + } + + /** + * Optional. Defines whether the instance has integrity monitoring enabled. + * + * Generated from protobuf field bool enable_integrity_monitoring = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableIntegrityMonitoring() + { + return $this->enable_integrity_monitoring; + } + + /** + * Optional. Defines whether the instance has integrity monitoring enabled. + * + * Generated from protobuf field bool enable_integrity_monitoring = 22 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableIntegrityMonitoring($var) + { + GPBUtil::checkBool($var); + $this->enable_integrity_monitoring = $var; + + return $this; + } + + /** + * The VM Boot Option, as set in the source VM. * * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineBootOption boot_option = 15; * @return int @@ -574,7 +686,7 @@ public function getBootOption() } /** - * The VM Boot Option, as set in the source vm. + * The VM Boot Option, as set in the source VM. * * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineBootOption boot_option = 15; * @param int $var @@ -666,5 +778,113 @@ public function setHostname($var) return $this; } + /** + * Optional. The encryption to apply to the VM disks. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\VMMigration\V1\Encryption|null + */ + public function getEncryption() + { + return $this->encryption; + } + + public function hasEncryption() + { + return isset($this->encryption); + } + + public function clearEncryption() + { + unset($this->encryption); + } + + /** + * Optional. The encryption to apply to the VM disks. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 19 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\VMMigration\V1\Encryption $var + * @return $this + */ + public function setEncryption($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\Encryption::class); + $this->encryption = $var; + + return $this; + } + + /** + * Optional. By default the virtual machine will keep its existing boot + * option. Setting this property will trigger an internal process which will + * convert the virtual machine from using the existing boot option to another. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.BootConversion boot_conversion = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getBootConversion() + { + return $this->boot_conversion; + } + + /** + * Optional. By default the virtual machine will keep its existing boot + * option. Setting this property will trigger an internal process which will + * convert the virtual machine from using the existing boot option to another. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.BootConversion boot_conversion = 20 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setBootConversion($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\BootConversion::class); + $this->boot_conversion = $var; + + return $this; + } + + /** + * Optional. Additional replica zones of the target regional disks. + * If this list is not empty a regional disk will be created. The first + * supported zone would be the one stated in the + * [zone][google.cloud.vmmigration.v1.ComputeEngineTargetDetails.zone] field. + * The rest are taken from this list. Please refer to the [regional disk + * creation + * API](https://cloud.google.com/compute/docs/regions-zones/global-regional-zonal-resources) + * for further details about regional vs zonal disks. If not specified, a + * zonal disk will be created in the same zone the VM is created. + * + * Generated from protobuf field repeated string disk_replica_zones = 24 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDiskReplicaZones() + { + return $this->disk_replica_zones; + } + + /** + * Optional. Additional replica zones of the target regional disks. + * If this list is not empty a regional disk will be created. The first + * supported zone would be the one stated in the + * [zone][google.cloud.vmmigration.v1.ComputeEngineTargetDetails.zone] field. + * The rest are taken from this list. Please refer to the [regional disk + * creation + * API](https://cloud.google.com/compute/docs/regions-zones/global-regional-zonal-resources) + * for further details about regional vs zonal disks. If not specified, a + * zonal disk will be created in the same zone the VM is created. + * + * Generated from protobuf field repeated string disk_replica_zones = 24 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDiskReplicaZones($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->disk_replica_zones = $arr; + + return $this; + } + } diff --git a/VmMigration/src/V1/ComputeScheduling.php b/VmMigration/src/V1/ComputeScheduling.php index bc30aaa06e34..2c038f9ccb9c 100644 --- a/VmMigration/src/V1/ComputeScheduling.php +++ b/VmMigration/src/V1/ComputeScheduling.php @@ -11,6 +11,8 @@ /** * Scheduling information for VM on maintenance/restart behaviour and * node allocation in sole tenant nodes. + * Options for instance behavior when the host machine undergoes + * maintenance that may temporarily impact instance performance. * * Generated from protobuf message google.cloud.vmmigration.v1.ComputeScheduling */ diff --git a/VmMigration/src/V1/CopyingSourceDiskSnapshotStep.php b/VmMigration/src/V1/CopyingSourceDiskSnapshotStep.php new file mode 100644 index 000000000000..82517363cd5e --- /dev/null +++ b/VmMigration/src/V1/CopyingSourceDiskSnapshotStep.php @@ -0,0 +1,33 @@ +google.cloud.vmmigration.v1.CopyingSourceDiskSnapshotStep + */ +class CopyingSourceDiskSnapshotStep extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + +} + diff --git a/VmMigration/src/V1/CreateCloneJobRequest.php b/VmMigration/src/V1/CreateCloneJobRequest.php index 41851b8961e2..119c3418d7ff 100644 --- a/VmMigration/src/V1/CreateCloneJobRequest.php +++ b/VmMigration/src/V1/CreateCloneJobRequest.php @@ -38,8 +38,8 @@ class CreateCloneJobRequest extends \Google\Protobuf\Internal\Message * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -85,8 +85,8 @@ public static function build(string $parent, \Google\Cloud\VMMigration\V1\CloneJ * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -192,8 +192,8 @@ public function setCloneJob($var) * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -213,8 +213,8 @@ public function getRequestId() * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/VmMigration/src/V1/CreateCutoverJobRequest.php b/VmMigration/src/V1/CreateCutoverJobRequest.php index ca9cc7598345..041fd4c6d145 100644 --- a/VmMigration/src/V1/CreateCutoverJobRequest.php +++ b/VmMigration/src/V1/CreateCutoverJobRequest.php @@ -38,8 +38,8 @@ class CreateCutoverJobRequest extends \Google\Protobuf\Internal\Message * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -85,8 +85,8 @@ public static function build(string $parent, \Google\Cloud\VMMigration\V1\Cutove * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -192,8 +192,8 @@ public function setCutoverJob($var) * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -213,8 +213,8 @@ public function getRequestId() * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/VmMigration/src/V1/CreateDatacenterConnectorRequest.php b/VmMigration/src/V1/CreateDatacenterConnectorRequest.php index ec4aaf84d99f..06e5d91a6460 100644 --- a/VmMigration/src/V1/CreateDatacenterConnectorRequest.php +++ b/VmMigration/src/V1/CreateDatacenterConnectorRequest.php @@ -41,8 +41,8 @@ class CreateDatacenterConnectorRequest extends \Google\Protobuf\Internal\Message * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -94,8 +94,8 @@ public static function build(string $parent, \Google\Cloud\VMMigration\V1\Datace * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -207,8 +207,8 @@ public function setDatacenterConnector($var) * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -228,8 +228,8 @@ public function getRequestId() * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/VmMigration/src/V1/CreateDiskMigrationJobRequest.php b/VmMigration/src/V1/CreateDiskMigrationJobRequest.php new file mode 100644 index 000000000000..7539c64666a6 --- /dev/null +++ b/VmMigration/src/V1/CreateDiskMigrationJobRequest.php @@ -0,0 +1,252 @@ +google.cloud.vmmigration.v1.CreateDiskMigrationJobRequest + */ +class CreateDiskMigrationJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The DiskMigrationJob's parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The DiskMigrationJob identifier. + * The maximum length of this value is 63 characters. + * Valid characters are lower case Latin letters, digits and hyphen. + * It must start with a Latin letter and must not end with a hyphen. + * + * Generated from protobuf field string disk_migration_job_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk_migration_job_id = ''; + /** + * Required. The create request body. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.DiskMigrationJob disk_migration_job = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk_migration_job = null; + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request timed out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param string $parent Required. The DiskMigrationJob's parent. Please see + * {@see VmMigrationClient::sourceName()} for help formatting this field. + * @param \Google\Cloud\VMMigration\V1\DiskMigrationJob $diskMigrationJob Required. The create request body. + * @param string $diskMigrationJobId Required. The DiskMigrationJob identifier. + * The maximum length of this value is 63 characters. + * Valid characters are lower case Latin letters, digits and hyphen. + * It must start with a Latin letter and must not end with a hyphen. + * + * @return \Google\Cloud\VMMigration\V1\CreateDiskMigrationJobRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\VMMigration\V1\DiskMigrationJob $diskMigrationJob, string $diskMigrationJobId): self + { + return (new self()) + ->setParent($parent) + ->setDiskMigrationJob($diskMigrationJob) + ->setDiskMigrationJobId($diskMigrationJobId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The DiskMigrationJob's parent. + * @type string $disk_migration_job_id + * Required. The DiskMigrationJob identifier. + * The maximum length of this value is 63 characters. + * Valid characters are lower case Latin letters, digits and hyphen. + * It must start with a Latin letter and must not end with a hyphen. + * @type \Google\Cloud\VMMigration\V1\DiskMigrationJob $disk_migration_job + * Required. The create request body. + * @type string $request_id + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request timed out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Required. The DiskMigrationJob's parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The DiskMigrationJob's parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The DiskMigrationJob identifier. + * The maximum length of this value is 63 characters. + * Valid characters are lower case Latin letters, digits and hyphen. + * It must start with a Latin letter and must not end with a hyphen. + * + * Generated from protobuf field string disk_migration_job_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getDiskMigrationJobId() + { + return $this->disk_migration_job_id; + } + + /** + * Required. The DiskMigrationJob identifier. + * The maximum length of this value is 63 characters. + * Valid characters are lower case Latin letters, digits and hyphen. + * It must start with a Latin letter and must not end with a hyphen. + * + * Generated from protobuf field string disk_migration_job_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setDiskMigrationJobId($var) + { + GPBUtil::checkString($var, True); + $this->disk_migration_job_id = $var; + + return $this; + } + + /** + * Required. The create request body. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.DiskMigrationJob disk_migration_job = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\VMMigration\V1\DiskMigrationJob|null + */ + public function getDiskMigrationJob() + { + return $this->disk_migration_job; + } + + public function hasDiskMigrationJob() + { + return isset($this->disk_migration_job); + } + + public function clearDiskMigrationJob() + { + unset($this->disk_migration_job); + } + + /** + * Required. The create request body. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.DiskMigrationJob disk_migration_job = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\VMMigration\V1\DiskMigrationJob $var + * @return $this + */ + public function setDiskMigrationJob($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\DiskMigrationJob::class); + $this->disk_migration_job = $var; + + return $this; + } + + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request timed out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request timed out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/CreateGroupRequest.php b/VmMigration/src/V1/CreateGroupRequest.php index de9bfaea8932..6364b1934cb1 100644 --- a/VmMigration/src/V1/CreateGroupRequest.php +++ b/VmMigration/src/V1/CreateGroupRequest.php @@ -38,8 +38,8 @@ class CreateGroupRequest extends \Google\Protobuf\Internal\Message * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -85,8 +85,8 @@ public static function build(string $parent, \Google\Cloud\VMMigration\V1\Group * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -192,8 +192,8 @@ public function setGroup($var) * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -213,8 +213,8 @@ public function getRequestId() * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/VmMigration/src/V1/CreateImageImportRequest.php b/VmMigration/src/V1/CreateImageImportRequest.php new file mode 100644 index 000000000000..934b71d47be6 --- /dev/null +++ b/VmMigration/src/V1/CreateImageImportRequest.php @@ -0,0 +1,252 @@ +google.cloud.vmmigration.v1.CreateImageImportRequest + */ +class CreateImageImportRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The ImageImport's parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Required. The image import identifier. + * This value maximum length is 63 characters, and valid characters are + * /[a-z][0-9]-/. It must start with an english letter and must not end with a + * hyphen. + * + * Generated from protobuf field string image_import_id = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $image_import_id = ''; + /** + * Required. The create request body. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ImageImport image_import = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $image_import = null; + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $parent Required. The ImageImport's parent. Please see + * {@see VmMigrationClient::locationName()} for help formatting this field. + * @param \Google\Cloud\VMMigration\V1\ImageImport $imageImport Required. The create request body. + * @param string $imageImportId Required. The image import identifier. + * This value maximum length is 63 characters, and valid characters are + * /[a-z][0-9]-/. It must start with an english letter and must not end with a + * hyphen. + * + * @return \Google\Cloud\VMMigration\V1\CreateImageImportRequest + * + * @experimental + */ + public static function build(string $parent, \Google\Cloud\VMMigration\V1\ImageImport $imageImport, string $imageImportId): self + { + return (new self()) + ->setParent($parent) + ->setImageImport($imageImport) + ->setImageImportId($imageImportId); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The ImageImport's parent. + * @type string $image_import_id + * Required. The image import identifier. + * This value maximum length is 63 characters, and valid characters are + * /[a-z][0-9]-/. It must start with an english letter and must not end with a + * hyphen. + * @type \Google\Cloud\VMMigration\V1\ImageImport $image_import + * Required. The create request body. + * @type string $request_id + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Required. The ImageImport's parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The ImageImport's parent. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Required. The image import identifier. + * This value maximum length is 63 characters, and valid characters are + * /[a-z][0-9]-/. It must start with an english letter and must not end with a + * hyphen. + * + * Generated from protobuf field string image_import_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getImageImportId() + { + return $this->image_import_id; + } + + /** + * Required. The image import identifier. + * This value maximum length is 63 characters, and valid characters are + * /[a-z][0-9]-/. It must start with an english letter and must not end with a + * hyphen. + * + * Generated from protobuf field string image_import_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setImageImportId($var) + { + GPBUtil::checkString($var, True); + $this->image_import_id = $var; + + return $this; + } + + /** + * Required. The create request body. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ImageImport image_import = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\VMMigration\V1\ImageImport|null + */ + public function getImageImport() + { + return $this->image_import; + } + + public function hasImageImport() + { + return isset($this->image_import); + } + + public function clearImageImport() + { + unset($this->image_import); + } + + /** + * Required. The create request body. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ImageImport image_import = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\VMMigration\V1\ImageImport $var + * @return $this + */ + public function setImageImport($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\ImageImport::class); + $this->image_import = $var; + + return $this; + } + + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/CreateMigratingVmRequest.php b/VmMigration/src/V1/CreateMigratingVmRequest.php index c12c649f5023..58176266340b 100644 --- a/VmMigration/src/V1/CreateMigratingVmRequest.php +++ b/VmMigration/src/V1/CreateMigratingVmRequest.php @@ -38,8 +38,8 @@ class CreateMigratingVmRequest extends \Google\Protobuf\Internal\Message * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -85,8 +85,8 @@ public static function build(string $parent, \Google\Cloud\VMMigration\V1\Migrat * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -192,8 +192,8 @@ public function setMigratingVm($var) * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -213,8 +213,8 @@ public function getRequestId() * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/VmMigration/src/V1/CreateSourceRequest.php b/VmMigration/src/V1/CreateSourceRequest.php index 525bb5819b4a..1ead753254f4 100644 --- a/VmMigration/src/V1/CreateSourceRequest.php +++ b/VmMigration/src/V1/CreateSourceRequest.php @@ -38,8 +38,8 @@ class CreateSourceRequest extends \Google\Protobuf\Internal\Message * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -85,8 +85,8 @@ public static function build(string $parent, \Google\Cloud\VMMigration\V1\Source * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -192,8 +192,8 @@ public function setSource($var) * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -213,8 +213,8 @@ public function getRequestId() * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/VmMigration/src/V1/CreateTargetProjectRequest.php b/VmMigration/src/V1/CreateTargetProjectRequest.php index fa7e25ef6158..c8933d912aa1 100644 --- a/VmMigration/src/V1/CreateTargetProjectRequest.php +++ b/VmMigration/src/V1/CreateTargetProjectRequest.php @@ -38,8 +38,8 @@ class CreateTargetProjectRequest extends \Google\Protobuf\Internal\Message * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -85,8 +85,8 @@ public static function build(string $parent, \Google\Cloud\VMMigration\V1\Target * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -192,8 +192,8 @@ public function setTargetProject($var) * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -213,8 +213,8 @@ public function getRequestId() * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/VmMigration/src/V1/CreateUtilizationReportRequest.php b/VmMigration/src/V1/CreateUtilizationReportRequest.php index 80a507c49703..4e9e80122c18 100644 --- a/VmMigration/src/V1/CreateUtilizationReportRequest.php +++ b/VmMigration/src/V1/CreateUtilizationReportRequest.php @@ -42,8 +42,8 @@ class CreateUtilizationReportRequest extends \Google\Protobuf\Internal\Message * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -98,8 +98,8 @@ public static function build(string $parent, \Google\Cloud\VMMigration\V1\Utiliz * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -213,8 +213,8 @@ public function setUtilizationReportId($var) * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -234,8 +234,8 @@ public function getRequestId() * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/VmMigration/src/V1/CreatingImageStep.php b/VmMigration/src/V1/CreatingImageStep.php new file mode 100644 index 000000000000..631508c9810b --- /dev/null +++ b/VmMigration/src/V1/CreatingImageStep.php @@ -0,0 +1,33 @@ +google.cloud.vmmigration.v1.CreatingImageStep + */ +class CreatingImageStep extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + +} + diff --git a/VmMigration/src/V1/CreatingSourceDiskSnapshotStep.php b/VmMigration/src/V1/CreatingSourceDiskSnapshotStep.php new file mode 100644 index 000000000000..ce5253fecc40 --- /dev/null +++ b/VmMigration/src/V1/CreatingSourceDiskSnapshotStep.php @@ -0,0 +1,33 @@ +google.cloud.vmmigration.v1.CreatingSourceDiskSnapshotStep + */ +class CreatingSourceDiskSnapshotStep extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + +} + diff --git a/VmMigration/src/V1/CutoverForecast.php b/VmMigration/src/V1/CutoverForecast.php new file mode 100644 index 000000000000..27e0fd954c03 --- /dev/null +++ b/VmMigration/src/V1/CutoverForecast.php @@ -0,0 +1,77 @@ +google.cloud.vmmigration.v1.CutoverForecast + */ +class CutoverForecast extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Estimation of the CutoverJob duration. + * + * Generated from protobuf field .google.protobuf.Duration estimated_cutover_job_duration = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $estimated_cutover_job_duration = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Duration $estimated_cutover_job_duration + * Output only. Estimation of the CutoverJob duration. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Estimation of the CutoverJob duration. + * + * Generated from protobuf field .google.protobuf.Duration estimated_cutover_job_duration = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Duration|null + */ + public function getEstimatedCutoverJobDuration() + { + return $this->estimated_cutover_job_duration; + } + + public function hasEstimatedCutoverJobDuration() + { + return isset($this->estimated_cutover_job_duration); + } + + public function clearEstimatedCutoverJobDuration() + { + unset($this->estimated_cutover_job_duration); + } + + /** + * Output only. Estimation of the CutoverJob duration. + * + * Generated from protobuf field .google.protobuf.Duration estimated_cutover_job_duration = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Duration $var + * @return $this + */ + public function setEstimatedCutoverJobDuration($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class); + $this->estimated_cutover_job_duration = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/CutoverJob.php b/VmMigration/src/V1/CutoverJob.php index 3fafe9c8c7e7..f8930646f96d 100644 --- a/VmMigration/src/V1/CutoverJob.php +++ b/VmMigration/src/V1/CutoverJob.php @@ -11,7 +11,7 @@ /** * CutoverJob message describes a cutover of a migrating VM. The CutoverJob is * the operation of shutting down the VM, creating a snapshot and - * clonning the VM using the replicated snapshot. + * cloning the VM using the replicated snapshot. * * Generated from protobuf message google.cloud.vmmigration.v1.CutoverJob */ @@ -84,6 +84,8 @@ class CutoverJob extends \Google\Protobuf\Internal\Message * * @type \Google\Cloud\VMMigration\V1\ComputeEngineTargetDetails $compute_engine_target_details * Output only. Details of the target VM in Compute Engine. + * @type \Google\Cloud\VMMigration\V1\ComputeEngineDisksTargetDetails $compute_engine_disks_target_details + * Output only. Details of the target Persistent Disks in Compute Engine. * @type \Google\Protobuf\Timestamp $create_time * Output only. The time the cutover job was created (as an API call, not when * it was actually created in the target). @@ -143,6 +145,37 @@ public function setComputeEngineTargetDetails($var) return $this; } + /** + * Output only. Details of the target Persistent Disks in Compute Engine. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineDisksTargetDetails compute_engine_disks_target_details = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\VMMigration\V1\ComputeEngineDisksTargetDetails|null + */ + public function getComputeEngineDisksTargetDetails() + { + return $this->readOneof(20); + } + + public function hasComputeEngineDisksTargetDetails() + { + return $this->hasOneof(20); + } + + /** + * Output only. Details of the target Persistent Disks in Compute Engine. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineDisksTargetDetails compute_engine_disks_target_details = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\VMMigration\V1\ComputeEngineDisksTargetDetails $var + * @return $this + */ + public function setComputeEngineDisksTargetDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\ComputeEngineDisksTargetDetails::class); + $this->writeOneof(20, $var); + + return $this; + } + /** * Output only. The time the cutover job was created (as an API call, not when * it was actually created in the target). diff --git a/VmMigration/src/V1/DataDiskImageImport.php b/VmMigration/src/V1/DataDiskImageImport.php new file mode 100644 index 000000000000..dcddf184f0a5 --- /dev/null +++ b/VmMigration/src/V1/DataDiskImageImport.php @@ -0,0 +1,33 @@ +google.cloud.vmmigration.v1.DataDiskImageImport + */ +class DataDiskImageImport extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + +} + diff --git a/VmMigration/src/V1/DeleteDatacenterConnectorRequest.php b/VmMigration/src/V1/DeleteDatacenterConnectorRequest.php index 3a18f26d864c..46e04e917a45 100644 --- a/VmMigration/src/V1/DeleteDatacenterConnectorRequest.php +++ b/VmMigration/src/V1/DeleteDatacenterConnectorRequest.php @@ -26,8 +26,8 @@ class DeleteDatacenterConnectorRequest extends \Google\Protobuf\Internal\Message * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -65,8 +65,8 @@ public static function build(string $name): self * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -110,8 +110,8 @@ public function setName($var) * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -131,8 +131,8 @@ public function getRequestId() * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/VmMigration/src/V1/DeleteDiskMigrationJobRequest.php b/VmMigration/src/V1/DeleteDiskMigrationJobRequest.php new file mode 100644 index 000000000000..e615a8a6ee85 --- /dev/null +++ b/VmMigration/src/V1/DeleteDiskMigrationJobRequest.php @@ -0,0 +1,81 @@ +google.cloud.vmmigration.v1.DeleteDiskMigrationJobRequest + */ +class DeleteDiskMigrationJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the DiskMigrationJob. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the DiskMigrationJob. Please see + * {@see VmMigrationClient::diskMigrationJobName()} for help formatting this field. + * + * @return \Google\Cloud\VMMigration\V1\DeleteDiskMigrationJobRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the DiskMigrationJob. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the DiskMigrationJob. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the DiskMigrationJob. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/DeleteGroupRequest.php b/VmMigration/src/V1/DeleteGroupRequest.php index 58ed1909db6e..60e62e2f1352 100644 --- a/VmMigration/src/V1/DeleteGroupRequest.php +++ b/VmMigration/src/V1/DeleteGroupRequest.php @@ -26,8 +26,8 @@ class DeleteGroupRequest extends \Google\Protobuf\Internal\Message * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -65,8 +65,8 @@ public static function build(string $name): self * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -110,8 +110,8 @@ public function setName($var) * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -131,8 +131,8 @@ public function getRequestId() * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/VmMigration/src/V1/DeleteImageImportRequest.php b/VmMigration/src/V1/DeleteImageImportRequest.php new file mode 100644 index 000000000000..1d07aeecebd9 --- /dev/null +++ b/VmMigration/src/V1/DeleteImageImportRequest.php @@ -0,0 +1,155 @@ +google.cloud.vmmigration.v1.DeleteImageImportRequest + */ +class DeleteImageImportRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The ImageImport name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $request_id = ''; + + /** + * @param string $name Required. The ImageImport name. Please see + * {@see VmMigrationClient::imageImportName()} for help formatting this field. + * + * @return \Google\Cloud\VMMigration\V1\DeleteImageImportRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The ImageImport name. + * @type string $request_id + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Required. The ImageImport name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The ImageImport name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/DeleteSourceRequest.php b/VmMigration/src/V1/DeleteSourceRequest.php index 73363cfd5bc7..fecc2f1d3685 100644 --- a/VmMigration/src/V1/DeleteSourceRequest.php +++ b/VmMigration/src/V1/DeleteSourceRequest.php @@ -26,8 +26,8 @@ class DeleteSourceRequest extends \Google\Protobuf\Internal\Message * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -65,8 +65,8 @@ public static function build(string $name): self * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -110,8 +110,8 @@ public function setName($var) * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -131,8 +131,8 @@ public function getRequestId() * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/VmMigration/src/V1/DeleteTargetProjectRequest.php b/VmMigration/src/V1/DeleteTargetProjectRequest.php index d1c390849152..a31415afd16a 100644 --- a/VmMigration/src/V1/DeleteTargetProjectRequest.php +++ b/VmMigration/src/V1/DeleteTargetProjectRequest.php @@ -26,8 +26,8 @@ class DeleteTargetProjectRequest extends \Google\Protobuf\Internal\Message * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -65,8 +65,8 @@ public static function build(string $name): self * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -110,8 +110,8 @@ public function setName($var) * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -131,8 +131,8 @@ public function getRequestId() * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/VmMigration/src/V1/DeleteUtilizationReportRequest.php b/VmMigration/src/V1/DeleteUtilizationReportRequest.php index 8341c1a7702f..4c2b2b73e4c9 100644 --- a/VmMigration/src/V1/DeleteUtilizationReportRequest.php +++ b/VmMigration/src/V1/DeleteUtilizationReportRequest.php @@ -26,8 +26,8 @@ class DeleteUtilizationReportRequest extends \Google\Protobuf\Internal\Message * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -65,8 +65,8 @@ public static function build(string $name): self * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -110,8 +110,8 @@ public function setName($var) * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -131,8 +131,8 @@ public function getRequestId() * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/VmMigration/src/V1/DiskImageTargetDetails.php b/VmMigration/src/V1/DiskImageTargetDetails.php new file mode 100644 index 000000000000..a4b3d8c60019 --- /dev/null +++ b/VmMigration/src/V1/DiskImageTargetDetails.php @@ -0,0 +1,418 @@ +google.cloud.vmmigration.v1.DiskImageTargetDetails + */ +class DiskImageTargetDetails extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the image to be created. + * + * Generated from protobuf field string image_name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $image_name = ''; + /** + * Required. Reference to the TargetProject resource that represents the + * target project in which the imported image will be created. + * + * Generated from protobuf field string target_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $target_project = ''; + /** + * Optional. An optional description of the image. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. The name of the image family to which the new image belongs. + * + * Generated from protobuf field string family_name = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $family_name = ''; + /** + * Optional. A map of labels to associate with the image. + * + * Generated from protobuf field map labels = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. Additional licenses to assign to the image. + * Format: + * https://www.googleapis.com/compute/v1/projects/PROJECT_ID/global/licenses/LICENSE_NAME + * Or + * https://www.googleapis.com/compute/beta/projects/PROJECT_ID/global/licenses/LICENSE_NAME + * + * Generated from protobuf field repeated string additional_licenses = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $additional_licenses; + /** + * Optional. Set to true to set the image storageLocations to the single + * region of the import job. When false, the closest multi-region is selected. + * + * Generated from protobuf field bool single_region_storage = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $single_region_storage = false; + /** + * Immutable. The encryption to apply to the image. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 10 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $encryption = null; + protected $os_adaptation_config; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\VMMigration\V1\ImageImportOsAdaptationParameters $os_adaptation_parameters + * Optional. Use to set the parameters relevant for the OS adaptation + * process. + * @type \Google\Cloud\VMMigration\V1\DataDiskImageImport $data_disk_image_import + * Optional. Use to skip OS adaptation process. + * @type string $image_name + * Required. The name of the image to be created. + * @type string $target_project + * Required. Reference to the TargetProject resource that represents the + * target project in which the imported image will be created. + * @type string $description + * Optional. An optional description of the image. + * @type string $family_name + * Optional. The name of the image family to which the new image belongs. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. A map of labels to associate with the image. + * @type array|\Google\Protobuf\Internal\RepeatedField $additional_licenses + * Optional. Additional licenses to assign to the image. + * Format: + * https://www.googleapis.com/compute/v1/projects/PROJECT_ID/global/licenses/LICENSE_NAME + * Or + * https://www.googleapis.com/compute/beta/projects/PROJECT_ID/global/licenses/LICENSE_NAME + * @type bool $single_region_storage + * Optional. Set to true to set the image storageLocations to the single + * region of the import job. When false, the closest multi-region is selected. + * @type \Google\Cloud\VMMigration\V1\Encryption $encryption + * Immutable. The encryption to apply to the image. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Use to set the parameters relevant for the OS adaptation + * process. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ImageImportOsAdaptationParameters os_adaptation_parameters = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\VMMigration\V1\ImageImportOsAdaptationParameters|null + */ + public function getOsAdaptationParameters() + { + return $this->readOneof(11); + } + + public function hasOsAdaptationParameters() + { + return $this->hasOneof(11); + } + + /** + * Optional. Use to set the parameters relevant for the OS adaptation + * process. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ImageImportOsAdaptationParameters os_adaptation_parameters = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\VMMigration\V1\ImageImportOsAdaptationParameters $var + * @return $this + */ + public function setOsAdaptationParameters($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\ImageImportOsAdaptationParameters::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * Optional. Use to skip OS adaptation process. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.DataDiskImageImport data_disk_image_import = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\VMMigration\V1\DataDiskImageImport|null + */ + public function getDataDiskImageImport() + { + return $this->readOneof(12); + } + + public function hasDataDiskImageImport() + { + return $this->hasOneof(12); + } + + /** + * Optional. Use to skip OS adaptation process. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.DataDiskImageImport data_disk_image_import = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\VMMigration\V1\DataDiskImageImport $var + * @return $this + */ + public function setDataDiskImageImport($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\DataDiskImageImport::class); + $this->writeOneof(12, $var); + + return $this; + } + + /** + * Required. The name of the image to be created. + * + * Generated from protobuf field string image_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getImageName() + { + return $this->image_name; + } + + /** + * Required. The name of the image to be created. + * + * Generated from protobuf field string image_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setImageName($var) + { + GPBUtil::checkString($var, True); + $this->image_name = $var; + + return $this; + } + + /** + * Required. Reference to the TargetProject resource that represents the + * target project in which the imported image will be created. + * + * Generated from protobuf field string target_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getTargetProject() + { + return $this->target_project; + } + + /** + * Required. Reference to the TargetProject resource that represents the + * target project in which the imported image will be created. + * + * Generated from protobuf field string target_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTargetProject($var) + { + GPBUtil::checkString($var, True); + $this->target_project = $var; + + return $this; + } + + /** + * Optional. An optional description of the image. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. An optional description of the image. + * + * Generated from protobuf field string description = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. The name of the image family to which the new image belongs. + * + * Generated from protobuf field string family_name = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFamilyName() + { + return $this->family_name; + } + + /** + * Optional. The name of the image family to which the new image belongs. + * + * Generated from protobuf field string family_name = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFamilyName($var) + { + GPBUtil::checkString($var, True); + $this->family_name = $var; + + return $this; + } + + /** + * Optional. A map of labels to associate with the image. + * + * Generated from protobuf field map labels = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. A map of labels to associate with the image. + * + * Generated from protobuf field map labels = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Optional. Additional licenses to assign to the image. + * Format: + * https://www.googleapis.com/compute/v1/projects/PROJECT_ID/global/licenses/LICENSE_NAME + * Or + * https://www.googleapis.com/compute/beta/projects/PROJECT_ID/global/licenses/LICENSE_NAME + * + * Generated from protobuf field repeated string additional_licenses = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAdditionalLicenses() + { + return $this->additional_licenses; + } + + /** + * Optional. Additional licenses to assign to the image. + * Format: + * https://www.googleapis.com/compute/v1/projects/PROJECT_ID/global/licenses/LICENSE_NAME + * Or + * https://www.googleapis.com/compute/beta/projects/PROJECT_ID/global/licenses/LICENSE_NAME + * + * Generated from protobuf field repeated string additional_licenses = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAdditionalLicenses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->additional_licenses = $arr; + + return $this; + } + + /** + * Optional. Set to true to set the image storageLocations to the single + * region of the import job. When false, the closest multi-region is selected. + * + * Generated from protobuf field bool single_region_storage = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getSingleRegionStorage() + { + return $this->single_region_storage; + } + + /** + * Optional. Set to true to set the image storageLocations to the single + * region of the import job. When false, the closest multi-region is selected. + * + * Generated from protobuf field bool single_region_storage = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setSingleRegionStorage($var) + { + GPBUtil::checkBool($var); + $this->single_region_storage = $var; + + return $this; + } + + /** + * Immutable. The encryption to apply to the image. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 10 [(.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\VMMigration\V1\Encryption|null + */ + public function getEncryption() + { + return $this->encryption; + } + + public function hasEncryption() + { + return isset($this->encryption); + } + + public function clearEncryption() + { + unset($this->encryption); + } + + /** + * Immutable. The encryption to apply to the image. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 10 [(.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\VMMigration\V1\Encryption $var + * @return $this + */ + public function setEncryption($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\Encryption::class); + $this->encryption = $var; + + return $this; + } + + /** + * @return string + */ + public function getOsAdaptationConfig() + { + return $this->whichOneof("os_adaptation_config"); + } + +} + diff --git a/VmMigration/src/V1/DiskMigrationJob.php b/VmMigration/src/V1/DiskMigrationJob.php new file mode 100644 index 000000000000..cf7234f510e8 --- /dev/null +++ b/VmMigration/src/V1/DiskMigrationJob.php @@ -0,0 +1,348 @@ +google.cloud.vmmigration.v1.DiskMigrationJob + */ +class DiskMigrationJob extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Identifier. The identifier of the DiskMigrationJob. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Required. Details of the target Disk in Compute Engine. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.DiskMigrationJobTargetDetails target_details = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $target_details = null; + /** + * Output only. The time the DiskMigrationJob resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The last time the DiskMigrationJob resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. State of the DiskMigrationJob. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.DiskMigrationJob.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. Provides details on the errors that led to the disk migration + * job's state in case of an error. + * + * Generated from protobuf field repeated .google.rpc.Status errors = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $errors; + /** + * Output only. The disk migration steps list representing its progress. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.DiskMigrationStep steps = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $steps; + protected $source_disk_details; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\VMMigration\V1\AwsSourceDiskDetails $aws_source_disk_details + * Details of the unattached AWS source disk. + * @type string $name + * Output only. Identifier. The identifier of the DiskMigrationJob. + * @type \Google\Cloud\VMMigration\V1\DiskMigrationJobTargetDetails $target_details + * Required. Details of the target Disk in Compute Engine. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the DiskMigrationJob resource was created. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The last time the DiskMigrationJob resource was updated. + * @type int $state + * Output only. State of the DiskMigrationJob. + * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $errors + * Output only. Provides details on the errors that led to the disk migration + * job's state in case of an error. + * @type array<\Google\Cloud\VMMigration\V1\DiskMigrationStep>|\Google\Protobuf\Internal\RepeatedField $steps + * Output only. The disk migration steps list representing its progress. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Details of the unattached AWS source disk. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AwsSourceDiskDetails aws_source_disk_details = 2; + * @return \Google\Cloud\VMMigration\V1\AwsSourceDiskDetails|null + */ + public function getAwsSourceDiskDetails() + { + return $this->readOneof(2); + } + + public function hasAwsSourceDiskDetails() + { + return $this->hasOneof(2); + } + + /** + * Details of the unattached AWS source disk. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AwsSourceDiskDetails aws_source_disk_details = 2; + * @param \Google\Cloud\VMMigration\V1\AwsSourceDiskDetails $var + * @return $this + */ + public function setAwsSourceDiskDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\AwsSourceDiskDetails::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Output only. Identifier. The identifier of the DiskMigrationJob. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. Identifier. The identifier of the DiskMigrationJob. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = IDENTIFIER, (.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Required. Details of the target Disk in Compute Engine. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.DiskMigrationJobTargetDetails target_details = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\VMMigration\V1\DiskMigrationJobTargetDetails|null + */ + public function getTargetDetails() + { + return $this->target_details; + } + + public function hasTargetDetails() + { + return isset($this->target_details); + } + + public function clearTargetDetails() + { + unset($this->target_details); + } + + /** + * Required. Details of the target Disk in Compute Engine. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.DiskMigrationJobTargetDetails target_details = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\VMMigration\V1\DiskMigrationJobTargetDetails $var + * @return $this + */ + public function setTargetDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\DiskMigrationJobTargetDetails::class); + $this->target_details = $var; + + return $this; + } + + /** + * Output only. The time the DiskMigrationJob resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the DiskMigrationJob resource was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The last time the DiskMigrationJob resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The last time the DiskMigrationJob resource was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. State of the DiskMigrationJob. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.DiskMigrationJob.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. State of the DiskMigrationJob. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.DiskMigrationJob.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\DiskMigrationJob\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. Provides details on the errors that led to the disk migration + * job's state in case of an error. + * + * Generated from protobuf field repeated .google.rpc.Status errors = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getErrors() + { + return $this->errors; + } + + /** + * Output only. Provides details on the errors that led to the disk migration + * job's state in case of an error. + * + * Generated from protobuf field repeated .google.rpc.Status errors = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); + $this->errors = $arr; + + return $this; + } + + /** + * Output only. The disk migration steps list representing its progress. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.DiskMigrationStep steps = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSteps() + { + return $this->steps; + } + + /** + * Output only. The disk migration steps list representing its progress. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.DiskMigrationStep steps = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\VMMigration\V1\DiskMigrationStep>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSteps($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VMMigration\V1\DiskMigrationStep::class); + $this->steps = $arr; + + return $this; + } + + /** + * @return string + */ + public function getSourceDiskDetails() + { + return $this->whichOneof("source_disk_details"); + } + +} + diff --git a/VmMigration/src/V1/DiskMigrationJob/State.php b/VmMigration/src/V1/DiskMigrationJob/State.php new file mode 100644 index 000000000000..e45c87ce8901 --- /dev/null +++ b/VmMigration/src/V1/DiskMigrationJob/State.php @@ -0,0 +1,91 @@ +google.cloud.vmmigration.v1.DiskMigrationJob.State + */ +class State +{ + /** + * The state is unspecified. This is not in use. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The initial state of the disk migration. + * In this state the customers can update the target details. + * + * Generated from protobuf enum READY = 1; + */ + const READY = 1; + /** + * The migration is active, and it's running or scheduled to run. + * + * Generated from protobuf enum RUNNING = 3; + */ + const RUNNING = 3; + /** + * The migration completed successfully. + * + * Generated from protobuf enum SUCCEEDED = 4; + */ + const SUCCEEDED = 4; + /** + * Migration cancellation was initiated. + * + * Generated from protobuf enum CANCELLING = 5; + */ + const CANCELLING = 5; + /** + * The migration was cancelled. + * + * Generated from protobuf enum CANCELLED = 6; + */ + const CANCELLED = 6; + /** + * The migration process encountered an unrecoverable error and was aborted. + * + * Generated from protobuf enum FAILED = 7; + */ + const FAILED = 7; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::READY => 'READY', + self::RUNNING => 'RUNNING', + self::SUCCEEDED => 'SUCCEEDED', + self::CANCELLING => 'CANCELLING', + self::CANCELLED => 'CANCELLED', + self::FAILED => 'FAILED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/VmMigration/src/V1/DiskMigrationJobTargetDetails.php b/VmMigration/src/V1/DiskMigrationJobTargetDetails.php new file mode 100644 index 000000000000..bf302bd40148 --- /dev/null +++ b/VmMigration/src/V1/DiskMigrationJobTargetDetails.php @@ -0,0 +1,203 @@ +google.cloud.vmmigration.v1.DiskMigrationJobTargetDetails + */ +class DiskMigrationJobTargetDetails extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the resource of type TargetProject which represents + * the Compute Engine project in which to create the disk. Should be of the + * form: projects/{project}/locations/global/targetProjects/{target-project} + * + * Generated from protobuf field string target_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $target_project = ''; + /** + * Optional. A map of labels to associate with the disk. + * + * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. The encryption to apply to the disk. + * If the DiskMigrationJob parent Source resource has an encryption, this + * field must be set to the same encryption key. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $encryption = null; + protected $target_storage; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\VMMigration\V1\ComputeEngineDisk $target_disk + * Required. The target disk. + * @type string $target_project + * Required. The name of the resource of type TargetProject which represents + * the Compute Engine project in which to create the disk. Should be of the + * form: projects/{project}/locations/global/targetProjects/{target-project} + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. A map of labels to associate with the disk. + * @type \Google\Cloud\VMMigration\V1\Encryption $encryption + * Optional. The encryption to apply to the disk. + * If the DiskMigrationJob parent Source resource has an encryption, this + * field must be set to the same encryption key. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Required. The target disk. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineDisk target_disk = 8 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\VMMigration\V1\ComputeEngineDisk|null + */ + public function getTargetDisk() + { + return $this->readOneof(8); + } + + public function hasTargetDisk() + { + return $this->hasOneof(8); + } + + /** + * Required. The target disk. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineDisk target_disk = 8 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\VMMigration\V1\ComputeEngineDisk $var + * @return $this + */ + public function setTargetDisk($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\ComputeEngineDisk::class); + $this->writeOneof(8, $var); + + return $this; + } + + /** + * Required. The name of the resource of type TargetProject which represents + * the Compute Engine project in which to create the disk. Should be of the + * form: projects/{project}/locations/global/targetProjects/{target-project} + * + * Generated from protobuf field string target_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getTargetProject() + { + return $this->target_project; + } + + /** + * Required. The name of the resource of type TargetProject which represents + * the Compute Engine project in which to create the disk. Should be of the + * form: projects/{project}/locations/global/targetProjects/{target-project} + * + * Generated from protobuf field string target_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTargetProject($var) + { + GPBUtil::checkString($var, True); + $this->target_project = $var; + + return $this; + } + + /** + * Optional. A map of labels to associate with the disk. + * + * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. A map of labels to associate with the disk. + * + * Generated from protobuf field map labels = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Optional. The encryption to apply to the disk. + * If the DiskMigrationJob parent Source resource has an encryption, this + * field must be set to the same encryption key. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\VMMigration\V1\Encryption|null + */ + public function getEncryption() + { + return $this->encryption; + } + + public function hasEncryption() + { + return isset($this->encryption); + } + + public function clearEncryption() + { + unset($this->encryption); + } + + /** + * Optional. The encryption to apply to the disk. + * If the DiskMigrationJob parent Source resource has an encryption, this + * field must be set to the same encryption key. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\VMMigration\V1\Encryption $var + * @return $this + */ + public function setEncryption($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\Encryption::class); + $this->encryption = $var; + + return $this; + } + + /** + * @return string + */ + public function getTargetStorage() + { + return $this->whichOneof("target_storage"); + } + +} + diff --git a/VmMigration/src/V1/DiskMigrationStep.php b/VmMigration/src/V1/DiskMigrationStep.php new file mode 100644 index 000000000000..bb2a8174f9ad --- /dev/null +++ b/VmMigration/src/V1/DiskMigrationStep.php @@ -0,0 +1,229 @@ +google.cloud.vmmigration.v1.DiskMigrationStep + */ +class DiskMigrationStep extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the step has started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $start_time = null; + /** + * Output only. The time the step has ended. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + protected $step; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\VMMigration\V1\CreatingSourceDiskSnapshotStep $creating_source_disk_snapshot + * Creating source disk snapshot step. + * @type \Google\Cloud\VMMigration\V1\CopyingSourceDiskSnapshotStep $copying_source_disk_snapshot + * Copying source disk snapshot step. + * @type \Google\Cloud\VMMigration\V1\ProvisioningTargetDiskStep $provisioning_target_disk + * Creating target disk step. + * @type \Google\Protobuf\Timestamp $start_time + * Output only. The time the step has started. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the step has ended. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Creating source disk snapshot step. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.CreatingSourceDiskSnapshotStep creating_source_disk_snapshot = 3; + * @return \Google\Cloud\VMMigration\V1\CreatingSourceDiskSnapshotStep|null + */ + public function getCreatingSourceDiskSnapshot() + { + return $this->readOneof(3); + } + + public function hasCreatingSourceDiskSnapshot() + { + return $this->hasOneof(3); + } + + /** + * Creating source disk snapshot step. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.CreatingSourceDiskSnapshotStep creating_source_disk_snapshot = 3; + * @param \Google\Cloud\VMMigration\V1\CreatingSourceDiskSnapshotStep $var + * @return $this + */ + public function setCreatingSourceDiskSnapshot($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\CreatingSourceDiskSnapshotStep::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Copying source disk snapshot step. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.CopyingSourceDiskSnapshotStep copying_source_disk_snapshot = 4; + * @return \Google\Cloud\VMMigration\V1\CopyingSourceDiskSnapshotStep|null + */ + public function getCopyingSourceDiskSnapshot() + { + return $this->readOneof(4); + } + + public function hasCopyingSourceDiskSnapshot() + { + return $this->hasOneof(4); + } + + /** + * Copying source disk snapshot step. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.CopyingSourceDiskSnapshotStep copying_source_disk_snapshot = 4; + * @param \Google\Cloud\VMMigration\V1\CopyingSourceDiskSnapshotStep $var + * @return $this + */ + public function setCopyingSourceDiskSnapshot($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\CopyingSourceDiskSnapshotStep::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Creating target disk step. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ProvisioningTargetDiskStep provisioning_target_disk = 5; + * @return \Google\Cloud\VMMigration\V1\ProvisioningTargetDiskStep|null + */ + public function getProvisioningTargetDisk() + { + return $this->readOneof(5); + } + + public function hasProvisioningTargetDisk() + { + return $this->hasOneof(5); + } + + /** + * Creating target disk step. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ProvisioningTargetDiskStep provisioning_target_disk = 5; + * @param \Google\Cloud\VMMigration\V1\ProvisioningTargetDiskStep $var + * @return $this + */ + public function setProvisioningTargetDisk($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\ProvisioningTargetDiskStep::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Output only. The time the step has started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Output only. The time the step has started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Output only. The time the step has ended. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the step has ended. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * @return string + */ + public function getStep() + { + return $this->whichOneof("step"); + } + +} + diff --git a/VmMigration/src/V1/DisksMigrationDisksTargetDefaults.php b/VmMigration/src/V1/DisksMigrationDisksTargetDefaults.php new file mode 100644 index 000000000000..ab03b8c4d8b1 --- /dev/null +++ b/VmMigration/src/V1/DisksMigrationDisksTargetDefaults.php @@ -0,0 +1,33 @@ +google.cloud.vmmigration.v1.DisksMigrationDisksTargetDefaults + */ +class DisksMigrationDisksTargetDefaults extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + +} + diff --git a/VmMigration/src/V1/DisksMigrationDisksTargetDetails.php b/VmMigration/src/V1/DisksMigrationDisksTargetDetails.php new file mode 100644 index 000000000000..a8bc9f589b43 --- /dev/null +++ b/VmMigration/src/V1/DisksMigrationDisksTargetDetails.php @@ -0,0 +1,33 @@ +google.cloud.vmmigration.v1.DisksMigrationDisksTargetDetails + */ +class DisksMigrationDisksTargetDetails extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + +} + diff --git a/VmMigration/src/V1/DisksMigrationVmTargetDefaults.php b/VmMigration/src/V1/DisksMigrationVmTargetDefaults.php new file mode 100644 index 000000000000..125c5d005c8f --- /dev/null +++ b/VmMigration/src/V1/DisksMigrationVmTargetDefaults.php @@ -0,0 +1,619 @@ +google.cloud.vmmigration.v1.DisksMigrationVmTargetDefaults + */ +class DisksMigrationVmTargetDefaults extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the VM to create. + * + * Generated from protobuf field string vm_name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $vm_name = ''; + /** + * Optional. The machine type series to create the VM with. + * For presentation only. + * + * Generated from protobuf field string machine_type_series = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $machine_type_series = ''; + /** + * Required. The machine type to create the VM with. + * + * Generated from protobuf field string machine_type = 3 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $machine_type = ''; + /** + * Optional. A list of network tags to associate with the VM. + * + * Generated from protobuf field repeated string network_tags = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $network_tags; + /** + * Optional. NICs to attach to the VM. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.NetworkInterface network_interfaces = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $network_interfaces; + /** + * Optional. The service account to associate the VM with. + * + * Generated from protobuf field string service_account = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $service_account = ''; + /** + * Optional. Compute instance scheduling information (if empty default is + * used). + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeScheduling compute_scheduling = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $compute_scheduling = null; + /** + * Optional. Defines whether the instance has Secure Boot enabled. + * This can be set to true only if the VM boot option is EFI. + * + * Generated from protobuf field bool secure_boot = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $secure_boot = false; + /** + * Optional. Defines whether the instance has vTPM enabled. + * + * Generated from protobuf field bool enable_vtpm = 16 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_vtpm = false; + /** + * Optional. Defines whether the instance has integrity monitoring enabled. + * + * Generated from protobuf field bool enable_integrity_monitoring = 17 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_integrity_monitoring = false; + /** + * Optional. The metadata key/value pairs to assign to the VM. + * + * Generated from protobuf field map metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $metadata; + /** + * Optional. Additional licenses to assign to the VM. + * + * Generated from protobuf field repeated string additional_licenses = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $additional_licenses; + /** + * Optional. The hostname to assign to the VM. + * + * Generated from protobuf field string hostname = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $hostname = ''; + /** + * Optional. A map of labels to associate with the VM. + * + * Generated from protobuf field map labels = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. Details of the boot disk of the VM. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.BootDiskDefaults boot_disk_defaults = 14 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $boot_disk_defaults = null; + /** + * Optional. The encryption to apply to the VM. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 15 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $encryption = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $vm_name + * Required. The name of the VM to create. + * @type string $machine_type_series + * Optional. The machine type series to create the VM with. + * For presentation only. + * @type string $machine_type + * Required. The machine type to create the VM with. + * @type array|\Google\Protobuf\Internal\RepeatedField $network_tags + * Optional. A list of network tags to associate with the VM. + * @type array<\Google\Cloud\VMMigration\V1\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $network_interfaces + * Optional. NICs to attach to the VM. + * @type string $service_account + * Optional. The service account to associate the VM with. + * @type \Google\Cloud\VMMigration\V1\ComputeScheduling $compute_scheduling + * Optional. Compute instance scheduling information (if empty default is + * used). + * @type bool $secure_boot + * Optional. Defines whether the instance has Secure Boot enabled. + * This can be set to true only if the VM boot option is EFI. + * @type bool $enable_vtpm + * Optional. Defines whether the instance has vTPM enabled. + * @type bool $enable_integrity_monitoring + * Optional. Defines whether the instance has integrity monitoring enabled. + * @type array|\Google\Protobuf\Internal\MapField $metadata + * Optional. The metadata key/value pairs to assign to the VM. + * @type array|\Google\Protobuf\Internal\RepeatedField $additional_licenses + * Optional. Additional licenses to assign to the VM. + * @type string $hostname + * Optional. The hostname to assign to the VM. + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. A map of labels to associate with the VM. + * @type \Google\Cloud\VMMigration\V1\BootDiskDefaults $boot_disk_defaults + * Optional. Details of the boot disk of the VM. + * @type \Google\Cloud\VMMigration\V1\Encryption $encryption + * Optional. The encryption to apply to the VM. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the VM to create. + * + * Generated from protobuf field string vm_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getVmName() + { + return $this->vm_name; + } + + /** + * Required. The name of the VM to create. + * + * Generated from protobuf field string vm_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setVmName($var) + { + GPBUtil::checkString($var, True); + $this->vm_name = $var; + + return $this; + } + + /** + * Optional. The machine type series to create the VM with. + * For presentation only. + * + * Generated from protobuf field string machine_type_series = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getMachineTypeSeries() + { + return $this->machine_type_series; + } + + /** + * Optional. The machine type series to create the VM with. + * For presentation only. + * + * Generated from protobuf field string machine_type_series = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setMachineTypeSeries($var) + { + GPBUtil::checkString($var, True); + $this->machine_type_series = $var; + + return $this; + } + + /** + * Required. The machine type to create the VM with. + * + * Generated from protobuf field string machine_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getMachineType() + { + return $this->machine_type; + } + + /** + * Required. The machine type to create the VM with. + * + * Generated from protobuf field string machine_type = 3 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setMachineType($var) + { + GPBUtil::checkString($var, True); + $this->machine_type = $var; + + return $this; + } + + /** + * Optional. A list of network tags to associate with the VM. + * + * Generated from protobuf field repeated string network_tags = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkTags() + { + return $this->network_tags; + } + + /** + * Optional. A list of network tags to associate with the VM. + * + * Generated from protobuf field repeated string network_tags = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->network_tags = $arr; + + return $this; + } + + /** + * Optional. NICs to attach to the VM. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.NetworkInterface network_interfaces = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkInterfaces() + { + return $this->network_interfaces; + } + + /** + * Optional. NICs to attach to the VM. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.NetworkInterface network_interfaces = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\VMMigration\V1\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkInterfaces($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VMMigration\V1\NetworkInterface::class); + $this->network_interfaces = $arr; + + return $this; + } + + /** + * Optional. The service account to associate the VM with. + * + * Generated from protobuf field string service_account = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getServiceAccount() + { + return $this->service_account; + } + + /** + * Optional. The service account to associate the VM with. + * + * Generated from protobuf field string service_account = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkString($var, True); + $this->service_account = $var; + + return $this; + } + + /** + * Optional. Compute instance scheduling information (if empty default is + * used). + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeScheduling compute_scheduling = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\VMMigration\V1\ComputeScheduling|null + */ + public function getComputeScheduling() + { + return $this->compute_scheduling; + } + + public function hasComputeScheduling() + { + return isset($this->compute_scheduling); + } + + public function clearComputeScheduling() + { + unset($this->compute_scheduling); + } + + /** + * Optional. Compute instance scheduling information (if empty default is + * used). + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeScheduling compute_scheduling = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\VMMigration\V1\ComputeScheduling $var + * @return $this + */ + public function setComputeScheduling($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\ComputeScheduling::class); + $this->compute_scheduling = $var; + + return $this; + } + + /** + * Optional. Defines whether the instance has Secure Boot enabled. + * This can be set to true only if the VM boot option is EFI. + * + * Generated from protobuf field bool secure_boot = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getSecureBoot() + { + return $this->secure_boot; + } + + /** + * Optional. Defines whether the instance has Secure Boot enabled. + * This can be set to true only if the VM boot option is EFI. + * + * Generated from protobuf field bool secure_boot = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setSecureBoot($var) + { + GPBUtil::checkBool($var); + $this->secure_boot = $var; + + return $this; + } + + /** + * Optional. Defines whether the instance has vTPM enabled. + * + * Generated from protobuf field bool enable_vtpm = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableVtpm() + { + return $this->enable_vtpm; + } + + /** + * Optional. Defines whether the instance has vTPM enabled. + * + * Generated from protobuf field bool enable_vtpm = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableVtpm($var) + { + GPBUtil::checkBool($var); + $this->enable_vtpm = $var; + + return $this; + } + + /** + * Optional. Defines whether the instance has integrity monitoring enabled. + * + * Generated from protobuf field bool enable_integrity_monitoring = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableIntegrityMonitoring() + { + return $this->enable_integrity_monitoring; + } + + /** + * Optional. Defines whether the instance has integrity monitoring enabled. + * + * Generated from protobuf field bool enable_integrity_monitoring = 17 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableIntegrityMonitoring($var) + { + GPBUtil::checkBool($var); + $this->enable_integrity_monitoring = $var; + + return $this; + } + + /** + * Optional. The metadata key/value pairs to assign to the VM. + * + * Generated from protobuf field map metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getMetadata() + { + return $this->metadata; + } + + /** + * Optional. The metadata key/value pairs to assign to the VM. + * + * Generated from protobuf field map metadata = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setMetadata($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->metadata = $arr; + + return $this; + } + + /** + * Optional. Additional licenses to assign to the VM. + * + * Generated from protobuf field repeated string additional_licenses = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAdditionalLicenses() + { + return $this->additional_licenses; + } + + /** + * Optional. Additional licenses to assign to the VM. + * + * Generated from protobuf field repeated string additional_licenses = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAdditionalLicenses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->additional_licenses = $arr; + + return $this; + } + + /** + * Optional. The hostname to assign to the VM. + * + * Generated from protobuf field string hostname = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getHostname() + { + return $this->hostname; + } + + /** + * Optional. The hostname to assign to the VM. + * + * Generated from protobuf field string hostname = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setHostname($var) + { + GPBUtil::checkString($var, True); + $this->hostname = $var; + + return $this; + } + + /** + * Optional. A map of labels to associate with the VM. + * + * Generated from protobuf field map labels = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. A map of labels to associate with the VM. + * + * Generated from protobuf field map labels = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Optional. Details of the boot disk of the VM. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.BootDiskDefaults boot_disk_defaults = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\VMMigration\V1\BootDiskDefaults|null + */ + public function getBootDiskDefaults() + { + return $this->boot_disk_defaults; + } + + public function hasBootDiskDefaults() + { + return isset($this->boot_disk_defaults); + } + + public function clearBootDiskDefaults() + { + unset($this->boot_disk_defaults); + } + + /** + * Optional. Details of the boot disk of the VM. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.BootDiskDefaults boot_disk_defaults = 14 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\VMMigration\V1\BootDiskDefaults $var + * @return $this + */ + public function setBootDiskDefaults($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\BootDiskDefaults::class); + $this->boot_disk_defaults = $var; + + return $this; + } + + /** + * Optional. The encryption to apply to the VM. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\VMMigration\V1\Encryption|null + */ + public function getEncryption() + { + return $this->encryption; + } + + public function hasEncryption() + { + return isset($this->encryption); + } + + public function clearEncryption() + { + unset($this->encryption); + } + + /** + * Optional. The encryption to apply to the VM. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 15 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\VMMigration\V1\Encryption $var + * @return $this + */ + public function setEncryption($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\Encryption::class); + $this->encryption = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/DisksMigrationVmTargetDetails.php b/VmMigration/src/V1/DisksMigrationVmTargetDetails.php new file mode 100644 index 000000000000..8cfe966ba6fd --- /dev/null +++ b/VmMigration/src/V1/DisksMigrationVmTargetDetails.php @@ -0,0 +1,67 @@ +google.cloud.vmmigration.v1.DisksMigrationVmTargetDetails + */ +class DisksMigrationVmTargetDetails extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The URI of the Compute Engine VM. + * + * Generated from protobuf field string vm_uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $vm_uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $vm_uri + * Output only. The URI of the Compute Engine VM. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The URI of the Compute Engine VM. + * + * Generated from protobuf field string vm_uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getVmUri() + { + return $this->vm_uri; + } + + /** + * Output only. The URI of the Compute Engine VM. + * + * Generated from protobuf field string vm_uri = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setVmUri($var) + { + GPBUtil::checkString($var, True); + $this->vm_uri = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/Encryption.php b/VmMigration/src/V1/Encryption.php new file mode 100644 index 000000000000..54c74f1ba10f --- /dev/null +++ b/VmMigration/src/V1/Encryption.php @@ -0,0 +1,71 @@ +google.cloud.vmmigration.v1.Encryption + */ +class Encryption extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the encryption key that is stored in Google Cloud + * KMS. + * + * Generated from protobuf field string kms_key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $kms_key = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $kms_key + * Required. The name of the encryption key that is stored in Google Cloud + * KMS. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the encryption key that is stored in Google Cloud + * KMS. + * + * Generated from protobuf field string kms_key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getKmsKey() + { + return $this->kms_key; + } + + /** + * Required. The name of the encryption key that is stored in Google Cloud + * KMS. + * + * Generated from protobuf field string kms_key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setKmsKey($var) + { + GPBUtil::checkString($var, True); + $this->kms_key = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/ExtendMigrationRequest.php b/VmMigration/src/V1/ExtendMigrationRequest.php new file mode 100644 index 000000000000..5e9215ea8340 --- /dev/null +++ b/VmMigration/src/V1/ExtendMigrationRequest.php @@ -0,0 +1,67 @@ +google.cloud.vmmigration.v1.ExtendMigrationRequest + */ +class ExtendMigrationRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the MigratingVm. + * + * Generated from protobuf field string migrating_vm = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $migrating_vm = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $migrating_vm + * Required. The name of the MigratingVm. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the MigratingVm. + * + * Generated from protobuf field string migrating_vm = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getMigratingVm() + { + return $this->migrating_vm; + } + + /** + * Required. The name of the MigratingVm. + * + * Generated from protobuf field string migrating_vm = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setMigratingVm($var) + { + GPBUtil::checkString($var, True); + $this->migrating_vm = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/ExtendMigrationResponse.php b/VmMigration/src/V1/ExtendMigrationResponse.php new file mode 100644 index 000000000000..b74ad3172fe5 --- /dev/null +++ b/VmMigration/src/V1/ExtendMigrationResponse.php @@ -0,0 +1,33 @@ +google.cloud.vmmigration.v1.ExtendMigrationResponse + */ +class ExtendMigrationResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + +} + diff --git a/VmMigration/src/V1/FetchInventoryResponse.php b/VmMigration/src/V1/FetchInventoryResponse.php index ce1bdac4c8c1..5a03c38c69aa 100644 --- a/VmMigration/src/V1/FetchInventoryResponse.php +++ b/VmMigration/src/V1/FetchInventoryResponse.php @@ -35,6 +35,8 @@ class FetchInventoryResponse extends \Google\Protobuf\Internal\Message * The description of the VMs in a Source of type Vmware. * @type \Google\Cloud\VMMigration\V1\AwsVmsDetails $aws_vms * The description of the VMs in a Source of type AWS. + * @type \Google\Cloud\VMMigration\V1\AzureVmsDetails $azure_vms + * The description of the VMs in a Source of type Azure. * @type \Google\Protobuf\Timestamp $update_time * Output only. The timestamp when the source was last queried (if the result * is from the cache). @@ -107,6 +109,37 @@ public function setAwsVms($var) return $this; } + /** + * The description of the VMs in a Source of type Azure. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureVmsDetails azure_vms = 5; + * @return \Google\Cloud\VMMigration\V1\AzureVmsDetails|null + */ + public function getAzureVms() + { + return $this->readOneof(5); + } + + public function hasAzureVms() + { + return $this->hasOneof(5); + } + + /** + * The description of the VMs in a Source of type Azure. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureVmsDetails azure_vms = 5; + * @param \Google\Cloud\VMMigration\V1\AzureVmsDetails $var + * @return $this + */ + public function setAzureVms($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\AzureVmsDetails::class); + $this->writeOneof(5, $var); + + return $this; + } + /** * Output only. The timestamp when the source was last queried (if the result * is from the cache). diff --git a/VmMigration/src/V1/FetchStorageInventoryRequest.php b/VmMigration/src/V1/FetchStorageInventoryRequest.php new file mode 100644 index 000000000000..c248b6bd0ddb --- /dev/null +++ b/VmMigration/src/V1/FetchStorageInventoryRequest.php @@ -0,0 +1,241 @@ +google.cloud.vmmigration.v1.FetchStorageInventoryRequest + */ +class FetchStorageInventoryRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the Source. + * + * Generated from protobuf field string source = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $source = ''; + /** + * Required. The type of the storage inventory to fetch. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.FetchStorageInventoryRequest.StorageType type = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $type = 0; + /** + * Optional. If this flag is set to true, the source will be queried instead + * of using cached results. Using this flag will make the call slower. + * + * Generated from protobuf field bool force_refresh = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $force_refresh = false; + /** + * Optional. The maximum number of VMs to return. The service may return + * fewer than this value. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `FetchStorageInventory` + * call. Provide this to retrieve the subsequent page. When paginating, all + * other parameters provided to `FetchStorageInventory` must match the call + * that provided the page token. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + + /** + * @param string $source Required. The name of the Source. Please see + * {@see VmMigrationClient::sourceName()} for help formatting this field. + * @param int $type Required. The type of the storage inventory to fetch. + * For allowed values, use constants defined on {@see \Google\Cloud\VMMigration\V1\FetchStorageInventoryRequest\StorageType} + * + * @return \Google\Cloud\VMMigration\V1\FetchStorageInventoryRequest + * + * @experimental + */ + public static function build(string $source, int $type): self + { + return (new self()) + ->setSource($source) + ->setType($type); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $source + * Required. The name of the Source. + * @type int $type + * Required. The type of the storage inventory to fetch. + * @type bool $force_refresh + * Optional. If this flag is set to true, the source will be queried instead + * of using cached results. Using this flag will make the call slower. + * @type int $page_size + * Optional. The maximum number of VMs to return. The service may return + * fewer than this value. + * @type string $page_token + * Optional. A page token, received from a previous `FetchStorageInventory` + * call. Provide this to retrieve the subsequent page. When paginating, all + * other parameters provided to `FetchStorageInventory` must match the call + * that provided the page token. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the Source. + * + * Generated from protobuf field string source = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getSource() + { + return $this->source; + } + + /** + * Required. The name of the Source. + * + * Generated from protobuf field string source = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setSource($var) + { + GPBUtil::checkString($var, True); + $this->source = $var; + + return $this; + } + + /** + * Required. The type of the storage inventory to fetch. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.FetchStorageInventoryRequest.StorageType type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Required. The type of the storage inventory to fetch. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.FetchStorageInventoryRequest.StorageType type = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\FetchStorageInventoryRequest\StorageType::class); + $this->type = $var; + + return $this; + } + + /** + * Optional. If this flag is set to true, the source will be queried instead + * of using cached results. Using this flag will make the call slower. + * + * Generated from protobuf field bool force_refresh = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getForceRefresh() + { + return $this->force_refresh; + } + + /** + * Optional. If this flag is set to true, the source will be queried instead + * of using cached results. Using this flag will make the call slower. + * + * Generated from protobuf field bool force_refresh = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setForceRefresh($var) + { + GPBUtil::checkBool($var); + $this->force_refresh = $var; + + return $this; + } + + /** + * Optional. The maximum number of VMs to return. The service may return + * fewer than this value. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of VMs to return. The service may return + * fewer than this value. + * + * Generated from protobuf field int32 page_size = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `FetchStorageInventory` + * call. Provide this to retrieve the subsequent page. When paginating, all + * other parameters provided to `FetchStorageInventory` must match the call + * that provided the page token. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `FetchStorageInventory` + * call. Provide this to retrieve the subsequent page. When paginating, all + * other parameters provided to `FetchStorageInventory` must match the call + * that provided the page token. + * + * Generated from protobuf field string page_token = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/FetchStorageInventoryRequest/StorageType.php b/VmMigration/src/V1/FetchStorageInventoryRequest/StorageType.php new file mode 100644 index 000000000000..0db72a0db67f --- /dev/null +++ b/VmMigration/src/V1/FetchStorageInventoryRequest/StorageType.php @@ -0,0 +1,62 @@ +google.cloud.vmmigration.v1.FetchStorageInventoryRequest.StorageType + */ +class StorageType +{ + /** + * The type is unspecified. + * + * Generated from protobuf enum STORAGE_TYPE_UNSPECIFIED = 0; + */ + const STORAGE_TYPE_UNSPECIFIED = 0; + /** + * The type is disks. + * + * Generated from protobuf enum DISKS = 1; + */ + const DISKS = 1; + /** + * The type is snapshots. + * + * Generated from protobuf enum SNAPSHOTS = 2; + */ + const SNAPSHOTS = 2; + + private static $valueToName = [ + self::STORAGE_TYPE_UNSPECIFIED => 'STORAGE_TYPE_UNSPECIFIED', + self::DISKS => 'DISKS', + self::SNAPSHOTS => 'SNAPSHOTS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/VmMigration/src/V1/FetchStorageInventoryResponse.php b/VmMigration/src/V1/FetchStorageInventoryResponse.php new file mode 100644 index 000000000000..d4ac29fa2692 --- /dev/null +++ b/VmMigration/src/V1/FetchStorageInventoryResponse.php @@ -0,0 +1,154 @@ +google.cloud.vmmigration.v1.FetchStorageInventoryResponse + */ +class FetchStorageInventoryResponse extends \Google\Protobuf\Internal\Message +{ + /** + * The list of storage resources in the source. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.SourceStorageResource resources = 1; + */ + private $resources; + /** + * Output only. The timestamp when the source was last queried (if the result + * is from the cache). + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $update_time = null; + /** + * Output only. A token, which can be sent as `page_token` to retrieve the + * next page. If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $next_page_token = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\VMMigration\V1\SourceStorageResource>|\Google\Protobuf\Internal\RepeatedField $resources + * The list of storage resources in the source. + * @type \Google\Protobuf\Timestamp $update_time + * Output only. The timestamp when the source was last queried (if the result + * is from the cache). + * @type string $next_page_token + * Output only. A token, which can be sent as `page_token` to retrieve the + * next page. If this field is omitted, there are no subsequent pages. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * The list of storage resources in the source. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.SourceStorageResource resources = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getResources() + { + return $this->resources; + } + + /** + * The list of storage resources in the source. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.SourceStorageResource resources = 1; + * @param array<\Google\Cloud\VMMigration\V1\SourceStorageResource>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setResources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VMMigration\V1\SourceStorageResource::class); + $this->resources = $arr; + + return $this; + } + + /** + * Output only. The timestamp when the source was last queried (if the result + * is from the cache). + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getUpdateTime() + { + return $this->update_time; + } + + public function hasUpdateTime() + { + return isset($this->update_time); + } + + public function clearUpdateTime() + { + unset($this->update_time); + } + + /** + * Output only. The timestamp when the source was last queried (if the result + * is from the cache). + * + * Generated from protobuf field .google.protobuf.Timestamp update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->update_time = $var; + + return $this; + } + + /** + * Output only. A token, which can be sent as `page_token` to retrieve the + * next page. If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Output only. A token, which can be sent as `page_token` to retrieve the + * next page. If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/GetDiskMigrationJobRequest.php b/VmMigration/src/V1/GetDiskMigrationJobRequest.php new file mode 100644 index 000000000000..8e9e08464c55 --- /dev/null +++ b/VmMigration/src/V1/GetDiskMigrationJobRequest.php @@ -0,0 +1,81 @@ +google.cloud.vmmigration.v1.GetDiskMigrationJobRequest + */ +class GetDiskMigrationJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the DiskMigrationJob. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the DiskMigrationJob. Please see + * {@see VmMigrationClient::diskMigrationJobName()} for help formatting this field. + * + * @return \Google\Cloud\VMMigration\V1\GetDiskMigrationJobRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the DiskMigrationJob. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the DiskMigrationJob. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the DiskMigrationJob. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/GetImageImportJobRequest.php b/VmMigration/src/V1/GetImageImportJobRequest.php new file mode 100644 index 000000000000..320c3b4f8ace --- /dev/null +++ b/VmMigration/src/V1/GetImageImportJobRequest.php @@ -0,0 +1,81 @@ +google.cloud.vmmigration.v1.GetImageImportJobRequest + */ +class GetImageImportJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The ImageImportJob name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The ImageImportJob name. Please see + * {@see VmMigrationClient::imageImportJobName()} for help formatting this field. + * + * @return \Google\Cloud\VMMigration\V1\GetImageImportJobRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The ImageImportJob name. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Required. The ImageImportJob name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The ImageImportJob name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/GetImageImportRequest.php b/VmMigration/src/V1/GetImageImportRequest.php new file mode 100644 index 000000000000..d4553f7a8fe8 --- /dev/null +++ b/VmMigration/src/V1/GetImageImportRequest.php @@ -0,0 +1,81 @@ +google.cloud.vmmigration.v1.GetImageImportRequest + */ +class GetImageImportRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The ImageImport name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The ImageImport name. Please see + * {@see VmMigrationClient::imageImportName()} for help formatting this field. + * + * @return \Google\Cloud\VMMigration\V1\GetImageImportRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The ImageImport name. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Required. The ImageImport name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The ImageImport name. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/Group.php b/VmMigration/src/V1/Group.php index ea661a9c1fef..ee1129f87c76 100644 --- a/VmMigration/src/V1/Group.php +++ b/VmMigration/src/V1/Group.php @@ -46,6 +46,12 @@ class Group extends \Google\Protobuf\Internal\Message * Generated from protobuf field string display_name = 5; */ protected $display_name = ''; + /** + * Immutable. The target type of this group. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Group.MigrationTargetType migration_target_type = 6 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $migration_target_type = 0; /** * Constructor. @@ -63,6 +69,8 @@ class Group extends \Google\Protobuf\Internal\Message * User-provided description of the group. * @type string $display_name * Display name is a user defined name for this group which can be updated. + * @type int $migration_target_type + * Immutable. The target type of this group. * } */ public function __construct($data = NULL) { @@ -220,5 +228,31 @@ public function setDisplayName($var) return $this; } + /** + * Immutable. The target type of this group. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Group.MigrationTargetType migration_target_type = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * @return int + */ + public function getMigrationTargetType() + { + return $this->migration_target_type; + } + + /** + * Immutable. The target type of this group. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Group.MigrationTargetType migration_target_type = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * @param int $var + * @return $this + */ + public function setMigrationTargetType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\Group\MigrationTargetType::class); + $this->migration_target_type = $var; + + return $this; + } + } diff --git a/VmMigration/src/V1/Group/MigrationTargetType.php b/VmMigration/src/V1/Group/MigrationTargetType.php new file mode 100644 index 000000000000..b83ca47adb88 --- /dev/null +++ b/VmMigration/src/V1/Group/MigrationTargetType.php @@ -0,0 +1,62 @@ +google.cloud.vmmigration.v1.Group.MigrationTargetType + */ +class MigrationTargetType +{ + /** + * Group type is not specified. This defaults to Compute Engine targets. + * + * Generated from protobuf enum MIGRATION_TARGET_TYPE_UNSPECIFIED = 0; + */ + const MIGRATION_TARGET_TYPE_UNSPECIFIED = 0; + /** + * All MigratingVMs in the group must have Compute Engine targets. + * + * Generated from protobuf enum MIGRATION_TARGET_TYPE_GCE = 1; + */ + const MIGRATION_TARGET_TYPE_GCE = 1; + /** + * All MigratingVMs in the group must have Compute Engine Disks targets. + * + * Generated from protobuf enum MIGRATION_TARGET_TYPE_DISKS = 2; + */ + const MIGRATION_TARGET_TYPE_DISKS = 2; + + private static $valueToName = [ + self::MIGRATION_TARGET_TYPE_UNSPECIFIED => 'MIGRATION_TARGET_TYPE_UNSPECIFIED', + self::MIGRATION_TARGET_TYPE_GCE => 'MIGRATION_TARGET_TYPE_GCE', + self::MIGRATION_TARGET_TYPE_DISKS => 'MIGRATION_TARGET_TYPE_DISKS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/VmMigration/src/V1/ImageImport.php b/VmMigration/src/V1/ImageImport.php new file mode 100644 index 000000000000..e4ec7140d676 --- /dev/null +++ b/VmMigration/src/V1/ImageImport.php @@ -0,0 +1,323 @@ +google.cloud.vmmigration.v1.ImageImport + */ +class ImageImport extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource path of the ImageImport. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. The time the image import was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The result of the most recent runs for this ImageImport. All + * jobs for this ImageImport can be listed via ListImageImportJobs. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.ImageImportJob recent_image_import_jobs = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $recent_image_import_jobs; + /** + * Immutable. The encryption details used by the image import process during + * the image adaptation for Compute Engine. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 6 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $encryption = null; + protected $source; + protected $target_defaults; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $cloud_storage_uri + * Immutable. The path to the Cloud Storage file from which the image should + * be imported. + * @type \Google\Cloud\VMMigration\V1\DiskImageTargetDetails $disk_image_target_defaults + * Immutable. Target details for importing a disk image, will be used by + * ImageImportJob. + * @type \Google\Cloud\VMMigration\V1\MachineImageTargetDetails $machine_image_target_defaults + * Immutable. Target details for importing a machine image, will be used by + * ImageImportJob. + * @type string $name + * Output only. The resource path of the ImageImport. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the image import was created. + * @type array<\Google\Cloud\VMMigration\V1\ImageImportJob>|\Google\Protobuf\Internal\RepeatedField $recent_image_import_jobs + * Output only. The result of the most recent runs for this ImageImport. All + * jobs for this ImageImport can be listed via ListImageImportJobs. + * @type \Google\Cloud\VMMigration\V1\Encryption $encryption + * Immutable. The encryption details used by the image import process during + * the image adaptation for Compute Engine. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Immutable. The path to the Cloud Storage file from which the image should + * be imported. + * + * Generated from protobuf field string cloud_storage_uri = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * @return string + */ + public function getCloudStorageUri() + { + return $this->readOneof(2); + } + + public function hasCloudStorageUri() + { + return $this->hasOneof(2); + } + + /** + * Immutable. The path to the Cloud Storage file from which the image should + * be imported. + * + * Generated from protobuf field string cloud_storage_uri = 2 [(.google.api.field_behavior) = IMMUTABLE]; + * @param string $var + * @return $this + */ + public function setCloudStorageUri($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Immutable. Target details for importing a disk image, will be used by + * ImageImportJob. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.DiskImageTargetDetails disk_image_target_defaults = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\VMMigration\V1\DiskImageTargetDetails|null + */ + public function getDiskImageTargetDefaults() + { + return $this->readOneof(4); + } + + public function hasDiskImageTargetDefaults() + { + return $this->hasOneof(4); + } + + /** + * Immutable. Target details for importing a disk image, will be used by + * ImageImportJob. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.DiskImageTargetDetails disk_image_target_defaults = 4 [(.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\VMMigration\V1\DiskImageTargetDetails $var + * @return $this + */ + public function setDiskImageTargetDefaults($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\DiskImageTargetDetails::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Immutable. Target details for importing a machine image, will be used by + * ImageImportJob. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.MachineImageTargetDetails machine_image_target_defaults = 7 [(.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\VMMigration\V1\MachineImageTargetDetails|null + */ + public function getMachineImageTargetDefaults() + { + return $this->readOneof(7); + } + + public function hasMachineImageTargetDefaults() + { + return $this->hasOneof(7); + } + + /** + * Immutable. Target details for importing a machine image, will be used by + * ImageImportJob. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.MachineImageTargetDetails machine_image_target_defaults = 7 [(.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\VMMigration\V1\MachineImageTargetDetails $var + * @return $this + */ + public function setMachineImageTargetDefaults($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\MachineImageTargetDetails::class); + $this->writeOneof(7, $var); + + return $this; + } + + /** + * Output only. The resource path of the ImageImport. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource path of the ImageImport. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The time the image import was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the image import was created. + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The result of the most recent runs for this ImageImport. All + * jobs for this ImageImport can be listed via ListImageImportJobs. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.ImageImportJob recent_image_import_jobs = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getRecentImageImportJobs() + { + return $this->recent_image_import_jobs; + } + + /** + * Output only. The result of the most recent runs for this ImageImport. All + * jobs for this ImageImport can be listed via ListImageImportJobs. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.ImageImportJob recent_image_import_jobs = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\VMMigration\V1\ImageImportJob>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setRecentImageImportJobs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VMMigration\V1\ImageImportJob::class); + $this->recent_image_import_jobs = $arr; + + return $this; + } + + /** + * Immutable. The encryption details used by the image import process during + * the image adaptation for Compute Engine. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\VMMigration\V1\Encryption|null + */ + public function getEncryption() + { + return $this->encryption; + } + + public function hasEncryption() + { + return isset($this->encryption); + } + + public function clearEncryption() + { + unset($this->encryption); + } + + /** + * Immutable. The encryption details used by the image import process during + * the image adaptation for Compute Engine. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\VMMigration\V1\Encryption $var + * @return $this + */ + public function setEncryption($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\Encryption::class); + $this->encryption = $var; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + + /** + * @return string + */ + public function getTargetDefaults() + { + return $this->whichOneof("target_defaults"); + } + +} + diff --git a/VmMigration/src/V1/ImageImportJob.php b/VmMigration/src/V1/ImageImportJob.php new file mode 100644 index 000000000000..2b39592673de --- /dev/null +++ b/VmMigration/src/V1/ImageImportJob.php @@ -0,0 +1,457 @@ +google.cloud.vmmigration.v1.ImageImportJob + */ +class ImageImportJob extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The resource path of the ImageImportJob. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $name = ''; + /** + * Output only. The resource paths of the resources created by the image + * import job. + * + * Generated from protobuf field repeated string created_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $created_resources; + /** + * Output only. The state of the image import. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ImageImportJob.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. The time the image import was created (as an API call, not + * when it was actually created in the target). + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $create_time = null; + /** + * Output only. The time the image import was ended. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + /** + * Output only. Provides details on the error that led to the image import + * state in case of an error. + * + * Generated from protobuf field repeated .google.rpc.Status errors = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $errors; + /** + * Output only. Warnings that occurred during the image import. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.MigrationWarning warnings = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $warnings; + /** + * Output only. The image import steps list representing its progress. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.ImageImportStep steps = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $steps; + protected $source; + protected $target_details; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $cloud_storage_uri + * Output only. The path to the Cloud Storage file from which the image + * should be imported. + * @type \Google\Cloud\VMMigration\V1\DiskImageTargetDetails $disk_image_target_details + * Output only. Target details used to import a disk image. + * @type \Google\Cloud\VMMigration\V1\MachineImageTargetDetails $machine_image_target_details + * Output only. Target details used to import a machine image. + * @type string $name + * Output only. The resource path of the ImageImportJob. + * @type array|\Google\Protobuf\Internal\RepeatedField $created_resources + * Output only. The resource paths of the resources created by the image + * import job. + * @type int $state + * Output only. The state of the image import. + * @type \Google\Protobuf\Timestamp $create_time + * Output only. The time the image import was created (as an API call, not + * when it was actually created in the target). + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the image import was ended. + * @type array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $errors + * Output only. Provides details on the error that led to the image import + * state in case of an error. + * @type array<\Google\Cloud\VMMigration\V1\MigrationWarning>|\Google\Protobuf\Internal\RepeatedField $warnings + * Output only. Warnings that occurred during the image import. + * @type array<\Google\Cloud\VMMigration\V1\ImageImportStep>|\Google\Protobuf\Internal\RepeatedField $steps + * Output only. The image import steps list representing its progress. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The path to the Cloud Storage file from which the image + * should be imported. + * + * Generated from protobuf field string cloud_storage_uri = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getCloudStorageUri() + { + return $this->readOneof(10); + } + + public function hasCloudStorageUri() + { + return $this->hasOneof(10); + } + + /** + * Output only. The path to the Cloud Storage file from which the image + * should be imported. + * + * Generated from protobuf field string cloud_storage_uri = 10 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setCloudStorageUri($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(10, $var); + + return $this; + } + + /** + * Output only. Target details used to import a disk image. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.DiskImageTargetDetails disk_image_target_details = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\VMMigration\V1\DiskImageTargetDetails|null + */ + public function getDiskImageTargetDetails() + { + return $this->readOneof(3); + } + + public function hasDiskImageTargetDetails() + { + return $this->hasOneof(3); + } + + /** + * Output only. Target details used to import a disk image. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.DiskImageTargetDetails disk_image_target_details = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\VMMigration\V1\DiskImageTargetDetails $var + * @return $this + */ + public function setDiskImageTargetDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\DiskImageTargetDetails::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Output only. Target details used to import a machine image. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.MachineImageTargetDetails machine_image_target_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\VMMigration\V1\MachineImageTargetDetails|null + */ + public function getMachineImageTargetDetails() + { + return $this->readOneof(11); + } + + public function hasMachineImageTargetDetails() + { + return $this->hasOneof(11); + } + + /** + * Output only. Target details used to import a machine image. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.MachineImageTargetDetails machine_image_target_details = 11 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\VMMigration\V1\MachineImageTargetDetails $var + * @return $this + */ + public function setMachineImageTargetDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\MachineImageTargetDetails::class); + $this->writeOneof(11, $var); + + return $this; + } + + /** + * Output only. The resource path of the ImageImportJob. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Output only. The resource path of the ImageImportJob. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Output only. The resource paths of the resources created by the image + * import job. + * + * Generated from protobuf field repeated string created_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getCreatedResources() + { + return $this->created_resources; + } + + /** + * Output only. The resource paths of the resources created by the image + * import job. + * + * Generated from protobuf field repeated string created_resources = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setCreatedResources($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->created_resources = $arr; + + return $this; + } + + /** + * Output only. The state of the image import. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ImageImportJob.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The state of the image import. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ImageImportJob.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\ImageImportJob\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. The time the image import was created (as an API call, not + * when it was actually created in the target). + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getCreateTime() + { + return $this->create_time; + } + + public function hasCreateTime() + { + return isset($this->create_time); + } + + public function clearCreateTime() + { + unset($this->create_time); + } + + /** + * Output only. The time the image import was created (as an API call, not + * when it was actually created in the target). + * + * Generated from protobuf field .google.protobuf.Timestamp create_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setCreateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->create_time = $var; + + return $this; + } + + /** + * Output only. The time the image import was ended. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the image import was ended. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * Output only. Provides details on the error that led to the image import + * state in case of an error. + * + * Generated from protobuf field repeated .google.rpc.Status errors = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getErrors() + { + return $this->errors; + } + + /** + * Output only. Provides details on the error that led to the image import + * state in case of an error. + * + * Generated from protobuf field repeated .google.rpc.Status errors = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Rpc\Status>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setErrors($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Status::class); + $this->errors = $arr; + + return $this; + } + + /** + * Output only. Warnings that occurred during the image import. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.MigrationWarning warnings = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWarnings() + { + return $this->warnings; + } + + /** + * Output only. Warnings that occurred during the image import. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.MigrationWarning warnings = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\VMMigration\V1\MigrationWarning>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWarnings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VMMigration\V1\MigrationWarning::class); + $this->warnings = $arr; + + return $this; + } + + /** + * Output only. The image import steps list representing its progress. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.ImageImportStep steps = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getSteps() + { + return $this->steps; + } + + /** + * Output only. The image import steps list representing its progress. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.ImageImportStep steps = 9 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\VMMigration\V1\ImageImportStep>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setSteps($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VMMigration\V1\ImageImportStep::class); + $this->steps = $arr; + + return $this; + } + + /** + * @return string + */ + public function getSource() + { + return $this->whichOneof("source"); + } + + /** + * @return string + */ + public function getTargetDetails() + { + return $this->whichOneof("target_details"); + } + +} + diff --git a/VmMigration/src/V1/ImageImportJob/State.php b/VmMigration/src/V1/ImageImportJob/State.php new file mode 100644 index 000000000000..6aa3010d08c3 --- /dev/null +++ b/VmMigration/src/V1/ImageImportJob/State.php @@ -0,0 +1,90 @@ +google.cloud.vmmigration.v1.ImageImportJob.State + */ +class State +{ + /** + * The state is unknown. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * The image import has not yet started. + * + * Generated from protobuf enum PENDING = 1; + */ + const PENDING = 1; + /** + * The image import is active and running. + * + * Generated from protobuf enum RUNNING = 2; + */ + const RUNNING = 2; + /** + * The image import has finished successfully. + * + * Generated from protobuf enum SUCCEEDED = 3; + */ + const SUCCEEDED = 3; + /** + * The image import has finished with errors. + * + * Generated from protobuf enum FAILED = 4; + */ + const FAILED = 4; + /** + * The image import is being cancelled. + * + * Generated from protobuf enum CANCELLING = 5; + */ + const CANCELLING = 5; + /** + * The image import was cancelled. + * + * Generated from protobuf enum CANCELLED = 6; + */ + const CANCELLED = 6; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PENDING => 'PENDING', + self::RUNNING => 'RUNNING', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + self::CANCELLING => 'CANCELLING', + self::CANCELLED => 'CANCELLED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/VmMigration/src/V1/ImageImportOsAdaptationParameters.php b/VmMigration/src/V1/ImageImportOsAdaptationParameters.php new file mode 100644 index 000000000000..311fc0506e6e --- /dev/null +++ b/VmMigration/src/V1/ImageImportOsAdaptationParameters.php @@ -0,0 +1,163 @@ +google.cloud.vmmigration.v1.ImageImportOsAdaptationParameters + */ +class ImageImportOsAdaptationParameters extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Set to true in order to generalize the imported image. + * The generalization process enables co-existence of multiple VMs created + * from the same image. + * For Windows, generalizing the image removes computer-specific information + * such as installed drivers and the computer security identifier (SID). + * + * Generated from protobuf field bool generalize = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $generalize = false; + /** + * Optional. Choose which type of license to apply to the imported image. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineLicenseType license_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $license_type = 0; + /** + * Optional. By default the image will keep its existing boot option. Setting + * this property will trigger an internal process which will convert the + * image from using the existing boot option to another. + * The size of the boot disk might be increased to allow the conversion + * + * Generated from protobuf field .google.cloud.vmmigration.v1.BootConversion boot_conversion = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $boot_conversion = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type bool $generalize + * Optional. Set to true in order to generalize the imported image. + * The generalization process enables co-existence of multiple VMs created + * from the same image. + * For Windows, generalizing the image removes computer-specific information + * such as installed drivers and the computer security identifier (SID). + * @type int $license_type + * Optional. Choose which type of license to apply to the imported image. + * @type int $boot_conversion + * Optional. By default the image will keep its existing boot option. Setting + * this property will trigger an internal process which will convert the + * image from using the existing boot option to another. + * The size of the boot disk might be increased to allow the conversion + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Set to true in order to generalize the imported image. + * The generalization process enables co-existence of multiple VMs created + * from the same image. + * For Windows, generalizing the image removes computer-specific information + * such as installed drivers and the computer security identifier (SID). + * + * Generated from protobuf field bool generalize = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getGeneralize() + { + return $this->generalize; + } + + /** + * Optional. Set to true in order to generalize the imported image. + * The generalization process enables co-existence of multiple VMs created + * from the same image. + * For Windows, generalizing the image removes computer-specific information + * such as installed drivers and the computer security identifier (SID). + * + * Generated from protobuf field bool generalize = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setGeneralize($var) + { + GPBUtil::checkBool($var); + $this->generalize = $var; + + return $this; + } + + /** + * Optional. Choose which type of license to apply to the imported image. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineLicenseType license_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getLicenseType() + { + return $this->license_type; + } + + /** + * Optional. Choose which type of license to apply to the imported image. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineLicenseType license_type = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setLicenseType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\ComputeEngineLicenseType::class); + $this->license_type = $var; + + return $this; + } + + /** + * Optional. By default the image will keep its existing boot option. Setting + * this property will trigger an internal process which will convert the + * image from using the existing boot option to another. + * The size of the boot disk might be increased to allow the conversion + * + * Generated from protobuf field .google.cloud.vmmigration.v1.BootConversion boot_conversion = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getBootConversion() + { + return $this->boot_conversion; + } + + /** + * Optional. By default the image will keep its existing boot option. Setting + * this property will trigger an internal process which will convert the + * image from using the existing boot option to another. + * The size of the boot disk might be increased to allow the conversion + * + * Generated from protobuf field .google.cloud.vmmigration.v1.BootConversion boot_conversion = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setBootConversion($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\BootConversion::class); + $this->boot_conversion = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/ImageImportStep.php b/VmMigration/src/V1/ImageImportStep.php new file mode 100644 index 000000000000..057657760a95 --- /dev/null +++ b/VmMigration/src/V1/ImageImportStep.php @@ -0,0 +1,262 @@ +google.cloud.vmmigration.v1.ImageImportStep + */ +class ImageImportStep extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The time the step has started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $start_time = null; + /** + * Output only. The time the step has ended. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $end_time = null; + protected $step; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\VMMigration\V1\InitializingImageImportStep $initializing + * Initializing step. + * @type \Google\Cloud\VMMigration\V1\LoadingImageSourceFilesStep $loading_source_files + * Loading source files step. + * @type \Google\Cloud\VMMigration\V1\AdaptingOSStep $adapting_os + * Adapting OS step. + * @type \Google\Cloud\VMMigration\V1\CreatingImageStep $creating_image + * Creating image step. + * @type \Google\Protobuf\Timestamp $start_time + * Output only. The time the step has started. + * @type \Google\Protobuf\Timestamp $end_time + * Output only. The time the step has ended. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Initializing step. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.InitializingImageImportStep initializing = 3; + * @return \Google\Cloud\VMMigration\V1\InitializingImageImportStep|null + */ + public function getInitializing() + { + return $this->readOneof(3); + } + + public function hasInitializing() + { + return $this->hasOneof(3); + } + + /** + * Initializing step. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.InitializingImageImportStep initializing = 3; + * @param \Google\Cloud\VMMigration\V1\InitializingImageImportStep $var + * @return $this + */ + public function setInitializing($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\InitializingImageImportStep::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Loading source files step. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.LoadingImageSourceFilesStep loading_source_files = 4; + * @return \Google\Cloud\VMMigration\V1\LoadingImageSourceFilesStep|null + */ + public function getLoadingSourceFiles() + { + return $this->readOneof(4); + } + + public function hasLoadingSourceFiles() + { + return $this->hasOneof(4); + } + + /** + * Loading source files step. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.LoadingImageSourceFilesStep loading_source_files = 4; + * @param \Google\Cloud\VMMigration\V1\LoadingImageSourceFilesStep $var + * @return $this + */ + public function setLoadingSourceFiles($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\LoadingImageSourceFilesStep::class); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Adapting OS step. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AdaptingOSStep adapting_os = 5; + * @return \Google\Cloud\VMMigration\V1\AdaptingOSStep|null + */ + public function getAdaptingOs() + { + return $this->readOneof(5); + } + + public function hasAdaptingOs() + { + return $this->hasOneof(5); + } + + /** + * Adapting OS step. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AdaptingOSStep adapting_os = 5; + * @param \Google\Cloud\VMMigration\V1\AdaptingOSStep $var + * @return $this + */ + public function setAdaptingOs($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\AdaptingOSStep::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Creating image step. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.CreatingImageStep creating_image = 6; + * @return \Google\Cloud\VMMigration\V1\CreatingImageStep|null + */ + public function getCreatingImage() + { + return $this->readOneof(6); + } + + public function hasCreatingImage() + { + return $this->hasOneof(6); + } + + /** + * Creating image step. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.CreatingImageStep creating_image = 6; + * @param \Google\Cloud\VMMigration\V1\CreatingImageStep $var + * @return $this + */ + public function setCreatingImage($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\CreatingImageStep::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * Output only. The time the step has started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getStartTime() + { + return $this->start_time; + } + + public function hasStartTime() + { + return isset($this->start_time); + } + + public function clearStartTime() + { + unset($this->start_time); + } + + /** + * Output only. The time the step has started. + * + * Generated from protobuf field .google.protobuf.Timestamp start_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setStartTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->start_time = $var; + + return $this; + } + + /** + * Output only. The time the step has ended. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getEndTime() + { + return $this->end_time; + } + + public function hasEndTime() + { + return isset($this->end_time); + } + + public function clearEndTime() + { + unset($this->end_time); + } + + /** + * Output only. The time the step has ended. + * + * Generated from protobuf field .google.protobuf.Timestamp end_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setEndTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->end_time = $var; + + return $this; + } + + /** + * @return string + */ + public function getStep() + { + return $this->whichOneof("step"); + } + +} + diff --git a/VmMigration/src/V1/InitializingImageImportStep.php b/VmMigration/src/V1/InitializingImageImportStep.php new file mode 100644 index 000000000000..8dba6ecee126 --- /dev/null +++ b/VmMigration/src/V1/InitializingImageImportStep.php @@ -0,0 +1,33 @@ +google.cloud.vmmigration.v1.InitializingImageImportStep + */ +class InitializingImageImportStep extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + +} + diff --git a/VmMigration/src/V1/ListDiskMigrationJobsRequest.php b/VmMigration/src/V1/ListDiskMigrationJobsRequest.php new file mode 100644 index 000000000000..c91d5361ad94 --- /dev/null +++ b/VmMigration/src/V1/ListDiskMigrationJobsRequest.php @@ -0,0 +1,245 @@ +google.cloud.vmmigration.v1.ListDiskMigrationJobsRequest + */ +class ListDiskMigrationJobsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, which owns this collection of DiskMigrationJobs. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of disk migration jobs to return. The service + * may return fewer than this value. If unspecified, at most 500 + * disk migration jobs will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListDiskMigrationJobs` + * call. Provide this to retrieve the subsequent page. + * When paginating, all parameters provided to `ListDiskMigrationJobs` + * except `page_size` must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. The filter request (according to AIP-160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. Ordering of the result list. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The parent, which owns this collection of DiskMigrationJobs. Please see + * {@see VmMigrationClient::sourceName()} for help formatting this field. + * + * @return \Google\Cloud\VMMigration\V1\ListDiskMigrationJobsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent, which owns this collection of DiskMigrationJobs. + * @type int $page_size + * Optional. The maximum number of disk migration jobs to return. The service + * may return fewer than this value. If unspecified, at most 500 + * disk migration jobs will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @type string $page_token + * Optional. A page token, received from a previous `ListDiskMigrationJobs` + * call. Provide this to retrieve the subsequent page. + * When paginating, all parameters provided to `ListDiskMigrationJobs` + * except `page_size` must match the call that provided the page token. + * @type string $filter + * Optional. The filter request (according to AIP-160). + * @type string $order_by + * Optional. Ordering of the result list. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, which owns this collection of DiskMigrationJobs. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent, which owns this collection of DiskMigrationJobs. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of disk migration jobs to return. The service + * may return fewer than this value. If unspecified, at most 500 + * disk migration jobs will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of disk migration jobs to return. The service + * may return fewer than this value. If unspecified, at most 500 + * disk migration jobs will be returned. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListDiskMigrationJobs` + * call. Provide this to retrieve the subsequent page. + * When paginating, all parameters provided to `ListDiskMigrationJobs` + * except `page_size` must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListDiskMigrationJobs` + * call. Provide this to retrieve the subsequent page. + * When paginating, all parameters provided to `ListDiskMigrationJobs` + * except `page_size` must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. The filter request (according to AIP-160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. The filter request (according to AIP-160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. Ordering of the result list. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. Ordering of the result list. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/ListDiskMigrationJobsResponse.php b/VmMigration/src/V1/ListDiskMigrationJobsResponse.php new file mode 100644 index 000000000000..6e70d1ee2552 --- /dev/null +++ b/VmMigration/src/V1/ListDiskMigrationJobsResponse.php @@ -0,0 +1,143 @@ +google.cloud.vmmigration.v1.ListDiskMigrationJobsResponse + */ +class ListDiskMigrationJobsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The list of the disk migration jobs. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.DiskMigrationJob disk_migration_jobs = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $disk_migration_jobs; + /** + * Optional. Output only. A token, which can be sent as `page_token` to + * retrieve the next page. If this field is omitted, there are no subsequent + * pages. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + */ + protected $next_page_token = ''; + /** + * Output only. Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\VMMigration\V1\DiskMigrationJob>|\Google\Protobuf\Internal\RepeatedField $disk_migration_jobs + * Output only. The list of the disk migration jobs. + * @type string $next_page_token + * Optional. Output only. A token, which can be sent as `page_token` to + * retrieve the next page. If this field is omitted, there are no subsequent + * pages. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Output only. Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The list of the disk migration jobs. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.DiskMigrationJob disk_migration_jobs = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDiskMigrationJobs() + { + return $this->disk_migration_jobs; + } + + /** + * Output only. The list of the disk migration jobs. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.DiskMigrationJob disk_migration_jobs = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\VMMigration\V1\DiskMigrationJob>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDiskMigrationJobs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VMMigration\V1\DiskMigrationJob::class); + $this->disk_migration_jobs = $arr; + + return $this; + } + + /** + * Optional. Output only. A token, which can be sent as `page_token` to + * retrieve the next page. If this field is omitted, there are no subsequent + * pages. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Optional. Output only. A token, which can be sent as `page_token` to + * retrieve the next page. If this field is omitted, there are no subsequent + * pages. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Output only. Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Output only. Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/ListImageImportJobsRequest.php b/VmMigration/src/V1/ListImageImportJobsRequest.php new file mode 100644 index 000000000000..305aa2e72036 --- /dev/null +++ b/VmMigration/src/V1/ListImageImportJobsRequest.php @@ -0,0 +1,253 @@ +google.cloud.vmmigration.v1.ListImageImportJobsRequest + */ +class ListImageImportJobsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, which owns this collection of targets. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of targets to return. The service may return + * fewer than this value. If unspecified, at most 500 targets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListImageImportJobs` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListImageImportJobs` + * must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. The filter request (according to AIP-160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. The order by fields for the result (according to AIP-132). + * Currently ordering is only possible by "name" field. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The parent, which owns this collection of targets. Please see + * {@see VmMigrationClient::imageImportName()} for help formatting this field. + * + * @return \Google\Cloud\VMMigration\V1\ListImageImportJobsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent, which owns this collection of targets. + * @type int $page_size + * Optional. The maximum number of targets to return. The service may return + * fewer than this value. If unspecified, at most 500 targets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @type string $page_token + * Optional. A page token, received from a previous `ListImageImportJobs` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListImageImportJobs` + * must match the call that provided the page token. + * @type string $filter + * Optional. The filter request (according to AIP-160). + * @type string $order_by + * Optional. The order by fields for the result (according to AIP-132). + * Currently ordering is only possible by "name" field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, which owns this collection of targets. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent, which owns this collection of targets. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of targets to return. The service may return + * fewer than this value. If unspecified, at most 500 targets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of targets to return. The service may return + * fewer than this value. If unspecified, at most 500 targets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListImageImportJobs` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListImageImportJobs` + * must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListImageImportJobs` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListImageImportJobs` + * must match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. The filter request (according to AIP-160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. The filter request (according to AIP-160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. The order by fields for the result (according to AIP-132). + * Currently ordering is only possible by "name" field. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. The order by fields for the result (according to AIP-132). + * Currently ordering is only possible by "name" field. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/ListImageImportJobsResponse.php b/VmMigration/src/V1/ListImageImportJobsResponse.php new file mode 100644 index 000000000000..6afe64103ced --- /dev/null +++ b/VmMigration/src/V1/ListImageImportJobsResponse.php @@ -0,0 +1,139 @@ +google.cloud.vmmigration.v1.ListImageImportJobsResponse + */ +class ListImageImportJobsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The list of target response. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.ImageImportJob image_import_jobs = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $image_import_jobs; + /** + * Output only. A token, which can be sent as `page_token` to retrieve the + * next page. If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $next_page_token = ''; + /** + * Output only. Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\VMMigration\V1\ImageImportJob>|\Google\Protobuf\Internal\RepeatedField $image_import_jobs + * Output only. The list of target response. + * @type string $next_page_token + * Output only. A token, which can be sent as `page_token` to retrieve the + * next page. If this field is omitted, there are no subsequent pages. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Output only. Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The list of target response. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.ImageImportJob image_import_jobs = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getImageImportJobs() + { + return $this->image_import_jobs; + } + + /** + * Output only. The list of target response. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.ImageImportJob image_import_jobs = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\VMMigration\V1\ImageImportJob>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setImageImportJobs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VMMigration\V1\ImageImportJob::class); + $this->image_import_jobs = $arr; + + return $this; + } + + /** + * Output only. A token, which can be sent as `page_token` to retrieve the + * next page. If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Output only. A token, which can be sent as `page_token` to retrieve the + * next page. If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Output only. Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Output only. Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/ListImageImportsRequest.php b/VmMigration/src/V1/ListImageImportsRequest.php new file mode 100644 index 000000000000..c7daef679702 --- /dev/null +++ b/VmMigration/src/V1/ListImageImportsRequest.php @@ -0,0 +1,253 @@ +google.cloud.vmmigration.v1.ListImageImportsRequest + */ +class ListImageImportsRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The parent, which owns this collection of targets. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $parent = ''; + /** + * Optional. The maximum number of targets to return. The service may return + * fewer than this value. If unspecified, at most 500 targets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_size = 0; + /** + * Optional. A page token, received from a previous `ListImageImports` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListImageImports` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $page_token = ''; + /** + * Optional. The filter request (according to AIP-160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $filter = ''; + /** + * Optional. The order by fields for the result (according to AIP-132). + * Currently ordering is only possible by "name" field. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $order_by = ''; + + /** + * @param string $parent Required. The parent, which owns this collection of targets. Please see + * {@see VmMigrationClient::locationName()} for help formatting this field. + * + * @return \Google\Cloud\VMMigration\V1\ListImageImportsRequest + * + * @experimental + */ + public static function build(string $parent): self + { + return (new self()) + ->setParent($parent); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $parent + * Required. The parent, which owns this collection of targets. + * @type int $page_size + * Optional. The maximum number of targets to return. The service may return + * fewer than this value. If unspecified, at most 500 targets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * @type string $page_token + * Optional. A page token, received from a previous `ListImageImports` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListImageImports` must + * match the call that provided the page token. + * @type string $filter + * Optional. The filter request (according to AIP-160). + * @type string $order_by + * Optional. The order by fields for the result (according to AIP-132). + * Currently ordering is only possible by "name" field. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Required. The parent, which owns this collection of targets. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getParent() + { + return $this->parent; + } + + /** + * Required. The parent, which owns this collection of targets. + * + * Generated from protobuf field string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setParent($var) + { + GPBUtil::checkString($var, True); + $this->parent = $var; + + return $this; + } + + /** + * Optional. The maximum number of targets to return. The service may return + * fewer than this value. If unspecified, at most 500 targets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getPageSize() + { + return $this->page_size; + } + + /** + * Optional. The maximum number of targets to return. The service may return + * fewer than this value. If unspecified, at most 500 targets will be + * returned. The maximum value is 1000; values above 1000 will be coerced to + * 1000. + * + * Generated from protobuf field int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setPageSize($var) + { + GPBUtil::checkInt32($var); + $this->page_size = $var; + + return $this; + } + + /** + * Optional. A page token, received from a previous `ListImageImports` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListImageImports` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getPageToken() + { + return $this->page_token; + } + + /** + * Optional. A page token, received from a previous `ListImageImports` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListImageImports` must + * match the call that provided the page token. + * + * Generated from protobuf field string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setPageToken($var) + { + GPBUtil::checkString($var, True); + $this->page_token = $var; + + return $this; + } + + /** + * Optional. The filter request (according to AIP-160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getFilter() + { + return $this->filter; + } + + /** + * Optional. The filter request (according to AIP-160). + * + * Generated from protobuf field string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setFilter($var) + { + GPBUtil::checkString($var, True); + $this->filter = $var; + + return $this; + } + + /** + * Optional. The order by fields for the result (according to AIP-132). + * Currently ordering is only possible by "name" field. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getOrderBy() + { + return $this->order_by; + } + + /** + * Optional. The order by fields for the result (according to AIP-132). + * Currently ordering is only possible by "name" field. + * + * Generated from protobuf field string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setOrderBy($var) + { + GPBUtil::checkString($var, True); + $this->order_by = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/ListImageImportsResponse.php b/VmMigration/src/V1/ListImageImportsResponse.php new file mode 100644 index 000000000000..996495a0eb34 --- /dev/null +++ b/VmMigration/src/V1/ListImageImportsResponse.php @@ -0,0 +1,139 @@ +google.cloud.vmmigration.v1.ListImageImportsResponse + */ +class ListImageImportsResponse extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The list of target response. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.ImageImport image_imports = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $image_imports; + /** + * Output only. A token, which can be sent as `page_token` to retrieve the + * next page. If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $next_page_token = ''; + /** + * Output only. Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $unreachable; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array<\Google\Cloud\VMMigration\V1\ImageImport>|\Google\Protobuf\Internal\RepeatedField $image_imports + * Output only. The list of target response. + * @type string $next_page_token + * Output only. A token, which can be sent as `page_token` to retrieve the + * next page. If this field is omitted, there are no subsequent pages. + * @type array|\Google\Protobuf\Internal\RepeatedField $unreachable + * Output only. Locations that could not be reached. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The list of target response. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.ImageImport image_imports = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getImageImports() + { + return $this->image_imports; + } + + /** + * Output only. The list of target response. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.ImageImport image_imports = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\VMMigration\V1\ImageImport>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setImageImports($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VMMigration\V1\ImageImport::class); + $this->image_imports = $arr; + + return $this; + } + + /** + * Output only. A token, which can be sent as `page_token` to retrieve the + * next page. If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getNextPageToken() + { + return $this->next_page_token; + } + + /** + * Output only. A token, which can be sent as `page_token` to retrieve the + * next page. If this field is omitted, there are no subsequent pages. + * + * Generated from protobuf field string next_page_token = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setNextPageToken($var) + { + GPBUtil::checkString($var, True); + $this->next_page_token = $var; + + return $this; + } + + /** + * Output only. Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getUnreachable() + { + return $this->unreachable; + } + + /** + * Output only. Locations that could not be reached. + * + * Generated from protobuf field repeated string unreachable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setUnreachable($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->unreachable = $arr; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/LoadingImageSourceFilesStep.php b/VmMigration/src/V1/LoadingImageSourceFilesStep.php new file mode 100644 index 000000000000..2e1966d24e6b --- /dev/null +++ b/VmMigration/src/V1/LoadingImageSourceFilesStep.php @@ -0,0 +1,33 @@ +google.cloud.vmmigration.v1.LoadingImageSourceFilesStep + */ +class LoadingImageSourceFilesStep extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + +} + diff --git a/VmMigration/src/V1/MachineImageParametersOverrides.php b/VmMigration/src/V1/MachineImageParametersOverrides.php new file mode 100644 index 000000000000..3df5deb08b6d --- /dev/null +++ b/VmMigration/src/V1/MachineImageParametersOverrides.php @@ -0,0 +1,84 @@ +google.cloud.vmmigration.v1.MachineImageParametersOverrides + */ +class MachineImageParametersOverrides extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. The machine type to create the MachineImage with. + * If empty, the service will choose a relevant machine type based on the + * information from the source image. + * For more information about machine types, please refer to + * https://cloud.google.com/compute/docs/machine-resource. + * + * Generated from protobuf field string machine_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $machine_type = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $machine_type + * Optional. The machine type to create the MachineImage with. + * If empty, the service will choose a relevant machine type based on the + * information from the source image. + * For more information about machine types, please refer to + * https://cloud.google.com/compute/docs/machine-resource. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Optional. The machine type to create the MachineImage with. + * If empty, the service will choose a relevant machine type based on the + * information from the source image. + * For more information about machine types, please refer to + * https://cloud.google.com/compute/docs/machine-resource. + * + * Generated from protobuf field string machine_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getMachineType() + { + return $this->machine_type; + } + + /** + * Optional. The machine type to create the MachineImage with. + * If empty, the service will choose a relevant machine type based on the + * information from the source image. + * For more information about machine types, please refer to + * https://cloud.google.com/compute/docs/machine-resource. + * + * Generated from protobuf field string machine_type = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setMachineType($var) + { + GPBUtil::checkString($var, True); + $this->machine_type = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/MachineImageTargetDetails.php b/VmMigration/src/V1/MachineImageTargetDetails.php new file mode 100644 index 000000000000..2f080f8e48db --- /dev/null +++ b/VmMigration/src/V1/MachineImageTargetDetails.php @@ -0,0 +1,612 @@ +google.cloud.vmmigration.v1.MachineImageTargetDetails + */ +class MachineImageTargetDetails extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the machine image to be created. + * + * Generated from protobuf field string machine_image_name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $machine_image_name = ''; + /** + * Required. Reference to the TargetProject resource that represents the + * target project in which the imported machine image will be created. + * + * Generated from protobuf field string target_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $target_project = ''; + /** + * Optional. An optional description of the machine image. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $description = ''; + /** + * Optional. Set to true to set the machine image storageLocations to the + * single region of the import job. When false, the closest multi-region is + * selected. + * + * Generated from protobuf field bool single_region_storage = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $single_region_storage = false; + /** + * Immutable. The encryption to apply to the machine image. + * If the Image Import resource has an encryption, this field must be set to + * the same encryption key. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 6 [(.google.api.field_behavior) = IMMUTABLE]; + */ + protected $encryption = null; + /** + * Optional. Parameters overriding decisions based on the source machine image + * configurations. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.MachineImageParametersOverrides machine_image_parameters_overrides = 7 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $machine_image_parameters_overrides = null; + /** + * Optional. The service account to assign to the instance created by the + * machine image. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ServiceAccount service_account = 8 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $service_account = null; + /** + * Optional. Additional licenses to assign to the instance created by the + * machine image. Format: + * https://www.googleapis.com/compute/v1/projects/PROJECT_ID/global/licenses/LICENSE_NAME + * Or + * https://www.googleapis.com/compute/beta/projects/PROJECT_ID/global/licenses/LICENSE_NAME + * + * Generated from protobuf field repeated string additional_licenses = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $additional_licenses; + /** + * Optional. The labels to apply to the instance created by the machine image. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $labels; + /** + * Optional. The tags to apply to the instance created by the machine image. + * + * Generated from protobuf field repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $tags; + /** + * Optional. Shielded instance configuration. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ShieldedInstanceConfig shielded_instance_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $shielded_instance_config = null; + /** + * Optional. The network interfaces to create with the instance created by the + * machine image. Internal and external IP addresses, and network tiers are + * ignored for machine image import. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.NetworkInterface network_interfaces = 13 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $network_interfaces; + protected $os_adaptation_config; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\VMMigration\V1\ImageImportOsAdaptationParameters $os_adaptation_parameters + * Optional. Use to set the parameters relevant for the OS adaptation + * process. + * @type \Google\Cloud\VMMigration\V1\SkipOsAdaptation $skip_os_adaptation + * Optional. Use to skip OS adaptation process. + * @type string $machine_image_name + * Required. The name of the machine image to be created. + * @type string $target_project + * Required. Reference to the TargetProject resource that represents the + * target project in which the imported machine image will be created. + * @type string $description + * Optional. An optional description of the machine image. + * @type bool $single_region_storage + * Optional. Set to true to set the machine image storageLocations to the + * single region of the import job. When false, the closest multi-region is + * selected. + * @type \Google\Cloud\VMMigration\V1\Encryption $encryption + * Immutable. The encryption to apply to the machine image. + * If the Image Import resource has an encryption, this field must be set to + * the same encryption key. + * @type \Google\Cloud\VMMigration\V1\MachineImageParametersOverrides $machine_image_parameters_overrides + * Optional. Parameters overriding decisions based on the source machine image + * configurations. + * @type \Google\Cloud\VMMigration\V1\ServiceAccount $service_account + * Optional. The service account to assign to the instance created by the + * machine image. + * @type array|\Google\Protobuf\Internal\RepeatedField $additional_licenses + * Optional. Additional licenses to assign to the instance created by the + * machine image. Format: + * https://www.googleapis.com/compute/v1/projects/PROJECT_ID/global/licenses/LICENSE_NAME + * Or + * https://www.googleapis.com/compute/beta/projects/PROJECT_ID/global/licenses/LICENSE_NAME + * @type array|\Google\Protobuf\Internal\MapField $labels + * Optional. The labels to apply to the instance created by the machine image. + * @type array|\Google\Protobuf\Internal\RepeatedField $tags + * Optional. The tags to apply to the instance created by the machine image. + * @type \Google\Cloud\VMMigration\V1\ShieldedInstanceConfig $shielded_instance_config + * Optional. Shielded instance configuration. + * @type array<\Google\Cloud\VMMigration\V1\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $network_interfaces + * Optional. The network interfaces to create with the instance created by the + * machine image. Internal and external IP addresses, and network tiers are + * ignored for machine image import. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Use to set the parameters relevant for the OS adaptation + * process. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ImageImportOsAdaptationParameters os_adaptation_parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\VMMigration\V1\ImageImportOsAdaptationParameters|null + */ + public function getOsAdaptationParameters() + { + return $this->readOneof(3); + } + + public function hasOsAdaptationParameters() + { + return $this->hasOneof(3); + } + + /** + * Optional. Use to set the parameters relevant for the OS adaptation + * process. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ImageImportOsAdaptationParameters os_adaptation_parameters = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\VMMigration\V1\ImageImportOsAdaptationParameters $var + * @return $this + */ + public function setOsAdaptationParameters($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\ImageImportOsAdaptationParameters::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Optional. Use to skip OS adaptation process. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.SkipOsAdaptation skip_os_adaptation = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\VMMigration\V1\SkipOsAdaptation|null + */ + public function getSkipOsAdaptation() + { + return $this->readOneof(16); + } + + public function hasSkipOsAdaptation() + { + return $this->hasOneof(16); + } + + /** + * Optional. Use to skip OS adaptation process. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.SkipOsAdaptation skip_os_adaptation = 16 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\VMMigration\V1\SkipOsAdaptation $var + * @return $this + */ + public function setSkipOsAdaptation($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\SkipOsAdaptation::class); + $this->writeOneof(16, $var); + + return $this; + } + + /** + * Required. The name of the machine image to be created. + * + * Generated from protobuf field string machine_image_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getMachineImageName() + { + return $this->machine_image_name; + } + + /** + * Required. The name of the machine image to be created. + * + * Generated from protobuf field string machine_image_name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setMachineImageName($var) + { + GPBUtil::checkString($var, True); + $this->machine_image_name = $var; + + return $this; + } + + /** + * Required. Reference to the TargetProject resource that represents the + * target project in which the imported machine image will be created. + * + * Generated from protobuf field string target_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getTargetProject() + { + return $this->target_project; + } + + /** + * Required. Reference to the TargetProject resource that represents the + * target project in which the imported machine image will be created. + * + * Generated from protobuf field string target_project = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setTargetProject($var) + { + GPBUtil::checkString($var, True); + $this->target_project = $var; + + return $this; + } + + /** + * Optional. An optional description of the machine image. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDescription() + { + return $this->description; + } + + /** + * Optional. An optional description of the machine image. + * + * Generated from protobuf field string description = 4 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDescription($var) + { + GPBUtil::checkString($var, True); + $this->description = $var; + + return $this; + } + + /** + * Optional. Set to true to set the machine image storageLocations to the + * single region of the import job. When false, the closest multi-region is + * selected. + * + * Generated from protobuf field bool single_region_storage = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getSingleRegionStorage() + { + return $this->single_region_storage; + } + + /** + * Optional. Set to true to set the machine image storageLocations to the + * single region of the import job. When false, the closest multi-region is + * selected. + * + * Generated from protobuf field bool single_region_storage = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setSingleRegionStorage($var) + { + GPBUtil::checkBool($var); + $this->single_region_storage = $var; + + return $this; + } + + /** + * Immutable. The encryption to apply to the machine image. + * If the Image Import resource has an encryption, this field must be set to + * the same encryption key. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\VMMigration\V1\Encryption|null + */ + public function getEncryption() + { + return $this->encryption; + } + + public function hasEncryption() + { + return isset($this->encryption); + } + + public function clearEncryption() + { + unset($this->encryption); + } + + /** + * Immutable. The encryption to apply to the machine image. + * If the Image Import resource has an encryption, this field must be set to + * the same encryption key. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 6 [(.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\VMMigration\V1\Encryption $var + * @return $this + */ + public function setEncryption($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\Encryption::class); + $this->encryption = $var; + + return $this; + } + + /** + * Optional. Parameters overriding decisions based on the source machine image + * configurations. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.MachineImageParametersOverrides machine_image_parameters_overrides = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\VMMigration\V1\MachineImageParametersOverrides|null + */ + public function getMachineImageParametersOverrides() + { + return $this->machine_image_parameters_overrides; + } + + public function hasMachineImageParametersOverrides() + { + return isset($this->machine_image_parameters_overrides); + } + + public function clearMachineImageParametersOverrides() + { + unset($this->machine_image_parameters_overrides); + } + + /** + * Optional. Parameters overriding decisions based on the source machine image + * configurations. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.MachineImageParametersOverrides machine_image_parameters_overrides = 7 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\VMMigration\V1\MachineImageParametersOverrides $var + * @return $this + */ + public function setMachineImageParametersOverrides($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\MachineImageParametersOverrides::class); + $this->machine_image_parameters_overrides = $var; + + return $this; + } + + /** + * Optional. The service account to assign to the instance created by the + * machine image. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ServiceAccount service_account = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\VMMigration\V1\ServiceAccount|null + */ + public function getServiceAccount() + { + return $this->service_account; + } + + public function hasServiceAccount() + { + return isset($this->service_account); + } + + public function clearServiceAccount() + { + unset($this->service_account); + } + + /** + * Optional. The service account to assign to the instance created by the + * machine image. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ServiceAccount service_account = 8 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\VMMigration\V1\ServiceAccount $var + * @return $this + */ + public function setServiceAccount($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\ServiceAccount::class); + $this->service_account = $var; + + return $this; + } + + /** + * Optional. Additional licenses to assign to the instance created by the + * machine image. Format: + * https://www.googleapis.com/compute/v1/projects/PROJECT_ID/global/licenses/LICENSE_NAME + * Or + * https://www.googleapis.com/compute/beta/projects/PROJECT_ID/global/licenses/LICENSE_NAME + * + * Generated from protobuf field repeated string additional_licenses = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getAdditionalLicenses() + { + return $this->additional_licenses; + } + + /** + * Optional. Additional licenses to assign to the instance created by the + * machine image. Format: + * https://www.googleapis.com/compute/v1/projects/PROJECT_ID/global/licenses/LICENSE_NAME + * Or + * https://www.googleapis.com/compute/beta/projects/PROJECT_ID/global/licenses/LICENSE_NAME + * + * Generated from protobuf field repeated string additional_licenses = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setAdditionalLicenses($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->additional_licenses = $arr; + + return $this; + } + + /** + * Optional. The labels to apply to the instance created by the machine image. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\MapField + */ + public function getLabels() + { + return $this->labels; + } + + /** + * Optional. The labels to apply to the instance created by the machine image. + * + * Generated from protobuf field map labels = 10 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->labels = $arr; + + return $this; + } + + /** + * Optional. The tags to apply to the instance created by the machine image. + * + * Generated from protobuf field repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getTags() + { + return $this->tags; + } + + /** + * Optional. The tags to apply to the instance created by the machine image. + * + * Generated from protobuf field repeated string tags = 11 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setTags($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->tags = $arr; + + return $this; + } + + /** + * Optional. Shielded instance configuration. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ShieldedInstanceConfig shielded_instance_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\VMMigration\V1\ShieldedInstanceConfig|null + */ + public function getShieldedInstanceConfig() + { + return $this->shielded_instance_config; + } + + public function hasShieldedInstanceConfig() + { + return isset($this->shielded_instance_config); + } + + public function clearShieldedInstanceConfig() + { + unset($this->shielded_instance_config); + } + + /** + * Optional. Shielded instance configuration. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ShieldedInstanceConfig shielded_instance_config = 12 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\VMMigration\V1\ShieldedInstanceConfig $var + * @return $this + */ + public function setShieldedInstanceConfig($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\ShieldedInstanceConfig::class); + $this->shielded_instance_config = $var; + + return $this; + } + + /** + * Optional. The network interfaces to create with the instance created by the + * machine image. Internal and external IP addresses, and network tiers are + * ignored for machine image import. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.NetworkInterface network_interfaces = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getNetworkInterfaces() + { + return $this->network_interfaces; + } + + /** + * Optional. The network interfaces to create with the instance created by the + * machine image. Internal and external IP addresses, and network tiers are + * ignored for machine image import. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.NetworkInterface network_interfaces = 13 [(.google.api.field_behavior) = OPTIONAL]; + * @param array<\Google\Cloud\VMMigration\V1\NetworkInterface>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setNetworkInterfaces($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VMMigration\V1\NetworkInterface::class); + $this->network_interfaces = $arr; + + return $this; + } + + /** + * @return string + */ + public function getOsAdaptationConfig() + { + return $this->whichOneof("os_adaptation_config"); + } + +} + diff --git a/VmMigration/src/V1/MigratingVm.php b/VmMigration/src/V1/MigratingVm.php index a86771ba3c43..41fa47c86dbd 100644 --- a/VmMigration/src/V1/MigratingVm.php +++ b/VmMigration/src/V1/MigratingVm.php @@ -81,12 +81,19 @@ class MigratingVm extends \Google\Protobuf\Internal\Message */ protected $state_time = null; /** - * Output only. The percentage progress of the current running replication - * cycle. + * Output only. Details of the current running replication cycle. * * Generated from protobuf field .google.cloud.vmmigration.v1.ReplicationCycle current_sync_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $current_sync_info = null; + /** + * Output only. Details of the last replication cycle. This will be updated + * whenever a replication cycle is finished and is not to be confused with + * last_sync which is only updated on successful replication cycles. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ReplicationCycle last_replication_cycle = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_replication_cycle = null; /** * Output only. The group this migrating vm is included in, if any. The group * is represented by the full path of the appropriate @@ -128,6 +135,20 @@ class MigratingVm extends \Google\Protobuf\Internal\Message * Generated from protobuf field repeated .google.cloud.vmmigration.v1.CutoverJob recent_cutover_jobs = 20 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ private $recent_cutover_jobs; + /** + * Output only. Provides details of future CutoverJobs of a MigratingVm. + * Set to empty when cutover forecast is unavailable. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.CutoverForecast cutover_forecast = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $cutover_forecast = null; + /** + * Output only. Provides details about the expiration state of the migrating + * VM. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.MigratingVm.Expiration expiration = 37 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expiration = null; protected $target_vm_defaults; protected $source_vm_details; @@ -139,8 +160,14 @@ class MigratingVm extends \Google\Protobuf\Internal\Message * * @type \Google\Cloud\VMMigration\V1\ComputeEngineTargetDefaults $compute_engine_target_defaults * Details of the target VM in Compute Engine. + * @type \Google\Cloud\VMMigration\V1\ComputeEngineDisksTargetDefaults $compute_engine_disks_target_defaults + * Details of the target Persistent Disks in Compute Engine. + * @type \Google\Cloud\VMMigration\V1\VmwareSourceVmDetails $vmware_source_vm_details + * Output only. Details of the VM from a Vmware source. * @type \Google\Cloud\VMMigration\V1\AwsSourceVmDetails $aws_source_vm_details * Output only. Details of the VM from an AWS source. + * @type \Google\Cloud\VMMigration\V1\AzureSourceVmDetails $azure_source_vm_details + * Output only. Details of the VM from an Azure source. * @type string $name * Output only. The identifier of the MigratingVm. * @type string $source_vm_id @@ -166,8 +193,11 @@ class MigratingVm extends \Google\Protobuf\Internal\Message * @type \Google\Protobuf\Timestamp $state_time * Output only. The last time the migrating VM state was updated. * @type \Google\Cloud\VMMigration\V1\ReplicationCycle $current_sync_info - * Output only. The percentage progress of the current running replication - * cycle. + * Output only. Details of the current running replication cycle. + * @type \Google\Cloud\VMMigration\V1\ReplicationCycle $last_replication_cycle + * Output only. Details of the last replication cycle. This will be updated + * whenever a replication cycle is finished and is not to be confused with + * last_sync which is only updated on successful replication cycles. * @type string $group * Output only. The group this migrating vm is included in, if any. The group * is represented by the full path of the appropriate @@ -189,6 +219,12 @@ class MigratingVm extends \Google\Protobuf\Internal\Message * running cutover job, if one exists. * Note: To have this field populated you need to explicitly request it via * the "view" parameter of the Get/List request. + * @type \Google\Cloud\VMMigration\V1\CutoverForecast $cutover_forecast + * Output only. Provides details of future CutoverJobs of a MigratingVm. + * Set to empty when cutover forecast is unavailable. + * @type \Google\Cloud\VMMigration\V1\MigratingVm\Expiration $expiration + * Output only. Provides details about the expiration state of the migrating + * VM. * } */ public function __construct($data = NULL) { @@ -227,6 +263,68 @@ public function setComputeEngineTargetDefaults($var) return $this; } + /** + * Details of the target Persistent Disks in Compute Engine. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineDisksTargetDefaults compute_engine_disks_target_defaults = 34; + * @return \Google\Cloud\VMMigration\V1\ComputeEngineDisksTargetDefaults|null + */ + public function getComputeEngineDisksTargetDefaults() + { + return $this->readOneof(34); + } + + public function hasComputeEngineDisksTargetDefaults() + { + return $this->hasOneof(34); + } + + /** + * Details of the target Persistent Disks in Compute Engine. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineDisksTargetDefaults compute_engine_disks_target_defaults = 34; + * @param \Google\Cloud\VMMigration\V1\ComputeEngineDisksTargetDefaults $var + * @return $this + */ + public function setComputeEngineDisksTargetDefaults($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\ComputeEngineDisksTargetDefaults::class); + $this->writeOneof(34, $var); + + return $this; + } + + /** + * Output only. Details of the VM from a Vmware source. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmwareSourceVmDetails vmware_source_vm_details = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\VMMigration\V1\VmwareSourceVmDetails|null + */ + public function getVmwareSourceVmDetails() + { + return $this->readOneof(28); + } + + public function hasVmwareSourceVmDetails() + { + return $this->hasOneof(28); + } + + /** + * Output only. Details of the VM from a Vmware source. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmwareSourceVmDetails vmware_source_vm_details = 28 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\VMMigration\V1\VmwareSourceVmDetails $var + * @return $this + */ + public function setVmwareSourceVmDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\VmwareSourceVmDetails::class); + $this->writeOneof(28, $var); + + return $this; + } + /** * Output only. Details of the VM from an AWS source. * @@ -258,6 +356,37 @@ public function setAwsSourceVmDetails($var) return $this; } + /** + * Output only. Details of the VM from an Azure source. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureSourceVmDetails azure_source_vm_details = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\VMMigration\V1\AzureSourceVmDetails|null + */ + public function getAzureSourceVmDetails() + { + return $this->readOneof(30); + } + + public function hasAzureSourceVmDetails() + { + return $this->hasOneof(30); + } + + /** + * Output only. Details of the VM from an Azure source. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureSourceVmDetails azure_source_vm_details = 30 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\VMMigration\V1\AzureSourceVmDetails $var + * @return $this + */ + public function setAzureSourceVmDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\AzureSourceVmDetails::class); + $this->writeOneof(30, $var); + + return $this; + } + /** * Output only. The identifier of the MigratingVm. * @@ -577,8 +706,7 @@ public function setStateTime($var) } /** - * Output only. The percentage progress of the current running replication - * cycle. + * Output only. Details of the current running replication cycle. * * Generated from protobuf field .google.cloud.vmmigration.v1.ReplicationCycle current_sync_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return \Google\Cloud\VMMigration\V1\ReplicationCycle|null @@ -599,8 +727,7 @@ public function clearCurrentSyncInfo() } /** - * Output only. The percentage progress of the current running replication - * cycle. + * Output only. Details of the current running replication cycle. * * Generated from protobuf field .google.cloud.vmmigration.v1.ReplicationCycle current_sync_info = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param \Google\Cloud\VMMigration\V1\ReplicationCycle $var @@ -614,6 +741,46 @@ public function setCurrentSyncInfo($var) return $this; } + /** + * Output only. Details of the last replication cycle. This will be updated + * whenever a replication cycle is finished and is not to be confused with + * last_sync which is only updated on successful replication cycles. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ReplicationCycle last_replication_cycle = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\VMMigration\V1\ReplicationCycle|null + */ + public function getLastReplicationCycle() + { + return $this->last_replication_cycle; + } + + public function hasLastReplicationCycle() + { + return isset($this->last_replication_cycle); + } + + public function clearLastReplicationCycle() + { + unset($this->last_replication_cycle); + } + + /** + * Output only. Details of the last replication cycle. This will be updated + * whenever a replication cycle is finished and is not to be confused with + * last_sync which is only updated on successful replication cycles. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ReplicationCycle last_replication_cycle = 32 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\VMMigration\V1\ReplicationCycle $var + * @return $this + */ + public function setLastReplicationCycle($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\ReplicationCycle::class); + $this->last_replication_cycle = $var; + + return $this; + } + /** * Output only. The group this migrating vm is included in, if any. The group * is represented by the full path of the appropriate @@ -776,6 +943,82 @@ public function setRecentCutoverJobs($var) return $this; } + /** + * Output only. Provides details of future CutoverJobs of a MigratingVm. + * Set to empty when cutover forecast is unavailable. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.CutoverForecast cutover_forecast = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\VMMigration\V1\CutoverForecast|null + */ + public function getCutoverForecast() + { + return $this->cutover_forecast; + } + + public function hasCutoverForecast() + { + return isset($this->cutover_forecast); + } + + public function clearCutoverForecast() + { + unset($this->cutover_forecast); + } + + /** + * Output only. Provides details of future CutoverJobs of a MigratingVm. + * Set to empty when cutover forecast is unavailable. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.CutoverForecast cutover_forecast = 33 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\VMMigration\V1\CutoverForecast $var + * @return $this + */ + public function setCutoverForecast($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\CutoverForecast::class); + $this->cutover_forecast = $var; + + return $this; + } + + /** + * Output only. Provides details about the expiration state of the migrating + * VM. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.MigratingVm.Expiration expiration = 37 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\VMMigration\V1\MigratingVm\Expiration|null + */ + public function getExpiration() + { + return $this->expiration; + } + + public function hasExpiration() + { + return isset($this->expiration); + } + + public function clearExpiration() + { + unset($this->expiration); + } + + /** + * Output only. Provides details about the expiration state of the migrating + * VM. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.MigratingVm.Expiration expiration = 37 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\VMMigration\V1\MigratingVm\Expiration $var + * @return $this + */ + public function setExpiration($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\MigratingVm\Expiration::class); + $this->expiration = $var; + + return $this; + } + /** * @return string */ diff --git a/VmMigration/src/V1/MigratingVm/Expiration.php b/VmMigration/src/V1/MigratingVm/Expiration.php new file mode 100644 index 000000000000..7d7f93c1dd81 --- /dev/null +++ b/VmMigration/src/V1/MigratingVm/Expiration.php @@ -0,0 +1,146 @@ +google.cloud.vmmigration.v1.MigratingVm.Expiration + */ +class Expiration extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Timestamp of when this resource is considered expired. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $expire_time = null; + /** + * Output only. The number of times expiration was extended. + * + * Generated from protobuf field int32 extension_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $extension_count = 0; + /** + * Output only. Describes whether the expiration can be extended. + * + * Generated from protobuf field bool extendable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $extendable = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\Timestamp $expire_time + * Output only. Timestamp of when this resource is considered expired. + * @type int $extension_count + * Output only. The number of times expiration was extended. + * @type bool $extendable + * Output only. Describes whether the expiration can be extended. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Timestamp of when this resource is considered expired. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getExpireTime() + { + return $this->expire_time; + } + + public function hasExpireTime() + { + return isset($this->expire_time); + } + + public function clearExpireTime() + { + unset($this->expire_time); + } + + /** + * Output only. Timestamp of when this resource is considered expired. + * + * Generated from protobuf field .google.protobuf.Timestamp expire_time = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setExpireTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->expire_time = $var; + + return $this; + } + + /** + * Output only. The number of times expiration was extended. + * + * Generated from protobuf field int32 extension_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getExtensionCount() + { + return $this->extension_count; + } + + /** + * Output only. The number of times expiration was extended. + * + * Generated from protobuf field int32 extension_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setExtensionCount($var) + { + GPBUtil::checkInt32($var); + $this->extension_count = $var; + + return $this; + } + + /** + * Output only. Describes whether the expiration can be extended. + * + * Generated from protobuf field bool extendable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return bool + */ + public function getExtendable() + { + return $this->extendable; + } + + /** + * Output only. Describes whether the expiration can be extended. + * + * Generated from protobuf field bool extendable = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param bool $var + * @return $this + */ + public function setExtendable($var) + { + GPBUtil::checkBool($var); + $this->extendable = $var; + + return $this; + } + +} + + diff --git a/VmMigration/src/V1/MigratingVm/State.php b/VmMigration/src/V1/MigratingVm/State.php index 5f5cf5e24374..2c8e5ae37f32 100644 --- a/VmMigration/src/V1/MigratingVm/State.php +++ b/VmMigration/src/V1/MigratingVm/State.php @@ -91,6 +91,21 @@ class State * Generated from protobuf enum ERROR = 13; */ const ERROR = 13; + /** + * The migrating VM has passed its expiration date. It might be possible to + * bring it back to "Active" state by updating the TTL field. For more + * information, see the documentation. + * + * Generated from protobuf enum EXPIRED = 14; + */ + const EXPIRED = 14; + /** + * The migrating VM's has been finalized and migration resources have been + * removed. + * + * Generated from protobuf enum FINALIZED_EXPIRED = 17; + */ + const FINALIZED_EXPIRED = 17; private static $valueToName = [ self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', @@ -105,6 +120,8 @@ class State self::FINALIZING => 'FINALIZING', self::FINALIZED => 'FINALIZED', self::ERROR => 'ERROR', + self::EXPIRED => 'EXPIRED', + self::FINALIZED_EXPIRED => 'FINALIZED_EXPIRED', ]; public static function name($value) diff --git a/VmMigration/src/V1/MigrationError/ErrorCode.php b/VmMigration/src/V1/MigrationError/ErrorCode.php index 2cd0a605d277..21c98c8b6237 100644 --- a/VmMigration/src/V1/MigrationError/ErrorCode.php +++ b/VmMigration/src/V1/MigrationError/ErrorCode.php @@ -20,61 +20,78 @@ class ErrorCode */ const ERROR_CODE_UNSPECIFIED = 0; /** - * Migrate for Compute encountered an unknown error. + * Migrate to Virtual Machines encountered an unknown error. * * Generated from protobuf enum UNKNOWN_ERROR = 1; */ const UNKNOWN_ERROR = 1; /** - * Migrate for Compute encountered an error while validating replication - * source health. + * Migrate to Virtual Machines encountered an error while validating + * replication source health. * * Generated from protobuf enum SOURCE_VALIDATION_ERROR = 2; */ const SOURCE_VALIDATION_ERROR = 2; /** - * Migrate for Compute encountered an error during source data operation. + * Migrate to Virtual Machines encountered an error during source data + * operation. * * Generated from protobuf enum SOURCE_REPLICATION_ERROR = 3; */ const SOURCE_REPLICATION_ERROR = 3; /** - * Migrate for Compute encountered an error during target data operation. + * Migrate to Virtual Machines encountered an error during target data + * operation. * * Generated from protobuf enum TARGET_REPLICATION_ERROR = 4; */ const TARGET_REPLICATION_ERROR = 4; /** - * Migrate for Compute encountered an error during OS adaptation. + * Migrate to Virtual Machines encountered an error during OS adaptation. * * Generated from protobuf enum OS_ADAPTATION_ERROR = 5; */ const OS_ADAPTATION_ERROR = 5; /** - * Migrate for Compute encountered an error in clone operation. + * Migrate to Virtual Machines encountered an error in clone operation. * * Generated from protobuf enum CLONE_ERROR = 6; */ const CLONE_ERROR = 6; /** - * Migrate for Compute encountered an error in cutover operation. + * Migrate to Virtual Machines encountered an error in cutover operation. * * Generated from protobuf enum CUTOVER_ERROR = 7; */ const CUTOVER_ERROR = 7; /** - * Migrate for Compute encountered an error during utilization report - * creation. + * Migrate to Virtual Machines encountered an error during utilization + * report creation. * * Generated from protobuf enum UTILIZATION_REPORT_ERROR = 8; */ const UTILIZATION_REPORT_ERROR = 8; /** - * Migrate for Compute encountered an error during appliance upgrade. + * Migrate to Virtual Machines encountered an error during appliance + * upgrade. * * Generated from protobuf enum APPLIANCE_UPGRADE_ERROR = 9; */ const APPLIANCE_UPGRADE_ERROR = 9; + /** + * Migrate to Virtual Machines encountered an error in image import + * operation. + * + * Generated from protobuf enum IMAGE_IMPORT_ERROR = 10; + */ + const IMAGE_IMPORT_ERROR = 10; + /** + * Migrate to Virtual Machines encountered an error in disk migration + * operation. + * + * Generated from protobuf enum DISK_MIGRATION_ERROR = 11; + */ + const DISK_MIGRATION_ERROR = 11; private static $valueToName = [ self::ERROR_CODE_UNSPECIFIED => 'ERROR_CODE_UNSPECIFIED', @@ -87,6 +104,8 @@ class ErrorCode self::CUTOVER_ERROR => 'CUTOVER_ERROR', self::UTILIZATION_REPORT_ERROR => 'UTILIZATION_REPORT_ERROR', self::APPLIANCE_UPGRADE_ERROR => 'APPLIANCE_UPGRADE_ERROR', + self::IMAGE_IMPORT_ERROR => 'IMAGE_IMPORT_ERROR', + self::DISK_MIGRATION_ERROR => 'DISK_MIGRATION_ERROR', ]; public static function name($value) diff --git a/VmMigration/src/V1/MigrationWarning.php b/VmMigration/src/V1/MigrationWarning.php new file mode 100644 index 000000000000..81976622d8dd --- /dev/null +++ b/VmMigration/src/V1/MigrationWarning.php @@ -0,0 +1,239 @@ +google.cloud.vmmigration.v1.MigrationWarning + */ +class MigrationWarning extends \Google\Protobuf\Internal\Message +{ + /** + * The warning code. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.MigrationWarning.WarningCode code = 1; + */ + protected $code = 0; + /** + * Output only. The localized warning message. + * + * Generated from protobuf field .google.rpc.LocalizedMessage warning_message = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $warning_message = null; + /** + * Output only. Suggested action for solving the warning. + * + * Generated from protobuf field .google.rpc.LocalizedMessage action_item = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $action_item = null; + /** + * Output only. URL(s) pointing to additional information on handling the + * current warning. + * + * Generated from protobuf field repeated .google.rpc.Help.Link help_links = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $help_links; + /** + * The time the warning occurred. + * + * Generated from protobuf field .google.protobuf.Timestamp warning_time = 5; + */ + protected $warning_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $code + * The warning code. + * @type \Google\Rpc\LocalizedMessage $warning_message + * Output only. The localized warning message. + * @type \Google\Rpc\LocalizedMessage $action_item + * Output only. Suggested action for solving the warning. + * @type array<\Google\Rpc\Help\Link>|\Google\Protobuf\Internal\RepeatedField $help_links + * Output only. URL(s) pointing to additional information on handling the + * current warning. + * @type \Google\Protobuf\Timestamp $warning_time + * The time the warning occurred. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * The warning code. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.MigrationWarning.WarningCode code = 1; + * @return int + */ + public function getCode() + { + return $this->code; + } + + /** + * The warning code. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.MigrationWarning.WarningCode code = 1; + * @param int $var + * @return $this + */ + public function setCode($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\MigrationWarning\WarningCode::class); + $this->code = $var; + + return $this; + } + + /** + * Output only. The localized warning message. + * + * Generated from protobuf field .google.rpc.LocalizedMessage warning_message = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Rpc\LocalizedMessage|null + */ + public function getWarningMessage() + { + return $this->warning_message; + } + + public function hasWarningMessage() + { + return isset($this->warning_message); + } + + public function clearWarningMessage() + { + unset($this->warning_message); + } + + /** + * Output only. The localized warning message. + * + * Generated from protobuf field .google.rpc.LocalizedMessage warning_message = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Rpc\LocalizedMessage $var + * @return $this + */ + public function setWarningMessage($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\LocalizedMessage::class); + $this->warning_message = $var; + + return $this; + } + + /** + * Output only. Suggested action for solving the warning. + * + * Generated from protobuf field .google.rpc.LocalizedMessage action_item = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Rpc\LocalizedMessage|null + */ + public function getActionItem() + { + return $this->action_item; + } + + public function hasActionItem() + { + return isset($this->action_item); + } + + public function clearActionItem() + { + unset($this->action_item); + } + + /** + * Output only. Suggested action for solving the warning. + * + * Generated from protobuf field .google.rpc.LocalizedMessage action_item = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Rpc\LocalizedMessage $var + * @return $this + */ + public function setActionItem($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\LocalizedMessage::class); + $this->action_item = $var; + + return $this; + } + + /** + * Output only. URL(s) pointing to additional information on handling the + * current warning. + * + * Generated from protobuf field repeated .google.rpc.Help.Link help_links = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getHelpLinks() + { + return $this->help_links; + } + + /** + * Output only. URL(s) pointing to additional information on handling the + * current warning. + * + * Generated from protobuf field repeated .google.rpc.Help.Link help_links = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Rpc\Help\Link>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setHelpLinks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Rpc\Help\Link::class); + $this->help_links = $arr; + + return $this; + } + + /** + * The time the warning occurred. + * + * Generated from protobuf field .google.protobuf.Timestamp warning_time = 5; + * @return \Google\Protobuf\Timestamp|null + */ + public function getWarningTime() + { + return $this->warning_time; + } + + public function hasWarningTime() + { + return isset($this->warning_time); + } + + public function clearWarningTime() + { + unset($this->warning_time); + } + + /** + * The time the warning occurred. + * + * Generated from protobuf field .google.protobuf.Timestamp warning_time = 5; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setWarningTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->warning_time = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/MigrationWarning/WarningCode.php b/VmMigration/src/V1/MigrationWarning/WarningCode.php new file mode 100644 index 000000000000..ea7c0b47b3c8 --- /dev/null +++ b/VmMigration/src/V1/MigrationWarning/WarningCode.php @@ -0,0 +1,55 @@ +google.cloud.vmmigration.v1.MigrationWarning.WarningCode + */ +class WarningCode +{ + /** + * Default value. This value is not used. + * + * Generated from protobuf enum WARNING_CODE_UNSPECIFIED = 0; + */ + const WARNING_CODE_UNSPECIFIED = 0; + /** + * A warning originated from OS Adaptation. + * + * Generated from protobuf enum ADAPTATION_WARNING = 1; + */ + const ADAPTATION_WARNING = 1; + + private static $valueToName = [ + self::WARNING_CODE_UNSPECIFIED => 'WARNING_CODE_UNSPECIFIED', + self::ADAPTATION_WARNING => 'ADAPTATION_WARNING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/VmMigration/src/V1/NetworkInterface.php b/VmMigration/src/V1/NetworkInterface.php index e70ad652db3a..2da4d08f8b54 100644 --- a/VmMigration/src/V1/NetworkInterface.php +++ b/VmMigration/src/V1/NetworkInterface.php @@ -16,31 +16,39 @@ class NetworkInterface extends \Google\Protobuf\Internal\Message { /** - * The network to connect the NIC to. + * Optional. The network to connect the NIC to. * - * Generated from protobuf field string network = 1; + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OPTIONAL]; */ protected $network = ''; /** - * The subnetwork to connect the NIC to. + * Optional. The subnetwork to connect the NIC to. * - * Generated from protobuf field string subnetwork = 2; + * Generated from protobuf field string subnetwork = 2 [(.google.api.field_behavior) = OPTIONAL]; */ protected $subnetwork = ''; /** - * The internal IP to define in the NIC. + * Optional. The internal IP to define in the NIC. * The formats accepted are: `ephemeral` \ ipv4 address \ a named address * resource full path. * - * Generated from protobuf field string internal_ip = 3; + * Generated from protobuf field string internal_ip = 3 [(.google.api.field_behavior) = OPTIONAL]; */ protected $internal_ip = ''; /** - * The external IP to define in the NIC. + * Optional. The external IP to define in the NIC. * - * Generated from protobuf field string external_ip = 4; + * Generated from protobuf field string external_ip = 4 [(.google.api.field_behavior) = OPTIONAL]; */ protected $external_ip = ''; + /** + * Optional. The networking tier used for optimizing connectivity between + * instances and systems on the internet. Applies only for external ephemeral + * IP addresses. If left empty, will default to PREMIUM. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineNetworkTier network_tier = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $network_tier = 0; /** * Constructor. @@ -49,15 +57,19 @@ class NetworkInterface extends \Google\Protobuf\Internal\Message * Optional. Data for populating the Message object. * * @type string $network - * The network to connect the NIC to. + * Optional. The network to connect the NIC to. * @type string $subnetwork - * The subnetwork to connect the NIC to. + * Optional. The subnetwork to connect the NIC to. * @type string $internal_ip - * The internal IP to define in the NIC. + * Optional. The internal IP to define in the NIC. * The formats accepted are: `ephemeral` \ ipv4 address \ a named address * resource full path. * @type string $external_ip - * The external IP to define in the NIC. + * Optional. The external IP to define in the NIC. + * @type int $network_tier + * Optional. The networking tier used for optimizing connectivity between + * instances and systems on the internet. Applies only for external ephemeral + * IP addresses. If left empty, will default to PREMIUM. * } */ public function __construct($data = NULL) { @@ -66,9 +78,9 @@ public function __construct($data = NULL) { } /** - * The network to connect the NIC to. + * Optional. The network to connect the NIC to. * - * Generated from protobuf field string network = 1; + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OPTIONAL]; * @return string */ public function getNetwork() @@ -77,9 +89,9 @@ public function getNetwork() } /** - * The network to connect the NIC to. + * Optional. The network to connect the NIC to. * - * Generated from protobuf field string network = 1; + * Generated from protobuf field string network = 1 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var * @return $this */ @@ -92,9 +104,9 @@ public function setNetwork($var) } /** - * The subnetwork to connect the NIC to. + * Optional. The subnetwork to connect the NIC to. * - * Generated from protobuf field string subnetwork = 2; + * Generated from protobuf field string subnetwork = 2 [(.google.api.field_behavior) = OPTIONAL]; * @return string */ public function getSubnetwork() @@ -103,9 +115,9 @@ public function getSubnetwork() } /** - * The subnetwork to connect the NIC to. + * Optional. The subnetwork to connect the NIC to. * - * Generated from protobuf field string subnetwork = 2; + * Generated from protobuf field string subnetwork = 2 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var * @return $this */ @@ -118,11 +130,11 @@ public function setSubnetwork($var) } /** - * The internal IP to define in the NIC. + * Optional. The internal IP to define in the NIC. * The formats accepted are: `ephemeral` \ ipv4 address \ a named address * resource full path. * - * Generated from protobuf field string internal_ip = 3; + * Generated from protobuf field string internal_ip = 3 [(.google.api.field_behavior) = OPTIONAL]; * @return string */ public function getInternalIp() @@ -131,11 +143,11 @@ public function getInternalIp() } /** - * The internal IP to define in the NIC. + * Optional. The internal IP to define in the NIC. * The formats accepted are: `ephemeral` \ ipv4 address \ a named address * resource full path. * - * Generated from protobuf field string internal_ip = 3; + * Generated from protobuf field string internal_ip = 3 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var * @return $this */ @@ -148,9 +160,9 @@ public function setInternalIp($var) } /** - * The external IP to define in the NIC. + * Optional. The external IP to define in the NIC. * - * Generated from protobuf field string external_ip = 4; + * Generated from protobuf field string external_ip = 4 [(.google.api.field_behavior) = OPTIONAL]; * @return string */ public function getExternalIp() @@ -159,9 +171,9 @@ public function getExternalIp() } /** - * The external IP to define in the NIC. + * Optional. The external IP to define in the NIC. * - * Generated from protobuf field string external_ip = 4; + * Generated from protobuf field string external_ip = 4 [(.google.api.field_behavior) = OPTIONAL]; * @param string $var * @return $this */ @@ -173,5 +185,35 @@ public function setExternalIp($var) return $this; } + /** + * Optional. The networking tier used for optimizing connectivity between + * instances and systems on the internet. Applies only for external ephemeral + * IP addresses. If left empty, will default to PREMIUM. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineNetworkTier network_tier = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getNetworkTier() + { + return $this->network_tier; + } + + /** + * Optional. The networking tier used for optimizing connectivity between + * instances and systems on the internet. Applies only for external ephemeral + * IP addresses. If left empty, will default to PREMIUM. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineNetworkTier network_tier = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setNetworkTier($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\ComputeEngineNetworkTier::class); + $this->network_tier = $var; + + return $this; + } + } diff --git a/VmMigration/src/V1/OsCapability.php b/VmMigration/src/V1/OsCapability.php new file mode 100644 index 000000000000..2ff3ca571273 --- /dev/null +++ b/VmMigration/src/V1/OsCapability.php @@ -0,0 +1,69 @@ +google.cloud.vmmigration.v1.OsCapability + */ +class OsCapability +{ + /** + * This is for API compatibility only and is not in use. + * + * Generated from protobuf enum OS_CAPABILITY_UNSPECIFIED = 0; + */ + const OS_CAPABILITY_UNSPECIFIED = 0; + /** + * NVMe driver installed and the VM can use NVMe PD or local SSD. + * + * Generated from protobuf enum OS_CAPABILITY_NVME_STORAGE_ACCESS = 1; + */ + const OS_CAPABILITY_NVME_STORAGE_ACCESS = 1; + /** + * gVNIC virtual NIC driver supported. + * + * Generated from protobuf enum OS_CAPABILITY_GVNIC_NETWORK_INTERFACE = 2; + */ + const OS_CAPABILITY_GVNIC_NETWORK_INTERFACE = 2; + /** + * IDPF virtual NIC driver supported. + * + * Generated from protobuf enum OS_CAPABILITY_IDPF_NETWORK_INTERFACE = 3; + */ + const OS_CAPABILITY_IDPF_NETWORK_INTERFACE = 3; + + private static $valueToName = [ + self::OS_CAPABILITY_UNSPECIFIED => 'OS_CAPABILITY_UNSPECIFIED', + self::OS_CAPABILITY_NVME_STORAGE_ACCESS => 'OS_CAPABILITY_NVME_STORAGE_ACCESS', + self::OS_CAPABILITY_GVNIC_NETWORK_INTERFACE => 'OS_CAPABILITY_GVNIC_NETWORK_INTERFACE', + self::OS_CAPABILITY_IDPF_NETWORK_INTERFACE => 'OS_CAPABILITY_IDPF_NETWORK_INTERFACE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/VmMigration/src/V1/PersistentDisk.php b/VmMigration/src/V1/PersistentDisk.php new file mode 100644 index 000000000000..555f047a74f0 --- /dev/null +++ b/VmMigration/src/V1/PersistentDisk.php @@ -0,0 +1,101 @@ +google.cloud.vmmigration.v1.PersistentDisk + */ +class PersistentDisk extends \Google\Protobuf\Internal\Message +{ + /** + * The ordinal number of the source VM disk. + * + * Generated from protobuf field int32 source_disk_number = 1; + */ + protected $source_disk_number = 0; + /** + * The URI of the Persistent Disk. + * + * Generated from protobuf field string disk_uri = 2; + */ + protected $disk_uri = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $source_disk_number + * The ordinal number of the source VM disk. + * @type string $disk_uri + * The URI of the Persistent Disk. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * The ordinal number of the source VM disk. + * + * Generated from protobuf field int32 source_disk_number = 1; + * @return int + */ + public function getSourceDiskNumber() + { + return $this->source_disk_number; + } + + /** + * The ordinal number of the source VM disk. + * + * Generated from protobuf field int32 source_disk_number = 1; + * @param int $var + * @return $this + */ + public function setSourceDiskNumber($var) + { + GPBUtil::checkInt32($var); + $this->source_disk_number = $var; + + return $this; + } + + /** + * The URI of the Persistent Disk. + * + * Generated from protobuf field string disk_uri = 2; + * @return string + */ + public function getDiskUri() + { + return $this->disk_uri; + } + + /** + * The URI of the Persistent Disk. + * + * Generated from protobuf field string disk_uri = 2; + * @param string $var + * @return $this + */ + public function setDiskUri($var) + { + GPBUtil::checkString($var, True); + $this->disk_uri = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/PersistentDiskDefaults.php b/VmMigration/src/V1/PersistentDiskDefaults.php new file mode 100644 index 000000000000..4cdf630fbfea --- /dev/null +++ b/VmMigration/src/V1/PersistentDiskDefaults.php @@ -0,0 +1,261 @@ +google.cloud.vmmigration.v1.PersistentDiskDefaults + */ +class PersistentDiskDefaults extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The ordinal number of the source VM disk. + * + * Generated from protobuf field int32 source_disk_number = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $source_disk_number = 0; + /** + * Optional. The name of the Persistent Disk to create. + * + * Generated from protobuf field string disk_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $disk_name = ''; + /** + * The disk type to use. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineDiskType disk_type = 3; + */ + protected $disk_type = 0; + /** + * A map of labels to associate with the Persistent Disk. + * + * Generated from protobuf field map additional_labels = 4; + */ + private $additional_labels; + /** + * Optional. The encryption to apply to the disk. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $encryption = null; + /** + * Optional. Details for attachment of the disk to a VM. + * Used when the disk is set to be attached to a target VM. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmAttachmentDetails vm_attachment_details = 6 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $vm_attachment_details = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $source_disk_number + * Required. The ordinal number of the source VM disk. + * @type string $disk_name + * Optional. The name of the Persistent Disk to create. + * @type int $disk_type + * The disk type to use. + * @type array|\Google\Protobuf\Internal\MapField $additional_labels + * A map of labels to associate with the Persistent Disk. + * @type \Google\Cloud\VMMigration\V1\Encryption $encryption + * Optional. The encryption to apply to the disk. + * @type \Google\Cloud\VMMigration\V1\VmAttachmentDetails $vm_attachment_details + * Optional. Details for attachment of the disk to a VM. + * Used when the disk is set to be attached to a target VM. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Required. The ordinal number of the source VM disk. + * + * Generated from protobuf field int32 source_disk_number = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return int + */ + public function getSourceDiskNumber() + { + return $this->source_disk_number; + } + + /** + * Required. The ordinal number of the source VM disk. + * + * Generated from protobuf field int32 source_disk_number = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param int $var + * @return $this + */ + public function setSourceDiskNumber($var) + { + GPBUtil::checkInt32($var); + $this->source_disk_number = $var; + + return $this; + } + + /** + * Optional. The name of the Persistent Disk to create. + * + * Generated from protobuf field string disk_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDiskName() + { + return $this->disk_name; + } + + /** + * Optional. The name of the Persistent Disk to create. + * + * Generated from protobuf field string disk_name = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDiskName($var) + { + GPBUtil::checkString($var, True); + $this->disk_name = $var; + + return $this; + } + + /** + * The disk type to use. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineDiskType disk_type = 3; + * @return int + */ + public function getDiskType() + { + return $this->disk_type; + } + + /** + * The disk type to use. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ComputeEngineDiskType disk_type = 3; + * @param int $var + * @return $this + */ + public function setDiskType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\ComputeEngineDiskType::class); + $this->disk_type = $var; + + return $this; + } + + /** + * A map of labels to associate with the Persistent Disk. + * + * Generated from protobuf field map additional_labels = 4; + * @return \Google\Protobuf\Internal\MapField + */ + public function getAdditionalLabels() + { + return $this->additional_labels; + } + + /** + * A map of labels to associate with the Persistent Disk. + * + * Generated from protobuf field map additional_labels = 4; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setAdditionalLabels($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING); + $this->additional_labels = $arr; + + return $this; + } + + /** + * Optional. The encryption to apply to the disk. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\VMMigration\V1\Encryption|null + */ + public function getEncryption() + { + return $this->encryption; + } + + public function hasEncryption() + { + return isset($this->encryption); + } + + public function clearEncryption() + { + unset($this->encryption); + } + + /** + * Optional. The encryption to apply to the disk. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 5 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\VMMigration\V1\Encryption $var + * @return $this + */ + public function setEncryption($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\Encryption::class); + $this->encryption = $var; + + return $this; + } + + /** + * Optional. Details for attachment of the disk to a VM. + * Used when the disk is set to be attached to a target VM. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmAttachmentDetails vm_attachment_details = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Cloud\VMMigration\V1\VmAttachmentDetails|null + */ + public function getVmAttachmentDetails() + { + return $this->vm_attachment_details; + } + + public function hasVmAttachmentDetails() + { + return isset($this->vm_attachment_details); + } + + public function clearVmAttachmentDetails() + { + unset($this->vm_attachment_details); + } + + /** + * Optional. Details for attachment of the disk to a VM. + * Used when the disk is set to be attached to a target VM. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmAttachmentDetails vm_attachment_details = 6 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Cloud\VMMigration\V1\VmAttachmentDetails $var + * @return $this + */ + public function setVmAttachmentDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\VmAttachmentDetails::class); + $this->vm_attachment_details = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/ProvisioningTargetDiskStep.php b/VmMigration/src/V1/ProvisioningTargetDiskStep.php new file mode 100644 index 000000000000..3e3fce1f0400 --- /dev/null +++ b/VmMigration/src/V1/ProvisioningTargetDiskStep.php @@ -0,0 +1,33 @@ +google.cloud.vmmigration.v1.ProvisioningTargetDiskStep + */ +class ProvisioningTargetDiskStep extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + +} + diff --git a/VmMigration/src/V1/ReplicationCycle.php b/VmMigration/src/V1/ReplicationCycle.php index ce03d8b59e45..639b3d34f93e 100644 --- a/VmMigration/src/V1/ReplicationCycle.php +++ b/VmMigration/src/V1/ReplicationCycle.php @@ -68,11 +68,18 @@ class ReplicationCycle extends \Google\Protobuf\Internal\Message */ protected $state = 0; /** - * Provides details on the state of the cycle in case of an error. + * Output only. Provides details on the state of the cycle in case of an + * error. * - * Generated from protobuf field .google.rpc.Status error = 12; + * Generated from protobuf field .google.rpc.Status error = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $error = null; + /** + * Output only. Warnings that occurred during the cycle. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.MigrationWarning warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $warnings; /** * Constructor. @@ -99,7 +106,10 @@ class ReplicationCycle extends \Google\Protobuf\Internal\Message * @type int $state * State of the ReplicationCycle. * @type \Google\Rpc\Status $error - * Provides details on the state of the cycle in case of an error. + * Output only. Provides details on the state of the cycle in case of an + * error. + * @type array<\Google\Cloud\VMMigration\V1\MigrationWarning>|\Google\Protobuf\Internal\RepeatedField $warnings + * Output only. Warnings that occurred during the cycle. * } */ public function __construct($data = NULL) { @@ -356,9 +366,10 @@ public function setState($var) } /** - * Provides details on the state of the cycle in case of an error. + * Output only. Provides details on the state of the cycle in case of an + * error. * - * Generated from protobuf field .google.rpc.Status error = 12; + * Generated from protobuf field .google.rpc.Status error = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return \Google\Rpc\Status|null */ public function getError() @@ -377,9 +388,10 @@ public function clearError() } /** - * Provides details on the state of the cycle in case of an error. + * Output only. Provides details on the state of the cycle in case of an + * error. * - * Generated from protobuf field .google.rpc.Status error = 12; + * Generated from protobuf field .google.rpc.Status error = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param \Google\Rpc\Status $var * @return $this */ @@ -391,5 +403,31 @@ public function setError($var) return $this; } + /** + * Output only. Warnings that occurred during the cycle. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.MigrationWarning warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getWarnings() + { + return $this->warnings; + } + + /** + * Output only. Warnings that occurred during the cycle. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.MigrationWarning warnings = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\VMMigration\V1\MigrationWarning>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setWarnings($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VMMigration\V1\MigrationWarning::class); + $this->warnings = $arr; + + return $this; + } + } diff --git a/VmMigration/src/V1/RunDiskMigrationJobRequest.php b/VmMigration/src/V1/RunDiskMigrationJobRequest.php new file mode 100644 index 000000000000..1efc879b69e3 --- /dev/null +++ b/VmMigration/src/V1/RunDiskMigrationJobRequest.php @@ -0,0 +1,81 @@ +google.cloud.vmmigration.v1.RunDiskMigrationJobRequest + */ +class RunDiskMigrationJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The name of the DiskMigrationJob. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $name = ''; + + /** + * @param string $name Required. The name of the DiskMigrationJob. Please see + * {@see VmMigrationClient::diskMigrationJobName()} for help formatting this field. + * + * @return \Google\Cloud\VMMigration\V1\RunDiskMigrationJobRequest + * + * @experimental + */ + public static function build(string $name): self + { + return (new self()) + ->setName($name); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The name of the DiskMigrationJob. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Required. The name of the DiskMigrationJob. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The name of the DiskMigrationJob. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/RunDiskMigrationJobResponse.php b/VmMigration/src/V1/RunDiskMigrationJobResponse.php new file mode 100644 index 000000000000..6e733db7fce7 --- /dev/null +++ b/VmMigration/src/V1/RunDiskMigrationJobResponse.php @@ -0,0 +1,33 @@ +google.cloud.vmmigration.v1.RunDiskMigrationJobResponse + */ +class RunDiskMigrationJobResponse extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + +} + diff --git a/VmMigration/src/V1/ServiceAccount.php b/VmMigration/src/V1/ServiceAccount.php new file mode 100644 index 000000000000..1da5072e17f9 --- /dev/null +++ b/VmMigration/src/V1/ServiceAccount.php @@ -0,0 +1,101 @@ +google.cloud.vmmigration.v1.ServiceAccount + */ +class ServiceAccount extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The email address of the service account. + * + * Generated from protobuf field string email = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + */ + protected $email = ''; + /** + * Optional. The list of scopes to be made available for this service account. + * + * Generated from protobuf field repeated string scopes = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + private $scopes; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $email + * Required. The email address of the service account. + * @type array|\Google\Protobuf\Internal\RepeatedField $scopes + * Optional. The list of scopes to be made available for this service account. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Required. The email address of the service account. + * + * Generated from protobuf field string email = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @return string + */ + public function getEmail() + { + return $this->email; + } + + /** + * Required. The email address of the service account. + * + * Generated from protobuf field string email = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { + * @param string $var + * @return $this + */ + public function setEmail($var) + { + GPBUtil::checkString($var, True); + $this->email = $var; + + return $this; + } + + /** + * Optional. The list of scopes to be made available for this service account. + * + * Generated from protobuf field repeated string scopes = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getScopes() + { + return $this->scopes; + } + + /** + * Optional. The list of scopes to be made available for this service account. + * + * Generated from protobuf field repeated string scopes = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setScopes($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->scopes = $arr; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/ShieldedInstanceConfig.php b/VmMigration/src/V1/ShieldedInstanceConfig.php new file mode 100644 index 000000000000..72a85e698bb8 --- /dev/null +++ b/VmMigration/src/V1/ShieldedInstanceConfig.php @@ -0,0 +1,155 @@ +google.cloud.vmmigration.v1.ShieldedInstanceConfig + */ +class ShieldedInstanceConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Defines whether the instance created by the machine image has + * Secure Boot enabled. This can be set to true only if the image boot option + * is EFI. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ShieldedInstanceConfig.SecureBoot secure_boot = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $secure_boot = 0; + /** + * Optional. Defines whether the instance created by the machine image has + * vTPM enabled. This can be set to true only if the image boot option is EFI. + * + * Generated from protobuf field bool enable_vtpm = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_vtpm = false; + /** + * Optional. Defines whether the instance created by the machine image has + * integrity monitoring enabled. This can be set to true only if the image + * boot option is EFI, and vTPM is enabled. + * + * Generated from protobuf field bool enable_integrity_monitoring = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $enable_integrity_monitoring = false; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $secure_boot + * Optional. Defines whether the instance created by the machine image has + * Secure Boot enabled. This can be set to true only if the image boot option + * is EFI. + * @type bool $enable_vtpm + * Optional. Defines whether the instance created by the machine image has + * vTPM enabled. This can be set to true only if the image boot option is EFI. + * @type bool $enable_integrity_monitoring + * Optional. Defines whether the instance created by the machine image has + * integrity monitoring enabled. This can be set to true only if the image + * boot option is EFI, and vTPM is enabled. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Defines whether the instance created by the machine image has + * Secure Boot enabled. This can be set to true only if the image boot option + * is EFI. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ShieldedInstanceConfig.SecureBoot secure_boot = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return int + */ + public function getSecureBoot() + { + return $this->secure_boot; + } + + /** + * Optional. Defines whether the instance created by the machine image has + * Secure Boot enabled. This can be set to true only if the image boot option + * is EFI. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.ShieldedInstanceConfig.SecureBoot secure_boot = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param int $var + * @return $this + */ + public function setSecureBoot($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\ShieldedInstanceConfig\SecureBoot::class); + $this->secure_boot = $var; + + return $this; + } + + /** + * Optional. Defines whether the instance created by the machine image has + * vTPM enabled. This can be set to true only if the image boot option is EFI. + * + * Generated from protobuf field bool enable_vtpm = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableVtpm() + { + return $this->enable_vtpm; + } + + /** + * Optional. Defines whether the instance created by the machine image has + * vTPM enabled. This can be set to true only if the image boot option is EFI. + * + * Generated from protobuf field bool enable_vtpm = 2 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableVtpm($var) + { + GPBUtil::checkBool($var); + $this->enable_vtpm = $var; + + return $this; + } + + /** + * Optional. Defines whether the instance created by the machine image has + * integrity monitoring enabled. This can be set to true only if the image + * boot option is EFI, and vTPM is enabled. + * + * Generated from protobuf field bool enable_integrity_monitoring = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getEnableIntegrityMonitoring() + { + return $this->enable_integrity_monitoring; + } + + /** + * Optional. Defines whether the instance created by the machine image has + * integrity monitoring enabled. This can be set to true only if the image + * boot option is EFI, and vTPM is enabled. + * + * Generated from protobuf field bool enable_integrity_monitoring = 3 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setEnableIntegrityMonitoring($var) + { + GPBUtil::checkBool($var); + $this->enable_integrity_monitoring = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/ShieldedInstanceConfig/SecureBoot.php b/VmMigration/src/V1/ShieldedInstanceConfig/SecureBoot.php new file mode 100644 index 000000000000..e2036e4b5263 --- /dev/null +++ b/VmMigration/src/V1/ShieldedInstanceConfig/SecureBoot.php @@ -0,0 +1,64 @@ +google.cloud.vmmigration.v1.ShieldedInstanceConfig.SecureBoot + */ +class SecureBoot +{ + /** + * No explicit value is selected. Will use the configuration of the source + * (if exists, otherwise the default will be false). + * + * Generated from protobuf enum SECURE_BOOT_UNSPECIFIED = 0; + */ + const SECURE_BOOT_UNSPECIFIED = 0; + /** + * Use secure boot. This can be set to true only if the image boot option is + * EFI. + * + * Generated from protobuf enum TRUE = 1; + */ + const TRUE = 1; + /** + * Do not use secure boot. + * + * Generated from protobuf enum FALSE = 2; + */ + const FALSE = 2; + + private static $valueToName = [ + self::SECURE_BOOT_UNSPECIFIED => 'SECURE_BOOT_UNSPECIFIED', + self::TRUE => 'TRUE', + self::FALSE => 'FALSE', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/VmMigration/src/V1/SkipOsAdaptation.php b/VmMigration/src/V1/SkipOsAdaptation.php new file mode 100644 index 000000000000..1722d0419a41 --- /dev/null +++ b/VmMigration/src/V1/SkipOsAdaptation.php @@ -0,0 +1,33 @@ +google.cloud.vmmigration.v1.SkipOsAdaptation + */ +class SkipOsAdaptation extends \Google\Protobuf\Internal\Message +{ + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + +} + diff --git a/VmMigration/src/V1/Source.php b/VmMigration/src/V1/Source.php index ae1ab78c28ca..64e8c843ffe2 100644 --- a/VmMigration/src/V1/Source.php +++ b/VmMigration/src/V1/Source.php @@ -46,6 +46,13 @@ class Source extends \Google\Protobuf\Internal\Message * Generated from protobuf field string description = 6; */ protected $description = ''; + /** + * Optional. Immutable. The encryption details of the source data stored by + * the service. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + */ + protected $encryption = null; protected $source_details; /** @@ -58,6 +65,8 @@ class Source extends \Google\Protobuf\Internal\Message * Vmware type source details. * @type \Google\Cloud\VMMigration\V1\AwsSourceDetails $aws * AWS type source details. + * @type \Google\Cloud\VMMigration\V1\AzureSourceDetails $azure + * Azure type source details. * @type string $name * Output only. The Source name. * @type \Google\Protobuf\Timestamp $create_time @@ -68,6 +77,9 @@ class Source extends \Google\Protobuf\Internal\Message * The labels of the source. * @type string $description * User-provided description of the source. + * @type \Google\Cloud\VMMigration\V1\Encryption $encryption + * Optional. Immutable. The encryption details of the source data stored by + * the service. * } */ public function __construct($data = NULL) { @@ -137,6 +149,37 @@ public function setAws($var) return $this; } + /** + * Azure type source details. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureSourceDetails azure = 13; + * @return \Google\Cloud\VMMigration\V1\AzureSourceDetails|null + */ + public function getAzure() + { + return $this->readOneof(13); + } + + public function hasAzure() + { + return $this->hasOneof(13); + } + + /** + * Azure type source details. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AzureSourceDetails azure = 13; + * @param \Google\Cloud\VMMigration\V1\AzureSourceDetails $var + * @return $this + */ + public function setAzure($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\AzureSourceDetails::class); + $this->writeOneof(13, $var); + + return $this; + } + /** * Output only. The Source name. * @@ -287,6 +330,44 @@ public function setDescription($var) return $this; } + /** + * Optional. Immutable. The encryption details of the source data stored by + * the service. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @return \Google\Cloud\VMMigration\V1\Encryption|null + */ + public function getEncryption() + { + return $this->encryption; + } + + public function hasEncryption() + { + return isset($this->encryption); + } + + public function clearEncryption() + { + unset($this->encryption); + } + + /** + * Optional. Immutable. The encryption details of the source data stored by + * the service. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.Encryption encryption = 14 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * @param \Google\Cloud\VMMigration\V1\Encryption $var + * @return $this + */ + public function setEncryption($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\Encryption::class); + $this->encryption = $var; + + return $this; + } + /** * @return string */ diff --git a/VmMigration/src/V1/SourceStorageResource.php b/VmMigration/src/V1/SourceStorageResource.php new file mode 100644 index 000000000000..865571297a61 --- /dev/null +++ b/VmMigration/src/V1/SourceStorageResource.php @@ -0,0 +1,75 @@ +google.cloud.vmmigration.v1.SourceStorageResource + */ +class SourceStorageResource extends \Google\Protobuf\Internal\Message +{ + protected $StorageResource; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\VMMigration\V1\AwsSourceDiskDetails $aws_disk_details + * Source AWS volume details. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Source AWS volume details. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AwsSourceDiskDetails aws_disk_details = 1; + * @return \Google\Cloud\VMMigration\V1\AwsSourceDiskDetails|null + */ + public function getAwsDiskDetails() + { + return $this->readOneof(1); + } + + public function hasAwsDiskDetails() + { + return $this->hasOneof(1); + } + + /** + * Source AWS volume details. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.AwsSourceDiskDetails aws_disk_details = 1; + * @param \Google\Cloud\VMMigration\V1\AwsSourceDiskDetails $var + * @return $this + */ + public function setAwsDiskDetails($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\AwsSourceDiskDetails::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * @return string + */ + public function getStorageResource() + { + return $this->whichOneof("StorageResource"); + } + +} + diff --git a/VmMigration/src/V1/TargetProject.php b/VmMigration/src/V1/TargetProject.php index d19fb184997d..0873fbf6555d 100644 --- a/VmMigration/src/V1/TargetProject.php +++ b/VmMigration/src/V1/TargetProject.php @@ -23,9 +23,9 @@ class TargetProject extends \Google\Protobuf\Internal\Message */ protected $name = ''; /** - * The target project ID (number) or project name. + * Required. The target project ID (number) or project name. * - * Generated from protobuf field string project = 2; + * Generated from protobuf field string project = 2 [(.google.api.field_behavior) = REQUIRED]; */ protected $project = ''; /** @@ -57,7 +57,7 @@ class TargetProject extends \Google\Protobuf\Internal\Message * @type string $name * Output only. The name of the target project. * @type string $project - * The target project ID (number) or project name. + * Required. The target project ID (number) or project name. * @type string $description * The target project's description. * @type \Google\Protobuf\Timestamp $create_time @@ -99,9 +99,9 @@ public function setName($var) } /** - * The target project ID (number) or project name. + * Required. The target project ID (number) or project name. * - * Generated from protobuf field string project = 2; + * Generated from protobuf field string project = 2 [(.google.api.field_behavior) = REQUIRED]; * @return string */ public function getProject() @@ -110,9 +110,9 @@ public function getProject() } /** - * The target project ID (number) or project name. + * Required. The target project ID (number) or project name. * - * Generated from protobuf field string project = 2; + * Generated from protobuf field string project = 2 [(.google.api.field_behavior) = REQUIRED]; * @param string $var * @return $this */ diff --git a/VmMigration/src/V1/UpdateDiskMigrationJobRequest.php b/VmMigration/src/V1/UpdateDiskMigrationJobRequest.php new file mode 100644 index 000000000000..5c5e7b119b68 --- /dev/null +++ b/VmMigration/src/V1/UpdateDiskMigrationJobRequest.php @@ -0,0 +1,235 @@ +google.cloud.vmmigration.v1.UpdateDiskMigrationJobRequest + */ +class UpdateDiskMigrationJobRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * DiskMigrationJob resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask, then a mask equivalent to all fields that are + * populated (have a non-empty value), will be implied. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $update_mask = null; + /** + * Required. The update request body. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.DiskMigrationJob disk_migration_job = 2 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $disk_migration_job = null; + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request timed out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + */ + protected $request_id = ''; + + /** + * @param \Google\Cloud\VMMigration\V1\DiskMigrationJob $diskMigrationJob Required. The update request body. + * @param \Google\Protobuf\FieldMask $updateMask Optional. Field mask is used to specify the fields to be overwritten in the + * DiskMigrationJob resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask, then a mask equivalent to all fields that are + * populated (have a non-empty value), will be implied. + * + * @return \Google\Cloud\VMMigration\V1\UpdateDiskMigrationJobRequest + * + * @experimental + */ + public static function build(\Google\Cloud\VMMigration\V1\DiskMigrationJob $diskMigrationJob, \Google\Protobuf\FieldMask $updateMask): self + { + return (new self()) + ->setDiskMigrationJob($diskMigrationJob) + ->setUpdateMask($updateMask); + } + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Protobuf\FieldMask $update_mask + * Optional. Field mask is used to specify the fields to be overwritten in the + * DiskMigrationJob resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask, then a mask equivalent to all fields that are + * populated (have a non-empty value), will be implied. + * @type \Google\Cloud\VMMigration\V1\DiskMigrationJob $disk_migration_job + * Required. The update request body. + * @type string $request_id + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request timed out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * DiskMigrationJob resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask, then a mask equivalent to all fields that are + * populated (have a non-empty value), will be implied. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return \Google\Protobuf\FieldMask|null + */ + public function getUpdateMask() + { + return $this->update_mask; + } + + public function hasUpdateMask() + { + return isset($this->update_mask); + } + + public function clearUpdateMask() + { + unset($this->update_mask); + } + + /** + * Optional. Field mask is used to specify the fields to be overwritten in the + * DiskMigrationJob resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask, then a mask equivalent to all fields that are + * populated (have a non-empty value), will be implied. + * + * Generated from protobuf field .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param \Google\Protobuf\FieldMask $var + * @return $this + */ + public function setUpdateMask($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class); + $this->update_mask = $var; + + return $this; + } + + /** + * Required. The update request body. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.DiskMigrationJob disk_migration_job = 2 [(.google.api.field_behavior) = REQUIRED]; + * @return \Google\Cloud\VMMigration\V1\DiskMigrationJob|null + */ + public function getDiskMigrationJob() + { + return $this->disk_migration_job; + } + + public function hasDiskMigrationJob() + { + return isset($this->disk_migration_job); + } + + public function clearDiskMigrationJob() + { + unset($this->disk_migration_job); + } + + /** + * Required. The update request body. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.DiskMigrationJob disk_migration_job = 2 [(.google.api.field_behavior) = REQUIRED]; + * @param \Google\Cloud\VMMigration\V1\DiskMigrationJob $var + * @return $this + */ + public function setDiskMigrationJob($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\DiskMigrationJob::class); + $this->disk_migration_job = $var; + + return $this; + } + + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request timed out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @return string + */ + public function getRequestId() + { + return $this->request_id; + } + + /** + * Optional. A request ID to identify requests. Specify a unique request ID + * so that if you must retry your request, the server will know to ignore + * the request if it has already been completed. The server will guarantee + * that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request timed out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * + * Generated from protobuf field string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { + * @param string $var + * @return $this + */ + public function setRequestId($var) + { + GPBUtil::checkString($var, True); + $this->request_id = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/UpdateGroupRequest.php b/VmMigration/src/V1/UpdateGroupRequest.php index c3566d1bd515..aee8dc2cfe74 100644 --- a/VmMigration/src/V1/UpdateGroupRequest.php +++ b/VmMigration/src/V1/UpdateGroupRequest.php @@ -36,8 +36,8 @@ class UpdateGroupRequest extends \Google\Protobuf\Internal\Message * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -86,8 +86,8 @@ public static function build(\Google\Cloud\VMMigration\V1\Group $group, \Google\ * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -185,8 +185,8 @@ public function setGroup($var) * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -206,8 +206,8 @@ public function getRequestId() * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/VmMigration/src/V1/UpdateMigratingVmRequest.php b/VmMigration/src/V1/UpdateMigratingVmRequest.php index 4dc83e8dfef2..ece9ca29fdc3 100644 --- a/VmMigration/src/V1/UpdateMigratingVmRequest.php +++ b/VmMigration/src/V1/UpdateMigratingVmRequest.php @@ -36,8 +36,8 @@ class UpdateMigratingVmRequest extends \Google\Protobuf\Internal\Message * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -86,8 +86,8 @@ public static function build(\Google\Cloud\VMMigration\V1\MigratingVm $migrating * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -185,8 +185,8 @@ public function setMigratingVm($var) * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -206,8 +206,8 @@ public function getRequestId() * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/VmMigration/src/V1/UpdateSourceRequest.php b/VmMigration/src/V1/UpdateSourceRequest.php index 6fedf6b84370..ceda1257271e 100644 --- a/VmMigration/src/V1/UpdateSourceRequest.php +++ b/VmMigration/src/V1/UpdateSourceRequest.php @@ -36,8 +36,8 @@ class UpdateSourceRequest extends \Google\Protobuf\Internal\Message * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -86,8 +86,8 @@ public static function build(\Google\Cloud\VMMigration\V1\Source $source, \Googl * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -185,8 +185,8 @@ public function setSource($var) * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -206,8 +206,8 @@ public function getRequestId() * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/VmMigration/src/V1/UpdateTargetProjectRequest.php b/VmMigration/src/V1/UpdateTargetProjectRequest.php index 64f7eaec9709..ae1b70e4fbe9 100644 --- a/VmMigration/src/V1/UpdateTargetProjectRequest.php +++ b/VmMigration/src/V1/UpdateTargetProjectRequest.php @@ -36,8 +36,8 @@ class UpdateTargetProjectRequest extends \Google\Protobuf\Internal\Message * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -86,8 +86,8 @@ public static function build(\Google\Cloud\VMMigration\V1\TargetProject $targetP * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -185,8 +185,8 @@ public function setTargetProject($var) * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -206,8 +206,8 @@ public function getRequestId() * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/VmMigration/src/V1/UpgradeApplianceRequest.php b/VmMigration/src/V1/UpgradeApplianceRequest.php index ceb9df3af2cf..b30ae788955e 100644 --- a/VmMigration/src/V1/UpgradeApplianceRequest.php +++ b/VmMigration/src/V1/UpgradeApplianceRequest.php @@ -26,8 +26,8 @@ class UpgradeApplianceRequest extends \Google\Protobuf\Internal\Message * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -51,8 +51,8 @@ class UpgradeApplianceRequest extends \Google\Protobuf\Internal\Message * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -96,8 +96,8 @@ public function setDatacenterConnector($var) * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. @@ -117,8 +117,8 @@ public function getRequestId() * so that if you must retry your request, the server will know to ignore * the request if it has already been completed. The server will guarantee * that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request * ID, the server can check if original operation with the same request ID * was received, and if so, will ignore the second request. This prevents * clients from accidentally creating duplicate commitments. diff --git a/VmMigration/src/V1/UpgradeStatus.php b/VmMigration/src/V1/UpgradeStatus.php index ed6bf097167b..de974a62e49f 100644 --- a/VmMigration/src/V1/UpgradeStatus.php +++ b/VmMigration/src/V1/UpgradeStatus.php @@ -28,9 +28,10 @@ class UpgradeStatus extends \Google\Protobuf\Internal\Message */ protected $state = 0; /** - * Provides details on the state of the upgrade operation in case of an error. + * Output only. Provides details on the state of the upgrade operation in case + * of an error. * - * Generated from protobuf field .google.rpc.Status error = 3; + * Generated from protobuf field .google.rpc.Status error = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $error = null; /** @@ -57,7 +58,8 @@ class UpgradeStatus extends \Google\Protobuf\Internal\Message * @type int $state * The state of the upgradeAppliance operation. * @type \Google\Rpc\Status $error - * Provides details on the state of the upgrade operation in case of an error. + * Output only. Provides details on the state of the upgrade operation in case + * of an error. * @type \Google\Protobuf\Timestamp $start_time * The time the operation was started. * @type string $previous_version @@ -122,9 +124,10 @@ public function setState($var) } /** - * Provides details on the state of the upgrade operation in case of an error. + * Output only. Provides details on the state of the upgrade operation in case + * of an error. * - * Generated from protobuf field .google.rpc.Status error = 3; + * Generated from protobuf field .google.rpc.Status error = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @return \Google\Rpc\Status|null */ public function getError() @@ -143,9 +146,10 @@ public function clearError() } /** - * Provides details on the state of the upgrade operation in case of an error. + * Output only. Provides details on the state of the upgrade operation in case + * of an error. * - * Generated from protobuf field .google.rpc.Status error = 3; + * Generated from protobuf field .google.rpc.Status error = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; * @param \Google\Rpc\Status $var * @return $this */ diff --git a/VmMigration/src/V1/VmArchitecture.php b/VmMigration/src/V1/VmArchitecture.php new file mode 100644 index 000000000000..7a1f3b7dac9f --- /dev/null +++ b/VmMigration/src/V1/VmArchitecture.php @@ -0,0 +1,61 @@ +google.cloud.vmmigration.v1.VmArchitecture + */ +class VmArchitecture +{ + /** + * The architecture is unknown. + * + * Generated from protobuf enum VM_ARCHITECTURE_UNSPECIFIED = 0; + */ + const VM_ARCHITECTURE_UNSPECIFIED = 0; + /** + * The architecture is one of the x86 architectures. + * + * Generated from protobuf enum VM_ARCHITECTURE_X86_FAMILY = 1; + */ + const VM_ARCHITECTURE_X86_FAMILY = 1; + /** + * The architecture is ARM64. + * + * Generated from protobuf enum VM_ARCHITECTURE_ARM64 = 2; + */ + const VM_ARCHITECTURE_ARM64 = 2; + + private static $valueToName = [ + self::VM_ARCHITECTURE_UNSPECIFIED => 'VM_ARCHITECTURE_UNSPECIFIED', + self::VM_ARCHITECTURE_X86_FAMILY => 'VM_ARCHITECTURE_X86_FAMILY', + self::VM_ARCHITECTURE_ARM64 => 'VM_ARCHITECTURE_ARM64', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/VmMigration/src/V1/VmAttachmentDetails.php b/VmMigration/src/V1/VmAttachmentDetails.php new file mode 100644 index 000000000000..a1e8872823da --- /dev/null +++ b/VmMigration/src/V1/VmAttachmentDetails.php @@ -0,0 +1,87 @@ +google.cloud.vmmigration.v1.VmAttachmentDetails + */ +class VmAttachmentDetails extends \Google\Protobuf\Internal\Message +{ + /** + * Optional. Specifies a unique device name of your choice that is reflected + * into the /dev/disk/by-id/google-* tree of a Linux operating system running + * within the instance. If not specified, the server chooses a default device + * name to apply to this disk, in the form persistent-disk-x, where x is a + * number assigned by Google Compute Engine. This field is only applicable for + * persistent disks. + * + * Generated from protobuf field string device_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $device_name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $device_name + * Optional. Specifies a unique device name of your choice that is reflected + * into the /dev/disk/by-id/google-* tree of a Linux operating system running + * within the instance. If not specified, the server chooses a default device + * name to apply to this disk, in the form persistent-disk-x, where x is a + * number assigned by Google Compute Engine. This field is only applicable for + * persistent disks. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Optional. Specifies a unique device name of your choice that is reflected + * into the /dev/disk/by-id/google-* tree of a Linux operating system running + * within the instance. If not specified, the server chooses a default device + * name to apply to this disk, in the form persistent-disk-x, where x is a + * number assigned by Google Compute Engine. This field is only applicable for + * persistent disks. + * + * Generated from protobuf field string device_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @return string + */ + public function getDeviceName() + { + return $this->device_name; + } + + /** + * Optional. Specifies a unique device name of your choice that is reflected + * into the /dev/disk/by-id/google-* tree of a Linux operating system running + * within the instance. If not specified, the server chooses a default device + * name to apply to this disk, in the form persistent-disk-x, where x is a + * number assigned by Google Compute Engine. This field is only applicable for + * persistent disks. + * + * Generated from protobuf field string device_name = 1 [(.google.api.field_behavior) = OPTIONAL]; + * @param string $var + * @return $this + */ + public function setDeviceName($var) + { + GPBUtil::checkString($var, True); + $this->device_name = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/VmCapabilities.php b/VmMigration/src/V1/VmCapabilities.php new file mode 100644 index 000000000000..fd4b3ccb610a --- /dev/null +++ b/VmMigration/src/V1/VmCapabilities.php @@ -0,0 +1,116 @@ +google.cloud.vmmigration.v1.VmCapabilities + */ +class VmCapabilities extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. Unordered list. List of certain VM OS capabilities needed for + * some Compute Engine features. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.OsCapability os_capabilities = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = UNORDERED_LIST]; + */ + private $os_capabilities; + /** + * Output only. The last time OS capabilities list was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp last_os_capabilities_update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $last_os_capabilities_update_time = null; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\RepeatedField $os_capabilities + * Output only. Unordered list. List of certain VM OS capabilities needed for + * some Compute Engine features. + * @type \Google\Protobuf\Timestamp $last_os_capabilities_update_time + * Output only. The last time OS capabilities list was updated. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Output only. Unordered list. List of certain VM OS capabilities needed for + * some Compute Engine features. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.OsCapability os_capabilities = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = UNORDERED_LIST]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOsCapabilities() + { + return $this->os_capabilities; + } + + /** + * Output only. Unordered list. List of certain VM OS capabilities needed for + * some Compute Engine features. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.OsCapability os_capabilities = 1 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = UNORDERED_LIST]; + * @param array|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOsCapabilities($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Google\Cloud\VMMigration\V1\OsCapability::class); + $this->os_capabilities = $arr; + + return $this; + } + + /** + * Output only. The last time OS capabilities list was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp last_os_capabilities_update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Timestamp|null + */ + public function getLastOsCapabilitiesUpdateTime() + { + return $this->last_os_capabilities_update_time; + } + + public function hasLastOsCapabilitiesUpdateTime() + { + return isset($this->last_os_capabilities_update_time); + } + + public function clearLastOsCapabilitiesUpdateTime() + { + unset($this->last_os_capabilities_update_time); + } + + /** + * Output only. The last time OS capabilities list was updated. + * + * Generated from protobuf field .google.protobuf.Timestamp last_os_capabilities_update_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Protobuf\Timestamp $var + * @return $this + */ + public function setLastOsCapabilitiesUpdateTime($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class); + $this->last_os_capabilities_update_time = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/VmwareSourceDetails.php b/VmMigration/src/V1/VmwareSourceDetails.php index 751c4aebdc1a..a1382ea205c4 100644 --- a/VmMigration/src/V1/VmwareSourceDetails.php +++ b/VmMigration/src/V1/VmwareSourceDetails.php @@ -41,6 +41,12 @@ class VmwareSourceDetails extends \Google\Protobuf\Internal\Message * Generated from protobuf field string thumbprint = 4; */ protected $thumbprint = ''; + /** + * The hostname of the vcenter. + * + * Generated from protobuf field string resolved_vcenter_host = 5; + */ + protected $resolved_vcenter_host = ''; /** * Constructor. @@ -57,6 +63,8 @@ class VmwareSourceDetails extends \Google\Protobuf\Internal\Message * The ip address of the vcenter this Source represents. * @type string $thumbprint * The thumbprint representing the certificate for the vcenter. + * @type string $resolved_vcenter_host + * The hostname of the vcenter. * } */ public function __construct($data = NULL) { @@ -170,5 +178,31 @@ public function setThumbprint($var) return $this; } + /** + * The hostname of the vcenter. + * + * Generated from protobuf field string resolved_vcenter_host = 5; + * @return string + */ + public function getResolvedVcenterHost() + { + return $this->resolved_vcenter_host; + } + + /** + * The hostname of the vcenter. + * + * Generated from protobuf field string resolved_vcenter_host = 5; + * @param string $var + * @return $this + */ + public function setResolvedVcenterHost($var) + { + GPBUtil::checkString($var, True); + $this->resolved_vcenter_host = $var; + + return $this; + } + } diff --git a/VmMigration/src/V1/VmwareSourceVmDetails.php b/VmMigration/src/V1/VmwareSourceVmDetails.php new file mode 100644 index 000000000000..313033f145c9 --- /dev/null +++ b/VmMigration/src/V1/VmwareSourceVmDetails.php @@ -0,0 +1,217 @@ +google.cloud.vmmigration.v1.VmwareSourceVmDetails + */ +class VmwareSourceVmDetails extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The firmware type of the source VM. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmwareSourceVmDetails.Firmware firmware = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $firmware = 0; + /** + * Output only. The total size of the disks being migrated in bytes. + * + * Generated from protobuf field int64 committed_storage_bytes = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $committed_storage_bytes = 0; + /** + * Output only. The disks attached to the source VM. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.VmwareSourceVmDetails.VmwareDiskDetails disks = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $disks; + /** + * Output only. Information about VM capabilities needed for some Compute + * Engine features. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmCapabilities vm_capabilities_info = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $vm_capabilities_info = null; + /** + * Output only. The VM architecture. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmArchitecture architecture = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $architecture = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $firmware + * Output only. The firmware type of the source VM. + * @type int|string $committed_storage_bytes + * Output only. The total size of the disks being migrated in bytes. + * @type array<\Google\Cloud\VMMigration\V1\VmwareSourceVmDetails\VmwareDiskDetails>|\Google\Protobuf\Internal\RepeatedField $disks + * Output only. The disks attached to the source VM. + * @type \Google\Cloud\VMMigration\V1\VmCapabilities $vm_capabilities_info + * Output only. Information about VM capabilities needed for some Compute + * Engine features. + * @type int $architecture + * Output only. The VM architecture. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The firmware type of the source VM. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmwareSourceVmDetails.Firmware firmware = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getFirmware() + { + return $this->firmware; + } + + /** + * Output only. The firmware type of the source VM. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmwareSourceVmDetails.Firmware firmware = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setFirmware($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\VmwareSourceVmDetails\Firmware::class); + $this->firmware = $var; + + return $this; + } + + /** + * Output only. The total size of the disks being migrated in bytes. + * + * Generated from protobuf field int64 committed_storage_bytes = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getCommittedStorageBytes() + { + return $this->committed_storage_bytes; + } + + /** + * Output only. The total size of the disks being migrated in bytes. + * + * Generated from protobuf field int64 committed_storage_bytes = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setCommittedStorageBytes($var) + { + GPBUtil::checkInt64($var); + $this->committed_storage_bytes = $var; + + return $this; + } + + /** + * Output only. The disks attached to the source VM. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.VmwareSourceVmDetails.VmwareDiskDetails disks = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getDisks() + { + return $this->disks; + } + + /** + * Output only. The disks attached to the source VM. + * + * Generated from protobuf field repeated .google.cloud.vmmigration.v1.VmwareSourceVmDetails.VmwareDiskDetails disks = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param array<\Google\Cloud\VMMigration\V1\VmwareSourceVmDetails\VmwareDiskDetails>|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setDisks($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\VMMigration\V1\VmwareSourceVmDetails\VmwareDiskDetails::class); + $this->disks = $arr; + + return $this; + } + + /** + * Output only. Information about VM capabilities needed for some Compute + * Engine features. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmCapabilities vm_capabilities_info = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return \Google\Cloud\VMMigration\V1\VmCapabilities|null + */ + public function getVmCapabilitiesInfo() + { + return $this->vm_capabilities_info; + } + + public function hasVmCapabilitiesInfo() + { + return isset($this->vm_capabilities_info); + } + + public function clearVmCapabilitiesInfo() + { + unset($this->vm_capabilities_info); + } + + /** + * Output only. Information about VM capabilities needed for some Compute + * Engine features. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmCapabilities vm_capabilities_info = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\VMMigration\V1\VmCapabilities $var + * @return $this + */ + public function setVmCapabilitiesInfo($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\VMMigration\V1\VmCapabilities::class); + $this->vm_capabilities_info = $var; + + return $this; + } + + /** + * Output only. The VM architecture. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmArchitecture architecture = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getArchitecture() + { + return $this->architecture; + } + + /** + * Output only. The VM architecture. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmArchitecture architecture = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setArchitecture($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\VmArchitecture::class); + $this->architecture = $var; + + return $this; + } + +} + diff --git a/VmMigration/src/V1/VmwareSourceVmDetails/Firmware.php b/VmMigration/src/V1/VmwareSourceVmDetails/Firmware.php new file mode 100644 index 000000000000..3f8eb0a8a3b7 --- /dev/null +++ b/VmMigration/src/V1/VmwareSourceVmDetails/Firmware.php @@ -0,0 +1,62 @@ +google.cloud.vmmigration.v1.VmwareSourceVmDetails.Firmware + */ +class Firmware +{ + /** + * The firmware is unknown. + * + * Generated from protobuf enum FIRMWARE_UNSPECIFIED = 0; + */ + const FIRMWARE_UNSPECIFIED = 0; + /** + * The firmware is EFI. + * + * Generated from protobuf enum EFI = 1; + */ + const EFI = 1; + /** + * The firmware is BIOS. + * + * Generated from protobuf enum BIOS = 2; + */ + const BIOS = 2; + + private static $valueToName = [ + self::FIRMWARE_UNSPECIFIED => 'FIRMWARE_UNSPECIFIED', + self::EFI => 'EFI', + self::BIOS => 'BIOS', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/VmMigration/src/V1/VmwareSourceVmDetails/VmwareDiskDetails.php b/VmMigration/src/V1/VmwareSourceVmDetails/VmwareDiskDetails.php new file mode 100644 index 000000000000..3dfab9434f88 --- /dev/null +++ b/VmMigration/src/V1/VmwareSourceVmDetails/VmwareDiskDetails.php @@ -0,0 +1,136 @@ +google.cloud.vmmigration.v1.VmwareSourceVmDetails.VmwareDiskDetails + */ +class VmwareDiskDetails extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The ordinal number of the disk. + * + * Generated from protobuf field int32 disk_number = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $disk_number = 0; + /** + * Output only. Size in GB. + * + * Generated from protobuf field int64 size_gb = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $size_gb = 0; + /** + * Output only. The disk label. + * + * Generated from protobuf field string label = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $label = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $disk_number + * Output only. The ordinal number of the disk. + * @type int|string $size_gb + * Output only. Size in GB. + * @type string $label + * Output only. The disk label. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The ordinal number of the disk. + * + * Generated from protobuf field int32 disk_number = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getDiskNumber() + { + return $this->disk_number; + } + + /** + * Output only. The ordinal number of the disk. + * + * Generated from protobuf field int32 disk_number = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setDiskNumber($var) + { + GPBUtil::checkInt32($var); + $this->disk_number = $var; + + return $this; + } + + /** + * Output only. Size in GB. + * + * Generated from protobuf field int64 size_gb = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getSizeGb() + { + return $this->size_gb; + } + + /** + * Output only. Size in GB. + * + * Generated from protobuf field int64 size_gb = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setSizeGb($var) + { + GPBUtil::checkInt64($var); + $this->size_gb = $var; + + return $this; + } + + /** + * Output only. The disk label. + * + * Generated from protobuf field string label = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getLabel() + { + return $this->label; + } + + /** + * Output only. The disk label. + * + * Generated from protobuf field string label = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setLabel($var) + { + GPBUtil::checkString($var, True); + $this->label = $var; + + return $this; + } + +} + + diff --git a/VmMigration/src/V1/VmwareVmDetails.php b/VmMigration/src/V1/VmwareVmDetails.php index d35cf1bfd3eb..ac8e71353c47 100644 --- a/VmMigration/src/V1/VmwareVmDetails.php +++ b/VmMigration/src/V1/VmwareVmDetails.php @@ -90,6 +90,12 @@ class VmwareVmDetails extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.vmmigration.v1.VmwareVmDetails.BootOption boot_option = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $boot_option = 0; + /** + * Output only. The CPU architecture. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmwareVmDetails.VmArchitecture architecture = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $architecture = 0; /** * Constructor. @@ -124,6 +130,8 @@ class VmwareVmDetails extends \Google\Protobuf\Internal\Message * for types of strings this might hold. * @type int $boot_option * Output only. The VM Boot Option. + * @type int $architecture + * Output only. The CPU architecture. * } */ public function __construct($data = NULL) { @@ -449,5 +457,31 @@ public function setBootOption($var) return $this; } + /** + * Output only. The CPU architecture. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmwareVmDetails.VmArchitecture architecture = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getArchitecture() + { + return $this->architecture; + } + + /** + * Output only. The CPU architecture. + * + * Generated from protobuf field .google.cloud.vmmigration.v1.VmwareVmDetails.VmArchitecture architecture = 14 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setArchitecture($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\VmwareVmDetails\VmArchitecture::class); + $this->architecture = $var; + + return $this; + } + } diff --git a/VmMigration/src/V1/VmwareVmDetails/VmArchitecture.php b/VmMigration/src/V1/VmwareVmDetails/VmArchitecture.php new file mode 100644 index 000000000000..8d39d8b7d3b1 --- /dev/null +++ b/VmMigration/src/V1/VmwareVmDetails/VmArchitecture.php @@ -0,0 +1,62 @@ +google.cloud.vmmigration.v1.VmwareVmDetails.VmArchitecture + */ +class VmArchitecture +{ + /** + * The architecture is unknown. + * + * Generated from protobuf enum VM_ARCHITECTURE_UNSPECIFIED = 0; + */ + const VM_ARCHITECTURE_UNSPECIFIED = 0; + /** + * The architecture is one of the x86 architectures. + * + * Generated from protobuf enum VM_ARCHITECTURE_X86_FAMILY = 1; + */ + const VM_ARCHITECTURE_X86_FAMILY = 1; + /** + * The architecture is ARM64. + * + * Generated from protobuf enum VM_ARCHITECTURE_ARM64 = 2; + */ + const VM_ARCHITECTURE_ARM64 = 2; + + private static $valueToName = [ + self::VM_ARCHITECTURE_UNSPECIFIED => 'VM_ARCHITECTURE_UNSPECIFIED', + self::VM_ARCHITECTURE_X86_FAMILY => 'VM_ARCHITECTURE_X86_FAMILY', + self::VM_ARCHITECTURE_ARM64 => 'VM_ARCHITECTURE_ARM64', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + + diff --git a/VmMigration/src/V1/gapic_metadata.json b/VmMigration/src/V1/gapic_metadata.json index 6a432b19446a..079a61db5e12 100644 --- a/VmMigration/src/V1/gapic_metadata.json +++ b/VmMigration/src/V1/gapic_metadata.json @@ -25,6 +25,16 @@ "cancelCutoverJob" ] }, + "CancelDiskMigrationJob": { + "methods": [ + "cancelDiskMigrationJob" + ] + }, + "CancelImageImportJob": { + "methods": [ + "cancelImageImportJob" + ] + }, "CreateCloneJob": { "methods": [ "createCloneJob" @@ -40,11 +50,21 @@ "createDatacenterConnector" ] }, + "CreateDiskMigrationJob": { + "methods": [ + "createDiskMigrationJob" + ] + }, "CreateGroup": { "methods": [ "createGroup" ] }, + "CreateImageImport": { + "methods": [ + "createImageImport" + ] + }, "CreateMigratingVm": { "methods": [ "createMigratingVm" @@ -70,11 +90,21 @@ "deleteDatacenterConnector" ] }, + "DeleteDiskMigrationJob": { + "methods": [ + "deleteDiskMigrationJob" + ] + }, "DeleteGroup": { "methods": [ "deleteGroup" ] }, + "DeleteImageImport": { + "methods": [ + "deleteImageImport" + ] + }, "DeleteMigratingVm": { "methods": [ "deleteMigratingVm" @@ -95,11 +125,21 @@ "deleteUtilizationReport" ] }, + "ExtendMigration": { + "methods": [ + "extendMigration" + ] + }, "FetchInventory": { "methods": [ "fetchInventory" ] }, + "FetchStorageInventory": { + "methods": [ + "fetchStorageInventory" + ] + }, "FinalizeMigration": { "methods": [ "finalizeMigration" @@ -120,11 +160,26 @@ "getDatacenterConnector" ] }, + "GetDiskMigrationJob": { + "methods": [ + "getDiskMigrationJob" + ] + }, "GetGroup": { "methods": [ "getGroup" ] }, + "GetImageImport": { + "methods": [ + "getImageImport" + ] + }, + "GetImageImportJob": { + "methods": [ + "getImageImportJob" + ] + }, "GetMigratingVm": { "methods": [ "getMigratingVm" @@ -165,11 +220,26 @@ "listDatacenterConnectors" ] }, + "ListDiskMigrationJobs": { + "methods": [ + "listDiskMigrationJobs" + ] + }, "ListGroups": { "methods": [ "listGroups" ] }, + "ListImageImportJobs": { + "methods": [ + "listImageImportJobs" + ] + }, + "ListImageImports": { + "methods": [ + "listImageImports" + ] + }, "ListMigratingVms": { "methods": [ "listMigratingVms" @@ -210,11 +280,21 @@ "resumeMigration" ] }, + "RunDiskMigrationJob": { + "methods": [ + "runDiskMigrationJob" + ] + }, "StartMigration": { "methods": [ "startMigration" ] }, + "UpdateDiskMigrationJob": { + "methods": [ + "updateDiskMigrationJob" + ] + }, "UpdateGroup": { "methods": [ "updateGroup" diff --git a/VmMigration/src/V1/resources/vm_migration_client_config.json b/VmMigration/src/V1/resources/vm_migration_client_config.json index 51f53c73dcb5..9cb301193296 100644 --- a/VmMigration/src/V1/resources/vm_migration_client_config.json +++ b/VmMigration/src/V1/resources/vm_migration_client_config.json @@ -61,6 +61,16 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "CancelDiskMigrationJob": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "CancelImageImportJob": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "CreateCloneJob": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", @@ -76,11 +86,21 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "CreateDiskMigrationJob": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "CreateGroup": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "CreateImageImport": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "CreateMigratingVm": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", @@ -106,11 +126,21 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "DeleteDiskMigrationJob": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "DeleteGroup": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "DeleteImageImport": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "DeleteMigratingVm": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", @@ -131,11 +161,21 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "ExtendMigration": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "FetchInventory": { "timeout_millis": 300000, "retry_codes_name": "no_retry_2_codes", "retry_params_name": "no_retry_2_params" }, + "FetchStorageInventory": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "FinalizeMigration": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", @@ -156,11 +196,26 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "GetDiskMigrationJob": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "GetGroup": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "GetImageImport": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "GetImageImportJob": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "GetMigratingVm": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", @@ -201,11 +256,26 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "ListDiskMigrationJobs": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "ListGroups": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "ListImageImportJobs": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, + "ListImageImports": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "ListMigratingVms": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", @@ -246,11 +316,21 @@ "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "RunDiskMigrationJob": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "StartMigration": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", "retry_params_name": "no_retry_1_params" }, + "UpdateDiskMigrationJob": { + "timeout_millis": 60000, + "retry_codes_name": "no_retry_1_codes", + "retry_params_name": "no_retry_1_params" + }, "UpdateGroup": { "timeout_millis": 60000, "retry_codes_name": "no_retry_1_codes", diff --git a/VmMigration/src/V1/resources/vm_migration_descriptor_config.php b/VmMigration/src/V1/resources/vm_migration_descriptor_config.php index 7a4fee565d72..9c7e1b03e819 100644 --- a/VmMigration/src/V1/resources/vm_migration_descriptor_config.php +++ b/VmMigration/src/V1/resources/vm_migration_descriptor_config.php @@ -80,6 +80,44 @@ ], ], ], + 'CancelDiskMigrationJob' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\VMMigration\V1\CancelDiskMigrationJobResponse', + 'metadataReturnType' => '\Google\Cloud\VMMigration\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'CancelImageImportJob' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\VMMigration\V1\CancelImageImportJobResponse', + 'metadataReturnType' => '\Google\Cloud\VMMigration\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'CreateCloneJob' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\VMMigration\V1\CloneJob', @@ -137,6 +175,25 @@ ], ], ], + 'CreateDiskMigrationJob' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\VMMigration\V1\DiskMigrationJob', + 'metadataReturnType' => '\Google\Cloud\VMMigration\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'CreateGroup' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\VMMigration\V1\Group', @@ -156,6 +213,25 @@ ], ], ], + 'CreateImageImport' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\VMMigration\V1\ImageImport', + 'metadataReturnType' => '\Google\Cloud\VMMigration\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'CreateMigratingVm' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\VMMigration\V1\MigratingVm', @@ -251,6 +327,25 @@ ], ], ], + 'DeleteDiskMigrationJob' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\VMMigration\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'DeleteGroup' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Protobuf\GPBEmpty', @@ -270,6 +365,25 @@ ], ], ], + 'DeleteImageImport' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Protobuf\GPBEmpty', + 'metadataReturnType' => '\Google\Cloud\VMMigration\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'DeleteMigratingVm' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Protobuf\GPBEmpty', @@ -346,6 +460,25 @@ ], ], ], + 'ExtendMigration' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\VMMigration\V1\ExtendMigrationResponse', + 'metadataReturnType' => '\Google\Cloud\VMMigration\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'migrating_vm', + 'fieldAccessors' => [ + 'getMigratingVm', + ], + ], + ], + ], 'FinalizeMigration' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\VMMigration\V1\FinalizeMigrationResponse', @@ -422,6 +555,25 @@ ], ], ], + 'RunDiskMigrationJob' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\VMMigration\V1\RunDiskMigrationJobResponse', + 'metadataReturnType' => '\Google\Cloud\VMMigration\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'StartMigration' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\VMMigration\V1\StartMigrationResponse', @@ -441,6 +593,26 @@ ], ], ], + 'UpdateDiskMigrationJob' => [ + 'longRunning' => [ + 'operationReturnType' => '\Google\Cloud\VMMigration\V1\DiskMigrationJob', + 'metadataReturnType' => '\Google\Cloud\VMMigration\V1\OperationMetadata', + 'initialPollDelayMillis' => '500', + 'pollDelayMultiplier' => '1.5', + 'maxPollDelayMillis' => '5000', + 'totalPollTimeoutMillis' => '300000', + ], + 'callType' => \Google\ApiCore\Call::LONGRUNNING_CALL, + 'headerParams' => [ + [ + 'keyName' => 'disk_migration_job.name', + 'fieldAccessors' => [ + 'getDiskMigrationJob', + 'getName', + ], + ], + ], + ], 'UpdateGroup' => [ 'longRunning' => [ 'operationReturnType' => '\Google\Cloud\VMMigration\V1\Group', @@ -552,6 +724,26 @@ ], ], ], + 'FetchStorageInventory' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getResources', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\VMMigration\V1\FetchStorageInventoryResponse', + 'headerParams' => [ + [ + 'keyName' => 'source', + 'fieldAccessors' => [ + 'getSource', + ], + ], + ], + ], 'GetCloneJob' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\VMMigration\V1\CloneJob', @@ -588,6 +780,18 @@ ], ], ], + 'GetDiskMigrationJob' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\VMMigration\V1\DiskMigrationJob', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'GetGroup' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\VMMigration\V1\Group', @@ -600,6 +804,30 @@ ], ], ], + 'GetImageImport' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\VMMigration\V1\ImageImport', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'GetImageImportJob' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\VMMigration\V1\ImageImportJob', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'GetMigratingVm' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\VMMigration\V1\MigratingVm', @@ -720,6 +948,26 @@ ], ], ], + 'ListDiskMigrationJobs' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getDiskMigrationJobs', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\VMMigration\V1\ListDiskMigrationJobsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'ListGroups' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', @@ -740,6 +988,46 @@ ], ], ], + 'ListImageImportJobs' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getImageImportJobs', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\VMMigration\V1\ListImageImportJobsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], + 'ListImageImports' => [ + 'pageStreaming' => [ + 'requestPageTokenGetMethod' => 'getPageToken', + 'requestPageTokenSetMethod' => 'setPageToken', + 'requestPageSizeGetMethod' => 'getPageSize', + 'requestPageSizeSetMethod' => 'setPageSize', + 'responsePageTokenGetMethod' => 'getNextPageToken', + 'resourcesGetMethod' => 'getImageImports', + ], + 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, + 'responseType' => 'Google\Cloud\VMMigration\V1\ListImageImportsResponse', + 'headerParams' => [ + [ + 'keyName' => 'parent', + 'fieldAccessors' => [ + 'getParent', + ], + ], + ], + ], 'ListMigratingVms' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', @@ -876,12 +1164,18 @@ ], 'templateMap' => [ 'cloneJob' => 'projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/cloneJobs/{clone_job}', + 'cryptoKey' => 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}', 'cutoverJob' => 'projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/cutoverJobs/{cutover_job}', 'datacenterConnector' => 'projects/{project}/locations/{location}/sources/{source}/datacenterConnectors/{datacenter_connector}', + 'diskMigrationJob' => 'projects/{project}/locations/{location}/sources/{source}/diskMigrationJobs/{disk_migration_job}', 'group' => 'projects/{project}/locations/{location}/groups/{group}', + 'image' => 'projects/{project}/global/images/{image}', + 'imageImport' => 'projects/{project}/locations/{location}/imageImports/{job}', + 'imageImportJob' => 'projects/{project}/locations/{location}/imageImports/{job}/imageImportJobs/{result}', 'location' => 'projects/{project}/locations/{location}', 'migratingVm' => 'projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}', 'replicationCycle' => 'projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/replicationCycles/{replication_cycle}', + 'serviceAccount' => 'projects/{project}/serviceAccounts/{service_account}', 'source' => 'projects/{project}/locations/{location}/sources/{source}', 'targetProject' => 'projects/{project}/locations/{location}/targetProjects/{target_project}', 'utilizationReport' => 'projects/{project}/locations/{location}/sources/{source}/utilizationReports/{utilization_report}', diff --git a/VmMigration/src/V1/resources/vm_migration_rest_client_config.php b/VmMigration/src/V1/resources/vm_migration_rest_client_config.php index a548189e98dc..87656f0d3441 100644 --- a/VmMigration/src/V1/resources/vm_migration_rest_client_config.php +++ b/VmMigration/src/V1/resources/vm_migration_rest_client_config.php @@ -83,6 +83,30 @@ ], ], ], + 'CancelDiskMigrationJob' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/sources/*/diskMigrationJobs/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'CancelImageImportJob' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/imageImports/*/imageImportJobs/*}:cancel', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'CreateCloneJob' => [ 'method' => 'post', 'uriTemplate' => '/v1/{parent=projects/*/locations/*/sources/*/migratingVms/*}/cloneJobs', @@ -128,6 +152,21 @@ 'datacenter_connector_id', ], ], + 'CreateDiskMigrationJob' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/sources/*}/diskMigrationJobs', + 'body' => 'disk_migration_job', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'disk_migration_job_id', + ], + ], 'CreateGroup' => [ 'method' => 'post', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/groups', @@ -143,6 +182,21 @@ 'group_id', ], ], + 'CreateImageImport' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/imageImports', + 'body' => 'image_import', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + 'queryParams' => [ + 'image_import_id', + ], + ], 'CreateMigratingVm' => [ 'method' => 'post', 'uriTemplate' => '/v1/{parent=projects/*/locations/*/sources/*}/migratingVms', @@ -214,6 +268,17 @@ ], ], ], + 'DeleteDiskMigrationJob' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/sources/*/diskMigrationJobs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'DeleteGroup' => [ 'method' => 'delete', 'uriTemplate' => '/v1/{name=projects/*/locations/*/groups/*}', @@ -225,6 +290,17 @@ ], ], ], + 'DeleteImageImport' => [ + 'method' => 'delete', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/imageImports/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'DeleteMigratingVm' => [ 'method' => 'delete', 'uriTemplate' => '/v1/{name=projects/*/locations/*/sources/*/migratingVms/*}', @@ -269,6 +345,18 @@ ], ], ], + 'ExtendMigration' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{migrating_vm=projects/*/locations/*/sources/*/migratingVms/*}:extendMigration', + 'body' => '*', + 'placeholders' => [ + 'migrating_vm' => [ + 'getters' => [ + 'getMigratingVm', + ], + ], + ], + ], 'FetchInventory' => [ 'method' => 'get', 'uriTemplate' => '/v1/{source=projects/*/locations/*/sources/*}:fetchInventory', @@ -280,6 +368,17 @@ ], ], ], + 'FetchStorageInventory' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{source=projects/*/locations/*/sources/*}:fetchStorageInventory', + 'placeholders' => [ + 'source' => [ + 'getters' => [ + 'getSource', + ], + ], + ], + ], 'FinalizeMigration' => [ 'method' => 'post', 'uriTemplate' => '/v1/{migrating_vm=projects/*/locations/*/sources/*/migratingVms/*}:finalizeMigration', @@ -325,6 +424,17 @@ ], ], ], + 'GetDiskMigrationJob' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/sources/*/diskMigrationJobs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetGroup' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/locations/*/groups/*}', @@ -336,6 +446,28 @@ ], ], ], + 'GetImageImport' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/imageImports/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'GetImageImportJob' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/imageImports/*/imageImportJobs/*}', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'GetMigratingVm' => [ 'method' => 'get', 'uriTemplate' => '/v1/{name=projects/*/locations/*/sources/*/migratingVms/*}', @@ -433,6 +565,17 @@ 'page_token', ], ], + 'ListDiskMigrationJobs' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/sources/*}/diskMigrationJobs', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'ListGroups' => [ 'method' => 'get', 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/groups', @@ -447,6 +590,28 @@ 'page_token', ], ], + 'ListImageImportJobs' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*/imageImports/*}/imageImportJobs', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], + 'ListImageImports' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{parent=projects/*/locations/*}/imageImports', + 'placeholders' => [ + 'parent' => [ + 'getters' => [ + 'getParent', + ], + ], + ], + ], 'ListMigratingVms' => [ 'method' => 'get', 'uriTemplate' => '/v1/{parent=projects/*/locations/*/sources/*}/migratingVms', @@ -553,6 +718,18 @@ ], ], ], + 'RunDiskMigrationJob' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*/sources/*/diskMigrationJobs/*}:run', + 'body' => '*', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'StartMigration' => [ 'method' => 'post', 'uriTemplate' => '/v1/{migrating_vm=projects/*/locations/*/sources/*/migratingVms/*}:startMigration', @@ -565,6 +742,19 @@ ], ], ], + 'UpdateDiskMigrationJob' => [ + 'method' => 'patch', + 'uriTemplate' => '/v1/{disk_migration_job.name=projects/*/locations/*/sources/*/diskMigrationJobs/*}', + 'body' => 'disk_migration_job', + 'placeholders' => [ + 'disk_migration_job.name' => [ + 'getters' => [ + 'getDiskMigrationJob', + 'getName', + ], + ], + ], + ], 'UpdateGroup' => [ 'method' => 'patch', 'uriTemplate' => '/v1/{group.name=projects/*/locations/*/groups/*}', diff --git a/VmMigration/tests/Unit/V1/Client/VmMigrationClientTest.php b/VmMigration/tests/Unit/V1/Client/VmMigrationClientTest.php index 62134d1c851f..7672e89e18eb 100644 --- a/VmMigration/tests/Unit/V1/Client/VmMigrationClientTest.php +++ b/VmMigration/tests/Unit/V1/Client/VmMigrationClientTest.php @@ -36,12 +36,20 @@ use Google\Cloud\VMMigration\V1\CancelCloneJobResponse; use Google\Cloud\VMMigration\V1\CancelCutoverJobRequest; use Google\Cloud\VMMigration\V1\CancelCutoverJobResponse; +use Google\Cloud\VMMigration\V1\CancelDiskMigrationJobRequest; +use Google\Cloud\VMMigration\V1\CancelDiskMigrationJobResponse; +use Google\Cloud\VMMigration\V1\CancelImageImportJobRequest; +use Google\Cloud\VMMigration\V1\CancelImageImportJobResponse; use Google\Cloud\VMMigration\V1\Client\VmMigrationClient; use Google\Cloud\VMMigration\V1\CloneJob; +use Google\Cloud\VMMigration\V1\ComputeEngineDisk; +use Google\Cloud\VMMigration\V1\ComputeEngineDiskType; use Google\Cloud\VMMigration\V1\CreateCloneJobRequest; use Google\Cloud\VMMigration\V1\CreateCutoverJobRequest; use Google\Cloud\VMMigration\V1\CreateDatacenterConnectorRequest; +use Google\Cloud\VMMigration\V1\CreateDiskMigrationJobRequest; use Google\Cloud\VMMigration\V1\CreateGroupRequest; +use Google\Cloud\VMMigration\V1\CreateImageImportRequest; use Google\Cloud\VMMigration\V1\CreateMigratingVmRequest; use Google\Cloud\VMMigration\V1\CreateSourceRequest; use Google\Cloud\VMMigration\V1\CreateTargetProjectRequest; @@ -49,33 +57,53 @@ use Google\Cloud\VMMigration\V1\CutoverJob; use Google\Cloud\VMMigration\V1\DatacenterConnector; use Google\Cloud\VMMigration\V1\DeleteDatacenterConnectorRequest; +use Google\Cloud\VMMigration\V1\DeleteDiskMigrationJobRequest; use Google\Cloud\VMMigration\V1\DeleteGroupRequest; +use Google\Cloud\VMMigration\V1\DeleteImageImportRequest; use Google\Cloud\VMMigration\V1\DeleteMigratingVmRequest; use Google\Cloud\VMMigration\V1\DeleteSourceRequest; use Google\Cloud\VMMigration\V1\DeleteTargetProjectRequest; use Google\Cloud\VMMigration\V1\DeleteUtilizationReportRequest; +use Google\Cloud\VMMigration\V1\DiskMigrationJob; +use Google\Cloud\VMMigration\V1\DiskMigrationJobTargetDetails; +use Google\Cloud\VMMigration\V1\ExtendMigrationRequest; +use Google\Cloud\VMMigration\V1\ExtendMigrationResponse; use Google\Cloud\VMMigration\V1\FetchInventoryRequest; use Google\Cloud\VMMigration\V1\FetchInventoryResponse; +use Google\Cloud\VMMigration\V1\FetchStorageInventoryRequest; +use Google\Cloud\VMMigration\V1\FetchStorageInventoryRequest\StorageType; +use Google\Cloud\VMMigration\V1\FetchStorageInventoryResponse; use Google\Cloud\VMMigration\V1\FinalizeMigrationRequest; use Google\Cloud\VMMigration\V1\FinalizeMigrationResponse; use Google\Cloud\VMMigration\V1\GetCloneJobRequest; use Google\Cloud\VMMigration\V1\GetCutoverJobRequest; use Google\Cloud\VMMigration\V1\GetDatacenterConnectorRequest; +use Google\Cloud\VMMigration\V1\GetDiskMigrationJobRequest; use Google\Cloud\VMMigration\V1\GetGroupRequest; +use Google\Cloud\VMMigration\V1\GetImageImportJobRequest; +use Google\Cloud\VMMigration\V1\GetImageImportRequest; use Google\Cloud\VMMigration\V1\GetMigratingVmRequest; use Google\Cloud\VMMigration\V1\GetReplicationCycleRequest; use Google\Cloud\VMMigration\V1\GetSourceRequest; use Google\Cloud\VMMigration\V1\GetTargetProjectRequest; use Google\Cloud\VMMigration\V1\GetUtilizationReportRequest; use Google\Cloud\VMMigration\V1\Group; +use Google\Cloud\VMMigration\V1\ImageImport; +use Google\Cloud\VMMigration\V1\ImageImportJob; use Google\Cloud\VMMigration\V1\ListCloneJobsRequest; use Google\Cloud\VMMigration\V1\ListCloneJobsResponse; use Google\Cloud\VMMigration\V1\ListCutoverJobsRequest; use Google\Cloud\VMMigration\V1\ListCutoverJobsResponse; use Google\Cloud\VMMigration\V1\ListDatacenterConnectorsRequest; use Google\Cloud\VMMigration\V1\ListDatacenterConnectorsResponse; +use Google\Cloud\VMMigration\V1\ListDiskMigrationJobsRequest; +use Google\Cloud\VMMigration\V1\ListDiskMigrationJobsResponse; use Google\Cloud\VMMigration\V1\ListGroupsRequest; use Google\Cloud\VMMigration\V1\ListGroupsResponse; +use Google\Cloud\VMMigration\V1\ListImageImportJobsRequest; +use Google\Cloud\VMMigration\V1\ListImageImportJobsResponse; +use Google\Cloud\VMMigration\V1\ListImageImportsRequest; +use Google\Cloud\VMMigration\V1\ListImageImportsResponse; use Google\Cloud\VMMigration\V1\ListMigratingVmsRequest; use Google\Cloud\VMMigration\V1\ListMigratingVmsResponse; use Google\Cloud\VMMigration\V1\ListReplicationCyclesRequest; @@ -94,10 +122,14 @@ use Google\Cloud\VMMigration\V1\ReplicationCycle; use Google\Cloud\VMMigration\V1\ResumeMigrationRequest; use Google\Cloud\VMMigration\V1\ResumeMigrationResponse; +use Google\Cloud\VMMigration\V1\RunDiskMigrationJobRequest; +use Google\Cloud\VMMigration\V1\RunDiskMigrationJobResponse; use Google\Cloud\VMMigration\V1\Source; +use Google\Cloud\VMMigration\V1\SourceStorageResource; use Google\Cloud\VMMigration\V1\StartMigrationRequest; use Google\Cloud\VMMigration\V1\StartMigrationResponse; use Google\Cloud\VMMigration\V1\TargetProject; +use Google\Cloud\VMMigration\V1\UpdateDiskMigrationJobRequest; use Google\Cloud\VMMigration\V1\UpdateGroupRequest; use Google\Cloud\VMMigration\V1\UpdateMigratingVmRequest; use Google\Cloud\VMMigration\V1\UpdateSourceRequest; @@ -533,6 +565,260 @@ public function cancelCutoverJobExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); } + /** @test */ + public function cancelDiskMigrationJobTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/cancelDiskMigrationJobTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new CancelDiskMigrationJobResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/cancelDiskMigrationJobTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->diskMigrationJobName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[DISK_MIGRATION_JOB]' + ); + $request = (new CancelDiskMigrationJobRequest())->setName($formattedName); + $response = $gapicClient->cancelDiskMigrationJob($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/CancelDiskMigrationJob', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/cancelDiskMigrationJobTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function cancelDiskMigrationJobExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/cancelDiskMigrationJobTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->diskMigrationJobName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[DISK_MIGRATION_JOB]' + ); + $request = (new CancelDiskMigrationJobRequest())->setName($formattedName); + $response = $gapicClient->cancelDiskMigrationJob($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/cancelDiskMigrationJobTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function cancelImageImportJobTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/cancelImageImportJobTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new CancelImageImportJobResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/cancelImageImportJobTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->imageImportJobName('[PROJECT]', '[LOCATION]', '[JOB]', '[RESULT]'); + $request = (new CancelImageImportJobRequest())->setName($formattedName); + $response = $gapicClient->cancelImageImportJob($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/CancelImageImportJob', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/cancelImageImportJobTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function cancelImageImportJobExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/cancelImageImportJobTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->imageImportJobName('[PROJECT]', '[LOCATION]', '[JOB]', '[RESULT]'); + $request = (new CancelImageImportJobRequest())->setName($formattedName); + $response = $gapicClient->cancelImageImportJob($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/cancelImageImportJobTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function createCloneJobTest() { @@ -964,7 +1250,7 @@ public function createDatacenterConnectorExceptionTest() } /** @test */ - public function createGroupTest() + public function createDiskMigrationJobTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -981,32 +1267,38 @@ public function createGroupTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createGroupTest'); + $incompleteOperation->setName('operations/createDiskMigrationJobTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $name = 'name3373707'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Group(); + $expectedResponse = new DiskMigrationJob(); $expectedResponse->setName($name); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); - $completeOperation->setName('operations/createGroupTest'); + $completeOperation->setName('operations/createDiskMigrationJobTest'); $completeOperation->setDone(true); $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $groupId = 'groupId506361563'; - $group = new Group(); - $request = (new CreateGroupRequest()) + $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); + $diskMigrationJobId = 'diskMigrationJobId1115031760'; + $diskMigrationJob = new DiskMigrationJob(); + $diskMigrationJobTargetDetails = new DiskMigrationJobTargetDetails(); + $targetDetailsTargetProject = $gapicClient->targetProjectName('[PROJECT]', '[LOCATION]', '[TARGET_PROJECT]'); + $diskMigrationJobTargetDetails->setTargetProject($targetDetailsTargetProject); + $targetDetailsTargetDisk = new ComputeEngineDisk(); + $targetDiskZone = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $targetDetailsTargetDisk->setZone($targetDiskZone); + $targetDiskDiskType = ComputeEngineDiskType::COMPUTE_ENGINE_DISK_TYPE_UNSPECIFIED; + $targetDetailsTargetDisk->setDiskType($targetDiskDiskType); + $diskMigrationJobTargetDetails->setTargetDisk($targetDetailsTargetDisk); + $diskMigrationJob->setTargetDetails($diskMigrationJobTargetDetails); + $request = (new CreateDiskMigrationJobRequest()) ->setParent($formattedParent) - ->setGroupId($groupId) - ->setGroup($group); - $response = $gapicClient->createGroup($request); + ->setDiskMigrationJobId($diskMigrationJobId) + ->setDiskMigrationJob($diskMigrationJob); + $response = $gapicClient->createDiskMigrationJob($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $apiRequests = $transport->popReceivedCalls(); @@ -1015,15 +1307,15 @@ public function createGroupTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/CreateGroup', $actualApiFuncCall); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/CreateDiskMigrationJob', $actualApiFuncCall); $actualValue = $actualApiRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualApiRequestObject->getGroupId(); - $this->assertProtobufEquals($groupId, $actualValue); - $actualValue = $actualApiRequestObject->getGroup(); - $this->assertProtobufEquals($group, $actualValue); + $actualValue = $actualApiRequestObject->getDiskMigrationJobId(); + $this->assertProtobufEquals($diskMigrationJobId, $actualValue); + $actualValue = $actualApiRequestObject->getDiskMigrationJob(); + $this->assertProtobufEquals($diskMigrationJob, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createGroupTest'); + $expectedOperationsRequestObject->setName('operations/createDiskMigrationJobTest'); $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, ]); @@ -1042,7 +1334,7 @@ public function createGroupTest() } /** @test */ - public function createGroupExceptionTest() + public function createDiskMigrationJobExceptionTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -1059,7 +1351,7 @@ public function createGroupExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/createGroupTest'); + $incompleteOperation->setName('operations/createDiskMigrationJobTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $status = new stdClass(); @@ -1076,18 +1368,28 @@ public function createGroupExceptionTest() ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $groupId = 'groupId506361563'; - $group = new Group(); - $request = (new CreateGroupRequest()) + $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); + $diskMigrationJobId = 'diskMigrationJobId1115031760'; + $diskMigrationJob = new DiskMigrationJob(); + $diskMigrationJobTargetDetails = new DiskMigrationJobTargetDetails(); + $targetDetailsTargetProject = $gapicClient->targetProjectName('[PROJECT]', '[LOCATION]', '[TARGET_PROJECT]'); + $diskMigrationJobTargetDetails->setTargetProject($targetDetailsTargetProject); + $targetDetailsTargetDisk = new ComputeEngineDisk(); + $targetDiskZone = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $targetDetailsTargetDisk->setZone($targetDiskZone); + $targetDiskDiskType = ComputeEngineDiskType::COMPUTE_ENGINE_DISK_TYPE_UNSPECIFIED; + $targetDetailsTargetDisk->setDiskType($targetDiskDiskType); + $diskMigrationJobTargetDetails->setTargetDisk($targetDetailsTargetDisk); + $diskMigrationJob->setTargetDetails($diskMigrationJobTargetDetails); + $request = (new CreateDiskMigrationJobRequest()) ->setParent($formattedParent) - ->setGroupId($groupId) - ->setGroup($group); - $response = $gapicClient->createGroup($request); + ->setDiskMigrationJobId($diskMigrationJobId) + ->setDiskMigrationJob($diskMigrationJob); + $response = $gapicClient->createDiskMigrationJob($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/createGroupTest'); + $expectedOperationsRequestObject->setName('operations/createDiskMigrationJobTest'); try { $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, @@ -1106,7 +1408,289 @@ public function createGroupExceptionTest() } /** @test */ - public function createMigratingVmTest() + public function createGroupTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createGroupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $description = 'description-1724546052'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Group(); + $expectedResponse->setName($name); + $expectedResponse->setDescription($description); + $expectedResponse->setDisplayName($displayName); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createGroupTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $groupId = 'groupId506361563'; + $group = new Group(); + $request = (new CreateGroupRequest()) + ->setParent($formattedParent) + ->setGroupId($groupId) + ->setGroup($group); + $response = $gapicClient->createGroup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/CreateGroup', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getGroupId(); + $this->assertProtobufEquals($groupId, $actualValue); + $actualValue = $actualApiRequestObject->getGroup(); + $this->assertProtobufEquals($group, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createGroupTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createGroupExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createGroupTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $groupId = 'groupId506361563'; + $group = new Group(); + $request = (new CreateGroupRequest()) + ->setParent($formattedParent) + ->setGroupId($groupId) + ->setGroup($group); + $response = $gapicClient->createGroup($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createGroupTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createImageImportTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createImageImportTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $cloudStorageUri = 'cloudStorageUri1921455774'; + $name = 'name3373707'; + $expectedResponse = new ImageImport(); + $expectedResponse->setCloudStorageUri($cloudStorageUri); + $expectedResponse->setName($name); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/createImageImportTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $imageImportId = 'imageImportId-677769711'; + $imageImport = new ImageImport(); + $request = (new CreateImageImportRequest()) + ->setParent($formattedParent) + ->setImageImportId($imageImportId) + ->setImageImport($imageImport); + $response = $gapicClient->createImageImport($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/CreateImageImport', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualApiRequestObject->getImageImportId(); + $this->assertProtobufEquals($imageImportId, $actualValue); + $actualValue = $actualApiRequestObject->getImageImport(); + $this->assertProtobufEquals($imageImport, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createImageImportTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createImageImportExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/createImageImportTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $imageImportId = 'imageImportId-677769711'; + $imageImport = new ImageImport(); + $request = (new CreateImageImportRequest()) + ->setParent($formattedParent) + ->setImageImportId($imageImportId) + ->setImageImport($imageImport); + $response = $gapicClient->createImageImport($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/createImageImportTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function createMigratingVmTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -1430,6 +2014,8 @@ public function createTargetProjectTest() $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $targetProjectId = 'targetProjectId1255314287'; $targetProject = new TargetProject(); + $targetProjectProject = 'targetProjectProject2026784177'; + $targetProject->setProject($targetProjectProject); $request = (new CreateTargetProjectRequest()) ->setParent($formattedParent) ->setTargetProjectId($targetProjectId) @@ -1507,6 +2093,8 @@ public function createTargetProjectExceptionTest() $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); $targetProjectId = 'targetProjectId1255314287'; $targetProject = new TargetProject(); + $targetProjectProject = 'targetProjectProject2026784177'; + $targetProject->setProject($targetProjectProject); $request = (new CreateTargetProjectRequest()) ->setParent($formattedParent) ->setTargetProjectId($targetProjectId) @@ -1808,7 +2396,7 @@ public function deleteDatacenterConnectorExceptionTest() } /** @test */ - public function deleteGroupTest() + public function deleteDiskMigrationJobTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -1825,21 +2413,26 @@ public function deleteGroupTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteGroupTest'); + $incompleteOperation->setName('operations/deleteDiskMigrationJobTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $expectedResponse = new GPBEmpty(); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteGroupTest'); + $completeOperation->setName('operations/deleteDiskMigrationJobTest'); $completeOperation->setDone(true); $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); - $request = (new DeleteGroupRequest())->setName($formattedName); - $response = $gapicClient->deleteGroup($request); + $formattedName = $gapicClient->diskMigrationJobName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[DISK_MIGRATION_JOB]' + ); + $request = (new DeleteDiskMigrationJobRequest())->setName($formattedName); + $response = $gapicClient->deleteDiskMigrationJob($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $apiRequests = $transport->popReceivedCalls(); @@ -1848,11 +2441,11 @@ public function deleteGroupTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/DeleteGroup', $actualApiFuncCall); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/DeleteDiskMigrationJob', $actualApiFuncCall); $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteGroupTest'); + $expectedOperationsRequestObject->setName('operations/deleteDiskMigrationJobTest'); $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, ]); @@ -1871,7 +2464,7 @@ public function deleteGroupTest() } /** @test */ - public function deleteGroupExceptionTest() + public function deleteDiskMigrationJobExceptionTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -1888,7 +2481,7 @@ public function deleteGroupExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteGroupTest'); + $incompleteOperation->setName('operations/deleteDiskMigrationJobTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $status = new stdClass(); @@ -1905,13 +2498,18 @@ public function deleteGroupExceptionTest() ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); - $request = (new DeleteGroupRequest())->setName($formattedName); - $response = $gapicClient->deleteGroup($request); + $formattedName = $gapicClient->diskMigrationJobName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[DISK_MIGRATION_JOB]' + ); + $request = (new DeleteDiskMigrationJobRequest())->setName($formattedName); + $response = $gapicClient->deleteDiskMigrationJob($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteGroupTest'); + $expectedOperationsRequestObject->setName('operations/deleteDiskMigrationJobTest'); try { $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, @@ -1930,7 +2528,7 @@ public function deleteGroupExceptionTest() } /** @test */ - public function deleteMigratingVmTest() + public function deleteGroupTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -1947,21 +2545,21 @@ public function deleteMigratingVmTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteMigratingVmTest'); + $incompleteOperation->setName('operations/deleteGroupTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $expectedResponse = new GPBEmpty(); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteMigratingVmTest'); + $completeOperation->setName('operations/deleteGroupTest'); $completeOperation->setDone(true); $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $request = (new DeleteMigratingVmRequest())->setName($formattedName); - $response = $gapicClient->deleteMigratingVm($request); + $formattedName = $gapicClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); + $request = (new DeleteGroupRequest())->setName($formattedName); + $response = $gapicClient->deleteGroup($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $apiRequests = $transport->popReceivedCalls(); @@ -1970,11 +2568,11 @@ public function deleteMigratingVmTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/DeleteMigratingVm', $actualApiFuncCall); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/DeleteGroup', $actualApiFuncCall); $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteMigratingVmTest'); + $expectedOperationsRequestObject->setName('operations/deleteGroupTest'); $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, ]); @@ -1993,7 +2591,7 @@ public function deleteMigratingVmTest() } /** @test */ - public function deleteMigratingVmExceptionTest() + public function deleteGroupExceptionTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -2010,7 +2608,7 @@ public function deleteMigratingVmExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteMigratingVmTest'); + $incompleteOperation->setName('operations/deleteGroupTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $status = new stdClass(); @@ -2027,13 +2625,13 @@ public function deleteMigratingVmExceptionTest() ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $request = (new DeleteMigratingVmRequest())->setName($formattedName); - $response = $gapicClient->deleteMigratingVm($request); + $formattedName = $gapicClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); + $request = (new DeleteGroupRequest())->setName($formattedName); + $response = $gapicClient->deleteGroup($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteMigratingVmTest'); + $expectedOperationsRequestObject->setName('operations/deleteGroupTest'); try { $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, @@ -2052,7 +2650,7 @@ public function deleteMigratingVmExceptionTest() } /** @test */ - public function deleteSourceTest() + public function deleteImageImportTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -2069,21 +2667,21 @@ public function deleteSourceTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteSourceTest'); + $incompleteOperation->setName('operations/deleteImageImportTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $expectedResponse = new GPBEmpty(); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteSourceTest'); + $completeOperation->setName('operations/deleteImageImportTest'); $completeOperation->setDone(true); $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $request = (new DeleteSourceRequest())->setName($formattedName); - $response = $gapicClient->deleteSource($request); + $formattedName = $gapicClient->imageImportName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new DeleteImageImportRequest())->setName($formattedName); + $response = $gapicClient->deleteImageImport($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $apiRequests = $transport->popReceivedCalls(); @@ -2092,11 +2690,11 @@ public function deleteSourceTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/DeleteSource', $actualApiFuncCall); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/DeleteImageImport', $actualApiFuncCall); $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteSourceTest'); + $expectedOperationsRequestObject->setName('operations/deleteImageImportTest'); $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, ]); @@ -2115,7 +2713,7 @@ public function deleteSourceTest() } /** @test */ - public function deleteSourceExceptionTest() + public function deleteImageImportExceptionTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -2132,7 +2730,7 @@ public function deleteSourceExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteSourceTest'); + $incompleteOperation->setName('operations/deleteImageImportTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $status = new stdClass(); @@ -2149,13 +2747,13 @@ public function deleteSourceExceptionTest() ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $request = (new DeleteSourceRequest())->setName($formattedName); - $response = $gapicClient->deleteSource($request); + $formattedName = $gapicClient->imageImportName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new DeleteImageImportRequest())->setName($formattedName); + $response = $gapicClient->deleteImageImport($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteSourceTest'); + $expectedOperationsRequestObject->setName('operations/deleteImageImportTest'); try { $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, @@ -2174,7 +2772,7 @@ public function deleteSourceExceptionTest() } /** @test */ - public function deleteTargetProjectTest() + public function deleteMigratingVmTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -2191,21 +2789,21 @@ public function deleteTargetProjectTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTargetProjectTest'); + $incompleteOperation->setName('operations/deleteMigratingVmTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $expectedResponse = new GPBEmpty(); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteTargetProjectTest'); + $completeOperation->setName('operations/deleteMigratingVmTest'); $completeOperation->setDone(true); $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->targetProjectName('[PROJECT]', '[LOCATION]', '[TARGET_PROJECT]'); - $request = (new DeleteTargetProjectRequest())->setName($formattedName); - $response = $gapicClient->deleteTargetProject($request); + $formattedName = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); + $request = (new DeleteMigratingVmRequest())->setName($formattedName); + $response = $gapicClient->deleteMigratingVm($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $apiRequests = $transport->popReceivedCalls(); @@ -2214,11 +2812,11 @@ public function deleteTargetProjectTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/DeleteTargetProject', $actualApiFuncCall); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/DeleteMigratingVm', $actualApiFuncCall); $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTargetProjectTest'); + $expectedOperationsRequestObject->setName('operations/deleteMigratingVmTest'); $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, ]); @@ -2237,7 +2835,7 @@ public function deleteTargetProjectTest() } /** @test */ - public function deleteTargetProjectExceptionTest() + public function deleteMigratingVmExceptionTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -2254,7 +2852,7 @@ public function deleteTargetProjectExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteTargetProjectTest'); + $incompleteOperation->setName('operations/deleteMigratingVmTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $status = new stdClass(); @@ -2271,13 +2869,13 @@ public function deleteTargetProjectExceptionTest() ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->targetProjectName('[PROJECT]', '[LOCATION]', '[TARGET_PROJECT]'); - $request = (new DeleteTargetProjectRequest())->setName($formattedName); - $response = $gapicClient->deleteTargetProject($request); + $formattedName = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); + $request = (new DeleteMigratingVmRequest())->setName($formattedName); + $response = $gapicClient->deleteMigratingVm($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteTargetProjectTest'); + $expectedOperationsRequestObject->setName('operations/deleteMigratingVmTest'); try { $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, @@ -2296,7 +2894,7 @@ public function deleteTargetProjectExceptionTest() } /** @test */ - public function deleteUtilizationReportTest() + public function deleteSourceTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -2313,26 +2911,21 @@ public function deleteUtilizationReportTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteUtilizationReportTest'); + $incompleteOperation->setName('operations/deleteSourceTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $expectedResponse = new GPBEmpty(); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); - $completeOperation->setName('operations/deleteUtilizationReportTest'); + $completeOperation->setName('operations/deleteSourceTest'); $completeOperation->setDone(true); $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->utilizationReportName( - '[PROJECT]', - '[LOCATION]', - '[SOURCE]', - '[UTILIZATION_REPORT]' - ); - $request = (new DeleteUtilizationReportRequest())->setName($formattedName); - $response = $gapicClient->deleteUtilizationReport($request); + $formattedName = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); + $request = (new DeleteSourceRequest())->setName($formattedName); + $response = $gapicClient->deleteSource($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $apiRequests = $transport->popReceivedCalls(); @@ -2341,11 +2934,11 @@ public function deleteUtilizationReportTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/DeleteUtilizationReport', $actualApiFuncCall); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/DeleteSource', $actualApiFuncCall); $actualValue = $actualApiRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteUtilizationReportTest'); + $expectedOperationsRequestObject->setName('operations/deleteSourceTest'); $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, ]); @@ -2364,7 +2957,7 @@ public function deleteUtilizationReportTest() } /** @test */ - public function deleteUtilizationReportExceptionTest() + public function deleteSourceExceptionTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -2381,7 +2974,7 @@ public function deleteUtilizationReportExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/deleteUtilizationReportTest'); + $incompleteOperation->setName('operations/deleteSourceTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $status = new stdClass(); @@ -2398,18 +2991,13 @@ public function deleteUtilizationReportExceptionTest() ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->utilizationReportName( - '[PROJECT]', - '[LOCATION]', - '[SOURCE]', - '[UTILIZATION_REPORT]' - ); - $request = (new DeleteUtilizationReportRequest())->setName($formattedName); - $response = $gapicClient->deleteUtilizationReport($request); + $formattedName = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); + $request = (new DeleteSourceRequest())->setName($formattedName); + $response = $gapicClient->deleteSource($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/deleteUtilizationReportTest'); + $expectedOperationsRequestObject->setName('operations/deleteSourceTest'); try { $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, @@ -2428,70 +3016,7 @@ public function deleteUtilizationReportExceptionTest() } /** @test */ - public function fetchInventoryTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - // Mock response - $expectedResponse = new FetchInventoryResponse(); - $transport->addResponse($expectedResponse); - // Mock request - $formattedSource = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $request = (new FetchInventoryRequest())->setSource($formattedSource); - $response = $gapicClient->fetchInventory($request); - $this->assertEquals($expectedResponse, $response); - $actualRequests = $transport->popReceivedCalls(); - $this->assertSame(1, count($actualRequests)); - $actualFuncCall = $actualRequests[0]->getFuncCall(); - $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/FetchInventory', $actualFuncCall); - $actualValue = $actualRequestObject->getSource(); - $this->assertProtobufEquals($formattedSource, $actualValue); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function fetchInventoryExceptionTest() - { - $transport = $this->createTransport(); - $gapicClient = $this->createClient([ - 'transport' => $transport, - ]); - $this->assertTrue($transport->isExhausted()); - $status = new stdClass(); - $status->code = Code::DATA_LOSS; - $status->details = 'internal error'; - $expectedExceptionMessage = json_encode( - [ - 'message' => 'internal error', - 'code' => Code::DATA_LOSS, - 'status' => 'DATA_LOSS', - 'details' => [], - ], - JSON_PRETTY_PRINT - ); - $transport->addResponse(null, $status); - // Mock request - $formattedSource = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $request = (new FetchInventoryRequest())->setSource($formattedSource); - try { - $gapicClient->fetchInventory($request); - // If the $gapicClient method call did not throw, fail the test - $this->fail('Expected an ApiException, but no exception was thrown.'); - } catch (ApiException $ex) { - $this->assertEquals($status->code, $ex->getCode()); - $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); - } - // Call popReceivedCalls to ensure the stub is exhausted - $transport->popReceivedCalls(); - $this->assertTrue($transport->isExhausted()); - } - - /** @test */ - public function finalizeMigrationTest() + public function deleteTargetProjectTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -2508,21 +3033,21 @@ public function finalizeMigrationTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/finalizeMigrationTest'); + $incompleteOperation->setName('operations/deleteTargetProjectTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); - $expectedResponse = new FinalizeMigrationResponse(); + $expectedResponse = new GPBEmpty(); $anyResponse = new Any(); $anyResponse->setValue($expectedResponse->serializeToString()); $completeOperation = new Operation(); - $completeOperation->setName('operations/finalizeMigrationTest'); + $completeOperation->setName('operations/deleteTargetProjectTest'); $completeOperation->setDone(true); $completeOperation->setResponse($anyResponse); $operationsTransport->addResponse($completeOperation); // Mock request - $formattedMigratingVm = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $request = (new FinalizeMigrationRequest())->setMigratingVm($formattedMigratingVm); - $response = $gapicClient->finalizeMigration($request); + $formattedName = $gapicClient->targetProjectName('[PROJECT]', '[LOCATION]', '[TARGET_PROJECT]'); + $request = (new DeleteTargetProjectRequest())->setName($formattedName); + $response = $gapicClient->deleteTargetProject($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $apiRequests = $transport->popReceivedCalls(); @@ -2531,11 +3056,11 @@ public function finalizeMigrationTest() $this->assertSame(0, count($operationsRequestsEmpty)); $actualApiFuncCall = $apiRequests[0]->getFuncCall(); $actualApiRequestObject = $apiRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/FinalizeMigration', $actualApiFuncCall); - $actualValue = $actualApiRequestObject->getMigratingVm(); - $this->assertProtobufEquals($formattedMigratingVm, $actualValue); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/DeleteTargetProject', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/finalizeMigrationTest'); + $expectedOperationsRequestObject->setName('operations/deleteTargetProjectTest'); $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, ]); @@ -2554,7 +3079,7 @@ public function finalizeMigrationTest() } /** @test */ - public function finalizeMigrationExceptionTest() + public function deleteTargetProjectExceptionTest() { $operationsTransport = $this->createTransport(); $operationsClient = new OperationsClient([ @@ -2571,7 +3096,7 @@ public function finalizeMigrationExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); // Mock response $incompleteOperation = new Operation(); - $incompleteOperation->setName('operations/finalizeMigrationTest'); + $incompleteOperation->setName('operations/deleteTargetProjectTest'); $incompleteOperation->setDone(false); $transport->addResponse($incompleteOperation); $status = new stdClass(); @@ -2588,13 +3113,13 @@ public function finalizeMigrationExceptionTest() ); $operationsTransport->addResponse(null, $status); // Mock request - $formattedMigratingVm = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); - $request = (new FinalizeMigrationRequest())->setMigratingVm($formattedMigratingVm); - $response = $gapicClient->finalizeMigration($request); + $formattedName = $gapicClient->targetProjectName('[PROJECT]', '[LOCATION]', '[TARGET_PROJECT]'); + $request = (new DeleteTargetProjectRequest())->setName($formattedName); + $response = $gapicClient->deleteTargetProject($request); $this->assertFalse($response->isDone()); $this->assertNull($response->getResult()); $expectedOperationsRequestObject = new GetOperationRequest(); - $expectedOperationsRequestObject->setName('operations/finalizeMigrationTest'); + $expectedOperationsRequestObject->setName('operations/deleteTargetProjectTest'); try { $response->pollUntilComplete([ 'initialPollDelayMillis' => 1, @@ -2613,24 +3138,538 @@ public function finalizeMigrationExceptionTest() } /** @test */ - public function getCloneJobTest() + public function deleteUtilizationReportTest() { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); $transport = $this->createTransport(); $gapicClient = $this->createClient([ 'transport' => $transport, + 'operationsClient' => $operationsClient, ]); $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); // Mock response - $name2 = 'name2-1052831874'; - $expectedResponse = new CloneJob(); - $expectedResponse->setName($name2); - $transport->addResponse($expectedResponse); + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteUtilizationReportTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new GPBEmpty(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/deleteUtilizationReportTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); // Mock request - $formattedName = $gapicClient->cloneJobName( + $formattedName = $gapicClient->utilizationReportName( '[PROJECT]', '[LOCATION]', '[SOURCE]', - '[MIGRATING_VM]', + '[UTILIZATION_REPORT]' + ); + $request = (new DeleteUtilizationReportRequest())->setName($formattedName); + $response = $gapicClient->deleteUtilizationReport($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/DeleteUtilizationReport', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteUtilizationReportTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function deleteUtilizationReportExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/deleteUtilizationReportTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->utilizationReportName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[UTILIZATION_REPORT]' + ); + $request = (new DeleteUtilizationReportRequest())->setName($formattedName); + $response = $gapicClient->deleteUtilizationReport($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/deleteUtilizationReportTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function extendMigrationTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/extendMigrationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new ExtendMigrationResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/extendMigrationTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedMigratingVm = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); + $request = (new ExtendMigrationRequest())->setMigratingVm($formattedMigratingVm); + $response = $gapicClient->extendMigration($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/ExtendMigration', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getMigratingVm(); + $this->assertProtobufEquals($formattedMigratingVm, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/extendMigrationTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function extendMigrationExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/extendMigrationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedMigratingVm = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); + $request = (new ExtendMigrationRequest())->setMigratingVm($formattedMigratingVm); + $response = $gapicClient->extendMigration($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/extendMigrationTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function fetchInventoryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new FetchInventoryResponse(); + $transport->addResponse($expectedResponse); + // Mock request + $formattedSource = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); + $request = (new FetchInventoryRequest())->setSource($formattedSource); + $response = $gapicClient->fetchInventory($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/FetchInventory', $actualFuncCall); + $actualValue = $actualRequestObject->getSource(); + $this->assertProtobufEquals($formattedSource, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function fetchInventoryExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedSource = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); + $request = (new FetchInventoryRequest())->setSource($formattedSource); + try { + $gapicClient->fetchInventory($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function fetchStorageInventoryTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $resourcesElement = new SourceStorageResource(); + $resources = [$resourcesElement]; + $expectedResponse = new FetchStorageInventoryResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setResources($resources); + $transport->addResponse($expectedResponse); + // Mock request + $formattedSource = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); + $type = StorageType::STORAGE_TYPE_UNSPECIFIED; + $request = (new FetchStorageInventoryRequest())->setSource($formattedSource)->setType($type); + $response = $gapicClient->fetchStorageInventory($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getResources()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/FetchStorageInventory', $actualFuncCall); + $actualValue = $actualRequestObject->getSource(); + $this->assertProtobufEquals($formattedSource, $actualValue); + $actualValue = $actualRequestObject->getType(); + $this->assertProtobufEquals($type, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function fetchStorageInventoryExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedSource = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); + $type = StorageType::STORAGE_TYPE_UNSPECIFIED; + $request = (new FetchStorageInventoryRequest())->setSource($formattedSource)->setType($type); + try { + $gapicClient->fetchStorageInventory($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function finalizeMigrationTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/finalizeMigrationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new FinalizeMigrationResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/finalizeMigrationTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedMigratingVm = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); + $request = (new FinalizeMigrationRequest())->setMigratingVm($formattedMigratingVm); + $response = $gapicClient->finalizeMigration($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/FinalizeMigration', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getMigratingVm(); + $this->assertProtobufEquals($formattedMigratingVm, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/finalizeMigrationTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function finalizeMigrationExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/finalizeMigrationTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedMigratingVm = $gapicClient->migratingVmName('[PROJECT]', '[LOCATION]', '[SOURCE]', '[MIGRATING_VM]'); + $request = (new FinalizeMigrationRequest())->setMigratingVm($formattedMigratingVm); + $response = $gapicClient->finalizeMigration($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/finalizeMigrationTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function getCloneJobTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new CloneJob(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->cloneJobName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[MIGRATING_VM]', '[CLONE_JOB]' ); $request = (new GetCloneJobRequest())->setName($formattedName); @@ -2771,7 +3810,238 @@ public function getCutoverJobExceptionTest() } /** @test */ - public function getDatacenterConnectorTest() + public function getDatacenterConnectorTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $registrationId = 'registrationId-412573087'; + $serviceAccount = 'serviceAccount-1948028253'; + $version = 'version351608024'; + $bucket = 'bucket-1378203158'; + $applianceInfrastructureVersion = 'applianceInfrastructureVersion662625550'; + $applianceSoftwareVersion = 'applianceSoftwareVersion-641402222'; + $expectedResponse = new DatacenterConnector(); + $expectedResponse->setName($name2); + $expectedResponse->setRegistrationId($registrationId); + $expectedResponse->setServiceAccount($serviceAccount); + $expectedResponse->setVersion($version); + $expectedResponse->setBucket($bucket); + $expectedResponse->setApplianceInfrastructureVersion($applianceInfrastructureVersion); + $expectedResponse->setApplianceSoftwareVersion($applianceSoftwareVersion); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->datacenterConnectorName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[DATACENTER_CONNECTOR]' + ); + $request = (new GetDatacenterConnectorRequest())->setName($formattedName); + $response = $gapicClient->getDatacenterConnector($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/GetDatacenterConnector', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDatacenterConnectorExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->datacenterConnectorName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[DATACENTER_CONNECTOR]' + ); + $request = (new GetDatacenterConnectorRequest())->setName($formattedName); + try { + $gapicClient->getDatacenterConnector($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDiskMigrationJobTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $expectedResponse = new DiskMigrationJob(); + $expectedResponse->setName($name2); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->diskMigrationJobName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[DISK_MIGRATION_JOB]' + ); + $request = (new GetDiskMigrationJobRequest())->setName($formattedName); + $response = $gapicClient->getDiskMigrationJob($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/GetDiskMigrationJob', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getDiskMigrationJobExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->diskMigrationJobName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[DISK_MIGRATION_JOB]' + ); + $request = (new GetDiskMigrationJobRequest())->setName($formattedName); + try { + $gapicClient->getDiskMigrationJob($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getGroupTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $name2 = 'name2-1052831874'; + $description = 'description-1724546052'; + $displayName = 'displayName1615086568'; + $expectedResponse = new Group(); + $expectedResponse->setName($name2); + $expectedResponse->setDescription($description); + $expectedResponse->setDisplayName($displayName); + $transport->addResponse($expectedResponse); + // Mock request + $formattedName = $gapicClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); + $request = (new GetGroupRequest())->setName($formattedName); + $response = $gapicClient->getGroup($request); + $this->assertEquals($expectedResponse, $response); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/GetGroup', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getGroupExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); + $request = (new GetGroupRequest())->setName($formattedName); + try { + $gapicClient->getGroup($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function getImageImportTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -2779,44 +4049,29 @@ public function getDatacenterConnectorTest() ]); $this->assertTrue($transport->isExhausted()); // Mock response + $cloudStorageUri = 'cloudStorageUri1921455774'; $name2 = 'name2-1052831874'; - $registrationId = 'registrationId-412573087'; - $serviceAccount = 'serviceAccount-1948028253'; - $version = 'version351608024'; - $bucket = 'bucket-1378203158'; - $applianceInfrastructureVersion = 'applianceInfrastructureVersion662625550'; - $applianceSoftwareVersion = 'applianceSoftwareVersion-641402222'; - $expectedResponse = new DatacenterConnector(); + $expectedResponse = new ImageImport(); + $expectedResponse->setCloudStorageUri($cloudStorageUri); $expectedResponse->setName($name2); - $expectedResponse->setRegistrationId($registrationId); - $expectedResponse->setServiceAccount($serviceAccount); - $expectedResponse->setVersion($version); - $expectedResponse->setBucket($bucket); - $expectedResponse->setApplianceInfrastructureVersion($applianceInfrastructureVersion); - $expectedResponse->setApplianceSoftwareVersion($applianceSoftwareVersion); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->datacenterConnectorName( - '[PROJECT]', - '[LOCATION]', - '[SOURCE]', - '[DATACENTER_CONNECTOR]' - ); - $request = (new GetDatacenterConnectorRequest())->setName($formattedName); - $response = $gapicClient->getDatacenterConnector($request); + $formattedName = $gapicClient->imageImportName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new GetImageImportRequest())->setName($formattedName); + $response = $gapicClient->getImageImport($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/GetDatacenterConnector', $actualFuncCall); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/GetImageImport', $actualFuncCall); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function getDatacenterConnectorExceptionTest() + public function getImageImportExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -2837,15 +4092,10 @@ public function getDatacenterConnectorExceptionTest() ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->datacenterConnectorName( - '[PROJECT]', - '[LOCATION]', - '[SOURCE]', - '[DATACENTER_CONNECTOR]' - ); - $request = (new GetDatacenterConnectorRequest())->setName($formattedName); + $formattedName = $gapicClient->imageImportName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new GetImageImportRequest())->setName($formattedName); try { - $gapicClient->getDatacenterConnector($request); + $gapicClient->getImageImport($request); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -2858,7 +4108,7 @@ public function getDatacenterConnectorExceptionTest() } /** @test */ - public function getGroupTest() + public function getImageImportJobTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -2866,31 +4116,29 @@ public function getGroupTest() ]); $this->assertTrue($transport->isExhausted()); // Mock response + $cloudStorageUri = 'cloudStorageUri1921455774'; $name2 = 'name2-1052831874'; - $description = 'description-1724546052'; - $displayName = 'displayName1615086568'; - $expectedResponse = new Group(); + $expectedResponse = new ImageImportJob(); + $expectedResponse->setCloudStorageUri($cloudStorageUri); $expectedResponse->setName($name2); - $expectedResponse->setDescription($description); - $expectedResponse->setDisplayName($displayName); $transport->addResponse($expectedResponse); // Mock request - $formattedName = $gapicClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); - $request = (new GetGroupRequest())->setName($formattedName); - $response = $gapicClient->getGroup($request); + $formattedName = $gapicClient->imageImportJobName('[PROJECT]', '[LOCATION]', '[JOB]', '[RESULT]'); + $request = (new GetImageImportJobRequest())->setName($formattedName); + $response = $gapicClient->getImageImportJob($request); $this->assertEquals($expectedResponse, $response); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/GetGroup', $actualFuncCall); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/GetImageImportJob', $actualFuncCall); $actualValue = $actualRequestObject->getName(); $this->assertProtobufEquals($formattedName, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function getGroupExceptionTest() + public function getImageImportJobExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -2911,10 +4159,10 @@ public function getGroupExceptionTest() ); $transport->addResponse(null, $status); // Mock request - $formattedName = $gapicClient->groupName('[PROJECT]', '[LOCATION]', '[GROUP]'); - $request = (new GetGroupRequest())->setName($formattedName); + $formattedName = $gapicClient->imageImportJobName('[PROJECT]', '[LOCATION]', '[JOB]', '[RESULT]'); + $request = (new GetImageImportJobRequest())->setName($formattedName); try { - $gapicClient->getGroup($request); + $gapicClient->getImageImportJob($request); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -3446,7 +4694,228 @@ public function listCutoverJobsExceptionTest() } /** @test */ - public function listDatacenterConnectorsTest() + public function listDatacenterConnectorsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $datacenterConnectorsElement = new DatacenterConnector(); + $datacenterConnectors = [$datacenterConnectorsElement]; + $expectedResponse = new ListDatacenterConnectorsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setDatacenterConnectors($datacenterConnectors); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); + $pageToken = 'pageToken1630607433'; + $request = (new ListDatacenterConnectorsRequest())->setParent($formattedParent)->setPageToken($pageToken); + $response = $gapicClient->listDatacenterConnectors($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getDatacenterConnectors()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/ListDatacenterConnectors', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getPageToken(); + $this->assertProtobufEquals($pageToken, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDatacenterConnectorsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); + $pageToken = 'pageToken1630607433'; + $request = (new ListDatacenterConnectorsRequest())->setParent($formattedParent)->setPageToken($pageToken); + try { + $gapicClient->listDatacenterConnectors($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDiskMigrationJobsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $diskMigrationJobsElement = new DiskMigrationJob(); + $diskMigrationJobs = [$diskMigrationJobsElement]; + $expectedResponse = new ListDiskMigrationJobsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setDiskMigrationJobs($diskMigrationJobs); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); + $request = (new ListDiskMigrationJobsRequest())->setParent($formattedParent); + $response = $gapicClient->listDiskMigrationJobs($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getDiskMigrationJobs()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/ListDiskMigrationJobs', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listDiskMigrationJobsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); + $request = (new ListDiskMigrationJobsRequest())->setParent($formattedParent); + try { + $gapicClient->listDiskMigrationJobs($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listGroupsTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $nextPageToken = ''; + $groupsElement = new Group(); + $groups = [$groupsElement]; + $expectedResponse = new ListGroupsResponse(); + $expectedResponse->setNextPageToken($nextPageToken); + $expectedResponse->setGroups($groups); + $transport->addResponse($expectedResponse); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $pageToken = 'pageToken1630607433'; + $request = (new ListGroupsRequest())->setParent($formattedParent)->setPageToken($pageToken); + $response = $gapicClient->listGroups($request); + $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); + $resources = iterator_to_array($response->iterateAllElements()); + $this->assertSame(1, count($resources)); + $this->assertEquals($expectedResponse->getGroups()[0], $resources[0]); + $actualRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($actualRequests)); + $actualFuncCall = $actualRequests[0]->getFuncCall(); + $actualRequestObject = $actualRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/ListGroups', $actualFuncCall); + $actualValue = $actualRequestObject->getParent(); + $this->assertProtobufEquals($formattedParent, $actualValue); + $actualValue = $actualRequestObject->getPageToken(); + $this->assertProtobufEquals($pageToken, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listGroupsExceptionTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $transport->addResponse(null, $status); + // Mock request + $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $pageToken = 'pageToken1630607433'; + $request = (new ListGroupsRequest())->setParent($formattedParent)->setPageToken($pageToken); + try { + $gapicClient->listGroups($request); + // If the $gapicClient method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stub is exhausted + $transport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function listImageImportJobsTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -3455,35 +4924,32 @@ public function listDatacenterConnectorsTest() $this->assertTrue($transport->isExhausted()); // Mock response $nextPageToken = ''; - $datacenterConnectorsElement = new DatacenterConnector(); - $datacenterConnectors = [$datacenterConnectorsElement]; - $expectedResponse = new ListDatacenterConnectorsResponse(); + $imageImportJobsElement = new ImageImportJob(); + $imageImportJobs = [$imageImportJobsElement]; + $expectedResponse = new ListImageImportJobsResponse(); $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setDatacenterConnectors($datacenterConnectors); + $expectedResponse->setImageImportJobs($imageImportJobs); $transport->addResponse($expectedResponse); // Mock request - $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $pageToken = 'pageToken1630607433'; - $request = (new ListDatacenterConnectorsRequest())->setParent($formattedParent)->setPageToken($pageToken); - $response = $gapicClient->listDatacenterConnectors($request); + $formattedParent = $gapicClient->imageImportName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new ListImageImportJobsRequest())->setParent($formattedParent); + $response = $gapicClient->listImageImportJobs($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getDatacenterConnectors()[0], $resources[0]); + $this->assertEquals($expectedResponse->getImageImportJobs()[0], $resources[0]); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/ListDatacenterConnectors', $actualFuncCall); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/ListImageImportJobs', $actualFuncCall); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getPageToken(); - $this->assertProtobufEquals($pageToken, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function listDatacenterConnectorsExceptionTest() + public function listImageImportJobsExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -3504,11 +4970,10 @@ public function listDatacenterConnectorsExceptionTest() ); $transport->addResponse(null, $status); // Mock request - $formattedParent = $gapicClient->sourceName('[PROJECT]', '[LOCATION]', '[SOURCE]'); - $pageToken = 'pageToken1630607433'; - $request = (new ListDatacenterConnectorsRequest())->setParent($formattedParent)->setPageToken($pageToken); + $formattedParent = $gapicClient->imageImportName('[PROJECT]', '[LOCATION]', '[JOB]'); + $request = (new ListImageImportJobsRequest())->setParent($formattedParent); try { - $gapicClient->listDatacenterConnectors($request); + $gapicClient->listImageImportJobs($request); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -3521,7 +4986,7 @@ public function listDatacenterConnectorsExceptionTest() } /** @test */ - public function listGroupsTest() + public function listImageImportsTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -3530,35 +4995,32 @@ public function listGroupsTest() $this->assertTrue($transport->isExhausted()); // Mock response $nextPageToken = ''; - $groupsElement = new Group(); - $groups = [$groupsElement]; - $expectedResponse = new ListGroupsResponse(); + $imageImportsElement = new ImageImport(); + $imageImports = [$imageImportsElement]; + $expectedResponse = new ListImageImportsResponse(); $expectedResponse->setNextPageToken($nextPageToken); - $expectedResponse->setGroups($groups); + $expectedResponse->setImageImports($imageImports); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $pageToken = 'pageToken1630607433'; - $request = (new ListGroupsRequest())->setParent($formattedParent)->setPageToken($pageToken); - $response = $gapicClient->listGroups($request); + $request = (new ListImageImportsRequest())->setParent($formattedParent); + $response = $gapicClient->listImageImports($request); $this->assertEquals($expectedResponse, $response->getPage()->getResponseObject()); $resources = iterator_to_array($response->iterateAllElements()); $this->assertSame(1, count($resources)); - $this->assertEquals($expectedResponse->getGroups()[0], $resources[0]); + $this->assertEquals($expectedResponse->getImageImports()[0], $resources[0]); $actualRequests = $transport->popReceivedCalls(); $this->assertSame(1, count($actualRequests)); $actualFuncCall = $actualRequests[0]->getFuncCall(); $actualRequestObject = $actualRequests[0]->getRequestObject(); - $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/ListGroups', $actualFuncCall); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/ListImageImports', $actualFuncCall); $actualValue = $actualRequestObject->getParent(); $this->assertProtobufEquals($formattedParent, $actualValue); - $actualValue = $actualRequestObject->getPageToken(); - $this->assertProtobufEquals($pageToken, $actualValue); $this->assertTrue($transport->isExhausted()); } /** @test */ - public function listGroupsExceptionTest() + public function listImageImportsExceptionTest() { $transport = $this->createTransport(); $gapicClient = $this->createClient([ @@ -3580,10 +5042,9 @@ public function listGroupsExceptionTest() $transport->addResponse(null, $status); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); - $pageToken = 'pageToken1630607433'; - $request = (new ListGroupsRequest())->setParent($formattedParent)->setPageToken($pageToken); + $request = (new ListImageImportsRequest())->setParent($formattedParent); try { - $gapicClient->listGroups($request); + $gapicClient->listImageImports($request); // If the $gapicClient method call did not throw, fail the test $this->fail('Expected an ApiException, but no exception was thrown.'); } catch (ApiException $ex) { @@ -4336,6 +5797,138 @@ public function resumeMigrationExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); } + /** @test */ + public function runDiskMigrationJobTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/runDiskMigrationJobTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $expectedResponse = new RunDiskMigrationJobResponse(); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/runDiskMigrationJobTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $formattedName = $gapicClient->diskMigrationJobName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[DISK_MIGRATION_JOB]' + ); + $request = (new RunDiskMigrationJobRequest())->setName($formattedName); + $response = $gapicClient->runDiskMigrationJob($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/RunDiskMigrationJob', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getName(); + $this->assertProtobufEquals($formattedName, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/runDiskMigrationJobTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function runDiskMigrationJobExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/runDiskMigrationJobTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $formattedName = $gapicClient->diskMigrationJobName( + '[PROJECT]', + '[LOCATION]', + '[SOURCE]', + '[DISK_MIGRATION_JOB]' + ); + $request = (new RunDiskMigrationJobRequest())->setName($formattedName); + $response = $gapicClient->runDiskMigrationJob($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/runDiskMigrationJobTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function startMigrationTest() { @@ -4458,6 +6051,150 @@ public function startMigrationExceptionTest() $this->assertTrue($operationsTransport->isExhausted()); } + /** @test */ + public function updateDiskMigrationJobTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateDiskMigrationJobTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $name = 'name3373707'; + $expectedResponse = new DiskMigrationJob(); + $expectedResponse->setName($name); + $anyResponse = new Any(); + $anyResponse->setValue($expectedResponse->serializeToString()); + $completeOperation = new Operation(); + $completeOperation->setName('operations/updateDiskMigrationJobTest'); + $completeOperation->setDone(true); + $completeOperation->setResponse($anyResponse); + $operationsTransport->addResponse($completeOperation); + // Mock request + $diskMigrationJob = new DiskMigrationJob(); + $diskMigrationJobTargetDetails = new DiskMigrationJobTargetDetails(); + $targetDetailsTargetProject = $gapicClient->targetProjectName('[PROJECT]', '[LOCATION]', '[TARGET_PROJECT]'); + $diskMigrationJobTargetDetails->setTargetProject($targetDetailsTargetProject); + $targetDetailsTargetDisk = new ComputeEngineDisk(); + $targetDiskZone = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $targetDetailsTargetDisk->setZone($targetDiskZone); + $targetDiskDiskType = ComputeEngineDiskType::COMPUTE_ENGINE_DISK_TYPE_UNSPECIFIED; + $targetDetailsTargetDisk->setDiskType($targetDiskDiskType); + $diskMigrationJobTargetDetails->setTargetDisk($targetDetailsTargetDisk); + $diskMigrationJob->setTargetDetails($diskMigrationJobTargetDetails); + $request = (new UpdateDiskMigrationJobRequest())->setDiskMigrationJob($diskMigrationJob); + $response = $gapicClient->updateDiskMigrationJob($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $apiRequests = $transport->popReceivedCalls(); + $this->assertSame(1, count($apiRequests)); + $operationsRequestsEmpty = $operationsTransport->popReceivedCalls(); + $this->assertSame(0, count($operationsRequestsEmpty)); + $actualApiFuncCall = $apiRequests[0]->getFuncCall(); + $actualApiRequestObject = $apiRequests[0]->getRequestObject(); + $this->assertSame('/google.cloud.vmmigration.v1.VmMigration/UpdateDiskMigrationJob', $actualApiFuncCall); + $actualValue = $actualApiRequestObject->getDiskMigrationJob(); + $this->assertProtobufEquals($diskMigrationJob, $actualValue); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateDiskMigrationJobTest'); + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + $this->assertTrue($response->isDone()); + $this->assertEquals($expectedResponse, $response->getResult()); + $apiRequestsEmpty = $transport->popReceivedCalls(); + $this->assertSame(0, count($apiRequestsEmpty)); + $operationsRequests = $operationsTransport->popReceivedCalls(); + $this->assertSame(1, count($operationsRequests)); + $actualOperationsFuncCall = $operationsRequests[0]->getFuncCall(); + $actualOperationsRequestObject = $operationsRequests[0]->getRequestObject(); + $this->assertSame('/google.longrunning.Operations/GetOperation', $actualOperationsFuncCall); + $this->assertEquals($expectedOperationsRequestObject, $actualOperationsRequestObject); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + + /** @test */ + public function updateDiskMigrationJobExceptionTest() + { + $operationsTransport = $this->createTransport(); + $operationsClient = new OperationsClient([ + 'apiEndpoint' => '', + 'transport' => $operationsTransport, + 'credentials' => $this->createCredentials(), + ]); + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + 'operationsClient' => $operationsClient, + ]); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + // Mock response + $incompleteOperation = new Operation(); + $incompleteOperation->setName('operations/updateDiskMigrationJobTest'); + $incompleteOperation->setDone(false); + $transport->addResponse($incompleteOperation); + $status = new stdClass(); + $status->code = Code::DATA_LOSS; + $status->details = 'internal error'; + $expectedExceptionMessage = json_encode( + [ + 'message' => 'internal error', + 'code' => Code::DATA_LOSS, + 'status' => 'DATA_LOSS', + 'details' => [], + ], + JSON_PRETTY_PRINT + ); + $operationsTransport->addResponse(null, $status); + // Mock request + $diskMigrationJob = new DiskMigrationJob(); + $diskMigrationJobTargetDetails = new DiskMigrationJobTargetDetails(); + $targetDetailsTargetProject = $gapicClient->targetProjectName('[PROJECT]', '[LOCATION]', '[TARGET_PROJECT]'); + $diskMigrationJobTargetDetails->setTargetProject($targetDetailsTargetProject); + $targetDetailsTargetDisk = new ComputeEngineDisk(); + $targetDiskZone = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); + $targetDetailsTargetDisk->setZone($targetDiskZone); + $targetDiskDiskType = ComputeEngineDiskType::COMPUTE_ENGINE_DISK_TYPE_UNSPECIFIED; + $targetDetailsTargetDisk->setDiskType($targetDiskDiskType); + $diskMigrationJobTargetDetails->setTargetDisk($targetDetailsTargetDisk); + $diskMigrationJob->setTargetDetails($diskMigrationJobTargetDetails); + $request = (new UpdateDiskMigrationJobRequest())->setDiskMigrationJob($diskMigrationJob); + $response = $gapicClient->updateDiskMigrationJob($request); + $this->assertFalse($response->isDone()); + $this->assertNull($response->getResult()); + $expectedOperationsRequestObject = new GetOperationRequest(); + $expectedOperationsRequestObject->setName('operations/updateDiskMigrationJobTest'); + try { + $response->pollUntilComplete([ + 'initialPollDelayMillis' => 1, + ]); + // If the pollUntilComplete() method call did not throw, fail the test + $this->fail('Expected an ApiException, but no exception was thrown.'); + } catch (ApiException $ex) { + $this->assertEquals($status->code, $ex->getCode()); + $this->assertEquals($expectedExceptionMessage, $ex->getMessage()); + } + // Call popReceivedCalls to ensure the stubs are exhausted + $transport->popReceivedCalls(); + $operationsTransport->popReceivedCalls(); + $this->assertTrue($transport->isExhausted()); + $this->assertTrue($operationsTransport->isExhausted()); + } + /** @test */ public function updateGroupTest() { @@ -4881,6 +6618,8 @@ public function updateTargetProjectTest() $operationsTransport->addResponse($completeOperation); // Mock request $targetProject = new TargetProject(); + $targetProjectProject = 'targetProjectProject2026784177'; + $targetProject->setProject($targetProjectProject); $request = (new UpdateTargetProjectRequest())->setTargetProject($targetProject); $response = $gapicClient->updateTargetProject($request); $this->assertFalse($response->isDone()); @@ -4949,6 +6688,8 @@ public function updateTargetProjectExceptionTest() $operationsTransport->addResponse(null, $status); // Mock request $targetProject = new TargetProject(); + $targetProjectProject = 'targetProjectProject2026784177'; + $targetProject->setProject($targetProjectProject); $request = (new UpdateTargetProjectRequest())->setTargetProject($targetProject); $response = $gapicClient->updateTargetProject($request); $this->assertFalse($response->isDone());