Skip to content

Commit 8f4cad2

Browse files
yoshi-automationbusunkim96
authored andcommitted
fix(irm): deprecate resource name helper methods (via synth) (#9860)
1 parent 5aa2bcc commit 8f4cad2

File tree

4 files changed

+56
-15
lines changed

4 files changed

+56
-15
lines changed

irm/docs/_static/custom.css

+1-1
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+
}

irm/docs/_templates/layout.html

+1
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' %}

irm/google/cloud/irm_v1alpha2/gapic/incident_service_client.py

+48-8
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):
7777

7878
@classmethod
7979
def annotation_path(cls, project, incident, annotation):
80-
"""Return a fully-qualified annotation string."""
80+
"""DEPRECATED. Return a fully-qualified annotation string."""
81+
warnings.warn(
82+
"Resource name helper functions are deprecated.",
83+
PendingDeprecationWarning,
84+
stacklevel=1,
85+
)
8186
return google.api_core.path_template.expand(
8287
"projects/{project}/incidents/{incident}/annotations/{annotation}",
8388
project=project,
@@ -87,7 +92,12 @@ def annotation_path(cls, project, incident, annotation):
8792

8893
@classmethod
8994
def artifact_path(cls, project, incident, artifact):
90-
"""Return a fully-qualified artifact string."""
95+
"""DEPRECATED. Return a fully-qualified artifact string."""
96+
warnings.warn(
97+
"Resource name helper functions are deprecated.",
98+
PendingDeprecationWarning,
99+
stacklevel=1,
100+
)
91101
return google.api_core.path_template.expand(
92102
"projects/{project}/incidents/{incident}/artifacts/{artifact}",
93103
project=project,
@@ -97,7 +107,12 @@ def artifact_path(cls, project, incident, artifact):
97107

98108
@classmethod
99109
def incident_path(cls, project, incident):
100-
"""Return a fully-qualified incident string."""
110+
"""DEPRECATED. Return a fully-qualified incident string."""
111+
warnings.warn(
112+
"Resource name helper functions are deprecated.",
113+
PendingDeprecationWarning,
114+
stacklevel=1,
115+
)
101116
return google.api_core.path_template.expand(
102117
"projects/{project}/incidents/{incident}",
103118
project=project,
@@ -106,14 +121,24 @@ def incident_path(cls, project, incident):
106121

107122
@classmethod
108123
def project_path(cls, project):
109-
"""Return a fully-qualified project string."""
124+
"""DEPRECATED. Return a fully-qualified project string."""
125+
warnings.warn(
126+
"Resource name helper functions are deprecated.",
127+
PendingDeprecationWarning,
128+
stacklevel=1,
129+
)
110130
return google.api_core.path_template.expand(
111131
"projects/{project}", project=project
112132
)
113133

114134
@classmethod
115135
def role_assignment_path(cls, project, incident, role_assignment):
116-
"""Return a fully-qualified role_assignment string."""
136+
"""DEPRECATED. Return a fully-qualified role_assignment string."""
137+
warnings.warn(
138+
"Resource name helper functions are deprecated.",
139+
PendingDeprecationWarning,
140+
stacklevel=1,
141+
)
117142
return google.api_core.path_template.expand(
118143
"projects/{project}/incidents/{incident}/roleAssignments/{role_assignment}",
119144
project=project,
@@ -123,14 +148,24 @@ def role_assignment_path(cls, project, incident, role_assignment):
123148

124149
@classmethod
125150
def signal_path(cls, project, signal):
126-
"""Return a fully-qualified signal string."""
151+
"""DEPRECATED. Return a fully-qualified signal string."""
152+
warnings.warn(
153+
"Resource name helper functions are deprecated.",
154+
PendingDeprecationWarning,
155+
stacklevel=1,
156+
)
127157
return google.api_core.path_template.expand(
128158
"projects/{project}/signals/{signal}", project=project, signal=signal
129159
)
130160

131161
@classmethod
132162
def subscription_path(cls, project, incident, subscription):
133-
"""Return a fully-qualified subscription string."""
163+
"""DEPRECATED. Return a fully-qualified subscription string."""
164+
warnings.warn(
165+
"Resource name helper functions are deprecated.",
166+
PendingDeprecationWarning,
167+
stacklevel=1,
168+
)
134169
return google.api_core.path_template.expand(
135170
"projects/{project}/incidents/{incident}/subscriptions/{subscription}",
136171
project=project,
@@ -140,7 +175,12 @@ def subscription_path(cls, project, incident, subscription):
140175

141176
@classmethod
142177
def tag_path(cls, project, incident, tag):
143-
"""Return a fully-qualified tag string."""
178+
"""DEPRECATED. Return a fully-qualified tag string."""
179+
warnings.warn(
180+
"Resource name helper functions are deprecated.",
181+
PendingDeprecationWarning,
182+
stacklevel=1,
183+
)
144184
return google.api_core.path_template.expand(
145185
"projects/{project}/incidents/{incident}/tags/{tag}",
146186
project=project,

irm/synth.metadata

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
2-
"updateTime": "2019-10-05T12:26:52.725480Z",
2+
"updateTime": "2019-11-20T13:23:46.362060Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.38.0",
8-
"dockerImage": "googleapis/artman@sha256:0d2f8d429110aeb8d82df6550ef4ede59d40df9062d260a1580fce688b0512bf"
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": "ceb8e2fb12f048cc94caae532ef0b4cf026a78f3",
16-
"internalRef": "272971705"
15+
"sha": "16543773103e2619d2b5f52456264de5bb9be104",
16+
"internalRef": "281423227"
1717
}
1818
},
1919
{
2020
"template": {
2121
"name": "python_library",
2222
"origin": "synthtool.gcp",
23-
"version": "2019.5.2"
23+
"version": "2019.10.17"
2424
}
2525
}
2626
],

0 commit comments

Comments
 (0)