Skip to content

Commit

Permalink
Merge pull request #139 from GoogleCloudPlatform/fix/list_agents_loca…
Browse files Browse the repository at this point in the history
…tion_id

fix: revert change to location_id arg
  • Loading branch information
kmaphoenix authored Aug 17, 2023
2 parents 9292e21 + e651ff7 commit b9a8526
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dfcx_scrapi/core/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def _list_agents_client_request(self, location_id) -> List[
def list_agents(
self,
project_id: str,
location: str = None) -> List[types.Agent]:
location_id: str = None) -> List[types.Agent]:
"""Get list of all CX agents in a given GCP Region or Project.
This method allows you to provide a GCP Project ID to retrieve all of
Expand All @@ -101,7 +101,7 @@ def list_agents(
List of Agent objects
"""

if not location:
if not location_id:
region_list = [
"global",
"us-central1",
Expand All @@ -121,7 +121,7 @@ def list_agents(
agents += self._list_agents_client_request(location_path)

else:
location_path = f"projects/{project_id}/locations/{location}"
location_path = f"projects/{project_id}/locations/{location_id}"
agents = self._list_agents_client_request(location_path)

return agents
Expand Down

0 comments on commit b9a8526

Please sign in to comment.