Skip to content

Commit 909e026

Browse files
yoshi-automationbusunkim96
authored andcommitted
fix(vision): deprecate resource name helper methods (via synth) (#9866)
1 parent bd5318a commit 909e026

File tree

6 files changed

+79
-18
lines changed

6 files changed

+79
-18
lines changed

vision/docs/_static/custom.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
div#python2-eol {
22
border-color: red;
33
border-width: medium;
4-
}
4+
}

vision/docs/_templates/layout.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
{% extends "!layout.html" %}
23
{%- block content %}
34
{%- if theme_fixed_sidebar|lower == 'true' %}

vision/google/cloud/vision_v1/gapic/product_search_client.py

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):
9696

9797
@classmethod
9898
def location_path(cls, project, location):
99-
"""Return a fully-qualified location string."""
99+
"""DEPRECATED. Return a fully-qualified location string."""
100+
warnings.warn(
101+
"Resource name helper functions are deprecated.",
102+
PendingDeprecationWarning,
103+
stacklevel=1,
104+
)
100105
return google.api_core.path_template.expand(
101106
"projects/{project}/locations/{location}",
102107
project=project,
@@ -105,7 +110,12 @@ def location_path(cls, project, location):
105110

106111
@classmethod
107112
def product_path(cls, project, location, product):
108-
"""Return a fully-qualified product string."""
113+
"""DEPRECATED. Return a fully-qualified product string."""
114+
warnings.warn(
115+
"Resource name helper functions are deprecated.",
116+
PendingDeprecationWarning,
117+
stacklevel=1,
118+
)
109119
return google.api_core.path_template.expand(
110120
"projects/{project}/locations/{location}/products/{product}",
111121
project=project,
@@ -115,7 +125,12 @@ def product_path(cls, project, location, product):
115125

116126
@classmethod
117127
def product_set_path(cls, project, location, product_set):
118-
"""Return a fully-qualified product_set string."""
128+
"""DEPRECATED. Return a fully-qualified product_set string."""
129+
warnings.warn(
130+
"Resource name helper functions are deprecated.",
131+
PendingDeprecationWarning,
132+
stacklevel=1,
133+
)
119134
return google.api_core.path_template.expand(
120135
"projects/{project}/locations/{location}/productSets/{product_set}",
121136
project=project,
@@ -125,7 +140,12 @@ def product_set_path(cls, project, location, product_set):
125140

126141
@classmethod
127142
def reference_image_path(cls, project, location, product, reference_image):
128-
"""Return a fully-qualified reference_image string."""
143+
"""DEPRECATED. Return a fully-qualified reference_image string."""
144+
warnings.warn(
145+
"Resource name helper functions are deprecated.",
146+
PendingDeprecationWarning,
147+
stacklevel=1,
148+
)
129149
return google.api_core.path_template.expand(
130150
"projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}",
131151
project=project,

vision/google/cloud/vision_v1p3beta1/gapic/product_search_client.py

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):
9393

9494
@classmethod
9595
def location_path(cls, project, location):
96-
"""Return a fully-qualified location string."""
96+
"""DEPRECATED. Return a fully-qualified location string."""
97+
warnings.warn(
98+
"Resource name helper functions are deprecated.",
99+
PendingDeprecationWarning,
100+
stacklevel=1,
101+
)
97102
return google.api_core.path_template.expand(
98103
"projects/{project}/locations/{location}",
99104
project=project,
@@ -102,7 +107,12 @@ def location_path(cls, project, location):
102107

103108
@classmethod
104109
def product_path(cls, project, location, product):
105-
"""Return a fully-qualified product string."""
110+
"""DEPRECATED. Return a fully-qualified product string."""
111+
warnings.warn(
112+
"Resource name helper functions are deprecated.",
113+
PendingDeprecationWarning,
114+
stacklevel=1,
115+
)
106116
return google.api_core.path_template.expand(
107117
"projects/{project}/locations/{location}/products/{product}",
108118
project=project,
@@ -112,7 +122,12 @@ def product_path(cls, project, location, product):
112122

113123
@classmethod
114124
def product_set_path(cls, project, location, product_set):
115-
"""Return a fully-qualified product_set string."""
125+
"""DEPRECATED. Return a fully-qualified product_set string."""
126+
warnings.warn(
127+
"Resource name helper functions are deprecated.",
128+
PendingDeprecationWarning,
129+
stacklevel=1,
130+
)
116131
return google.api_core.path_template.expand(
117132
"projects/{project}/locations/{location}/productSets/{product_set}",
118133
project=project,
@@ -122,7 +137,12 @@ def product_set_path(cls, project, location, product_set):
122137

123138
@classmethod
124139
def reference_image_path(cls, project, location, product, reference_image):
125-
"""Return a fully-qualified reference_image string."""
140+
"""DEPRECATED. Return a fully-qualified reference_image string."""
141+
warnings.warn(
142+
"Resource name helper functions are deprecated.",
143+
PendingDeprecationWarning,
144+
stacklevel=1,
145+
)
126146
return google.api_core.path_template.expand(
127147
"projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}",
128148
project=project,

vision/google/cloud/vision_v1p4beta1/gapic/product_search_client.py

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):
9494

9595
@classmethod
9696
def location_path(cls, project, location):
97-
"""Return a fully-qualified location string."""
97+
"""DEPRECATED. Return a fully-qualified location string."""
98+
warnings.warn(
99+
"Resource name helper functions are deprecated.",
100+
PendingDeprecationWarning,
101+
stacklevel=1,
102+
)
98103
return google.api_core.path_template.expand(
99104
"projects/{project}/locations/{location}",
100105
project=project,
@@ -103,7 +108,12 @@ def location_path(cls, project, location):
103108

104109
@classmethod
105110
def product_path(cls, project, location, product):
106-
"""Return a fully-qualified product string."""
111+
"""DEPRECATED. Return a fully-qualified product string."""
112+
warnings.warn(
113+
"Resource name helper functions are deprecated.",
114+
PendingDeprecationWarning,
115+
stacklevel=1,
116+
)
107117
return google.api_core.path_template.expand(
108118
"projects/{project}/locations/{location}/products/{product}",
109119
project=project,
@@ -113,7 +123,12 @@ def product_path(cls, project, location, product):
113123

114124
@classmethod
115125
def product_set_path(cls, project, location, product_set):
116-
"""Return a fully-qualified product_set string."""
126+
"""DEPRECATED. Return a fully-qualified product_set string."""
127+
warnings.warn(
128+
"Resource name helper functions are deprecated.",
129+
PendingDeprecationWarning,
130+
stacklevel=1,
131+
)
117132
return google.api_core.path_template.expand(
118133
"projects/{project}/locations/{location}/productSets/{product_set}",
119134
project=project,
@@ -123,7 +138,12 @@ def product_set_path(cls, project, location, product_set):
123138

124139
@classmethod
125140
def reference_image_path(cls, project, location, product, reference_image):
126-
"""Return a fully-qualified reference_image string."""
141+
"""DEPRECATED. Return a fully-qualified reference_image string."""
142+
warnings.warn(
143+
"Resource name helper functions are deprecated.",
144+
PendingDeprecationWarning,
145+
stacklevel=1,
146+
)
127147
return google.api_core.path_template.expand(
128148
"projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}",
129149
project=project,

vision/synth.metadata

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"updateTime": "2019-11-06T13:44:16.072107Z",
2+
"updateTime": "2019-11-20T13:38:24.545550Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.41.0",
8-
"dockerImage": "googleapis/artman@sha256:75b38a3b073a7b243545f2332463096624c802bb1e56b8cb6f22ba1ecd325fa9"
7+
"version": "0.42.1",
8+
"dockerImage": "googleapis/artman@sha256:c773192618c608a7a0415dd95282f841f8e6bcdef7dd760a988c93b77a64bd57"
99
}
1010
},
1111
{
1212
"git": {
1313
"name": "googleapis",
1414
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "5691fcb7c1a926b52577aa1834f31d9c50efda54",
16-
"internalRef": "278731899"
15+
"sha": "16543773103e2619d2b5f52456264de5bb9be104",
16+
"internalRef": "281423227"
1717
}
1818
},
1919
{

0 commit comments

Comments
 (0)