Skip to content

Added new apis to workbook and datasource #1637

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

Closed
wants to merge 5 commits into from

Conversation

vchavatapalli
Copy link

No description provided.

Copy link

Thanks for the contribution! Unfortunately we can't verify the commit author(s): Vineeth Chavatapalli <v***@s***.com> SFDC\vchavatapalli <v***@s***.com>. One possible solution is to add that email to your GitHub account. Alternatively you can change your commits to another email and force push the change. After getting your commits associated with your GitHub account, refresh the status of this Pull Request.

Copy link
Contributor

@jorwoods jorwoods left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Unit tests are missing for these endpoints.
  2. Can you point to the docs where you found these endpoints that support updating multiple connections at a time? I don't see it anywhere.

@@ -319,6 +319,71 @@ def update_connection(
logger.info(f"Updated datasource item (ID: {datasource_item.id} & connection item {connection_item.id}")
return connection

@api(version="3.26")
def update_connections(
self, datasource_item: DatasourceItem, connection_luids: list[str], authentication_type: str, username: Optional[str] = None, password: Optional[str] = None, embed_password: Optional[bool] = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should accept an Iterable[ConnectionItem] rather than taking a list of ids and then Connection attributes as keyword args.

@@ -325,6 +325,72 @@ def update_connection(self, workbook_item: WorkbookItem, connection_item: Connec
logger.info(f"Updated workbook item (ID: {workbook_item.id} & connection item {connection_item.id})")
return connection

# Update workbook_connections
@api(version="3.26")
def update_connections(self, workbook_item: WorkbookItem, connection_luids: list[str], authentication_type: str, username: Optional[str] = None, password: Optional[str] = None, embed_password: Optional[bool] = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as datasource method.


url = f"{self.baseurl}/{datasource_item.id}/connections"

ts_request = Element("tsRequest")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating the XML payload belongs in the request_factory.

@@ -318,4 +318,4 @@ def interval(self, interval_values):
self._interval = interval_values

def _interval_type_pairs(self):
return [(IntervalItem.Occurrence.MonthDay, self.interval)]
return [(IntervalItem.Occurrence.MonthDay, str(day)) for day in self.interval]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants