diff --git a/src/CloudDataplex.php b/src/CloudDataplex.php index 666d15c9b2..32f52f396b 100644 --- a/src/CloudDataplex.php +++ b/src/CloudDataplex.php @@ -1192,7 +1192,17 @@ public function __construct($clientOrConfig = [], $rootUrl = null) 'jobs', [ 'methods' => [ - 'generateDataQualityRules' => [ + 'cancel' => [ + 'path' => 'v1/{+name}:cancel', + 'httpMethod' => 'POST', + 'parameters' => [ + 'name' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + ], + ],'generateDataQualityRules' => [ 'path' => 'v1/{+name}:generateDataQualityRules', 'httpMethod' => 'POST', 'parameters' => [ diff --git a/src/CloudDataplex/GoogleCloudDataplexV1CancelDataScanJobRequest.php b/src/CloudDataplex/GoogleCloudDataplexV1CancelDataScanJobRequest.php new file mode 100644 index 0000000000..e8f5030196 --- /dev/null +++ b/src/CloudDataplex/GoogleCloudDataplexV1CancelDataScanJobRequest.php @@ -0,0 +1,25 @@ +attributes = $attributes; + } + /** + * @return string[] + */ + public function getAttributes() + { + return $this->attributes; + } /** * Optional. The unnested column which this rule is evaluated against. * @@ -263,6 +293,23 @@ public function getRowConditionExpectation() { return $this->rowConditionExpectation; } + /** + * Output only. Contains information about the source of the rule and its + * relationship with the BigQuery table, where applicable. + * + * @param GoogleCloudDataplexV1DataQualityRuleRuleSource $ruleSource + */ + public function setRuleSource(GoogleCloudDataplexV1DataQualityRuleRuleSource $ruleSource) + { + $this->ruleSource = $ruleSource; + } + /** + * @return GoogleCloudDataplexV1DataQualityRuleRuleSource + */ + public function getRuleSource() + { + return $this->ruleSource; + } /** * Row-level rule which evaluates whether each column value is contained by a * specified set. @@ -347,6 +394,24 @@ public function getTableConditionExpectation() { return $this->tableConditionExpectation; } + /** + * Aggregate rule which references a rule template and provides the parameters + * to be substituted in the template. If any rows are returned, this rule + * fails. + * + * @param GoogleCloudDataplexV1DataQualityRuleTemplateReference $templateReference + */ + public function setTemplateReference(GoogleCloudDataplexV1DataQualityRuleTemplateReference $templateReference) + { + $this->templateReference = $templateReference; + } + /** + * @return GoogleCloudDataplexV1DataQualityRuleTemplateReference + */ + public function getTemplateReference() + { + return $this->templateReference; + } public function setThreshold($threshold) { $this->threshold = $threshold; diff --git a/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleRuleSource.php b/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleRuleSource.php new file mode 100644 index 0000000000..8ef3df68c3 --- /dev/null +++ b/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleRuleSource.php @@ -0,0 +1,47 @@ +rulePathElements = $rulePathElements; + } + /** + * @return GoogleCloudDataplexV1DataQualityRuleRuleSourceRulePathElement[] + */ + public function getRulePathElements() + { + return $this->rulePathElements; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GoogleCloudDataplexV1DataQualityRuleRuleSource::class, 'Google_Service_CloudDataplex_GoogleCloudDataplexV1DataQualityRuleRuleSource'); diff --git a/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleRuleSourceRulePathElement.php b/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleRuleSourceRulePathElement.php new file mode 100644 index 0000000000..6845b9d248 --- /dev/null +++ b/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleRuleSourceRulePathElement.php @@ -0,0 +1,63 @@ +entryLinkSource = $entryLinkSource; + } + /** + * @return GoogleCloudDataplexV1DataQualityRuleRuleSourceRulePathElementEntryLinkSource + */ + public function getEntryLinkSource() + { + return $this->entryLinkSource; + } + /** + * Output only. Entry source represents information about the related source + * entry. + * + * @param GoogleCloudDataplexV1DataQualityRuleRuleSourceRulePathElementEntrySource $entrySource + */ + public function setEntrySource(GoogleCloudDataplexV1DataQualityRuleRuleSourceRulePathElementEntrySource $entrySource) + { + $this->entrySource = $entrySource; + } + /** + * @return GoogleCloudDataplexV1DataQualityRuleRuleSourceRulePathElementEntrySource + */ + public function getEntrySource() + { + return $this->entrySource; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GoogleCloudDataplexV1DataQualityRuleRuleSourceRulePathElement::class, 'Google_Service_CloudDataplex_GoogleCloudDataplexV1DataQualityRuleRuleSourceRulePathElement'); diff --git a/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleRuleSourceRulePathElementEntryLinkSource.php b/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleRuleSourceRulePathElementEntryLinkSource.php new file mode 100644 index 0000000000..e82c48fa12 --- /dev/null +++ b/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleRuleSourceRulePathElementEntryLinkSource.php @@ -0,0 +1,80 @@ +entryLink = $entryLink; + } + /** + * @return string + */ + public function getEntryLink() + { + return $this->entryLink; + } + /** + * Output only. The entry link type to represent the current relationship + * between the entry and the next entry in the path. In the form of: projects/ + * {project_id_or_number}/locations/{location_id}/entryLinkTypes/{entry_link_t + * ype_id} + * + * @param string $entryLinkType + */ + public function setEntryLinkType($entryLinkType) + { + $this->entryLinkType = $entryLinkType; + } + /** + * @return string + */ + public function getEntryLinkType() + { + return $this->entryLinkType; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GoogleCloudDataplexV1DataQualityRuleRuleSourceRulePathElementEntryLinkSource::class, 'Google_Service_CloudDataplex_GoogleCloudDataplexV1DataQualityRuleRuleSourceRulePathElementEntryLinkSource'); diff --git a/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleRuleSourceRulePathElementEntrySource.php b/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleRuleSourceRulePathElementEntrySource.php new file mode 100644 index 0000000000..3fdfbcf17a --- /dev/null +++ b/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleRuleSourceRulePathElementEntrySource.php @@ -0,0 +1,100 @@ +displayName = $displayName; + } + /** + * @return string + */ + public function getDisplayName() + { + return $this->displayName; + } + /** + * Output only. The entry name in the form of: projects/{project_id_or_number} + * /locations/{location_id}/entryGroups/{entry_group_id}/entries/{entry_id} + * + * @param string $entry + */ + public function setEntry($entry) + { + $this->entry = $entry; + } + /** + * @return string + */ + public function getEntry() + { + return $this->entry; + } + /** + * Output only. The entry type to represent the current characteristics of the + * entry in the form of: + * projects/{project_id_or_number}/locations/{location_id}/entryTypes/{entry- + * type-id}. + * + * @param string $entryType + */ + public function setEntryType($entryType) + { + $this->entryType = $entryType; + } + /** + * @return string + */ + public function getEntryType() + { + return $this->entryType; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GoogleCloudDataplexV1DataQualityRuleRuleSourceRulePathElementEntrySource::class, 'Google_Service_CloudDataplex_GoogleCloudDataplexV1DataQualityRuleRuleSourceRulePathElementEntrySource'); diff --git a/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleTemplate.php b/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleTemplate.php new file mode 100644 index 0000000000..96aefd9f53 --- /dev/null +++ b/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleTemplate.php @@ -0,0 +1,138 @@ +capabilities = $capabilities; + } + /** + * @return string[] + */ + public function getCapabilities() + { + return $this->capabilities; + } + /** + * Output only. The dimension a rule template belongs to. Rule level results + * are also aggregated at the dimension level. + * + * @param string $dimension + */ + public function setDimension($dimension) + { + $this->dimension = $dimension; + } + /** + * @return string + */ + public function getDimension() + { + return $this->dimension; + } + /** + * Output only. Description for input parameters + * + * @param GoogleCloudDataplexV1DataQualityRuleTemplateParameterDescription[] $inputParameters + */ + public function setInputParameters($inputParameters) + { + $this->inputParameters = $inputParameters; + } + /** + * @return GoogleCloudDataplexV1DataQualityRuleTemplateParameterDescription[] + */ + public function getInputParameters() + { + return $this->inputParameters; + } + /** + * Output only. The name of the rule template in the format: projects/{project + * _id_or_number}/locations/{location_id}/entryGroups/{entry_group_id}/entries + * /{entry_id} + * + * @param string $name + */ + public function setName($name) + { + $this->name = $name; + } + /** + * @return string + */ + public function getName() + { + return $this->name; + } + /** + * Output only. Collection of SQLs for data quality rules. Currently only one + * SQL is supported. + * + * @param GoogleCloudDataplexV1DataQualityRuleTemplateSql[] $sqlCollection + */ + public function setSqlCollection($sqlCollection) + { + $this->sqlCollection = $sqlCollection; + } + /** + * @return GoogleCloudDataplexV1DataQualityRuleTemplateSql[] + */ + public function getSqlCollection() + { + return $this->sqlCollection; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GoogleCloudDataplexV1DataQualityRuleTemplate::class, 'Google_Service_CloudDataplex_GoogleCloudDataplexV1DataQualityRuleTemplate'); diff --git a/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleTemplateParameterDescription.php b/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleTemplateParameterDescription.php new file mode 100644 index 0000000000..ecfa0ccec6 --- /dev/null +++ b/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleTemplateParameterDescription.php @@ -0,0 +1,74 @@ +defaultValue = $defaultValue; + } + /** + * @return string + */ + public function getDefaultValue() + { + return $this->defaultValue; + } + /** + * Output only. Description of the input parameter. It can include the type(s) + * supported by the parameter and intended usage. It is for information + * purposes only and does not affect the behavior of the rule template. + * + * @param string $description + */ + public function setDescription($description) + { + $this->description = $description; + } + /** + * @return string + */ + public function getDescription() + { + return $this->description; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GoogleCloudDataplexV1DataQualityRuleTemplateParameterDescription::class, 'Google_Service_CloudDataplex_GoogleCloudDataplexV1DataQualityRuleTemplateParameterDescription'); diff --git a/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleTemplateReference.php b/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleTemplateReference.php new file mode 100644 index 0000000000..d05d05d6ed --- /dev/null +++ b/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleTemplateReference.php @@ -0,0 +1,120 @@ +name = $name; + } + /** + * @return string + */ + public function getName() + { + return $this->name; + } + /** + * Output only. The resolved SQL statement generated from the template with + * parameters substituted. It is only populated in the result. + * + * @param string $resolvedSql + */ + public function setResolvedSql($resolvedSql) + { + $this->resolvedSql = $resolvedSql; + } + /** + * @return string + */ + public function getResolvedSql() + { + return $this->resolvedSql; + } + /** + * Output only. The rule template used to resolve the rule. It is only + * populated in the result. + * + * @param GoogleCloudDataplexV1DataQualityRuleTemplate $ruleTemplate + */ + public function setRuleTemplate(GoogleCloudDataplexV1DataQualityRuleTemplate $ruleTemplate) + { + $this->ruleTemplate = $ruleTemplate; + } + /** + * @return GoogleCloudDataplexV1DataQualityRuleTemplate + */ + public function getRuleTemplate() + { + return $this->ruleTemplate; + } + /** + * Optional. Provides the map of parameter name and value. The maximum size of + * the field is 120KB (encoded as UTF-8). + * + * @param GoogleCloudDataplexV1DataQualityRuleTemplateReferenceParameterValue[] $values + */ + public function setValues($values) + { + $this->values = $values; + } + /** + * @return GoogleCloudDataplexV1DataQualityRuleTemplateReferenceParameterValue[] + */ + public function getValues() + { + return $this->values; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GoogleCloudDataplexV1DataQualityRuleTemplateReference::class, 'Google_Service_CloudDataplex_GoogleCloudDataplexV1DataQualityRuleTemplateReference'); diff --git a/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleTemplateReferenceParameterValue.php b/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleTemplateReferenceParameterValue.php new file mode 100644 index 0000000000..a36363b654 --- /dev/null +++ b/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleTemplateReferenceParameterValue.php @@ -0,0 +1,48 @@ +value = $value; + } + /** + * @return string + */ + public function getValue() + { + return $this->value; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GoogleCloudDataplexV1DataQualityRuleTemplateReferenceParameterValue::class, 'Google_Service_CloudDataplex_GoogleCloudDataplexV1DataQualityRuleTemplateReferenceParameterValue'); diff --git a/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleTemplateSql.php b/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleTemplateSql.php new file mode 100644 index 0000000000..73e0192fd4 --- /dev/null +++ b/src/CloudDataplex/GoogleCloudDataplexV1DataQualityRuleTemplateSql.php @@ -0,0 +1,48 @@ +query = $query; + } + /** + * @return string + */ + public function getQuery() + { + return $this->query; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GoogleCloudDataplexV1DataQualityRuleTemplateSql::class, 'Google_Service_CloudDataplex_GoogleCloudDataplexV1DataQualityRuleTemplateSql'); diff --git a/src/CloudDataplex/GoogleCloudDataplexV1DataQualityScanRuleResult.php b/src/CloudDataplex/GoogleCloudDataplexV1DataQualityScanRuleResult.php index 0d1e75b026..fecd6a733d 100644 --- a/src/CloudDataplex/GoogleCloudDataplexV1DataQualityScanRuleResult.php +++ b/src/CloudDataplex/GoogleCloudDataplexV1DataQualityScanRuleResult.php @@ -83,6 +83,10 @@ class GoogleCloudDataplexV1DataQualityScanRuleResult extends \Google\Model * See DataQualityRule.SqlAssertion. */ public const RULE_TYPE_SQL_ASSERTION = 'SQL_ASSERTION'; + /** + * See DataQualityRule.TemplateReference. + */ + public const RULE_TYPE_TEMPLATE_REFERENCE = 'TEMPLATE_REFERENCE'; /** * The number of rows returned by the SQL statement in a SQL assertion rule. * This field is only valid for SQL assertion rules. @@ -354,7 +358,7 @@ public function getRuleName() * Accepted values: RULE_TYPE_UNSPECIFIED, NON_NULL_EXPECTATION, * RANGE_EXPECTATION, REGEX_EXPECTATION, ROW_CONDITION_EXPECTATION, * SET_EXPECTATION, STATISTIC_RANGE_EXPECTATION, TABLE_CONDITION_EXPECTATION, - * UNIQUENESS_EXPECTATION, SQL_ASSERTION + * UNIQUENESS_EXPECTATION, SQL_ASSERTION, TEMPLATE_REFERENCE * * @param self::RULE_TYPE_* $ruleType */ diff --git a/src/CloudDataplex/GoogleCloudDataplexV1DataQualitySpec.php b/src/CloudDataplex/GoogleCloudDataplexV1DataQualitySpec.php index b5b2d5f463..178bff670b 100644 --- a/src/CloudDataplex/GoogleCloudDataplexV1DataQualitySpec.php +++ b/src/CloudDataplex/GoogleCloudDataplexV1DataQualitySpec.php @@ -27,6 +27,33 @@ class GoogleCloudDataplexV1DataQualitySpec extends \Google\Collection * @var bool */ public $catalogPublishingEnabled; + /** + * Optional. If enabled, the data scan will retrieve rules defined in the + * dataplex-types.global.data-rules aspect on all paths of the catalog entry + * corresponding to the BigQuery table resource and all attached glossary + * terms. The path that data-rules aspect is attached on the table entry + * defines the column that the rule will be evaluated against. For glossary + * terms, the path that the terms are attached on the table entry defines the + * column that the rule will be evaluated against. At the start of scan + * execution, the rules reflect the latest state retrieved from the catalog + * entry and any updates on the rules thereafter are ignored for that + * execution. The updates will be reflected from the next execution. Rules + * defined in the datascan must be empty if this field is enabled. + * + * @var bool + */ + public $enableCatalogBasedRules; + /** + * Optional. Filter for selectively running a subset of rules. You can filter + * the request by the name or attribute key-value pairs defined on the rule. + * If not specified, all rules are run. The filter is applicable to both, the + * rules retrieved from catalog and explicitly defined rules in the scan. + * Please see filter syntax (https://docs.cloud.google.com/dataplex/docs/auto- + * data-quality-overview#rule-filtering) for more details. + * + * @var string + */ + public $filter; protected $postScanActionsType = GoogleCloudDataplexV1DataQualitySpecPostScanActions::class; protected $postScanActionsDataType = ''; /** @@ -67,6 +94,53 @@ public function getCatalogPublishingEnabled() { return $this->catalogPublishingEnabled; } + /** + * Optional. If enabled, the data scan will retrieve rules defined in the + * dataplex-types.global.data-rules aspect on all paths of the catalog entry + * corresponding to the BigQuery table resource and all attached glossary + * terms. The path that data-rules aspect is attached on the table entry + * defines the column that the rule will be evaluated against. For glossary + * terms, the path that the terms are attached on the table entry defines the + * column that the rule will be evaluated against. At the start of scan + * execution, the rules reflect the latest state retrieved from the catalog + * entry and any updates on the rules thereafter are ignored for that + * execution. The updates will be reflected from the next execution. Rules + * defined in the datascan must be empty if this field is enabled. + * + * @param bool $enableCatalogBasedRules + */ + public function setEnableCatalogBasedRules($enableCatalogBasedRules) + { + $this->enableCatalogBasedRules = $enableCatalogBasedRules; + } + /** + * @return bool + */ + public function getEnableCatalogBasedRules() + { + return $this->enableCatalogBasedRules; + } + /** + * Optional. Filter for selectively running a subset of rules. You can filter + * the request by the name or attribute key-value pairs defined on the rule. + * If not specified, all rules are run. The filter is applicable to both, the + * rules retrieved from catalog and explicitly defined rules in the scan. + * Please see filter syntax (https://docs.cloud.google.com/dataplex/docs/auto- + * data-quality-overview#rule-filtering) for more details. + * + * @param string $filter + */ + public function setFilter($filter) + { + $this->filter = $filter; + } + /** + * @return string + */ + public function getFilter() + { + return $this->filter; + } /** * Optional. Actions to take upon job completion. * diff --git a/src/CloudDataplex/Resource/ProjectsLocationsDataScansJobs.php b/src/CloudDataplex/Resource/ProjectsLocationsDataScansJobs.php index aa4ba80c60..65625af161 100644 --- a/src/CloudDataplex/Resource/ProjectsLocationsDataScansJobs.php +++ b/src/CloudDataplex/Resource/ProjectsLocationsDataScansJobs.php @@ -17,6 +17,8 @@ namespace Google\Service\CloudDataplex\Resource; +use Google\Service\CloudDataplex\GoogleCloudDataplexV1CancelDataScanJobRequest; +use Google\Service\CloudDataplex\GoogleCloudDataplexV1CancelDataScanJobResponse; use Google\Service\CloudDataplex\GoogleCloudDataplexV1DataScanJob; use Google\Service\CloudDataplex\GoogleCloudDataplexV1GenerateDataQualityRulesRequest; use Google\Service\CloudDataplex\GoogleCloudDataplexV1GenerateDataQualityRulesResponse; @@ -32,6 +34,24 @@ */ class ProjectsLocationsDataScansJobs extends \Google\Service\Resource { + /** + * Cancels a running/pending DataScan job. (jobs.cancel) + * + * @param string $name Required. The resource name of the DataScanJob: projects/ + * {project_id_or_number}/locations/{location_id}/dataScans/{data_scan_id}/jobs/ + * {data_scan_job_id} where project_id_or_number refers to a project_id or + * project_number and location_id refers to a Google Cloud region. + * @param GoogleCloudDataplexV1CancelDataScanJobRequest $postBody + * @param array $optParams Optional parameters. + * @return GoogleCloudDataplexV1CancelDataScanJobResponse + * @throws \Google\Service\Exception + */ + public function cancel($name, GoogleCloudDataplexV1CancelDataScanJobRequest $postBody, $optParams = []) + { + $params = ['name' => $name, 'postBody' => $postBody]; + $params = array_merge($params, $optParams); + return $this->call('cancel', [$params], GoogleCloudDataplexV1CancelDataScanJobResponse::class); + } /** * Generates recommended data quality rules based on the results of a data * profiling scan.Use the recommendations to build rules for a data quality