Skip to content

Commit

Permalink
make departure_date optional (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
alanag13 committed Apr 22, 2020
1 parent 52d7991 commit 0a8881e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ how a consumer would use the library (e.g. adding unit tests, updating documenta
- Exceptions that inherit from `Py42HTTPError` now return the original `requests.Response` object on the exception's
`.response` property instead of a string representation of the `HTTPError` that was raised.

- `departure_date` is now an optional parameter for `sdk.detectionlists.departing_employee.add()`.

## 1.0.0 - 2020-04-21

### Changed
Expand Down
12 changes: 4 additions & 8 deletions src/py42/clients/detectionlists/departing_employee.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def __init__(self, session, user_context, detection_list_user_client):
self._user_context = user_context
self._detection_list_user_client = detection_list_user_client

def add(self, user_id, departure_date):
def add(self, user_id, departure_date=None):
"""Adds a user to the Departing Employees list. Creates a detection list user profile if one
didn't already exist.
`REST Documentation <https://ecm-east.us.code42.com/svc/swagger/index.html?urls.primaryName=v2#/>`__
Expand All @@ -25,7 +25,7 @@ def add(self, user_id, departure_date):
Args:
user_id (str or int): The Code42 userUid of the user you want to add to the departing
employees list.
departure_date (date): Date in YYYY-MM-DD format. Date is treated as UTC.
departure_date (str, optional): Date in YYYY-MM-DD format. Date is treated as UTC. Defaults to None.
Returns:
:class:`py42.response.Py42Response`
Expand Down Expand Up @@ -89,9 +89,7 @@ def _get_departing_employees_page(
}
return self._session.post(uri, data=json.dumps(data))

def get_all(
self, filter_type=u"OPEN", sort_key=u"CREATED_AT", sort_direction=u"DESC",
):
def get_all(self, filter_type=u"OPEN", sort_key=u"CREATED_AT", sort_direction=u"DESC"):
"""Gets all Departing Employees.
Args:
Expand Down Expand Up @@ -132,9 +130,7 @@ def set_alerts_enabled(self, alerts_enabled=True):
data = {u"tenantId": tenant_id, u"alertsEnabled": alerts_enabled}
return self._session.post(uri, data=json.dumps(data))

def update_departure_date(
self, user_id, departure_date,
):
def update_departure_date(self, user_id, departure_date):
"""Add or modify details of an existing Departing Employee case.
`REST Documentation <https://ecm-east.us.code42.com/svc/swagger/index.html?urls.primaryName=v2#/>`__
Expand Down

0 comments on commit 0a8881e

Please sign in to comment.