Skip to content

Commit f899b62

Browse files
authored
Change build_api_url to an instance method. (#8747)
1 parent f69ad9a commit f899b62

File tree

1 file changed

+4
-7
lines changed
  • packages/google-cloud-core/google/cloud

1 file changed

+4
-7
lines changed

packages/google-cloud-core/google/cloud/_http.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,6 @@ class JSONConnection(Connection):
159159
This defines :meth:`api_request` for making a generic JSON
160160
API request and API requests are created elsewhere.
161161
162-
The class constants
163-
164162
* :attr:`API_BASE_URL`
165163
* :attr:`API_VERSION`
166164
* :attr:`API_URL_TEMPLATE`
@@ -177,9 +175,8 @@ class JSONConnection(Connection):
177175
API_URL_TEMPLATE = None
178176
"""A template for the URL of a particular API call."""
179177

180-
@classmethod
181178
def build_api_url(
182-
cls, path, query_params=None, api_base_url=None, api_version=None
179+
self, path, query_params=None, api_base_url=None, api_version=None
183180
):
184181
"""Construct an API url given a few components, some optional.
185182
@@ -205,9 +202,9 @@ def build_api_url(
205202
:rtype: str
206203
:returns: The URL assembled from the pieces provided.
207204
"""
208-
url = cls.API_URL_TEMPLATE.format(
209-
api_base_url=(api_base_url or cls.API_BASE_URL),
210-
api_version=(api_version or cls.API_VERSION),
205+
url = self.API_URL_TEMPLATE.format(
206+
api_base_url=(api_base_url or self.API_BASE_URL),
207+
api_version=(api_version or self.API_VERSION),
211208
path=path,
212209
)
213210

0 commit comments

Comments
 (0)