Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit 296962a

Browse files
fix(datastream): Change a few resource pattern variables from camelCase to snake_case (#20)
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 393705818 Source-Link: googleapis/googleapis@9e99074 Source-Link: https://github.com/googleapis/googleapis-gen/commit/1eee1fcf28b8d8557bd8358d00181ebefffc4a7d
1 parent 4588eab commit 296962a

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

google/cloud/datastream_v1alpha1/services/datastream/client.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -161,57 +161,57 @@ def transport(self) -> DatastreamTransport:
161161

162162
@staticmethod
163163
def connection_profile_path(
164-
project: str, location: str, connectionProfile: str,
164+
project: str, location: str, connection_profile: str,
165165
) -> str:
166166
"""Returns a fully-qualified connection_profile string."""
167-
return "projects/{project}/locations/{location}/connectionProfiles/{connectionProfile}".format(
168-
project=project, location=location, connectionProfile=connectionProfile,
167+
return "projects/{project}/locations/{location}/connectionProfiles/{connection_profile}".format(
168+
project=project, location=location, connection_profile=connection_profile,
169169
)
170170

171171
@staticmethod
172172
def parse_connection_profile_path(path: str) -> Dict[str, str]:
173173
"""Parses a connection_profile path into its component segments."""
174174
m = re.match(
175-
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/connectionProfiles/(?P<connectionProfile>.+?)$",
175+
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/connectionProfiles/(?P<connection_profile>.+?)$",
176176
path,
177177
)
178178
return m.groupdict() if m else {}
179179

180180
@staticmethod
181181
def private_connection_path(
182-
project: str, location: str, privateConnection: str,
182+
project: str, location: str, private_connection: str,
183183
) -> str:
184184
"""Returns a fully-qualified private_connection string."""
185-
return "projects/{project}/locations/{location}/privateConnections/{privateConnection}".format(
186-
project=project, location=location, privateConnection=privateConnection,
185+
return "projects/{project}/locations/{location}/privateConnections/{private_connection}".format(
186+
project=project, location=location, private_connection=private_connection,
187187
)
188188

189189
@staticmethod
190190
def parse_private_connection_path(path: str) -> Dict[str, str]:
191191
"""Parses a private_connection path into its component segments."""
192192
m = re.match(
193-
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/privateConnections/(?P<privateConnection>.+?)$",
193+
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/privateConnections/(?P<private_connection>.+?)$",
194194
path,
195195
)
196196
return m.groupdict() if m else {}
197197

198198
@staticmethod
199199
def route_path(
200-
project: str, location: str, privateConnection: str, route: str,
200+
project: str, location: str, private_connection: str, route: str,
201201
) -> str:
202202
"""Returns a fully-qualified route string."""
203-
return "projects/{project}/locations/{location}/privateConnections/{privateConnection}/routes/{route}".format(
203+
return "projects/{project}/locations/{location}/privateConnections/{private_connection}/routes/{route}".format(
204204
project=project,
205205
location=location,
206-
privateConnection=privateConnection,
206+
private_connection=private_connection,
207207
route=route,
208208
)
209209

210210
@staticmethod
211211
def parse_route_path(path: str) -> Dict[str, str]:
212212
"""Parses a route path into its component segments."""
213213
m = re.match(
214-
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/privateConnections/(?P<privateConnection>.+?)/routes/(?P<route>.+?)$",
214+
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/privateConnections/(?P<private_connection>.+?)/routes/(?P<route>.+?)$",
215215
path,
216216
)
217217
return m.groupdict() if m else {}

tests/unit/gapic/datastream_v1alpha1/test_datastream.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6046,12 +6046,12 @@ def test_datastream_grpc_lro_async_client():
60466046
def test_connection_profile_path():
60476047
project = "squid"
60486048
location = "clam"
6049-
connectionProfile = "whelk"
6050-
expected = "projects/{project}/locations/{location}/connectionProfiles/{connectionProfile}".format(
6051-
project=project, location=location, connectionProfile=connectionProfile,
6049+
connection_profile = "whelk"
6050+
expected = "projects/{project}/locations/{location}/connectionProfiles/{connection_profile}".format(
6051+
project=project, location=location, connection_profile=connection_profile,
60526052
)
60536053
actual = DatastreamClient.connection_profile_path(
6054-
project, location, connectionProfile
6054+
project, location, connection_profile
60556055
)
60566056
assert expected == actual
60576057

@@ -6060,7 +6060,7 @@ def test_parse_connection_profile_path():
60606060
expected = {
60616061
"project": "octopus",
60626062
"location": "oyster",
6063-
"connectionProfile": "nudibranch",
6063+
"connection_profile": "nudibranch",
60646064
}
60656065
path = DatastreamClient.connection_profile_path(**expected)
60666066

@@ -6072,12 +6072,12 @@ def test_parse_connection_profile_path():
60726072
def test_private_connection_path():
60736073
project = "cuttlefish"
60746074
location = "mussel"
6075-
privateConnection = "winkle"
6076-
expected = "projects/{project}/locations/{location}/privateConnections/{privateConnection}".format(
6077-
project=project, location=location, privateConnection=privateConnection,
6075+
private_connection = "winkle"
6076+
expected = "projects/{project}/locations/{location}/privateConnections/{private_connection}".format(
6077+
project=project, location=location, private_connection=private_connection,
60786078
)
60796079
actual = DatastreamClient.private_connection_path(
6080-
project, location, privateConnection
6080+
project, location, private_connection
60816081
)
60826082
assert expected == actual
60836083

@@ -6086,7 +6086,7 @@ def test_parse_private_connection_path():
60866086
expected = {
60876087
"project": "nautilus",
60886088
"location": "scallop",
6089-
"privateConnection": "abalone",
6089+
"private_connection": "abalone",
60906090
}
60916091
path = DatastreamClient.private_connection_path(**expected)
60926092

@@ -6098,23 +6098,23 @@ def test_parse_private_connection_path():
60986098
def test_route_path():
60996099
project = "squid"
61006100
location = "clam"
6101-
privateConnection = "whelk"
6101+
private_connection = "whelk"
61026102
route = "octopus"
6103-
expected = "projects/{project}/locations/{location}/privateConnections/{privateConnection}/routes/{route}".format(
6103+
expected = "projects/{project}/locations/{location}/privateConnections/{private_connection}/routes/{route}".format(
61046104
project=project,
61056105
location=location,
6106-
privateConnection=privateConnection,
6106+
private_connection=private_connection,
61076107
route=route,
61086108
)
6109-
actual = DatastreamClient.route_path(project, location, privateConnection, route)
6109+
actual = DatastreamClient.route_path(project, location, private_connection, route)
61106110
assert expected == actual
61116111

61126112

61136113
def test_parse_route_path():
61146114
expected = {
61156115
"project": "oyster",
61166116
"location": "nudibranch",
6117-
"privateConnection": "cuttlefish",
6117+
"private_connection": "cuttlefish",
61186118
"route": "mussel",
61196119
}
61206120
path = DatastreamClient.route_path(**expected)

0 commit comments

Comments
 (0)