Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 40340c9

Browse files
yoshi-automationbusunkim96
authored andcommitted
fix(monitoring): deprecate resource name helper methods; update docs configuration (via synth) (#9838)
1 parent d6d974e commit 40340c9

File tree

7 files changed

+101
-21
lines changed

7 files changed

+101
-21
lines changed

monitoring/google/cloud/monitoring_v3/gapic/alert_policy_service_client.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):
9090

9191
@classmethod
9292
def alert_policy_path(cls, project, alert_policy):
93-
"""Return a fully-qualified alert_policy string."""
93+
"""DEPRECATED. Return a fully-qualified alert_policy string."""
94+
warnings.warn(
95+
"Resource name helper functions are deprecated.",
96+
PendingDeprecationWarning,
97+
stacklevel=1,
98+
)
9499
return google.api_core.path_template.expand(
95100
"projects/{project}/alertPolicies/{alert_policy}",
96101
project=project,
@@ -99,7 +104,12 @@ def alert_policy_path(cls, project, alert_policy):
99104

100105
@classmethod
101106
def alert_policy_condition_path(cls, project, alert_policy, condition):
102-
"""Return a fully-qualified alert_policy_condition string."""
107+
"""DEPRECATED. Return a fully-qualified alert_policy_condition string."""
108+
warnings.warn(
109+
"Resource name helper functions are deprecated.",
110+
PendingDeprecationWarning,
111+
stacklevel=1,
112+
)
103113
return google.api_core.path_template.expand(
104114
"projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}",
105115
project=project,
@@ -109,7 +119,12 @@ def alert_policy_condition_path(cls, project, alert_policy, condition):
109119

110120
@classmethod
111121
def project_path(cls, project):
112-
"""Return a fully-qualified project string."""
122+
"""DEPRECATED. Return a fully-qualified project string."""
123+
warnings.warn(
124+
"Resource name helper functions are deprecated.",
125+
PendingDeprecationWarning,
126+
stacklevel=1,
127+
)
113128
return google.api_core.path_template.expand(
114129
"projects/{project}", project=project,
115130
)

monitoring/google/cloud/monitoring_v3/gapic/group_service_client.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,24 @@ def from_service_account_file(cls, filename, *args, **kwargs):
9595

9696
@classmethod
9797
def group_path(cls, project, group):
98-
"""Return a fully-qualified group string."""
98+
"""DEPRECATED. Return a fully-qualified group string."""
99+
warnings.warn(
100+
"Resource name helper functions are deprecated.",
101+
PendingDeprecationWarning,
102+
stacklevel=1,
103+
)
99104
return google.api_core.path_template.expand(
100105
"projects/{project}/groups/{group}", project=project, group=group,
101106
)
102107

103108
@classmethod
104109
def project_path(cls, project):
105-
"""Return a fully-qualified project string."""
110+
"""DEPRECATED. Return a fully-qualified project 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}", project=project,
108118
)

monitoring/google/cloud/monitoring_v3/gapic/metric_service_client.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):
9090

9191
@classmethod
9292
def metric_descriptor_path(cls, project, metric_descriptor):
93-
"""Return a fully-qualified metric_descriptor string."""
93+
"""DEPRECATED. Return a fully-qualified metric_descriptor string."""
94+
warnings.warn(
95+
"Resource name helper functions are deprecated.",
96+
PendingDeprecationWarning,
97+
stacklevel=1,
98+
)
9499
return google.api_core.path_template.expand(
95100
"projects/{project}/metricDescriptors/{metric_descriptor=**}",
96101
project=project,
@@ -99,7 +104,12 @@ def metric_descriptor_path(cls, project, metric_descriptor):
99104

100105
@classmethod
101106
def monitored_resource_descriptor_path(cls, project, monitored_resource_descriptor):
102-
"""Return a fully-qualified monitored_resource_descriptor string."""
107+
"""DEPRECATED. Return a fully-qualified monitored_resource_descriptor string."""
108+
warnings.warn(
109+
"Resource name helper functions are deprecated.",
110+
PendingDeprecationWarning,
111+
stacklevel=1,
112+
)
103113
return google.api_core.path_template.expand(
104114
"projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}",
105115
project=project,
@@ -108,7 +118,12 @@ def monitored_resource_descriptor_path(cls, project, monitored_resource_descript
108118

109119
@classmethod
110120
def project_path(cls, project):
111-
"""Return a fully-qualified project string."""
121+
"""DEPRECATED. Return a fully-qualified project string."""
122+
warnings.warn(
123+
"Resource name helper functions are deprecated.",
124+
PendingDeprecationWarning,
125+
stacklevel=1,
126+
)
112127
return google.api_core.path_template.expand(
113128
"projects/{project}", project=project,
114129
)

monitoring/google/cloud/monitoring_v3/gapic/notification_channel_service_client.py

Lines changed: 18 additions & 3 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 notification_channel_path(cls, project, notification_channel):
99-
"""Return a fully-qualified notification_channel string."""
99+
"""DEPRECATED. Return a fully-qualified notification_channel 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}/notificationChannels/{notification_channel}",
102107
project=project,
@@ -105,7 +110,12 @@ def notification_channel_path(cls, project, notification_channel):
105110

106111
@classmethod
107112
def notification_channel_descriptor_path(cls, project, channel_descriptor):
108-
"""Return a fully-qualified notification_channel_descriptor string."""
113+
"""DEPRECATED. Return a fully-qualified notification_channel_descriptor 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}/notificationChannelDescriptors/{channel_descriptor}",
111121
project=project,
@@ -114,7 +124,12 @@ def notification_channel_descriptor_path(cls, project, channel_descriptor):
114124

115125
@classmethod
116126
def project_path(cls, project):
117-
"""Return a fully-qualified project string."""
127+
"""DEPRECATED. Return a fully-qualified project string."""
128+
warnings.warn(
129+
"Resource name helper functions are deprecated.",
130+
PendingDeprecationWarning,
131+
stacklevel=1,
132+
)
118133
return google.api_core.path_template.expand(
119134
"projects/{project}", project=project,
120135
)

monitoring/google/cloud/monitoring_v3/gapic/service_monitoring_service_client.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,21 +101,36 @@ def from_service_account_file(cls, filename, *args, **kwargs):
101101

102102
@classmethod
103103
def project_path(cls, project):
104-
"""Return a fully-qualified project string."""
104+
"""DEPRECATED. Return a fully-qualified project string."""
105+
warnings.warn(
106+
"Resource name helper functions are deprecated.",
107+
PendingDeprecationWarning,
108+
stacklevel=1,
109+
)
105110
return google.api_core.path_template.expand(
106111
"projects/{project}", project=project,
107112
)
108113

109114
@classmethod
110115
def service_path(cls, project, service):
111-
"""Return a fully-qualified service string."""
116+
"""DEPRECATED. Return a fully-qualified service string."""
117+
warnings.warn(
118+
"Resource name helper functions are deprecated.",
119+
PendingDeprecationWarning,
120+
stacklevel=1,
121+
)
112122
return google.api_core.path_template.expand(
113123
"projects/{project}/services/{service}", project=project, service=service,
114124
)
115125

116126
@classmethod
117127
def service_level_objective_path(cls, project, service, service_level_objective):
118-
"""Return a fully-qualified service_level_objective string."""
128+
"""DEPRECATED. Return a fully-qualified service_level_objective 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}/services/{service}/serviceLevelObjectives/{service_level_objective}",
121136
project=project,

