Skip to content

Commit

Permalink
Merge pull request #18 from Roborian/17--add-new-method-add_person_to…
Browse files Browse the repository at this point in the history
…_account

add new method: add_person_to_account
  • Loading branch information
savelkouls authored Apr 22, 2024
2 parents 6e23312 + 80749bf commit d78afa0
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/outsetapy/api/crm/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,24 @@ async def delete(self, uid: str) -> None:
if not response.ok:
raise Exception(response)
return None


async def add_person_to_account(
self, account_uid: str, email: str, first_name: str, last_name: str
) -> Union[None, ValidationError[Account]]:
request = (
Request(self.store, f"crm/accounts/{account_uid}/memberships?sendWelcomeEmail=true")
.authenticate_as_server()
.with_body(
{
"Account": {"Uid": account_uid},
"Person": {"Email": email, "FirstName": first_name, "LastName": last_name},
"IsPrimary": "false",
}
)
)
response = request.post()
return response

async def extend_trial(
self, uid: str, date: datetime
) -> Union[None, ValidationError[Subscription]]:
Expand Down

0 comments on commit d78afa0

Please sign in to comment.