diff --git a/.fern/replay.lock b/.fern/replay.lock new file mode 100644 index 00000000..7582ec98 --- /dev/null +++ b/.fern/replay.lock @@ -0,0 +1,10 @@ +# DO NOT EDIT MANUALLY - Managed by Fern Replay +version: "1.0" +generations: + - commit_sha: d1b397945cde28063f302964d1e6ea46f27e8829 + tree_hash: f1b01b10fcf7273166b948e7e390c5d6290dca8e + timestamp: 2026-06-15T16:04:12.369Z + cli_version: unknown + generator_versions: {} +current_generation: d1b397945cde28063f302964d1e6ea46f27e8829 +patches: [] diff --git a/.fernignore b/.fernignore index 427e91c8..40dcfa92 100644 --- a/.fernignore +++ b/.fernignore @@ -22,4 +22,7 @@ tests/custom/test_datetime_filters.py tests/custom/test_error_response_handling.py tests/custom/test_query_encoder_edges.py tests/custom/test_enum_forward_compat_response.py -tests/custom/test_enum_forward_compat_query.py \ No newline at end of file +tests/custom/test_enum_forward_compat_query.py +.fern/replay.lock +.fern/replay.yml +.gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..74928d6a --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +.fern/replay.lock linguist-generated=true diff --git a/README.md b/README.md index cc6b143c..c422227c 100644 --- a/README.md +++ b/README.md @@ -258,3 +258,4 @@ while response.next is not None: + diff --git a/pyproject.toml b/pyproject.toml index ece2d8d4..8fc8bf4a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "MergePythonClient" [tool.poetry] name = "MergePythonClient" -version = "3.1.0a1" +version = "3.1.0a2" description = "" readme = "README.md" authors = [] diff --git a/reference.md b/reference.md index ea129c56..b3dfff17 100644 --- a/reference.md +++ b/reference.md @@ -54408,6 +54408,258 @@ client.calendar.events.list( + + + + +
client.calendar.events.invitees_list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Invitee` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge +from merge.resources.calendar.resources.events import ( + EventsInviteesListRequestExpand, +) + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.calendar.events.invitees_list( + event_id="event_id", + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + expand=EventsInviteesListRequestExpand.EVENT, + include_deleted_data=True, + include_remote_data=True, + include_shell_data=True, + page_size=1, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**event_id:** `str` + +
+
+ +
+
+ +**cursor:** `typing.Optional[str]` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `typing.Optional[EventsInviteesListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**include_deleted_data:** `typing.Optional[bool]` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**include_shell_data:** `typing.Optional[bool]` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**page_size:** `typing.Optional[int]` — Number of results to return per page. The maximum limit is 100. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.calendar.events.locations_list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Location` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.calendar.events.locations_list( + event_id="event_id", + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + include_deleted_data=True, + include_remote_data=True, + include_shell_data=True, + page_size=1, +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**event_id:** `str` + +
+
+ +
+
+ +**cursor:** `typing.Optional[str]` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `typing.Optional[typing.Literal["event"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**include_deleted_data:** `typing.Optional[bool]` — Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + +
+
+ +
+
+ +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**include_shell_data:** `typing.Optional[bool]` — Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + +
+
+ +
+
+ +**page_size:** `typing.Optional[int]` — Number of results to return per page. The maximum limit is 100. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ +
diff --git a/src/merge/core/client_wrapper.py b/src/merge/core/client_wrapper.py index eaa44007..a6cf4ac5 100644 --- a/src/merge/core/client_wrapper.py +++ b/src/merge/core/client_wrapper.py @@ -24,10 +24,10 @@ def __init__( def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { - "User-Agent": "MergePythonClient/3.2.0a1", + "User-Agent": "MergePythonClient/3.1.0a2", "X-Fern-Language": "Python", "X-Fern-SDK-Name": "MergePythonClient", - "X-Fern-SDK-Version": "3.2.0a1", + "X-Fern-SDK-Version": "3.1.0a2", **(self.get_custom_headers() or {}), } if self._account_token is not None: diff --git a/src/merge/resources/calendar/__init__.py b/src/merge/resources/calendar/__init__.py index 50c97a91..251636c3 100644 --- a/src/merge/resources/calendar/__init__.py +++ b/src/merge/resources/calendar/__init__.py @@ -21,6 +21,7 @@ AuditLogEvent, AuditLogEventEventType, AuditLogEventRole, + AvailabilityStatusEnum, AvailableActions, Calendar, CalendarFieldMappings, @@ -57,6 +58,9 @@ GroupFieldMappings, IndividualCommonModelScopeDeserializer, IndividualCommonModelScopeDeserializerRequest, + Invitee, + InviteeAvailabilityStatus, + InviteeRsvp, Issue, IssueStatus, IssueStatusEnum, @@ -64,6 +68,9 @@ LastSyncResultEnum, LinkToken, LinkedAccountPatchResponse, + Location, + LocationLocationType, + LocationTypeEnum, MethodEnum, ModelOperation, ModelPermissionDeserializer, @@ -75,7 +82,9 @@ PaginatedCalendarList, PaginatedEventList, PaginatedGroupList, + PaginatedInviteeList, PaginatedIssueList, + PaginatedLocationList, PaginatedSeriesList, PaginatedSyncStatusList, PaginatedUserList, @@ -98,6 +107,7 @@ ResponseTypeEnum, RoleEnum, RolesEnum, + RsvpEnum, SelectiveSyncConfigurationsUsageEnum, Series, SeriesFieldMappings, @@ -116,6 +126,7 @@ CalendarsListRequestType, EndUserDetailsRequestCompletedAccountInitialScreen, EndUserDetailsRequestLanguage, + EventsInviteesListRequestExpand, EventsListRequestExpandItem, EventsRetrieveRequestExpandItem, GroupsListRequestExpandItem, @@ -161,6 +172,7 @@ "AuditLogEvent": ".types", "AuditLogEventEventType": ".types", "AuditLogEventRole": ".types", + "AvailabilityStatusEnum": ".types", "AvailableActions": ".types", "Calendar": ".types", "CalendarFieldMappings": ".types", @@ -186,6 +198,7 @@ "Event": ".types", "EventFieldMappings": ".types", "EventTypeEnum": ".types", + "EventsInviteesListRequestExpand": ".resources", "EventsListRequestExpandItem": ".resources", "EventsRetrieveRequestExpandItem": ".resources", "ExternalTargetFieldApi": ".types", @@ -204,6 +217,9 @@ "GroupsRetrieveRequestExpandItem": ".resources", "IndividualCommonModelScopeDeserializer": ".types", "IndividualCommonModelScopeDeserializerRequest": ".types", + "Invitee": ".types", + "InviteeAvailabilityStatus": ".types", + "InviteeRsvp": ".types", "Issue": ".types", "IssueStatus": ".types", "IssueStatusEnum": ".types", @@ -213,6 +229,9 @@ "LinkToken": ".types", "LinkedAccountPatchResponse": ".types", "LinkedAccountsListRequestCategory": ".resources", + "Location": ".types", + "LocationLocationType": ".types", + "LocationTypeEnum": ".types", "MethodEnum": ".types", "ModelOperation": ".types", "ModelPermissionDeserializer": ".types", @@ -224,7 +243,9 @@ "PaginatedCalendarList": ".types", "PaginatedEventList": ".types", "PaginatedGroupList": ".types", + "PaginatedInviteeList": ".types", "PaginatedIssueList": ".types", + "PaginatedLocationList": ".types", "PaginatedSeriesList": ".types", "PaginatedSyncStatusList": ".types", "PaginatedUserList": ".types", @@ -247,6 +268,7 @@ "ResponseTypeEnum": ".types", "RoleEnum": ".types", "RolesEnum": ".types", + "RsvpEnum": ".types", "SelectiveSyncConfigurationsUsageEnum": ".types", "Series": ".types", "SeriesFieldMappings": ".types", @@ -319,6 +341,7 @@ def __dir__(): "AuditLogEvent", "AuditLogEventEventType", "AuditLogEventRole", + "AvailabilityStatusEnum", "AvailableActions", "Calendar", "CalendarFieldMappings", @@ -344,6 +367,7 @@ def __dir__(): "Event", "EventFieldMappings", "EventTypeEnum", + "EventsInviteesListRequestExpand", "EventsListRequestExpandItem", "EventsRetrieveRequestExpandItem", "ExternalTargetFieldApi", @@ -362,6 +386,9 @@ def __dir__(): "GroupsRetrieveRequestExpandItem", "IndividualCommonModelScopeDeserializer", "IndividualCommonModelScopeDeserializerRequest", + "Invitee", + "InviteeAvailabilityStatus", + "InviteeRsvp", "Issue", "IssueStatus", "IssueStatusEnum", @@ -371,6 +398,9 @@ def __dir__(): "LinkToken", "LinkedAccountPatchResponse", "LinkedAccountsListRequestCategory", + "Location", + "LocationLocationType", + "LocationTypeEnum", "MethodEnum", "ModelOperation", "ModelPermissionDeserializer", @@ -382,7 +412,9 @@ def __dir__(): "PaginatedCalendarList", "PaginatedEventList", "PaginatedGroupList", + "PaginatedInviteeList", "PaginatedIssueList", + "PaginatedLocationList", "PaginatedSeriesList", "PaginatedSyncStatusList", "PaginatedUserList", @@ -405,6 +437,7 @@ def __dir__(): "ResponseTypeEnum", "RoleEnum", "RolesEnum", + "RsvpEnum", "SelectiveSyncConfigurationsUsageEnum", "Series", "SeriesFieldMappings", diff --git a/src/merge/resources/calendar/resources/__init__.py b/src/merge/resources/calendar/resources/__init__.py index 4f399b63..cdc79661 100644 --- a/src/merge/resources/calendar/resources/__init__.py +++ b/src/merge/resources/calendar/resources/__init__.py @@ -32,7 +32,7 @@ ) from .async_passthrough import AsyncPassthroughRetrieveResponse from .calendars import CalendarsListRequestType - from .events import EventsListRequestExpandItem, EventsRetrieveRequestExpandItem + from .events import EventsInviteesListRequestExpand, EventsListRequestExpandItem, EventsRetrieveRequestExpandItem from .groups import GroupsListRequestExpandItem, GroupsRetrieveRequestExpandItem from .issues import IssuesListRequestStatus from .link_token import EndUserDetailsRequestCompletedAccountInitialScreen, EndUserDetailsRequestLanguage @@ -42,6 +42,7 @@ "CalendarsListRequestType": ".calendars", "EndUserDetailsRequestCompletedAccountInitialScreen": ".link_token", "EndUserDetailsRequestLanguage": ".link_token", + "EventsInviteesListRequestExpand": ".events", "EventsListRequestExpandItem": ".events", "EventsRetrieveRequestExpandItem": ".events", "GroupsListRequestExpandItem": ".groups", @@ -97,6 +98,7 @@ def __dir__(): "CalendarsListRequestType", "EndUserDetailsRequestCompletedAccountInitialScreen", "EndUserDetailsRequestLanguage", + "EventsInviteesListRequestExpand", "EventsListRequestExpandItem", "EventsRetrieveRequestExpandItem", "GroupsListRequestExpandItem", diff --git a/src/merge/resources/calendar/resources/events/__init__.py b/src/merge/resources/calendar/resources/events/__init__.py index c77a101a..aff733e7 100644 --- a/src/merge/resources/calendar/resources/events/__init__.py +++ b/src/merge/resources/calendar/resources/events/__init__.py @@ -6,8 +6,9 @@ from importlib import import_module if typing.TYPE_CHECKING: - from .types import EventsListRequestExpandItem, EventsRetrieveRequestExpandItem + from .types import EventsInviteesListRequestExpand, EventsListRequestExpandItem, EventsRetrieveRequestExpandItem _dynamic_imports: typing.Dict[str, str] = { + "EventsInviteesListRequestExpand": ".types", "EventsListRequestExpandItem": ".types", "EventsRetrieveRequestExpandItem": ".types", } @@ -32,4 +33,4 @@ def __dir__(): return sorted(lazy_attrs) -__all__ = ["EventsListRequestExpandItem", "EventsRetrieveRequestExpandItem"] +__all__ = ["EventsInviteesListRequestExpand", "EventsListRequestExpandItem", "EventsRetrieveRequestExpandItem"] diff --git a/src/merge/resources/calendar/resources/events/client.py b/src/merge/resources/calendar/resources/events/client.py index 2c1f8f65..0d6bf75e 100644 --- a/src/merge/resources/calendar/resources/events/client.py +++ b/src/merge/resources/calendar/resources/events/client.py @@ -7,7 +7,10 @@ from .....core.request_options import RequestOptions from ...types.event import Event from ...types.paginated_event_list import PaginatedEventList +from ...types.paginated_invitee_list import PaginatedInviteeList +from ...types.paginated_location_list import PaginatedLocationList from .raw_client import AsyncRawEventsClient, RawEventsClient +from .types.events_invitees_list_request_expand import EventsInviteesListRequestExpand from .types.events_list_request_expand_item import EventsListRequestExpandItem from .types.events_retrieve_request_expand_item import EventsRetrieveRequestExpandItem @@ -190,6 +193,158 @@ def list( ) return _response.data + def invitees_list( + self, + event_id: str, + *, + cursor: typing.Optional[str] = None, + expand: typing.Optional[EventsInviteesListRequestExpand] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + page_size: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedInviteeList: + """ + Returns a list of `Invitee` objects. + + Parameters + ---------- + event_id : str + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[EventsInviteesListRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + include_deleted_data : typing.Optional[bool] + Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + page_size : typing.Optional[int] + Number of results to return per page. The maximum limit is 100. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedInviteeList + + + Examples + -------- + from merge import Merge + from merge.resources.calendar.resources.events import ( + EventsInviteesListRequestExpand, + ) + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.calendar.events.invitees_list( + event_id="event_id", + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + expand=EventsInviteesListRequestExpand.EVENT, + include_deleted_data=True, + include_remote_data=True, + include_shell_data=True, + page_size=1, + ) + """ + _response = self._raw_client.invitees_list( + event_id, + cursor=cursor, + expand=expand, + include_deleted_data=include_deleted_data, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + page_size=page_size, + request_options=request_options, + ) + return _response.data + + def locations_list( + self, + event_id: str, + *, + cursor: typing.Optional[str] = None, + expand: typing.Optional[typing.Literal["event"]] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + page_size: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedLocationList: + """ + Returns a list of `Location` objects. + + Parameters + ---------- + event_id : str + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[typing.Literal["event"]] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + include_deleted_data : typing.Optional[bool] + Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + page_size : typing.Optional[int] + Number of results to return per page. The maximum limit is 100. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedLocationList + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.calendar.events.locations_list( + event_id="event_id", + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + include_deleted_data=True, + include_remote_data=True, + include_shell_data=True, + page_size=1, + ) + """ + _response = self._raw_client.locations_list( + event_id, + cursor=cursor, + expand=expand, + include_deleted_data=include_deleted_data, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + page_size=page_size, + request_options=request_options, + ) + return _response.data + def retrieve( self, id: str, @@ -434,6 +589,174 @@ async def main() -> None: ) return _response.data + async def invitees_list( + self, + event_id: str, + *, + cursor: typing.Optional[str] = None, + expand: typing.Optional[EventsInviteesListRequestExpand] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + page_size: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedInviteeList: + """ + Returns a list of `Invitee` objects. + + Parameters + ---------- + event_id : str + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[EventsInviteesListRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + include_deleted_data : typing.Optional[bool] + Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + page_size : typing.Optional[int] + Number of results to return per page. The maximum limit is 100. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedInviteeList + + + Examples + -------- + import asyncio + + from merge import AsyncMerge + from merge.resources.calendar.resources.events import ( + EventsInviteesListRequestExpand, + ) + + client = AsyncMerge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.calendar.events.invitees_list( + event_id="event_id", + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + expand=EventsInviteesListRequestExpand.EVENT, + include_deleted_data=True, + include_remote_data=True, + include_shell_data=True, + page_size=1, + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.invitees_list( + event_id, + cursor=cursor, + expand=expand, + include_deleted_data=include_deleted_data, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + page_size=page_size, + request_options=request_options, + ) + return _response.data + + async def locations_list( + self, + event_id: str, + *, + cursor: typing.Optional[str] = None, + expand: typing.Optional[typing.Literal["event"]] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + page_size: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedLocationList: + """ + Returns a list of `Location` objects. + + Parameters + ---------- + event_id : str + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[typing.Literal["event"]] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + include_deleted_data : typing.Optional[bool] + Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + page_size : typing.Optional[int] + Number of results to return per page. The maximum limit is 100. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedLocationList + + + Examples + -------- + import asyncio + + from merge import AsyncMerge + + client = AsyncMerge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.calendar.events.locations_list( + event_id="event_id", + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + include_deleted_data=True, + include_remote_data=True, + include_shell_data=True, + page_size=1, + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.locations_list( + event_id, + cursor=cursor, + expand=expand, + include_deleted_data=include_deleted_data, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + page_size=page_size, + request_options=request_options, + ) + return _response.data + async def retrieve( self, id: str, diff --git a/src/merge/resources/calendar/resources/events/raw_client.py b/src/merge/resources/calendar/resources/events/raw_client.py index 84bd0e7c..ba83c808 100644 --- a/src/merge/resources/calendar/resources/events/raw_client.py +++ b/src/merge/resources/calendar/resources/events/raw_client.py @@ -13,6 +13,9 @@ from .....core.unchecked_base_model import construct_type from ...types.event import Event from ...types.paginated_event_list import PaginatedEventList +from ...types.paginated_invitee_list import PaginatedInviteeList +from ...types.paginated_location_list import PaginatedLocationList +from .types.events_invitees_list_request_expand import EventsInviteesListRequestExpand from .types.events_list_request_expand_item import EventsListRequestExpandItem from .types.events_retrieve_request_expand_item import EventsRetrieveRequestExpandItem @@ -158,6 +161,152 @@ def list( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + def invitees_list( + self, + event_id: str, + *, + cursor: typing.Optional[str] = None, + expand: typing.Optional[EventsInviteesListRequestExpand] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + page_size: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[PaginatedInviteeList]: + """ + Returns a list of `Invitee` objects. + + Parameters + ---------- + event_id : str + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[EventsInviteesListRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + include_deleted_data : typing.Optional[bool] + Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + page_size : typing.Optional[int] + Number of results to return per page. The maximum limit is 100. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[PaginatedInviteeList] + + """ + _response = self._client_wrapper.httpx_client.request( + f"calendar/v1/events/{jsonable_encoder(event_id)}/invitees", + method="GET", + params={ + "cursor": cursor, + "expand": expand, + "include_deleted_data": include_deleted_data, + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + "page_size": page_size, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedInviteeList, + construct_type( + type_=PaginatedInviteeList, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + def locations_list( + self, + event_id: str, + *, + cursor: typing.Optional[str] = None, + expand: typing.Optional[typing.Literal["event"]] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + page_size: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[PaginatedLocationList]: + """ + Returns a list of `Location` objects. + + Parameters + ---------- + event_id : str + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[typing.Literal["event"]] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + include_deleted_data : typing.Optional[bool] + Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + page_size : typing.Optional[int] + Number of results to return per page. The maximum limit is 100. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[PaginatedLocationList] + + """ + _response = self._client_wrapper.httpx_client.request( + f"calendar/v1/events/{jsonable_encoder(event_id)}/locations", + method="GET", + params={ + "cursor": cursor, + "expand": expand, + "include_deleted_data": include_deleted_data, + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + "page_size": page_size, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedLocationList, + construct_type( + type_=PaginatedLocationList, # type: ignore + object_=_response.json(), + ), + ) + return HttpResponse(response=_response, data=_data) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + def retrieve( self, id: str, @@ -360,6 +509,152 @@ async def list( raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + async def invitees_list( + self, + event_id: str, + *, + cursor: typing.Optional[str] = None, + expand: typing.Optional[EventsInviteesListRequestExpand] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + page_size: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[PaginatedInviteeList]: + """ + Returns a list of `Invitee` objects. + + Parameters + ---------- + event_id : str + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[EventsInviteesListRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + include_deleted_data : typing.Optional[bool] + Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + page_size : typing.Optional[int] + Number of results to return per page. The maximum limit is 100. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[PaginatedInviteeList] + + """ + _response = await self._client_wrapper.httpx_client.request( + f"calendar/v1/events/{jsonable_encoder(event_id)}/invitees", + method="GET", + params={ + "cursor": cursor, + "expand": expand, + "include_deleted_data": include_deleted_data, + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + "page_size": page_size, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedInviteeList, + construct_type( + type_=PaginatedInviteeList, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + + async def locations_list( + self, + event_id: str, + *, + cursor: typing.Optional[str] = None, + expand: typing.Optional[typing.Literal["event"]] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + page_size: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[PaginatedLocationList]: + """ + Returns a list of `Location` objects. + + Parameters + ---------- + event_id : str + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[typing.Literal["event"]] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + include_deleted_data : typing.Optional[bool] + Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + + include_remote_data : typing.Optional[bool] + Whether to include the original data Merge fetched from the third-party to produce these models. + + include_shell_data : typing.Optional[bool] + Whether to include shell records. Shell records are empty records (they may contain some metadata but all other fields are null). + + page_size : typing.Optional[int] + Number of results to return per page. The maximum limit is 100. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[PaginatedLocationList] + + """ + _response = await self._client_wrapper.httpx_client.request( + f"calendar/v1/events/{jsonable_encoder(event_id)}/locations", + method="GET", + params={ + "cursor": cursor, + "expand": expand, + "include_deleted_data": include_deleted_data, + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + "page_size": page_size, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedLocationList, + construct_type( + type_=PaginatedLocationList, # type: ignore + object_=_response.json(), + ), + ) + return AsyncHttpResponse(response=_response, data=_data) + _response_json = _response.json() + except JSONDecodeError: + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) + raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json) + async def retrieve( self, id: str, diff --git a/src/merge/resources/calendar/resources/events/types/__init__.py b/src/merge/resources/calendar/resources/events/types/__init__.py index cdea9941..841fa107 100644 --- a/src/merge/resources/calendar/resources/events/types/__init__.py +++ b/src/merge/resources/calendar/resources/events/types/__init__.py @@ -6,9 +6,11 @@ from importlib import import_module if typing.TYPE_CHECKING: + from .events_invitees_list_request_expand import EventsInviteesListRequestExpand from .events_list_request_expand_item import EventsListRequestExpandItem from .events_retrieve_request_expand_item import EventsRetrieveRequestExpandItem _dynamic_imports: typing.Dict[str, str] = { + "EventsInviteesListRequestExpand": ".events_invitees_list_request_expand", "EventsListRequestExpandItem": ".events_list_request_expand_item", "EventsRetrieveRequestExpandItem": ".events_retrieve_request_expand_item", } @@ -33,4 +35,4 @@ def __dir__(): return sorted(lazy_attrs) -__all__ = ["EventsListRequestExpandItem", "EventsRetrieveRequestExpandItem"] +__all__ = ["EventsInviteesListRequestExpand", "EventsListRequestExpandItem", "EventsRetrieveRequestExpandItem"] diff --git a/src/merge/resources/calendar/resources/events/types/events_invitees_list_request_expand.py b/src/merge/resources/calendar/resources/events/types/events_invitees_list_request_expand.py new file mode 100644 index 00000000..ede6c4c7 --- /dev/null +++ b/src/merge/resources/calendar/resources/events/types/events_invitees_list_request_expand.py @@ -0,0 +1,41 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class EventsInviteesListRequestExpand(str, enum.Enum): + EVENT = "event" + EVENT_GROUP = "event,group" + EVENT_USER = "event,user" + EVENT_USER_GROUP = "event,user,group" + GROUP = "group" + USER = "user" + USER_GROUP = "user,group" + + def visit( + self, + event: typing.Callable[[], T_Result], + event_group: typing.Callable[[], T_Result], + event_user: typing.Callable[[], T_Result], + event_user_group: typing.Callable[[], T_Result], + group: typing.Callable[[], T_Result], + user: typing.Callable[[], T_Result], + user_group: typing.Callable[[], T_Result], + ) -> T_Result: + if self is EventsInviteesListRequestExpand.EVENT: + return event() + if self is EventsInviteesListRequestExpand.EVENT_GROUP: + return event_group() + if self is EventsInviteesListRequestExpand.EVENT_USER: + return event_user() + if self is EventsInviteesListRequestExpand.EVENT_USER_GROUP: + return event_user_group() + if self is EventsInviteesListRequestExpand.GROUP: + return group() + if self is EventsInviteesListRequestExpand.USER: + return user() + if self is EventsInviteesListRequestExpand.USER_GROUP: + return user_group() diff --git a/src/merge/resources/calendar/types/__init__.py b/src/merge/resources/calendar/types/__init__.py index 5c8ac62c..7863e434 100644 --- a/src/merge/resources/calendar/types/__init__.py +++ b/src/merge/resources/calendar/types/__init__.py @@ -20,6 +20,7 @@ from .audit_log_event import AuditLogEvent from .audit_log_event_event_type import AuditLogEventEventType from .audit_log_event_role import AuditLogEventRole + from .availability_status_enum import AvailabilityStatusEnum from .available_actions import AvailableActions from .calendar import Calendar from .calendar_field_mappings import CalendarFieldMappings @@ -58,6 +59,9 @@ from .group_field_mappings import GroupFieldMappings from .individual_common_model_scope_deserializer import IndividualCommonModelScopeDeserializer from .individual_common_model_scope_deserializer_request import IndividualCommonModelScopeDeserializerRequest + from .invitee import Invitee + from .invitee_availability_status import InviteeAvailabilityStatus + from .invitee_rsvp import InviteeRsvp from .issue import Issue from .issue_status import IssueStatus from .issue_status_enum import IssueStatusEnum @@ -65,6 +69,9 @@ from .last_sync_result_enum import LastSyncResultEnum from .link_token import LinkToken from .linked_account_patch_response import LinkedAccountPatchResponse + from .location import Location + from .location_location_type import LocationLocationType + from .location_type_enum import LocationTypeEnum from .method_enum import MethodEnum from .model_operation import ModelOperation from .model_permission_deserializer import ModelPermissionDeserializer @@ -76,7 +83,9 @@ from .paginated_calendar_list import PaginatedCalendarList from .paginated_event_list import PaginatedEventList from .paginated_group_list import PaginatedGroupList + from .paginated_invitee_list import PaginatedInviteeList from .paginated_issue_list import PaginatedIssueList + from .paginated_location_list import PaginatedLocationList from .paginated_series_list import PaginatedSeriesList from .paginated_sync_status_list import PaginatedSyncStatusList from .paginated_user_list import PaginatedUserList @@ -99,6 +108,7 @@ from .response_type_enum import ResponseTypeEnum from .role_enum import RoleEnum from .roles_enum import RolesEnum + from .rsvp_enum import RsvpEnum from .selective_sync_configurations_usage_enum import SelectiveSyncConfigurationsUsageEnum from .series import Series from .series_field_mappings import SeriesFieldMappings @@ -126,6 +136,7 @@ "AuditLogEvent": ".audit_log_event", "AuditLogEventEventType": ".audit_log_event_event_type", "AuditLogEventRole": ".audit_log_event_role", + "AvailabilityStatusEnum": ".availability_status_enum", "AvailableActions": ".available_actions", "Calendar": ".calendar", "CalendarFieldMappings": ".calendar_field_mappings", @@ -162,6 +173,9 @@ "GroupFieldMappings": ".group_field_mappings", "IndividualCommonModelScopeDeserializer": ".individual_common_model_scope_deserializer", "IndividualCommonModelScopeDeserializerRequest": ".individual_common_model_scope_deserializer_request", + "Invitee": ".invitee", + "InviteeAvailabilityStatus": ".invitee_availability_status", + "InviteeRsvp": ".invitee_rsvp", "Issue": ".issue", "IssueStatus": ".issue_status", "IssueStatusEnum": ".issue_status_enum", @@ -169,6 +183,9 @@ "LastSyncResultEnum": ".last_sync_result_enum", "LinkToken": ".link_token", "LinkedAccountPatchResponse": ".linked_account_patch_response", + "Location": ".location", + "LocationLocationType": ".location_location_type", + "LocationTypeEnum": ".location_type_enum", "MethodEnum": ".method_enum", "ModelOperation": ".model_operation", "ModelPermissionDeserializer": ".model_permission_deserializer", @@ -180,7 +197,9 @@ "PaginatedCalendarList": ".paginated_calendar_list", "PaginatedEventList": ".paginated_event_list", "PaginatedGroupList": ".paginated_group_list", + "PaginatedInviteeList": ".paginated_invitee_list", "PaginatedIssueList": ".paginated_issue_list", + "PaginatedLocationList": ".paginated_location_list", "PaginatedSeriesList": ".paginated_series_list", "PaginatedSyncStatusList": ".paginated_sync_status_list", "PaginatedUserList": ".paginated_user_list", @@ -203,6 +222,7 @@ "ResponseTypeEnum": ".response_type_enum", "RoleEnum": ".role_enum", "RolesEnum": ".roles_enum", + "RsvpEnum": ".rsvp_enum", "SelectiveSyncConfigurationsUsageEnum": ".selective_sync_configurations_usage_enum", "Series": ".series", "SeriesFieldMappings": ".series_field_mappings", @@ -252,6 +272,7 @@ def __dir__(): "AuditLogEvent", "AuditLogEventEventType", "AuditLogEventRole", + "AvailabilityStatusEnum", "AvailableActions", "Calendar", "CalendarFieldMappings", @@ -288,6 +309,9 @@ def __dir__(): "GroupFieldMappings", "IndividualCommonModelScopeDeserializer", "IndividualCommonModelScopeDeserializerRequest", + "Invitee", + "InviteeAvailabilityStatus", + "InviteeRsvp", "Issue", "IssueStatus", "IssueStatusEnum", @@ -295,6 +319,9 @@ def __dir__(): "LastSyncResultEnum", "LinkToken", "LinkedAccountPatchResponse", + "Location", + "LocationLocationType", + "LocationTypeEnum", "MethodEnum", "ModelOperation", "ModelPermissionDeserializer", @@ -306,7 +333,9 @@ def __dir__(): "PaginatedCalendarList", "PaginatedEventList", "PaginatedGroupList", + "PaginatedInviteeList", "PaginatedIssueList", + "PaginatedLocationList", "PaginatedSeriesList", "PaginatedSyncStatusList", "PaginatedUserList", @@ -329,6 +358,7 @@ def __dir__(): "ResponseTypeEnum", "RoleEnum", "RolesEnum", + "RsvpEnum", "SelectiveSyncConfigurationsUsageEnum", "Series", "SeriesFieldMappings", diff --git a/src/merge/resources/calendar/types/availability_status_enum.py b/src/merge/resources/calendar/types/availability_status_enum.py new file mode 100644 index 00000000..a9fa8980 --- /dev/null +++ b/src/merge/resources/calendar/types/availability_status_enum.py @@ -0,0 +1,33 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class AvailabilityStatusEnum(str, enum.Enum): + FREE = "FREE" + BUSY = "BUSY" + OUT_OF_OFFICE = "OUT_OF_OFFICE" + WORKING_ELSEWHERE = "WORKING_ELSEWHERE" + UNKNOWN = "UNKNOWN" + + def visit( + self, + free: typing.Callable[[], T_Result], + busy: typing.Callable[[], T_Result], + out_of_office: typing.Callable[[], T_Result], + working_elsewhere: typing.Callable[[], T_Result], + unknown: typing.Callable[[], T_Result], + ) -> T_Result: + if self is AvailabilityStatusEnum.FREE: + return free() + if self is AvailabilityStatusEnum.BUSY: + return busy() + if self is AvailabilityStatusEnum.OUT_OF_OFFICE: + return out_of_office() + if self is AvailabilityStatusEnum.WORKING_ELSEWHERE: + return working_elsewhere() + if self is AvailabilityStatusEnum.UNKNOWN: + return unknown() diff --git a/src/merge/resources/calendar/types/invitee.py b/src/merge/resources/calendar/types/invitee.py new file mode 100644 index 00000000..9db3e580 --- /dev/null +++ b/src/merge/resources/calendar/types/invitee.py @@ -0,0 +1,88 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ....core.unchecked_base_model import UncheckedBaseModel +from .invitee_availability_status import InviteeAvailabilityStatus +from .invitee_rsvp import InviteeRsvp + + +class Invitee(UncheckedBaseModel): + """ + # The Invitee Object + ### Description + The `Invitee` object represents a user or group attendee of an event. + """ + + id: typing.Optional[str] = None + remote_id: typing.Optional[str] = pydantic.Field(default=None) + """ + The third-party API ID of the matching object. + """ + + created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The datetime that this object was created by Merge. + """ + + modified_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The datetime that this object was modified by Merge. + """ + + is_required: typing.Optional[bool] = pydantic.Field(default=None) + """ + Whether the invitee is required. + """ + + is_organizer: typing.Optional[bool] = pydantic.Field(default=None) + """ + Whether the invitee is the organizer. + """ + + availability_status: typing.Optional[InviteeAvailabilityStatus] = pydantic.Field(default=None) + """ + The availability status of the invitee during the event. Possible values include: FREE, BUSY, OUT_OF_OFFICE, WORKING_ELSEWHERE, UNKNOWN. + """ + + rsvp: typing.Optional[InviteeRsvp] = pydantic.Field(default=None) + """ + The RSVP response of the invitee. Possible values include: YES, NO, MAYBE, NONE. + """ + + event: typing.Optional[str] = pydantic.Field(default=None) + """ + The event which the invitee is invited to. + """ + + user: typing.Optional[str] = pydantic.Field(default=None) + """ + The user who is invited. + """ + + group: typing.Optional[str] = pydantic.Field(default=None) + """ + The group which is invited. + """ + + email_address: typing.Optional[str] = pydantic.Field(default=None) + """ + The email address of the invitee + """ + + remote_was_deleted: typing.Optional[bool] = pydantic.Field(default=None) + """ + Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/merge/resources/calendar/types/invitee_availability_status.py b/src/merge/resources/calendar/types/invitee_availability_status.py new file mode 100644 index 00000000..daab4e09 --- /dev/null +++ b/src/merge/resources/calendar/types/invitee_availability_status.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .availability_status_enum import AvailabilityStatusEnum + +InviteeAvailabilityStatus = typing.Union[AvailabilityStatusEnum, str] diff --git a/src/merge/resources/calendar/types/invitee_rsvp.py b/src/merge/resources/calendar/types/invitee_rsvp.py new file mode 100644 index 00000000..cc1c5a53 --- /dev/null +++ b/src/merge/resources/calendar/types/invitee_rsvp.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .rsvp_enum import RsvpEnum + +InviteeRsvp = typing.Union[RsvpEnum, str] diff --git a/src/merge/resources/calendar/types/location.py b/src/merge/resources/calendar/types/location.py new file mode 100644 index 00000000..4bde037c --- /dev/null +++ b/src/merge/resources/calendar/types/location.py @@ -0,0 +1,72 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ....core.unchecked_base_model import UncheckedBaseModel +from .location_location_type import LocationLocationType + + +class Location(UncheckedBaseModel): + """ + # The Location Object + ### Description + The `Location` object represents a location for an event. + """ + + id: typing.Optional[str] = None + remote_id: typing.Optional[str] = pydantic.Field(default=None) + """ + The third-party API ID of the matching object. + """ + + created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The datetime that this object was created by Merge. + """ + + modified_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The datetime that this object was modified by Merge. + """ + + location_type: typing.Optional[LocationLocationType] = pydantic.Field(default=None) + """ + The type of location. Possible values include: PHYSICAL, VIRTUAL, OTHER. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + The name of the location. + """ + + address: typing.Optional[str] = pydantic.Field(default=None) + """ + The address of the event location. + """ + + event_url: typing.Optional[str] = pydantic.Field(default=None) + """ + The url of the virtual event location. + """ + + event: typing.Optional[str] = pydantic.Field(default=None) + """ + The event which the location belongs to. + """ + + remote_was_deleted: typing.Optional[bool] = pydantic.Field(default=None) + """ + Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](https://docs.merge.dev/integrations/hris/supported-features/). + """ + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/merge/resources/calendar/types/location_location_type.py b/src/merge/resources/calendar/types/location_location_type.py new file mode 100644 index 00000000..5b3e7213 --- /dev/null +++ b/src/merge/resources/calendar/types/location_location_type.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .location_type_enum import LocationTypeEnum + +LocationLocationType = typing.Union[LocationTypeEnum, str] diff --git a/src/merge/resources/calendar/types/location_type_enum.py b/src/merge/resources/calendar/types/location_type_enum.py new file mode 100644 index 00000000..245dda5c --- /dev/null +++ b/src/merge/resources/calendar/types/location_type_enum.py @@ -0,0 +1,25 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class LocationTypeEnum(str, enum.Enum): + PHYSICAL = "PHYSICAL" + VIRTUAL = "VIRTUAL" + OTHER = "OTHER" + + def visit( + self, + physical: typing.Callable[[], T_Result], + virtual: typing.Callable[[], T_Result], + other: typing.Callable[[], T_Result], + ) -> T_Result: + if self is LocationTypeEnum.PHYSICAL: + return physical() + if self is LocationTypeEnum.VIRTUAL: + return virtual() + if self is LocationTypeEnum.OTHER: + return other() diff --git a/src/merge/resources/calendar/types/paginated_invitee_list.py b/src/merge/resources/calendar/types/paginated_invitee_list.py new file mode 100644 index 00000000..93d2d70e --- /dev/null +++ b/src/merge/resources/calendar/types/paginated_invitee_list.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ....core.unchecked_base_model import UncheckedBaseModel +from .invitee import Invitee + + +class PaginatedInviteeList(UncheckedBaseModel): + next: typing.Optional[str] = None + previous: typing.Optional[str] = None + results: typing.Optional[typing.List[Invitee]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/merge/resources/calendar/types/paginated_location_list.py b/src/merge/resources/calendar/types/paginated_location_list.py new file mode 100644 index 00000000..924a5042 --- /dev/null +++ b/src/merge/resources/calendar/types/paginated_location_list.py @@ -0,0 +1,23 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2 +from ....core.unchecked_base_model import UncheckedBaseModel +from .location import Location + + +class PaginatedLocationList(UncheckedBaseModel): + next: typing.Optional[str] = None + previous: typing.Optional[str] = None + results: typing.Optional[typing.List[Location]] = None + + if IS_PYDANTIC_V2: + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 + else: + + class Config: + frozen = True + smart_union = True + extra = pydantic.Extra.allow diff --git a/src/merge/resources/calendar/types/rsvp_enum.py b/src/merge/resources/calendar/types/rsvp_enum.py new file mode 100644 index 00000000..4720d3bd --- /dev/null +++ b/src/merge/resources/calendar/types/rsvp_enum.py @@ -0,0 +1,29 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class RsvpEnum(str, enum.Enum): + YES = "YES" + NO = "NO" + MAYBE = "MAYBE" + NONE = "NONE" + + def visit( + self, + yes: typing.Callable[[], T_Result], + no: typing.Callable[[], T_Result], + maybe: typing.Callable[[], T_Result], + none: typing.Callable[[], T_Result], + ) -> T_Result: + if self is RsvpEnum.YES: + return yes() + if self is RsvpEnum.NO: + return no() + if self is RsvpEnum.MAYBE: + return maybe() + if self is RsvpEnum.NONE: + return none()