Skip to content

Commit

Permalink
fix: format files
Browse files Browse the repository at this point in the history
  • Loading branch information
sajarin committed Oct 25, 2023
1 parent 2e96706 commit 0768d3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
Attachments,
AttachmentsCompact,
CustomFields,
Portfolio,
PortfolioMemberships,
OrganizationExports,
Portfolio,
PortfolioMemberships,
Projects,
Sections,
SectionsCompact,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,12 @@ class Tags(WorkspaceRequestParamsRelatedStream):
def path(self, **kwargs) -> str:
return "tags"


class Portfolio(WorkspaceRequestParamsRelatedStream):
def path(self, **kwargs) -> str:
return "portfolios"


class PortfolioRelatedStream(AsanaStream, ABC):
"""
Stream Portfolio memberships depends on `portfolio`: argument in request.
Expand All @@ -273,15 +275,17 @@ class PortfolioRelatedStream(AsanaStream, ABC):
def stream_slices(self, **kwargs) -> Iterable[Optional[Mapping[str, Any]]]:
yield from self.read_slices_from_records(stream_class=Portfolio, slice_field="gid")


class PortfolioMemberships(PortfolioRelatedStream):
def path(self, **kwargs) -> str:
return "portfolio_memberships"

def request_params(self, stream_slice: Mapping[str, Any] = None, **kwargs) -> MutableMapping[str, Any]:
params = super().request_params(stream_slice=stream_slice, **kwargs)
params["portfolio"] = stream_slice["gid"]
return params


class Tasks(ProjectRelatedStream):
use_cache = True

Expand Down

0 comments on commit 0768d3c

Please sign in to comment.