Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [Dataplex] introduce DataScans service #5391

Merged
merged 17 commits into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified Dataplex/metadata/V1/Content.php
Binary file not shown.
Binary file added Dataplex/metadata/V1/DataProfile.php
Binary file not shown.
Binary file added Dataplex/metadata/V1/DataQuality.php
Binary file not shown.
Binary file added Dataplex/metadata/V1/Datascans.php
Binary file not shown.
Binary file modified Dataplex/metadata/V1/Logs.php
Binary file not shown.
Binary file modified Dataplex/metadata/V1/Metadata.php
Binary file not shown.
Binary file added Dataplex/metadata/V1/Processing.php
Binary file not shown.
7 changes: 4 additions & 3 deletions Dataplex/metadata/V1/Service.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Dataplex/metadata/V1/Tasks.php
Binary file not shown.
81 changes: 81 additions & 0 deletions Dataplex/samples/V1/ContentServiceClient/create_content.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?php
/*
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* GENERATED CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START dataplex_v1_generated_ContentService_CreateContent_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\Content;
use Google\Cloud\Dataplex\V1\ContentServiceClient;

/**
* Create a content.
*
* @param string $formattedParent The resource name of the parent lake:
* projects/{project_id}/locations/{location_id}/lakes/{lake_id}
* Please see {@see ContentServiceClient::lakeName()} for help formatting this field.
* @param string $contentPath The path for the Content file, represented as directory
* structure. Unique within a lake. Limited to alphanumerics, hyphens,
* underscores, dots and slashes.
* @param string $contentDataText Content data in string format.
*/
function create_content_sample(
string $formattedParent,
string $contentPath,
string $contentDataText
): void {
// Create a client.
$contentServiceClient = new ContentServiceClient();

// Prepare any non-scalar elements to be passed along with the request.
$content = (new Content())
->setPath($contentPath)
->setDataText($contentDataText);

// Call the API and handle any network failures.
try {
/** @var Content $response */
$response = $contentServiceClient->createContent($formattedParent, $content);
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
{
$formattedParent = ContentServiceClient::lakeName('[PROJECT]', '[LOCATION]', '[LAKE]');
$contentPath = '[PATH]';
$contentDataText = '[DATA_TEXT]';

create_content_sample($formattedParent, $contentPath, $contentDataText);
}
// [END dataplex_v1_generated_ContentService_CreateContent_sync]
70 changes: 70 additions & 0 deletions Dataplex/samples/V1/ContentServiceClient/delete_content.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?php
/*
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* GENERATED CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START dataplex_v1_generated_ContentService_DeleteContent_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\ContentServiceClient;

/**
* Delete a content.
*
* @param string $formattedName The resource name of the content:
* projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id}
* Please see {@see ContentServiceClient::contentName()} for help formatting this field.
*/
function delete_content_sample(string $formattedName): void
{
// Create a client.
$contentServiceClient = new ContentServiceClient();

// Call the API and handle any network failures.
try {
$contentServiceClient->deleteContent($formattedName);
printf('Call completed successfully.' . PHP_EOL);
} 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 = ContentServiceClient::contentName(
'[PROJECT]',
'[LOCATION]',
'[LAKE]',
'[CONTENT]'
);

delete_content_sample($formattedName);
}
// [END dataplex_v1_generated_ContentService_DeleteContent_sync]
72 changes: 72 additions & 0 deletions Dataplex/samples/V1/ContentServiceClient/get_content.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php
/*
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* GENERATED CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START dataplex_v1_generated_ContentService_GetContent_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\Content;
use Google\Cloud\Dataplex\V1\ContentServiceClient;

/**
* Get a content resource.
*
* @param string $formattedName The resource name of the content:
* projects/{project_id}/locations/{location_id}/lakes/{lake_id}/content/{content_id}
* Please see {@see ContentServiceClient::contentName()} for help formatting this field.
*/
function get_content_sample(string $formattedName): void
{
// Create a client.
$contentServiceClient = new ContentServiceClient();

// Call the API and handle any network failures.
try {
/** @var Content $response */
$response = $contentServiceClient->getContent($formattedName);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}

/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$formattedName = ContentServiceClient::contentName(
'[PROJECT]',
'[LOCATION]',
'[LAKE]',
'[CONTENT]'
);

get_content_sample($formattedName);
}
// [END dataplex_v1_generated_ContentService_GetContent_sync]
67 changes: 67 additions & 0 deletions Dataplex/samples/V1/ContentServiceClient/get_iam_policy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php
/*
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* GENERATED CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START dataplex_v1_generated_ContentService_GetIamPolicy_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\ContentServiceClient;
use Google\Cloud\Iam\V1\Policy;

/**
* Gets the access control policy for a resource. Returns an empty policy
if the resource exists and does not have a policy set.
*
* @param string $resource REQUIRED: The resource for which the policy is being requested.
* See the operation documentation for the appropriate value for this field.
*/
function get_iam_policy_sample(string $resource): void
{
// Create a client.
$contentServiceClient = new ContentServiceClient();

// Call the API and handle any network failures.
try {
/** @var Policy $response */
$response = $contentServiceClient->getIamPolicy($resource);
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
{
$resource = '[RESOURCE]';

get_iam_policy_sample($resource);
}
// [END dataplex_v1_generated_ContentService_GetIamPolicy_sync]
53 changes: 53 additions & 0 deletions Dataplex/samples/V1/ContentServiceClient/get_location.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php
/*
* Copyright 2022 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* GENERATED CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START dataplex_v1_generated_ContentService_GetLocation_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\Dataplex\V1\ContentServiceClient;
use Google\Cloud\Location\Location;

/**
* Gets information about a location.
*
* 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 get_location_sample(): void
{
// Create a client.
$contentServiceClient = new ContentServiceClient();

// Call the API and handle any network failures.
try {
/** @var Location $response */
$response = $contentServiceClient->getLocation();
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
// [END dataplex_v1_generated_ContentService_GetLocation_sync]
Loading