diff --git a/src/DatabaseMigrationService.php b/src/DatabaseMigrationService.php index ce559fe669..e369ea1ba5 100644 --- a/src/DatabaseMigrationService.php +++ b/src/DatabaseMigrationService.php @@ -662,6 +662,16 @@ public function __construct($clientOrConfig = [], $rootUrl = null) 'required' => true, ], ], + ],'fetchSourceObjects' => [ + 'path' => 'v1/{+name}:fetchSourceObjects', + 'httpMethod' => 'GET', + 'parameters' => [ + 'name' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + ], ],'generateSshScript' => [ 'path' => 'v1/{+migrationJob}:generateSshScript', 'httpMethod' => 'POST', @@ -840,7 +850,17 @@ public function __construct($clientOrConfig = [], $rootUrl = null) 'objects', [ 'methods' => [ - 'getIamPolicy' => [ + 'get' => [ + 'path' => 'v1/{+name}', + 'httpMethod' => 'GET', + 'parameters' => [ + 'name' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + ], + ],'getIamPolicy' => [ 'path' => 'v1/{+resource}:getIamPolicy', 'httpMethod' => 'GET', 'parameters' => [ @@ -854,6 +874,34 @@ public function __construct($clientOrConfig = [], $rootUrl = null) 'type' => 'integer', ], ], + ],'list' => [ + 'path' => 'v1/{+parent}/objects', + 'httpMethod' => 'GET', + 'parameters' => [ + 'parent' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + 'pageSize' => [ + 'location' => 'query', + 'type' => 'integer', + ], + 'pageToken' => [ + 'location' => 'query', + 'type' => 'string', + ], + ], + ],'lookup' => [ + 'path' => 'v1/{+parent}/objects:lookup', + 'httpMethod' => 'POST', + 'parameters' => [ + 'parent' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + ], ],'setIamPolicy' => [ 'path' => 'v1/{+resource}:setIamPolicy', 'httpMethod' => 'POST', diff --git a/src/DatabaseMigrationService/ListMigrationJobObjectsResponse.php b/src/DatabaseMigrationService/ListMigrationJobObjectsResponse.php new file mode 100644 index 0000000000..0577c7c66c --- /dev/null +++ b/src/DatabaseMigrationService/ListMigrationJobObjectsResponse.php @@ -0,0 +1,61 @@ +migrationJobObjects = $migrationJobObjects; + } + /** + * @return MigrationJobObject[] + */ + public function getMigrationJobObjects() + { + return $this->migrationJobObjects; + } + /** + * @param string + */ + public function setNextPageToken($nextPageToken) + { + $this->nextPageToken = $nextPageToken; + } + /** + * @return string + */ + public function getNextPageToken() + { + return $this->nextPageToken; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ListMigrationJobObjectsResponse::class, 'Google_Service_DatabaseMigrationService_ListMigrationJobObjectsResponse'); diff --git a/src/DatabaseMigrationService/LookupMigrationJobObjectRequest.php b/src/DatabaseMigrationService/LookupMigrationJobObjectRequest.php new file mode 100644 index 0000000000..f58218e89f --- /dev/null +++ b/src/DatabaseMigrationService/LookupMigrationJobObjectRequest.php @@ -0,0 +1,42 @@ +sourceObjectIdentifier = $sourceObjectIdentifier; + } + /** + * @return SourceObjectIdentifier + */ + public function getSourceObjectIdentifier() + { + return $this->sourceObjectIdentifier; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(LookupMigrationJobObjectRequest::class, 'Google_Service_DatabaseMigrationService_LookupMigrationJobObjectRequest'); diff --git a/src/DatabaseMigrationService/MaterializedViewEntity.php b/src/DatabaseMigrationService/MaterializedViewEntity.php index b61e2fe52b..cc3f933b69 100644 --- a/src/DatabaseMigrationService/MaterializedViewEntity.php +++ b/src/DatabaseMigrationService/MaterializedViewEntity.php @@ -17,12 +17,15 @@ namespace Google\Service\DatabaseMigrationService; -class MaterializedViewEntity extends \Google\Model +class MaterializedViewEntity extends \Google\Collection { + protected $collection_key = 'indices'; /** * @var array[] */ public $customFeatures; + protected $indicesType = IndexEntity::class; + protected $indicesDataType = 'array'; /** * @var string */ @@ -42,6 +45,20 @@ public function getCustomFeatures() { return $this->customFeatures; } + /** + * @param IndexEntity[] + */ + public function setIndices($indices) + { + $this->indices = $indices; + } + /** + * @return IndexEntity[] + */ + public function getIndices() + { + return $this->indices; + } /** * @param string */ diff --git a/src/DatabaseMigrationService/MigrationJob.php b/src/DatabaseMigrationService/MigrationJob.php index 226a4db46e..e701ee0d05 100644 --- a/src/DatabaseMigrationService/MigrationJob.php +++ b/src/DatabaseMigrationService/MigrationJob.php @@ -71,6 +71,8 @@ class MigrationJob extends \Google\Model * @var string */ public $name; + protected $objectsConfigType = MigrationJobObjectsConfig::class; + protected $objectsConfigDataType = ''; protected $oracleToPostgresConfigType = OracleToPostgresConfig::class; protected $oracleToPostgresConfigDataType = ''; protected $performanceConfigType = PerformanceConfig::class; @@ -316,6 +318,20 @@ public function getName() { return $this->name; } + /** + * @param MigrationJobObjectsConfig + */ + public function setObjectsConfig(MigrationJobObjectsConfig $objectsConfig) + { + $this->objectsConfig = $objectsConfig; + } + /** + * @return MigrationJobObjectsConfig + */ + public function getObjectsConfig() + { + return $this->objectsConfig; + } /** * @param OracleToPostgresConfig */ diff --git a/src/DatabaseMigrationService/MigrationJobObject.php b/src/DatabaseMigrationService/MigrationJobObject.php new file mode 100644 index 0000000000..9951d0223a --- /dev/null +++ b/src/DatabaseMigrationService/MigrationJobObject.php @@ -0,0 +1,148 @@ +createTime = $createTime; + } + /** + * @return string + */ + public function getCreateTime() + { + return $this->createTime; + } + /** + * @param Status + */ + public function setError(Status $error) + { + $this->error = $error; + } + /** + * @return Status + */ + public function getError() + { + return $this->error; + } + /** + * @param string + */ + public function setName($name) + { + $this->name = $name; + } + /** + * @return string + */ + public function getName() + { + return $this->name; + } + /** + * @param string + */ + public function setPhase($phase) + { + $this->phase = $phase; + } + /** + * @return string + */ + public function getPhase() + { + return $this->phase; + } + /** + * @param SourceObjectIdentifier + */ + public function setSourceObject(SourceObjectIdentifier $sourceObject) + { + $this->sourceObject = $sourceObject; + } + /** + * @return SourceObjectIdentifier + */ + public function getSourceObject() + { + return $this->sourceObject; + } + /** + * @param string + */ + public function setState($state) + { + $this->state = $state; + } + /** + * @return string + */ + public function getState() + { + return $this->state; + } + /** + * @param string + */ + public function setUpdateTime($updateTime) + { + $this->updateTime = $updateTime; + } + /** + * @return string + */ + public function getUpdateTime() + { + return $this->updateTime; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MigrationJobObject::class, 'Google_Service_DatabaseMigrationService_MigrationJobObject'); diff --git a/src/DatabaseMigrationService/MigrationJobObjectsConfig.php b/src/DatabaseMigrationService/MigrationJobObjectsConfig.php new file mode 100644 index 0000000000..c1339701f0 --- /dev/null +++ b/src/DatabaseMigrationService/MigrationJobObjectsConfig.php @@ -0,0 +1,42 @@ +sourceObjectsConfig = $sourceObjectsConfig; + } + /** + * @return SourceObjectsConfig + */ + public function getSourceObjectsConfig() + { + return $this->sourceObjectsConfig; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(MigrationJobObjectsConfig::class, 'Google_Service_DatabaseMigrationService_MigrationJobObjectsConfig'); diff --git a/src/DatabaseMigrationService/PromoteMigrationJobRequest.php b/src/DatabaseMigrationService/PromoteMigrationJobRequest.php index 23449a104d..344f0fc615 100644 --- a/src/DatabaseMigrationService/PromoteMigrationJobRequest.php +++ b/src/DatabaseMigrationService/PromoteMigrationJobRequest.php @@ -19,6 +19,23 @@ class PromoteMigrationJobRequest extends \Google\Model { + protected $objectsFilterType = MigrationJobObjectsConfig::class; + protected $objectsFilterDataType = ''; + + /** + * @param MigrationJobObjectsConfig + */ + public function setObjectsFilter(MigrationJobObjectsConfig $objectsFilter) + { + $this->objectsFilter = $objectsFilter; + } + /** + * @return MigrationJobObjectsConfig + */ + public function getObjectsFilter() + { + return $this->objectsFilter; + } } // Adding a class alias for backwards compatibility with the previous class name. diff --git a/src/DatabaseMigrationService/Resource/ProjectsLocationsMigrationJobs.php b/src/DatabaseMigrationService/Resource/ProjectsLocationsMigrationJobs.php index 2b0690f114..a489f2f6c3 100644 --- a/src/DatabaseMigrationService/Resource/ProjectsLocationsMigrationJobs.php +++ b/src/DatabaseMigrationService/Resource/ProjectsLocationsMigrationJobs.php @@ -112,6 +112,24 @@ public function demoteDestination($name, DemoteDestinationRequest $postBody, $op $params = array_merge($params, $optParams); return $this->call('demoteDestination', [$params], Operation::class); } + /** + * Retrieves objects from the source database that can be selected for data + * migration. This is applicable for the following migrations: 1. PostgreSQL to + * Cloud SQL for PostgreSQL 2. PostgreSQL to AlloyDB for PostgreSQL. + * (migrationJobs.fetchSourceObjects) + * + * @param string $name Required. The resource name for the migration job for + * which source objects should be returned. + * @param array $optParams Optional parameters. + * @return Operation + * @throws \Google\Service\Exception + */ + public function fetchSourceObjects($name, $optParams = []) + { + $params = ['name' => $name]; + $params = array_merge($params, $optParams); + return $this->call('fetchSourceObjects', [$params], Operation::class); + } /** * Generate a SSH configuration script to configure the reverse SSH * connectivity. (migrationJobs.generateSshScript) diff --git a/src/DatabaseMigrationService/Resource/ProjectsLocationsMigrationJobsObjects.php b/src/DatabaseMigrationService/Resource/ProjectsLocationsMigrationJobsObjects.php index 7d8738c646..c6416e26ed 100644 --- a/src/DatabaseMigrationService/Resource/ProjectsLocationsMigrationJobsObjects.php +++ b/src/DatabaseMigrationService/Resource/ProjectsLocationsMigrationJobsObjects.php @@ -17,6 +17,9 @@ namespace Google\Service\DatabaseMigrationService\Resource; +use Google\Service\DatabaseMigrationService\ListMigrationJobObjectsResponse; +use Google\Service\DatabaseMigrationService\LookupMigrationJobObjectRequest; +use Google\Service\DatabaseMigrationService\MigrationJobObject; use Google\Service\DatabaseMigrationService\Policy; use Google\Service\DatabaseMigrationService\SetIamPolicyRequest; use Google\Service\DatabaseMigrationService\TestIamPermissionsRequest; @@ -32,6 +35,21 @@ */ class ProjectsLocationsMigrationJobsObjects extends \Google\Service\Resource { + /** + * Use this method to get details about a migration job object. (objects.get) + * + * @param string $name Required. The name of the migration job object resource + * to get. + * @param array $optParams Optional parameters. + * @return MigrationJobObject + * @throws \Google\Service\Exception + */ + public function get($name, $optParams = []) + { + $params = ['name' => $name]; + $params = array_merge($params, $optParams); + return $this->call('get', [$params], MigrationJobObject::class); + } /** * Gets the access control policy for a resource. Returns an empty policy if the * resource exists and does not have a policy set. (objects.getIamPolicy) @@ -63,6 +81,47 @@ public function getIamPolicy($resource, $optParams = []) $params = array_merge($params, $optParams); return $this->call('getIamPolicy', [$params], Policy::class); } + /** + * Use this method to list the objects of a specific migration job. + * (objects.listProjectsLocationsMigrationJobsObjects) + * + * @param string $parent Required. The parent migration job that owns the + * collection of objects. + * @param array $optParams Optional parameters. + * + * @opt_param int pageSize Maximum number of objects to return. Default is 50. + * The maximum value is 1000; values above 1000 will be coerced to 1000. + * @opt_param string pageToken Page token received from a previous + * `ListMigrationJObObjectsRequest` call. Provide this to retrieve the + * subsequent page. When paginating, all other parameters provided to + * `ListMigrationJobObjectsRequest` must match the call that provided the page + * token. + * @return ListMigrationJobObjectsResponse + * @throws \Google\Service\Exception + */ + public function listProjectsLocationsMigrationJobsObjects($parent, $optParams = []) + { + $params = ['parent' => $parent]; + $params = array_merge($params, $optParams); + return $this->call('list', [$params], ListMigrationJobObjectsResponse::class); + } + /** + * Use this method to look up a migration job object by its source object + * identifier. (objects.lookup) + * + * @param string $parent Required. The parent migration job that owns the + * collection of objects. + * @param LookupMigrationJobObjectRequest $postBody + * @param array $optParams Optional parameters. + * @return MigrationJobObject + * @throws \Google\Service\Exception + */ + public function lookup($parent, LookupMigrationJobObjectRequest $postBody, $optParams = []) + { + $params = ['parent' => $parent, 'postBody' => $postBody]; + $params = array_merge($params, $optParams); + return $this->call('lookup', [$params], MigrationJobObject::class); + } /** * Sets the access control policy on the specified resource. Replaces any * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and diff --git a/src/DatabaseMigrationService/Resource/ProjectsLocationsOperations.php b/src/DatabaseMigrationService/Resource/ProjectsLocationsOperations.php index ab5463a35a..571eef44ff 100644 --- a/src/DatabaseMigrationService/Resource/ProjectsLocationsOperations.php +++ b/src/DatabaseMigrationService/Resource/ProjectsLocationsOperations.php @@ -40,7 +40,7 @@ class ProjectsLocationsOperations extends \Google\Service\Resource * other methods to check whether the cancellation succeeded or whether the * operation completed despite cancellation. On successful cancellation, the * operation is not deleted; instead, it becomes an operation with an - * Operation.error value with a google.rpc.Status.code of 1, corresponding to + * Operation.error value with a google.rpc.Status.code of `1`, corresponding to * `Code.CANCELLED`. (operations.cancel) * * @param string $name The name of the operation resource to be cancelled. diff --git a/src/DatabaseMigrationService/RestartMigrationJobRequest.php b/src/DatabaseMigrationService/RestartMigrationJobRequest.php index 3ea7a3e399..8fb5e3f795 100644 --- a/src/DatabaseMigrationService/RestartMigrationJobRequest.php +++ b/src/DatabaseMigrationService/RestartMigrationJobRequest.php @@ -19,11 +19,27 @@ class RestartMigrationJobRequest extends \Google\Model { + protected $objectsFilterType = MigrationJobObjectsConfig::class; + protected $objectsFilterDataType = ''; /** * @var bool */ public $skipValidation; + /** + * @param MigrationJobObjectsConfig + */ + public function setObjectsFilter(MigrationJobObjectsConfig $objectsFilter) + { + $this->objectsFilter = $objectsFilter; + } + /** + * @return MigrationJobObjectsConfig + */ + public function getObjectsFilter() + { + return $this->objectsFilter; + } /** * @param bool */ diff --git a/src/DatabaseMigrationService/SourceObjectConfig.php b/src/DatabaseMigrationService/SourceObjectConfig.php new file mode 100644 index 0000000000..43ef2b737d --- /dev/null +++ b/src/DatabaseMigrationService/SourceObjectConfig.php @@ -0,0 +1,42 @@ +objectIdentifier = $objectIdentifier; + } + /** + * @return SourceObjectIdentifier + */ + public function getObjectIdentifier() + { + return $this->objectIdentifier; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SourceObjectConfig::class, 'Google_Service_DatabaseMigrationService_SourceObjectConfig'); diff --git a/src/DatabaseMigrationService/SourceObjectIdentifier.php b/src/DatabaseMigrationService/SourceObjectIdentifier.php new file mode 100644 index 0000000000..7dd84ef4ee --- /dev/null +++ b/src/DatabaseMigrationService/SourceObjectIdentifier.php @@ -0,0 +1,62 @@ +database = $database; + } + /** + * @return string + */ + public function getDatabase() + { + return $this->database; + } + /** + * @param string + */ + public function setType($type) + { + $this->type = $type; + } + /** + * @return string + */ + public function getType() + { + return $this->type; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SourceObjectIdentifier::class, 'Google_Service_DatabaseMigrationService_SourceObjectIdentifier'); diff --git a/src/DatabaseMigrationService/SourceObjectsConfig.php b/src/DatabaseMigrationService/SourceObjectsConfig.php new file mode 100644 index 0000000000..cc2e5a7c84 --- /dev/null +++ b/src/DatabaseMigrationService/SourceObjectsConfig.php @@ -0,0 +1,61 @@ +objectConfigs = $objectConfigs; + } + /** + * @return SourceObjectConfig[] + */ + public function getObjectConfigs() + { + return $this->objectConfigs; + } + /** + * @param string + */ + public function setObjectsSelectionType($objectsSelectionType) + { + $this->objectsSelectionType = $objectsSelectionType; + } + /** + * @return string + */ + public function getObjectsSelectionType() + { + return $this->objectsSelectionType; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(SourceObjectsConfig::class, 'Google_Service_DatabaseMigrationService_SourceObjectsConfig');