monitoring/google/cloud/monitoring_v3/gapic/uptime_check_service_client.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,24 @@ def from_service_account_file(cls, filename, *args, **kwargs):
108108

109109
@classmethod
110110
def project_path(cls, project):
111-
"""Return a fully-qualified project string."""
111+
"""DEPRECATED. Return a fully-qualified project string."""
112+
warnings.warn(
113+
"Resource name helper functions are deprecated.",
114+
PendingDeprecationWarning,
115+
stacklevel=1,
116+
)
112117
return google.api_core.path_template.expand(
113118
"projects/{project}", project=project,
114119
)
115120

116121
@classmethod
117122
def uptime_check_config_path(cls, project, uptime_check_config):
118-
"""Return a fully-qualified uptime_check_config string."""
123+
"""DEPRECATED. Return a fully-qualified uptime_check_config string."""
124+
warnings.warn(
125+
"Resource name helper functions are deprecated.",
126+
PendingDeprecationWarning,
127+
stacklevel=1,
128+
)
119129
return google.api_core.path_template.expand(
120130
"projects/{project}/uptimeCheckConfigs/{uptime_check_config}",
121131
project=project,

monitoring/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-14T13:26:57.703896Z",
2+
"updateTime": "2019-11-19T13:28:35.257420Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.41.1",
8-
"dockerImage": "googleapis/artman@sha256:545c758c76c3f779037aa259023ec3d1ef2d57d2c8cd00a222cb187d63ceac5e"
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": "4f747bda9b099b4426f495985680d16d0227fa5f",
16-
"internalRef": "280394936"
15+
"sha": "d8dd7fe8d5304f7bd1c52207703d7f27d5328c5a",
16+
"internalRef": "281088257"
1717
}
1818
},
1919
{

0 commit comments

Comments
 (0)