diff --git a/DataCatalog/metadata/V1/Bigquery.php b/DataCatalog/metadata/V1/Bigquery.php index ee848a4826c8..ac2691e4b12e 100644 Binary files a/DataCatalog/metadata/V1/Bigquery.php and b/DataCatalog/metadata/V1/Bigquery.php differ diff --git a/DataCatalog/metadata/V1/Common.php b/DataCatalog/metadata/V1/Common.php index 4c0cec007b61..dac8af30e4f3 100644 Binary files a/DataCatalog/metadata/V1/Common.php and b/DataCatalog/metadata/V1/Common.php differ diff --git a/DataCatalog/metadata/V1/DataSource.php b/DataCatalog/metadata/V1/DataSource.php index 0a0e16648f4b..84ae8556e688 100644 Binary files a/DataCatalog/metadata/V1/DataSource.php and b/DataCatalog/metadata/V1/DataSource.php differ diff --git a/DataCatalog/metadata/V1/Datacatalog.php b/DataCatalog/metadata/V1/Datacatalog.php index e5773885e958..93250bd197f7 100644 Binary files a/DataCatalog/metadata/V1/Datacatalog.php and b/DataCatalog/metadata/V1/Datacatalog.php differ diff --git a/DataCatalog/metadata/V1/DataplexSpec.php b/DataCatalog/metadata/V1/DataplexSpec.php index cd48190b90cb..5f2b4928323b 100644 --- a/DataCatalog/metadata/V1/DataplexSpec.php +++ b/DataCatalog/metadata/V1/DataplexSpec.php @@ -18,7 +18,7 @@ public static function initOnce() { \GPBMetadata\Google\Cloud\Datacatalog\V1\PhysicalSchema::initOnce(); $pool->internalAddGeneratedFile( ' - + /google/cloud/datacatalog/v1/dataplex_spec.protogoogle.cloud.datacatalog.v11google/cloud/datacatalog/v1/physical_schema.proto" DataplexSpec asset ( @ @@ -36,8 +36,8 @@ public static function initOnce() { system (2-.google.cloud.datacatalog.v1.IntegratedSystem fully_qualified_name (  google_cloud_resource (  -data_catalog_entry ( B -com.google.cloud.datacatalog.v1BDataplexSpecProtoPZAcloud.google.com/go/datacatalog/apiv1/datacatalogpb;datacatalogpbGoogle.Cloud.DataCatalog.V1Google\\Cloud\\DataCatalog\\V1Google::Cloud::DataCatalog::V1bproto3' +data_catalog_entry ( B +com.google.cloud.datacatalog.v1BDataplexSpecProtoPZAcloud.google.com/go/datacatalog/apiv1/datacatalogpb;datacatalogpbGoogle.Cloud.DataCatalog.V1Google\\Cloud\\DataCatalog\\V1Google::Cloud::DataCatalog::V1bproto3' , true); static::$is_initialized = true; diff --git a/DataCatalog/metadata/V1/DumpContent.php b/DataCatalog/metadata/V1/DumpContent.php index 93abced0982c..834c34260593 100644 Binary files a/DataCatalog/metadata/V1/DumpContent.php and b/DataCatalog/metadata/V1/DumpContent.php differ diff --git a/DataCatalog/metadata/V1/GcsFilesetSpec.php b/DataCatalog/metadata/V1/GcsFilesetSpec.php index 2350c774ebd3..615a0c7338ac 100644 --- a/DataCatalog/metadata/V1/GcsFilesetSpec.php +++ b/DataCatalog/metadata/V1/GcsFilesetSpec.php @@ -18,7 +18,7 @@ public static function initOnce() { \GPBMetadata\Google\Cloud\Datacatalog\V1\Timestamps::initOnce(); $pool->internalAddGeneratedFile( ' - + 2google/cloud/datacatalog/v1/gcs_fileset_spec.protogoogle.cloud.datacatalog.v1,google/cloud/datacatalog/v1/timestamps.proto"z GcsFilesetSpec file_patterns ( BAL @@ -27,8 +27,8 @@ public static function initOnce() { file_path ( BAJ gcs_timestamps ( 2-.google.cloud.datacatalog.v1.SystemTimestampsBA -size_bytes (BAB -com.google.cloud.datacatalog.v1PZAcloud.google.com/go/datacatalog/apiv1/datacatalogpb;datacatalogpbGoogle.Cloud.DataCatalog.V1Google\\Cloud\\DataCatalog\\V1Google::Cloud::DataCatalog::V1bproto3' +size_bytes (BAB +com.google.cloud.datacatalog.v1PZAcloud.google.com/go/datacatalog/apiv1/datacatalogpb;datacatalogpbGoogle.Cloud.DataCatalog.V1Google\\Cloud\\DataCatalog\\V1Google::Cloud::DataCatalog::V1bproto3' , true); static::$is_initialized = true; diff --git a/DataCatalog/metadata/V1/PhysicalSchema.php b/DataCatalog/metadata/V1/PhysicalSchema.php index a23ebb0ee678..abe23e97c85f 100644 Binary files a/DataCatalog/metadata/V1/PhysicalSchema.php and b/DataCatalog/metadata/V1/PhysicalSchema.php differ diff --git a/DataCatalog/metadata/V1/Policytagmanager.php b/DataCatalog/metadata/V1/Policytagmanager.php index 480b55d6570c..1bd639f28022 100644 Binary files a/DataCatalog/metadata/V1/Policytagmanager.php and b/DataCatalog/metadata/V1/Policytagmanager.php differ diff --git a/DataCatalog/metadata/V1/Policytagmanagerserialization.php b/DataCatalog/metadata/V1/Policytagmanagerserialization.php index 104108eed989..0f5679250501 100644 Binary files a/DataCatalog/metadata/V1/Policytagmanagerserialization.php and b/DataCatalog/metadata/V1/Policytagmanagerserialization.php differ diff --git a/DataCatalog/metadata/V1/Search.php b/DataCatalog/metadata/V1/Search.php index a559da264d80..a3d2582b6f95 100644 Binary files a/DataCatalog/metadata/V1/Search.php and b/DataCatalog/metadata/V1/Search.php differ diff --git a/DataCatalog/metadata/V1/Tags.php b/DataCatalog/metadata/V1/Tags.php index 77189495ff4f..296d505f6e8b 100644 Binary files a/DataCatalog/metadata/V1/Tags.php and b/DataCatalog/metadata/V1/Tags.php differ diff --git a/DataCatalog/metadata/V1/Timestamps.php b/DataCatalog/metadata/V1/Timestamps.php index cbfa95d8ad26..d246542aaf44 100644 --- a/DataCatalog/metadata/V1/Timestamps.php +++ b/DataCatalog/metadata/V1/Timestamps.php @@ -18,13 +18,13 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); $pool->internalAddGeneratedFile( ' - + ,google/cloud/datacatalog/v1/timestamps.protogoogle.cloud.datacatalog.v1google/protobuf/timestamp.proto" SystemTimestamps/ create_time ( 2.google.protobuf.Timestamp/ update_time ( 2.google.protobuf.Timestamp4 - expire_time ( 2.google.protobuf.TimestampBAB -com.google.cloud.datacatalog.v1PZAcloud.google.com/go/datacatalog/apiv1/datacatalogpb;datacatalogpbGoogle.Cloud.DataCatalog.V1Google\\Cloud\\DataCatalog\\V1Google::Cloud::DataCatalog::V1bproto3' + expire_time ( 2.google.protobuf.TimestampBAB +com.google.cloud.datacatalog.v1PZAcloud.google.com/go/datacatalog/apiv1/datacatalogpb;datacatalogpbGoogle.Cloud.DataCatalog.V1Google\\Cloud\\DataCatalog\\V1Google::Cloud::DataCatalog::V1bproto3' , true); static::$is_initialized = true; diff --git a/DataCatalog/samples/V1/DataCatalogClient/retrieve_config.php b/DataCatalog/samples/V1/DataCatalogClient/retrieve_config.php new file mode 100644 index 000000000000..71db67e3b4bc --- /dev/null +++ b/DataCatalog/samples/V1/DataCatalogClient/retrieve_config.php @@ -0,0 +1,72 @@ +setName($name); + + // Call the API and handle any network failures. + try { + /** @var OrganizationConfig $response */ + $response = $dataCatalogClient->retrieveConfig($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 +{ + $name = '[NAME]'; + + retrieve_config_sample($name); +} +// [END datacatalog_v1_generated_DataCatalog_RetrieveConfig_sync] diff --git a/DataCatalog/samples/V1/DataCatalogClient/retrieve_effective_config.php b/DataCatalog/samples/V1/DataCatalogClient/retrieve_effective_config.php new file mode 100644 index 000000000000..e3084e1dec0a --- /dev/null +++ b/DataCatalog/samples/V1/DataCatalogClient/retrieve_effective_config.php @@ -0,0 +1,74 @@ +setName($name); + + // Call the API and handle any network failures. + try { + /** @var MigrationConfig $response */ + $response = $dataCatalogClient->retrieveEffectiveConfig($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 +{ + $name = '[NAME]'; + + retrieve_effective_config_sample($name); +} +// [END datacatalog_v1_generated_DataCatalog_RetrieveEffectiveConfig_sync] diff --git a/DataCatalog/samples/V1/DataCatalogClient/set_config.php b/DataCatalog/samples/V1/DataCatalogClient/set_config.php new file mode 100644 index 000000000000..1c0a6e690b6c --- /dev/null +++ b/DataCatalog/samples/V1/DataCatalogClient/set_config.php @@ -0,0 +1,71 @@ +setName($name); + + // Call the API and handle any network failures. + try { + /** @var MigrationConfig $response */ + $response = $dataCatalogClient->setConfig($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 +{ + $name = '[NAME]'; + + set_config_sample($name); +} +// [END datacatalog_v1_generated_DataCatalog_SetConfig_sync] diff --git a/DataCatalog/src/V1/CatalogUIExperience.php b/DataCatalog/src/V1/CatalogUIExperience.php new file mode 100644 index 000000000000..893e185cffcf --- /dev/null +++ b/DataCatalog/src/V1/CatalogUIExperience.php @@ -0,0 +1,61 @@ +google.cloud.datacatalog.v1.CatalogUIExperience + */ +class CatalogUIExperience +{ + /** + * Default value. The default UI is Dataplex. + * + * Generated from protobuf enum CATALOG_UI_EXPERIENCE_UNSPECIFIED = 0; + */ + const CATALOG_UI_EXPERIENCE_UNSPECIFIED = 0; + /** + * The UI is Dataplex. + * + * Generated from protobuf enum CATALOG_UI_EXPERIENCE_ENABLED = 1; + */ + const CATALOG_UI_EXPERIENCE_ENABLED = 1; + /** + * The UI is Data Catalog. + * + * Generated from protobuf enum CATALOG_UI_EXPERIENCE_DISABLED = 2; + */ + const CATALOG_UI_EXPERIENCE_DISABLED = 2; + + private static $valueToName = [ + self::CATALOG_UI_EXPERIENCE_UNSPECIFIED => 'CATALOG_UI_EXPERIENCE_UNSPECIFIED', + self::CATALOG_UI_EXPERIENCE_ENABLED => 'CATALOG_UI_EXPERIENCE_ENABLED', + self::CATALOG_UI_EXPERIENCE_DISABLED => 'CATALOG_UI_EXPERIENCE_DISABLED', + ]; + + 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/DataCatalog/src/V1/Client/DataCatalogClient.php b/DataCatalog/src/V1/Client/DataCatalogClient.php index 29ec8e0bba20..f14a7d0c1bb3 100644 --- a/DataCatalog/src/V1/Client/DataCatalogClient.php +++ b/DataCatalog/src/V1/Client/DataCatalogClient.php @@ -58,14 +58,19 @@ use Google\Cloud\DataCatalog\V1\ListEntryGroupsRequest; use Google\Cloud\DataCatalog\V1\ListTagsRequest; use Google\Cloud\DataCatalog\V1\LookupEntryRequest; +use Google\Cloud\DataCatalog\V1\MigrationConfig; use Google\Cloud\DataCatalog\V1\ModifyEntryContactsRequest; use Google\Cloud\DataCatalog\V1\ModifyEntryOverviewRequest; +use Google\Cloud\DataCatalog\V1\OrganizationConfig; use Google\Cloud\DataCatalog\V1\ReconcileTagsMetadata; use Google\Cloud\DataCatalog\V1\ReconcileTagsRequest; use Google\Cloud\DataCatalog\V1\ReconcileTagsResponse; use Google\Cloud\DataCatalog\V1\RenameTagTemplateFieldEnumValueRequest; use Google\Cloud\DataCatalog\V1\RenameTagTemplateFieldRequest; +use Google\Cloud\DataCatalog\V1\RetrieveConfigRequest; +use Google\Cloud\DataCatalog\V1\RetrieveEffectiveConfigRequest; use Google\Cloud\DataCatalog\V1\SearchCatalogRequest; +use Google\Cloud\DataCatalog\V1\SetConfigRequest; use Google\Cloud\DataCatalog\V1\StarEntryRequest; use Google\Cloud\DataCatalog\V1\StarEntryResponse; use Google\Cloud\DataCatalog\V1\Tag; @@ -123,7 +128,10 @@ * @method PromiseInterface reconcileTagsAsync(ReconcileTagsRequest $request, array $optionalArgs = []) * @method PromiseInterface renameTagTemplateFieldAsync(RenameTagTemplateFieldRequest $request, array $optionalArgs = []) * @method PromiseInterface renameTagTemplateFieldEnumValueAsync(RenameTagTemplateFieldEnumValueRequest $request, array $optionalArgs = []) + * @method PromiseInterface retrieveConfigAsync(RetrieveConfigRequest $request, array $optionalArgs = []) + * @method PromiseInterface retrieveEffectiveConfigAsync(RetrieveEffectiveConfigRequest $request, array $optionalArgs = []) * @method PromiseInterface searchCatalogAsync(SearchCatalogRequest $request, array $optionalArgs = []) + * @method PromiseInterface setConfigAsync(SetConfigRequest $request, array $optionalArgs = []) * @method PromiseInterface setIamPolicyAsync(SetIamPolicyRequest $request, array $optionalArgs = []) * @method PromiseInterface starEntryAsync(StarEntryRequest $request, array $optionalArgs = []) * @method PromiseInterface testIamPermissionsAsync(TestIamPermissionsRequest $request, array $optionalArgs = []) @@ -1262,6 +1270,66 @@ public function renameTagTemplateFieldEnumValue( return $this->startApiCall('RenameTagTemplateFieldEnumValue', $request, $callOptions)->wait(); } + /** + * Retrieves the configuration related to the migration from Data Catalog to + * Dataplex for a specific organization, including all the projects under it + * which have a separate configuration set. + * + * The async variant is {@see DataCatalogClient::retrieveConfigAsync()} . + * + * @example samples/V1/DataCatalogClient/retrieve_config.php + * + * @param RetrieveConfigRequest $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 OrganizationConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function retrieveConfig(RetrieveConfigRequest $request, array $callOptions = []): OrganizationConfig + { + return $this->startApiCall('RetrieveConfig', $request, $callOptions)->wait(); + } + + /** + * Retrieves the effective configuration related to the migration from Data + * Catalog to Dataplex for a specific organization or project. If there is no + * specific configuration set for the resource, the setting is checked + * hierarchicahlly through the ancestors of the resource, starting from the + * resource itself. + * + * The async variant is {@see DataCatalogClient::retrieveEffectiveConfigAsync()} . + * + * @example samples/V1/DataCatalogClient/retrieve_effective_config.php + * + * @param RetrieveEffectiveConfigRequest $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 MigrationConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function retrieveEffectiveConfig( + RetrieveEffectiveConfigRequest $request, + array $callOptions = [] + ): MigrationConfig { + return $this->startApiCall('RetrieveEffectiveConfig', $request, $callOptions)->wait(); + } + /** * Searches Data Catalog for multiple resources like entries and tags that * match a query. @@ -1302,6 +1370,33 @@ public function searchCatalog(SearchCatalogRequest $request, array $callOptions return $this->startApiCall('SearchCatalog', $request, $callOptions); } + /** + * Sets the configuration related to the migration to Dataplex for an + * organization or project. + * + * The async variant is {@see DataCatalogClient::setConfigAsync()} . + * + * @example samples/V1/DataCatalogClient/set_config.php + * + * @param SetConfigRequest $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 MigrationConfig + * + * @throws ApiException Thrown if the API call fails. + */ + public function setConfig(SetConfigRequest $request, array $callOptions = []): MigrationConfig + { + return $this->startApiCall('SetConfig', $request, $callOptions)->wait(); + } + /** * Sets an access control policy for a resource. Replaces any existing * policy. diff --git a/DataCatalog/src/V1/EntryGroup.php b/DataCatalog/src/V1/EntryGroup.php index 5dcefe830da7..4a7d94acee7c 100644 --- a/DataCatalog/src/V1/EntryGroup.php +++ b/DataCatalog/src/V1/EntryGroup.php @@ -10,8 +10,8 @@ /** * Entry group metadata. - * An `EntryGroup` resource represents a logical grouping of zero or more - * Data Catalog [Entry][google.cloud.datacatalog.v1.Entry] resources. + * An `EntryGroup` resource represents a logical grouping of zero or more + * Data Catalog [Entry][google.cloud.datacatalog.v1.Entry] resources. * * Generated from protobuf message google.cloud.datacatalog.v1.EntryGroup */ @@ -46,6 +46,16 @@ class EntryGroup extends \Google\Protobuf\Internal\Message * Generated from protobuf field .google.cloud.datacatalog.v1.SystemTimestamps data_catalog_timestamps = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; */ protected $data_catalog_timestamps = null; + /** + * Optional. When set to [true], it means DataCatalog EntryGroup was + * transferred to Dataplex Catalog Service. It makes EntryGroup and its + * Entries to be read-only in DataCatalog. However, new Tags on EntryGroup and + * its Entries can be created. After setting the flag to [true] it cannot be + * unset. + * + * Generated from protobuf field bool transferred_to_dataplex = 9 [(.google.api.field_behavior) = OPTIONAL]; + */ + protected $transferred_to_dataplex = false; /** * Constructor. @@ -66,6 +76,12 @@ class EntryGroup extends \Google\Protobuf\Internal\Message * Default value is an empty string. * @type \Google\Cloud\DataCatalog\V1\SystemTimestamps $data_catalog_timestamps * Output only. Timestamps of the entry group. Default value is empty. + * @type bool $transferred_to_dataplex + * Optional. When set to [true], it means DataCatalog EntryGroup was + * transferred to Dataplex Catalog Service. It makes EntryGroup and its + * Entries to be read-only in DataCatalog. However, new Tags on EntryGroup and + * its Entries can be created. After setting the flag to [true] it cannot be + * unset. * } */ public function __construct($data = NULL) { @@ -197,5 +213,39 @@ public function setDataCatalogTimestamps($var) return $this; } + /** + * Optional. When set to [true], it means DataCatalog EntryGroup was + * transferred to Dataplex Catalog Service. It makes EntryGroup and its + * Entries to be read-only in DataCatalog. However, new Tags on EntryGroup and + * its Entries can be created. After setting the flag to [true] it cannot be + * unset. + * + * Generated from protobuf field bool transferred_to_dataplex = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @return bool + */ + public function getTransferredToDataplex() + { + return $this->transferred_to_dataplex; + } + + /** + * Optional. When set to [true], it means DataCatalog EntryGroup was + * transferred to Dataplex Catalog Service. It makes EntryGroup and its + * Entries to be read-only in DataCatalog. However, new Tags on EntryGroup and + * its Entries can be created. After setting the flag to [true] it cannot be + * unset. + * + * Generated from protobuf field bool transferred_to_dataplex = 9 [(.google.api.field_behavior) = OPTIONAL]; + * @param bool $var + * @return $this + */ + public function setTransferredToDataplex($var) + { + GPBUtil::checkBool($var); + $this->transferred_to_dataplex = $var; + + return $this; + } + } diff --git a/DataCatalog/src/V1/MigrationConfig.php b/DataCatalog/src/V1/MigrationConfig.php new file mode 100644 index 000000000000..c2006d27036a --- /dev/null +++ b/DataCatalog/src/V1/MigrationConfig.php @@ -0,0 +1,105 @@ +google.cloud.datacatalog.v1.MigrationConfig + */ +class MigrationConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Opt-in status for the migration of Tag Templates to Dataplex. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.TagTemplateMigration tag_template_migration = 1; + */ + protected $tag_template_migration = 0; + /** + * Opt-in status for the UI switch to Dataplex. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.CatalogUIExperience catalog_ui_experience = 2; + */ + protected $catalog_ui_experience = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $tag_template_migration + * Opt-in status for the migration of Tag Templates to Dataplex. + * @type int $catalog_ui_experience + * Opt-in status for the UI switch to Dataplex. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\V1\Datacatalog::initOnce(); + parent::__construct($data); + } + + /** + * Opt-in status for the migration of Tag Templates to Dataplex. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.TagTemplateMigration tag_template_migration = 1; + * @return int + */ + public function getTagTemplateMigration() + { + return $this->tag_template_migration; + } + + /** + * Opt-in status for the migration of Tag Templates to Dataplex. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.TagTemplateMigration tag_template_migration = 1; + * @param int $var + * @return $this + */ + public function setTagTemplateMigration($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DataCatalog\V1\TagTemplateMigration::class); + $this->tag_template_migration = $var; + + return $this; + } + + /** + * Opt-in status for the UI switch to Dataplex. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.CatalogUIExperience catalog_ui_experience = 2; + * @return int + */ + public function getCatalogUiExperience() + { + return $this->catalog_ui_experience; + } + + /** + * Opt-in status for the UI switch to Dataplex. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.CatalogUIExperience catalog_ui_experience = 2; + * @param int $var + * @return $this + */ + public function setCatalogUiExperience($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DataCatalog\V1\CatalogUIExperience::class); + $this->catalog_ui_experience = $var; + + return $this; + } + +} + diff --git a/DataCatalog/src/V1/OrganizationConfig.php b/DataCatalog/src/V1/OrganizationConfig.php new file mode 100644 index 000000000000..499855049a8c --- /dev/null +++ b/DataCatalog/src/V1/OrganizationConfig.php @@ -0,0 +1,78 @@ +google.cloud.datacatalog.v1.OrganizationConfig + */ +class OrganizationConfig extends \Google\Protobuf\Internal\Message +{ + /** + * Map of organizations and project resource names and their configuration. + * The format for the map keys is `organizations/{organizationId}` or + * `projects/{projectId}`. + * + * Generated from protobuf field map config = 1; + */ + private $config; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type array|\Google\Protobuf\Internal\MapField $config + * Map of organizations and project resource names and their configuration. + * The format for the map keys is `organizations/{organizationId}` or + * `projects/{projectId}`. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\V1\Datacatalog::initOnce(); + parent::__construct($data); + } + + /** + * Map of organizations and project resource names and their configuration. + * The format for the map keys is `organizations/{organizationId}` or + * `projects/{projectId}`. + * + * Generated from protobuf field map config = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getConfig() + { + return $this->config; + } + + /** + * Map of organizations and project resource names and their configuration. + * The format for the map keys is `organizations/{organizationId}` or + * `projects/{projectId}`. + * + * Generated from protobuf field map config = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setConfig($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DataCatalog\V1\MigrationConfig::class); + $this->config = $arr; + + return $this; + } + +} + diff --git a/DataCatalog/src/V1/RetrieveConfigRequest.php b/DataCatalog/src/V1/RetrieveConfigRequest.php new file mode 100644 index 000000000000..b50525b4d63e --- /dev/null +++ b/DataCatalog/src/V1/RetrieveConfigRequest.php @@ -0,0 +1,68 @@ +google.cloud.datacatalog.v1.RetrieveConfigRequest + */ +class RetrieveConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The organization whose config is being retrieved. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The organization whose config is being retrieved. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\V1\Datacatalog::initOnce(); + parent::__construct($data); + } + + /** + * Required. The organization whose config is being retrieved. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The organization whose config is being retrieved. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/DataCatalog/src/V1/RetrieveEffectiveConfigRequest.php b/DataCatalog/src/V1/RetrieveEffectiveConfigRequest.php new file mode 100644 index 000000000000..db9b1407fced --- /dev/null +++ b/DataCatalog/src/V1/RetrieveEffectiveConfigRequest.php @@ -0,0 +1,68 @@ +google.cloud.datacatalog.v1.RetrieveEffectiveConfigRequest + */ +class RetrieveEffectiveConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The resource whose effective config is being retrieved. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The resource whose effective config is being retrieved. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\V1\Datacatalog::initOnce(); + parent::__construct($data); + } + + /** + * Required. The resource whose effective config is being retrieved. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The resource whose effective config is being retrieved. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + +} + diff --git a/DataCatalog/src/V1/SetConfigRequest.php b/DataCatalog/src/V1/SetConfigRequest.php new file mode 100644 index 000000000000..9b8210c2e934 --- /dev/null +++ b/DataCatalog/src/V1/SetConfigRequest.php @@ -0,0 +1,143 @@ +google.cloud.datacatalog.v1.SetConfigRequest + */ +class SetConfigRequest extends \Google\Protobuf\Internal\Message +{ + /** + * Required. The organization or project whose config is being specified. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + */ + protected $name = ''; + protected $configuration; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $name + * Required. The organization or project whose config is being specified. + * @type int $tag_template_migration + * Opt-in status for the migration of Tag Templates to Dataplex. + * @type int $catalog_ui_experience + * Opt-in status for the UI switch to Dataplex. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Datacatalog\V1\Datacatalog::initOnce(); + parent::__construct($data); + } + + /** + * Required. The organization or project whose config is being specified. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Required. The organization or project whose config is being specified. + * + * Generated from protobuf field string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Opt-in status for the migration of Tag Templates to Dataplex. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.TagTemplateMigration tag_template_migration = 2; + * @return int + */ + public function getTagTemplateMigration() + { + return $this->readOneof(2); + } + + public function hasTagTemplateMigration() + { + return $this->hasOneof(2); + } + + /** + * Opt-in status for the migration of Tag Templates to Dataplex. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.TagTemplateMigration tag_template_migration = 2; + * @param int $var + * @return $this + */ + public function setTagTemplateMigration($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DataCatalog\V1\TagTemplateMigration::class); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Opt-in status for the UI switch to Dataplex. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.CatalogUIExperience catalog_ui_experience = 3; + * @return int + */ + public function getCatalogUiExperience() + { + return $this->readOneof(3); + } + + public function hasCatalogUiExperience() + { + return $this->hasOneof(3); + } + + /** + * Opt-in status for the UI switch to Dataplex. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.CatalogUIExperience catalog_ui_experience = 3; + * @param int $var + * @return $this + */ + public function setCatalogUiExperience($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DataCatalog\V1\CatalogUIExperience::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * @return string + */ + public function getConfiguration() + { + return $this->whichOneof("configuration"); + } + +} + diff --git a/DataCatalog/src/V1/Tag.php b/DataCatalog/src/V1/Tag.php index f576496d2fb3..25c37054bacf 100644 --- a/DataCatalog/src/V1/Tag.php +++ b/DataCatalog/src/V1/Tag.php @@ -51,6 +51,12 @@ class Tag extends \Google\Protobuf\Internal\Message * Generated from protobuf field map fields = 3 [(.google.api.field_behavior) = REQUIRED]; */ private $fields; + /** + * Output only. Denotes the transfer status of the Tag Template. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.TagTemplate.DataplexTransferStatus dataplex_transfer_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $dataplex_transfer_status = 0; protected $scope; /** @@ -80,6 +86,8 @@ class Tag extends \Google\Protobuf\Internal\Message * information about that field. * Tag template defines valid field IDs. A tag * must have at least 1 field and at most 500 fields. + * @type int $dataplex_transfer_status + * Output only. Denotes the transfer status of the Tag Template. * } */ public function __construct($data = NULL) { @@ -244,6 +252,32 @@ public function setFields($var) return $this; } + /** + * Output only. Denotes the transfer status of the Tag Template. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.TagTemplate.DataplexTransferStatus dataplex_transfer_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getDataplexTransferStatus() + { + return $this->dataplex_transfer_status; + } + + /** + * Output only. Denotes the transfer status of the Tag Template. + * + * Generated from protobuf field .google.cloud.datacatalog.v1.TagTemplate.DataplexTransferStatus dataplex_transfer_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setDataplexTransferStatus($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\DataCatalog\V1\TagTemplate\DataplexTransferStatus::class); + $this->dataplex_transfer_status = $var; + + return $this; + } + /** * @return string */ diff --git a/DataCatalog/src/V1/TagTemplate/DataplexTransferStatus.php b/DataCatalog/src/V1/TagTemplate/DataplexTransferStatus.php index cfc5495c9db0..3231b7956cc6 100644 --- a/DataCatalog/src/V1/TagTemplate/DataplexTransferStatus.php +++ b/DataCatalog/src/V1/TagTemplate/DataplexTransferStatus.php @@ -29,10 +29,18 @@ class DataplexTransferStatus * Generated from protobuf enum MIGRATED = 1 [deprecated = true]; */ const MIGRATED = 1; + /** + * TagTemplate and its tags are auto-copied to Dataplex service. + * Visible in both services. Editable in Dataplex, read-only in DataCatalog. + * + * Generated from protobuf enum TRANSFERRED = 2; + */ + const TRANSFERRED = 2; private static $valueToName = [ self::DATAPLEX_TRANSFER_STATUS_UNSPECIFIED => 'DATAPLEX_TRANSFER_STATUS_UNSPECIFIED', self::MIGRATED => 'MIGRATED', + self::TRANSFERRED => 'TRANSFERRED', ]; public static function name($value) diff --git a/DataCatalog/src/V1/TagTemplateMigration.php b/DataCatalog/src/V1/TagTemplateMigration.php new file mode 100644 index 000000000000..fc9a17519c2e --- /dev/null +++ b/DataCatalog/src/V1/TagTemplateMigration.php @@ -0,0 +1,63 @@ +google.cloud.datacatalog.v1.TagTemplateMigration + */ +class TagTemplateMigration +{ + /** + * Default value. Migration of Tag Templates from Data Catalog to Dataplex is + * not performed. + * + * Generated from protobuf enum TAG_TEMPLATE_MIGRATION_UNSPECIFIED = 0; + */ + const TAG_TEMPLATE_MIGRATION_UNSPECIFIED = 0; + /** + * Migration of Tag Templates from Data Catalog to Dataplex is enabled. + * + * Generated from protobuf enum TAG_TEMPLATE_MIGRATION_ENABLED = 1; + */ + const TAG_TEMPLATE_MIGRATION_ENABLED = 1; + /** + * Migration of Tag Templates from Data Catalog to Dataplex is disabled. + * + * Generated from protobuf enum TAG_TEMPLATE_MIGRATION_DISABLED = 2; + */ + const TAG_TEMPLATE_MIGRATION_DISABLED = 2; + + private static $valueToName = [ + self::TAG_TEMPLATE_MIGRATION_UNSPECIFIED => 'TAG_TEMPLATE_MIGRATION_UNSPECIFIED', + self::TAG_TEMPLATE_MIGRATION_ENABLED => 'TAG_TEMPLATE_MIGRATION_ENABLED', + self::TAG_TEMPLATE_MIGRATION_DISABLED => 'TAG_TEMPLATE_MIGRATION_DISABLED', + ]; + + 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/DataCatalog/src/V1/gapic_metadata.json b/DataCatalog/src/V1/gapic_metadata.json index bf1807d340fc..cf1d5d32642a 100644 --- a/DataCatalog/src/V1/gapic_metadata.json +++ b/DataCatalog/src/V1/gapic_metadata.json @@ -130,11 +130,26 @@ "renameTagTemplateFieldEnumValue" ] }, + "RetrieveConfig": { + "methods": [ + "retrieveConfig" + ] + }, + "RetrieveEffectiveConfig": { + "methods": [ + "retrieveEffectiveConfig" + ] + }, "SearchCatalog": { "methods": [ "searchCatalog" ] }, + "SetConfig": { + "methods": [ + "setConfig" + ] + }, "SetIamPolicy": { "methods": [ "setIamPolicy" diff --git a/DataCatalog/src/V1/resources/data_catalog_client_config.json b/DataCatalog/src/V1/resources/data_catalog_client_config.json index df0536489ab1..89bd71b7efa3 100644 --- a/DataCatalog/src/V1/resources/data_catalog_client_config.json +++ b/DataCatalog/src/V1/resources/data_catalog_client_config.json @@ -150,11 +150,26 @@ "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "RetrieveConfig": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, + "RetrieveEffectiveConfig": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "SearchCatalog": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", "retry_params_name": "retry_policy_1_params" }, + "SetConfig": { + "timeout_millis": 60000, + "retry_codes_name": "retry_policy_1_codes", + "retry_params_name": "retry_policy_1_params" + }, "SetIamPolicy": { "timeout_millis": 60000, "retry_codes_name": "retry_policy_1_codes", diff --git a/DataCatalog/src/V1/resources/data_catalog_descriptor_config.php b/DataCatalog/src/V1/resources/data_catalog_descriptor_config.php index f33442a300df..49a2dde5e8e4 100644 --- a/DataCatalog/src/V1/resources/data_catalog_descriptor_config.php +++ b/DataCatalog/src/V1/resources/data_catalog_descriptor_config.php @@ -341,6 +341,30 @@ ], ], ], + 'RetrieveConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DataCatalog\V1\OrganizationConfig', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], + 'RetrieveEffectiveConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DataCatalog\V1\MigrationConfig', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'SearchCatalog' => [ 'pageStreaming' => [ 'requestPageTokenGetMethod' => 'getPageToken', @@ -353,6 +377,18 @@ 'callType' => \Google\ApiCore\Call::PAGINATED_CALL, 'responseType' => 'Google\Cloud\DataCatalog\V1\SearchCatalogResponse', ], + 'SetConfig' => [ + 'callType' => \Google\ApiCore\Call::UNARY_CALL, + 'responseType' => 'Google\Cloud\DataCatalog\V1\MigrationConfig', + 'headerParams' => [ + [ + 'keyName' => 'name', + 'fieldAccessors' => [ + 'getName', + ], + ], + ], + ], 'SetIamPolicy' => [ 'callType' => \Google\ApiCore\Call::UNARY_CALL, 'responseType' => 'Google\Cloud\Iam\V1\Policy', diff --git a/DataCatalog/src/V1/resources/data_catalog_rest_client_config.php b/DataCatalog/src/V1/resources/data_catalog_rest_client_config.php index 6cfbc6216468..672253b7495e 100644 --- a/DataCatalog/src/V1/resources/data_catalog_rest_client_config.php +++ b/DataCatalog/src/V1/resources/data_catalog_rest_client_config.php @@ -341,11 +341,58 @@ ], ], ], + 'RetrieveConfig' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*}:retrieveConfig', + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], + 'RetrieveEffectiveConfig' => [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*}:retrieveEffectiveConfig', + 'additionalBindings' => [ + [ + 'method' => 'get', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}:retrieveEffectiveConfig', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'SearchCatalog' => [ 'method' => 'post', 'uriTemplate' => '/v1/catalog:search', 'body' => '*', ], + 'SetConfig' => [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=organizations/*/locations/*}:setConfig', + 'body' => '*', + 'additionalBindings' => [ + [ + 'method' => 'post', + 'uriTemplate' => '/v1/{name=projects/*/locations/*}:setConfig', + 'body' => '*', + ], + ], + 'placeholders' => [ + 'name' => [ + 'getters' => [ + 'getName', + ], + ], + ], + ], 'SetIamPolicy' => [ 'method' => 'post', 'uriTemplate' => '/v1/{resource=projects/*/locations/*/tagTemplates/*}:setIamPolicy', diff --git a/DataCatalog/tests/Unit/V1/Client/DataCatalogClientTest.php b/DataCatalog/tests/Unit/V1/Client/DataCatalogClientTest.php index ce241156d6d4..1c6e9e7fd578 100644 --- a/DataCatalog/tests/Unit/V1/Client/DataCatalogClientTest.php +++ b/DataCatalog/tests/Unit/V1/Client/DataCatalogClientTest.php @@ -54,16 +54,21 @@ use Google\Cloud\DataCatalog\V1\ListTagsRequest; use Google\Cloud\DataCatalog\V1\ListTagsResponse; use Google\Cloud\DataCatalog\V1\LookupEntryRequest; +use Google\Cloud\DataCatalog\V1\MigrationConfig; use Google\Cloud\DataCatalog\V1\ModifyEntryContactsRequest; use Google\Cloud\DataCatalog\V1\ModifyEntryOverviewRequest; +use Google\Cloud\DataCatalog\V1\OrganizationConfig; use Google\Cloud\DataCatalog\V1\ReconcileTagsRequest; use Google\Cloud\DataCatalog\V1\ReconcileTagsResponse; use Google\Cloud\DataCatalog\V1\RenameTagTemplateFieldEnumValueRequest; use Google\Cloud\DataCatalog\V1\RenameTagTemplateFieldRequest; +use Google\Cloud\DataCatalog\V1\RetrieveConfigRequest; +use Google\Cloud\DataCatalog\V1\RetrieveEffectiveConfigRequest; use Google\Cloud\DataCatalog\V1\SearchCatalogRequest; use Google\Cloud\DataCatalog\V1\SearchCatalogRequest\Scope; use Google\Cloud\DataCatalog\V1\SearchCatalogResponse; use Google\Cloud\DataCatalog\V1\SearchCatalogResult; +use Google\Cloud\DataCatalog\V1\SetConfigRequest; use Google\Cloud\DataCatalog\V1\StarEntryRequest; use Google\Cloud\DataCatalog\V1\StarEntryResponse; use Google\Cloud\DataCatalog\V1\Tag; @@ -223,10 +228,12 @@ public function createEntryGroupTest() $name = 'name3373707'; $displayName = 'displayName1615086568'; $description = 'description-1724546052'; + $transferredToDataplex = true; $expectedResponse = new EntryGroup(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); $expectedResponse->setDescription($description); + $expectedResponse->setTransferredToDataplex($transferredToDataplex); $transport->addResponse($expectedResponse); // Mock request $formattedParent = $gapicClient->locationName('[PROJECT]', '[LOCATION]'); @@ -968,10 +975,12 @@ public function getEntryGroupTest() $name2 = 'name2-1052831874'; $displayName = 'displayName1615086568'; $description = 'description-1724546052'; + $transferredToDataplex = true; $expectedResponse = new EntryGroup(); $expectedResponse->setName($name2); $expectedResponse->setDisplayName($displayName); $expectedResponse->setDescription($description); + $expectedResponse->setTransferredToDataplex($transferredToDataplex); $transport->addResponse($expectedResponse); // Mock request $formattedName = $gapicClient->entryGroupName('[PROJECT]', '[LOCATION]', '[ENTRY_GROUP]'); @@ -2013,6 +2022,132 @@ public function renameTagTemplateFieldEnumValueExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function retrieveConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new OrganizationConfig(); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $request = (new RetrieveConfigRequest())->setName($name); + $response = $gapicClient->retrieveConfig($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.datacatalog.v1.DataCatalog/RetrieveConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function retrieveConfigExceptionTest() + { + $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 + $name = 'name3373707'; + $request = (new RetrieveConfigRequest())->setName($name); + try { + $gapicClient->retrieveConfig($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 retrieveEffectiveConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new MigrationConfig(); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $request = (new RetrieveEffectiveConfigRequest())->setName($name); + $response = $gapicClient->retrieveEffectiveConfig($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.datacatalog.v1.DataCatalog/RetrieveEffectiveConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function retrieveEffectiveConfigExceptionTest() + { + $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 + $name = 'name3373707'; + $request = (new RetrieveEffectiveConfigRequest())->setName($name); + try { + $gapicClient->retrieveEffectiveConfig($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 searchCatalogTest() { @@ -2090,6 +2225,69 @@ public function searchCatalogExceptionTest() $this->assertTrue($transport->isExhausted()); } + /** @test */ + public function setConfigTest() + { + $transport = $this->createTransport(); + $gapicClient = $this->createClient([ + 'transport' => $transport, + ]); + $this->assertTrue($transport->isExhausted()); + // Mock response + $expectedResponse = new MigrationConfig(); + $transport->addResponse($expectedResponse); + // Mock request + $name = 'name3373707'; + $request = (new SetConfigRequest())->setName($name); + $response = $gapicClient->setConfig($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.datacatalog.v1.DataCatalog/SetConfig', $actualFuncCall); + $actualValue = $actualRequestObject->getName(); + $this->assertProtobufEquals($name, $actualValue); + $this->assertTrue($transport->isExhausted()); + } + + /** @test */ + public function setConfigExceptionTest() + { + $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 + $name = 'name3373707'; + $request = (new SetConfigRequest())->setName($name); + try { + $gapicClient->setConfig($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 setIamPolicyTest() { @@ -2443,10 +2641,12 @@ public function updateEntryGroupTest() $name = 'name3373707'; $displayName = 'displayName1615086568'; $description = 'description-1724546052'; + $transferredToDataplex = true; $expectedResponse = new EntryGroup(); $expectedResponse->setName($name); $expectedResponse->setDisplayName($displayName); $expectedResponse->setDescription($description); + $expectedResponse->setTransferredToDataplex($transferredToDataplex); $transport->addResponse($expectedResponse); // Mock request $entryGroup = new EntryGroup();