Skip to content

Rename uses of 'instance' to 'workspace' #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions rapid_pro_tools/rapid_pro_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ def __init__(self, server, token):
"""
self.rapid_pro = TembaClient(server, token)

def get_instance_name(self):
def get_workspace_name(self):
"""
:return: The name of this instance.
:return: The name of this workspace.
:rtype: str
"""
return self.rapid_pro.get_org(retry_on_rate_exceed=True).name

def list_archives(self, archive_type=None):
"""
Lists all of the available archives on this instance.
Lists all of the available archives on this workspace.

Returns a list of objects with archive metadata. Pass one of these metadata objects into
`RapidProClient.get_archive` to download the archive itself. Note that the download links in the returned
Expand All @@ -50,7 +50,7 @@ def list_archives(self, archive_type=None):
:param archive_type: The type of archives to list (either 'message' or 'run') or None.
If None, lists both types of archive.
:type archive_type: str | None
:return: List of available archives on this instance.
:return: List of available archives on this workspace.
:rtype: list of temba_client.v2.types.Archive
"""
assert archive_type in {"message", "run"}
Expand Down Expand Up @@ -134,9 +134,9 @@ def get_flow_ids(self, flow_names):

def get_all_flow_ids(self):
"""
Gets all the flow ids currently available on the Rapid Pro instance.
Gets all the flow ids currently available on this Rapid Pro workspace.

:return: Ids of all flows on Rapid Pro instance.
:return: Ids of all flows on this Rapid Pro workspace.
:rtype: list of str
"""
return [f.uuid for f in self.rapid_pro.get_flows().all(retry_on_rate_exceed=True)]
Expand Down Expand Up @@ -231,7 +231,7 @@ def get_raw_messages(self, created_after_inclusive=None, created_before_exclusiv
created_before_exclusive=created_before_exclusive
)

log.info(f"Fetching messages from production Rapid Pro instance...")
log.info(f"Fetching messages from production Rapid Pro workspace...")
production_messages = self.rapid_pro.get_messages(after=created_after_inclusive, before=created_before_inclusive)\
.all(retry_on_rate_exceed=True)

Expand Down Expand Up @@ -463,7 +463,7 @@ def get_raw_runs(self, flow_id=None, last_modified_after_inclusive=None, last_mo
last_modified_before_exclusive=last_modified_before_exclusive
)

log.info(f"Fetching runs from production Rapid Pro instance...")
log.info(f"Fetching runs from production Rapid Pro workspace...")
production_runs = self.rapid_pro.get_runs(
flow=flow_id, after=last_modified_after_inclusive, before=last_modified_before_inclusive
).all(retry_on_rate_exceed=True)
Expand Down