Skip to content
Permalink
Browse files
feat(bigquerydatatransfer): undeprecate resource name helper methods;…
… add py2 deprecation warning; bump copyright year to 2020 (via synth) (#10226)
  • Loading branch information
yoshi-automation committed Jan 30, 2020
1 parent 9ca090a commit c0f9cc398e5558002c79a875809bb6cd1a98a8a4
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -16,12 +16,23 @@


from __future__ import absolute_import
import sys
import warnings

from google.cloud.bigquery_datatransfer_v1 import types
from google.cloud.bigquery_datatransfer_v1.gapic import data_transfer_service_client
from google.cloud.bigquery_datatransfer_v1.gapic import enums


if sys.version_info[:2] == (2, 7):
message = (
"A future version of this library will drop support for Python 2.7."
"More details about Python 2 support for Google Cloud Client Libraries"
"can be found at https://cloud.google.com/python/docs/python2-sunset/"
)
warnings.warn(message, DeprecationWarning)


class DataTransferServiceClient(data_transfer_service_client.DataTransferServiceClient):
__doc__ = data_transfer_service_client.DataTransferServiceClient.__doc__
enums = enums
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -90,12 +90,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):

@classmethod
def location_path(cls, project, location):
"""DEPRECATED. Return a fully-qualified location string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified location string."""
return google.api_core.path_template.expand(
"projects/{project}/locations/{location}",
project=project,
@@ -104,12 +99,7 @@ def location_path(cls, project, location):

@classmethod
def location_data_source_path(cls, project, location, data_source):
"""DEPRECATED. Return a fully-qualified location_data_source string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified location_data_source string."""
return google.api_core.path_template.expand(
"projects/{project}/locations/{location}/dataSources/{data_source}",
project=project,
@@ -119,12 +109,7 @@ def location_data_source_path(cls, project, location, data_source):

@classmethod
def location_run_path(cls, project, location, transfer_config, run):
"""DEPRECATED. Return a fully-qualified location_run string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified location_run string."""
return google.api_core.path_template.expand(
"projects/{project}/locations/{location}/transferConfigs/{transfer_config}/runs/{run}",
project=project,
@@ -135,12 +120,7 @@ def location_run_path(cls, project, location, transfer_config, run):

@classmethod
def location_transfer_config_path(cls, project, location, transfer_config):
"""DEPRECATED. Return a fully-qualified location_transfer_config string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified location_transfer_config string."""
return google.api_core.path_template.expand(
"projects/{project}/locations/{location}/transferConfigs/{transfer_config}",
project=project,
@@ -150,24 +130,14 @@ def location_transfer_config_path(cls, project, location, transfer_config):

@classmethod
def project_path(cls, project):
"""DEPRECATED. Return a fully-qualified project string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified project string."""
return google.api_core.path_template.expand(
"projects/{project}", project=project
)

@classmethod
def project_data_source_path(cls, project, data_source):
"""DEPRECATED. Return a fully-qualified project_data_source string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified project_data_source string."""
return google.api_core.path_template.expand(
"projects/{project}/dataSources/{data_source}",
project=project,
@@ -176,12 +146,7 @@ def project_data_source_path(cls, project, data_source):

@classmethod
def project_run_path(cls, project, transfer_config, run):
"""DEPRECATED. Return a fully-qualified project_run string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified project_run string."""
return google.api_core.path_template.expand(
"projects/{project}/transferConfigs/{transfer_config}/runs/{run}",
project=project,
@@ -191,12 +156,7 @@ def project_run_path(cls, project, transfer_config, run):

@classmethod
def project_transfer_config_path(cls, project, transfer_config):
"""DEPRECATED. Return a fully-qualified project_transfer_config string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
"""Return a fully-qualified project_transfer_config string."""
return google.api_core.path_template.expand(
"projects/{project}/transferConfigs/{transfer_config}",
project=project,
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

Some generated files are not rendered by default. Learn more.

@@ -30,11 +30,6 @@ option java_outer_classname = "TransferProto";
option java_package = "com.google.cloud.bigquery.datatransfer.v1";
option objc_class_prefix = "GCBDT";
option php_namespace = "Google\\Cloud\\BigQuery\\DataTransfer\\V1";
option (google.api.resource_definition) = {
type: "bigquerydatatransfer.google.com/Parent"
pattern: "projects/{project}"
pattern: "projects/{project}/locations/{location}"
};

// DEPRECATED. Represents data transfer type.
enum TransferType {
Loading

0 comments on commit c0f9cc3

Please sign in to comment.