diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cac8c778..1732f62e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,6 +38,7 @@ jobs: env: SDK_TESTING_FILE_STORAGE_ACCOUNT_TOKEN: ${{ secrets.SDK_TESTING_FILE_STORAGE_ACCOUNT_TOKEN }} SDK_TESTING_KEY: ${{ secrets.SDK_TESTING_KEY }} + SDK_TESTING_KNOWLEDGEBASE_ACCOUNT_TOKEN: ${{ secrets.SDK_TESTING_KNOWLEDGEBASE_ACCOUNT_TOKEN }} publish: needs: [compile, test] diff --git a/.mock/definition/knowledgebase/__package__.yml b/.mock/definition/knowledgebase/__package__.yml new file mode 100644 index 00000000..ed758215 --- /dev/null +++ b/.mock/definition/knowledgebase/__package__.yml @@ -0,0 +1,2225 @@ +types: + AccountDetailsCategory: + discriminated: false + union: + - CategoryEnum + - string + source: + openapi: openapi/openapi.yml + inline: true + AccountDetails: + properties: + id: + type: optional + validation: + format: uuid + access: read-only + integration: + type: optional + access: read-only + integration_slug: + type: optional + access: read-only + category: optional + end_user_origin_id: + type: optional + access: read-only + end_user_organization_name: + type: optional + access: read-only + end_user_email_address: + type: optional + validation: + format: email + access: read-only + status: + type: optional + access: read-only + webhook_listener_url: + type: optional + validation: + format: uri + access: read-only + is_duplicate: + type: optional + docs: >- + Whether a Production Linked Account's credentials match another + existing Production Linked Account. This field is `null` for Test + Linked Accounts, incomplete Production Linked Accounts, and ignored + duplicate Production Linked Account sets. + access: read-only + account_type: + type: optional + access: read-only + completed_at: + type: optional + docs: The time at which account completes the linking flow. + source: + openapi: openapi/openapi.yml + AccountDetailsAndActionsCategory: + discriminated: false + union: + - CategoryEnum + - string + source: + openapi: openapi/openapi.yml + inline: true + AccountDetailsAndActionsStatus: + discriminated: false + union: + - AccountDetailsAndActionsStatusEnum + - string + source: + openapi: openapi/openapi.yml + inline: true + AccountDetailsAndActions: + docs: >- + # The LinkedAccount Object + + ### Description + + The `LinkedAccount` object is used to represent an end user's link with a + specific integration. + + + ### Usage Example + + View a list of your organization's `LinkedAccount` objects. + properties: + id: string + category: optional + status: AccountDetailsAndActionsStatus + status_detail: optional + end_user_origin_id: optional + end_user_organization_name: string + end_user_email_address: string + subdomain: + type: optional + docs: The tenant or domain the customer has provided access to. + webhook_listener_url: string + is_duplicate: + type: optional + docs: >- + Whether a Production Linked Account's credentials match another + existing Production Linked Account. This field is `null` for Test + Linked Accounts, incomplete Production Linked Accounts, and ignored + duplicate Production Linked Account sets. + integration: optional + account_type: string + completed_at: datetime + integration_specific_fields: optional> + source: + openapi: openapi/openapi.yml + AccountDetailsAndActionsIntegration: + properties: + name: string + categories: list + image: optional + square_image: optional + color: string + slug: string + passthrough_available: boolean + available_model_operations: optional> + source: + openapi: openapi/openapi.yml + AccountDetailsAndActionsStatusEnum: + enum: + - COMPLETE + - INCOMPLETE + - RELINK_NEEDED + - IDLE + docs: |- + * `COMPLETE` - COMPLETE + * `INCOMPLETE` - INCOMPLETE + * `RELINK_NEEDED` - RELINK_NEEDED + * `IDLE` - IDLE + source: + openapi: openapi/openapi.yml + AccountIntegration: + properties: + name: + type: string + docs: Company name. + abbreviated_name: + type: optional + docs: >- + Optional. This shortened name appears in places with limited space, + usually in conjunction with the platform's logo (e.g., Merge Link + menu).

Example: Workforce Now (in lieu of ADP Workforce + Now), SuccessFactors (in lieu of SAP SuccessFactors) + categories: + type: optional> + docs: >- + Category or categories this integration belongs to. Multiple + categories should be comma separated, i.e. [ats, hris]. + access: read-only + image: + type: optional + docs: Company logo in rectangular shape. + validation: + format: uri + square_image: + type: optional + docs: Company logo in square shape. + validation: + format: uri + color: + type: optional + docs: >- + The color of this integration used for buttons and text throughout the + app and landing pages. Choose a darker, saturated color. + validation: + pattern: ^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$ + maxLength: 18 + slug: + type: optional + access: read-only + api_endpoints_to_documentation_urls: + type: optional> + docs: >- + Mapping of API endpoints to documentation urls for support. Example: + {'GET': [['/common-model-scopes', + 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', + 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], + 'POST': []} + webhook_setup_guide_url: + type: optional + docs: >- + Setup guide URL for third party webhook creation. Exposed in Merge + Docs. + category_beta_status: + type: optional> + docs: Category or categories this integration is in beta status for. + access: read-only + source: + openapi: openapi/openapi.yml + AccountToken: + properties: + account_token: string + integration: AccountIntegration + id: string + source: + openapi: openapi/openapi.yml + AdvancedMetadata: + properties: + id: + type: string + validation: + format: uuid + display_name: optional + description: optional + is_required: optional + is_custom: optional + field_choices: optional> + source: + openapi: openapi/openapi.yml + ArticleAuthor: + discriminated: false + docs: The user who created the article. + union: + - type: string + validation: + format: uuid + - User + source: + openapi: openapi/openapi.yml + inline: true + ArticleLastEditedBy: + discriminated: false + docs: The user to last update the article. + union: + - type: string + validation: + format: uuid + - User + source: + openapi: openapi/openapi.yml + inline: true + ArticleVisibility: + discriminated: false + docs: |- + The visibility of the article. + + * `PUBLIC` - PUBLIC + * `INTERNAL` - INTERNAL + * `RESTRICTED` - RESTRICTED + union: + - VisibilityEnum + - string + source: + openapi: openapi/openapi.yml + inline: true + ArticleStatus: + discriminated: false + docs: |- + The status of the article. + + * `DRAFT` - DRAFT + * `PUBLISHED` - PUBLISHED + * `ARCHIVED` - ARCHIVED + * `TRASH` - TRASH + union: + - Status3C6Enum + - string + source: + openapi: openapi/openapi.yml + inline: true + ArticleType: + discriminated: false + docs: |- + The type of the article. + + * `PAGE` - PAGE + * `BLOG_POST` - BLOG_POST + * `SMART_LINK` - SMART_LINK + union: + - ArticleTypeEnum + - string + source: + openapi: openapi/openapi.yml + inline: true + ArticleParentArticle: + discriminated: false + docs: The parent article an article is nested within. + union: + - type: string + validation: + format: uuid + - Article + source: + openapi: openapi/openapi.yml + inline: true + ArticleParentContainer: + discriminated: false + docs: The parent container an article is nested within. + union: + - type: string + validation: + format: uuid + - Container + source: + openapi: openapi/openapi.yml + inline: true + ArticleRootContainer: + discriminated: false + docs: >- + The top-level container in the hierarchy that holds this article. This + will reference a container object that will typically be a SPACE or + WORKSPACE type. + union: + - type: string + validation: + format: uuid + - Container + source: + openapi: openapi/openapi.yml + inline: true + ArticlePermissionsItem: + discriminated: false + union: + - type: string + validation: + format: uuid + - Permission + source: + openapi: openapi/openapi.yml + inline: true + ArticleAttachmentsItem: + discriminated: false + union: + - type: string + validation: + format: uuid + - Attachment + source: + openapi: openapi/openapi.yml + inline: true + Article: + docs: >- + # The Article Object + + ### Description + + The `Article` object is used to represent a form of content in the + knowledge base, such as an article or page. + + ### Usage Example + + Fetch from the `GET /api/knowledgebase/v1/articles` endpoint and view + their articles. + properties: + id: + type: optional + validation: + format: uuid + access: read-only + remote_id: + type: optional + docs: The third-party API ID of the matching object. + created_at: + type: optional + docs: The datetime that this object was created by Merge. + access: read-only + modified_at: + type: optional + docs: The datetime that this object was modified by Merge. + access: read-only + title: + type: optional + docs: The title of the article. + validation: + maxLength: 254 + description: + type: optional + docs: Description of the article. + validation: + maxLength: 2000 + author: + type: optional + docs: The user who created the article. + last_edited_by: + type: optional + docs: The user to last update the article. + visibility: + type: optional + docs: |- + The visibility of the article. + + * `PUBLIC` - PUBLIC + * `INTERNAL` - INTERNAL + * `RESTRICTED` - RESTRICTED + article_content_download_url: + type: optional + docs: The presigned S3 URL to fetch article content. + access: read-only + checksum: + type: optional + docs: The SHA256 checksum of the article content. + validation: + maxLength: 254 + article_url: + type: optional + docs: The URL to the webpage of the article. + validation: + maxLength: 2000 + status: + type: optional + docs: |- + The status of the article. + + * `DRAFT` - DRAFT + * `PUBLISHED` - PUBLISHED + * `ARCHIVED` - ARCHIVED + * `TRASH` - TRASH + type: + type: optional + docs: |- + The type of the article. + + * `PAGE` - PAGE + * `BLOG_POST` - BLOG_POST + * `SMART_LINK` - SMART_LINK + remote_created_at: + type: optional + docs: When the third party's article was created. + remote_updated_at: + type: optional + docs: When the third party's article was updated. + parent_article: + type: optional + docs: The parent article an article is nested within. + parent_container: + type: optional + docs: The parent container an article is nested within. + root_container: + type: optional + docs: >- + The top-level container in the hierarchy that holds this article. This + will reference a container object that will typically be a SPACE or + WORKSPACE type. + permissions: optional> + attachments: optional>> + remote_was_deleted: + type: optional + docs: >- + 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/). + access: read-only + field_mappings: + type: optional> + access: read-only + remote_data: + type: optional> + access: read-only + source: + openapi: openapi/openapi.yml + ArticleTypeEnum: + enum: + - PAGE + - BLOG_POST + - SMART_LINK + docs: |- + * `PAGE` - PAGE + * `BLOG_POST` - BLOG_POST + * `SMART_LINK` - SMART_LINK + source: + openapi: openapi/openapi.yml + AsyncPassthroughReciept: + properties: + async_passthrough_receipt_id: + type: string + validation: + format: uuid + source: + openapi: openapi/openapi.yml + Attachment: + docs: >- + # The Attachment Object + + ### Description + + The `Attachment` object is used to represent an attachment to an article + or container. + + ### Usage Example + + Fetch from the `GET /api/knowledgebase/v1/attachments` endpoint and view + their attachments. + properties: + id: + type: optional + validation: + format: uuid + access: read-only + remote_id: + type: optional + docs: The third-party API ID of the matching object. + created_at: + type: optional + docs: The datetime that this object was created by Merge. + access: read-only + modified_at: + type: optional + docs: The datetime that this object was modified by Merge. + access: read-only + name: + type: optional + docs: The attachment's name. + validation: + maxLength: 254 + description: + type: optional + docs: The attachment's description. + validation: + maxLength: 2000 + attachment_url: + type: optional + docs: The attachment's url. + validation: + maxLength: 2000 + remote_was_deleted: + type: optional + docs: >- + 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/). + access: read-only + field_mappings: + type: optional> + access: read-only + remote_data: + type: optional> + access: read-only + source: + openapi: openapi/openapi.yml + AuditLogEventRole: + discriminated: false + docs: >- + Designates the role of the user (or SYSTEM/API if action not taken by a + user) at the time of this Event occurring. + + + * `ADMIN` - ADMIN + + * `DEVELOPER` - DEVELOPER + + * `MEMBER` - MEMBER + + * `API` - API + + * `SYSTEM` - SYSTEM + + * `MERGE_TEAM` - MERGE_TEAM + union: + - RoleEnum + - string + source: + openapi: openapi/openapi.yml + inline: true + AuditLogEventEventType: + discriminated: false + docs: >- + Designates the type of event that occurred. + + + * `CREATED_REMOTE_PRODUCTION_API_KEY` - CREATED_REMOTE_PRODUCTION_API_KEY + + * `DELETED_REMOTE_PRODUCTION_API_KEY` - DELETED_REMOTE_PRODUCTION_API_KEY + + * `CREATED_TEST_API_KEY` - CREATED_TEST_API_KEY + + * `DELETED_TEST_API_KEY` - DELETED_TEST_API_KEY + + * `REGENERATED_PRODUCTION_API_KEY` - REGENERATED_PRODUCTION_API_KEY + + * `REGENERATED_WEBHOOK_SIGNATURE` - REGENERATED_WEBHOOK_SIGNATURE + + * `INVITED_USER` - INVITED_USER + + * `TWO_FACTOR_AUTH_ENABLED` - TWO_FACTOR_AUTH_ENABLED + + * `TWO_FACTOR_AUTH_DISABLED` - TWO_FACTOR_AUTH_DISABLED + + * `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT + + * `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT` - + DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT + + * `CREATED_DESTINATION` - CREATED_DESTINATION + + * `DELETED_DESTINATION` - DELETED_DESTINATION + + * `CHANGED_DESTINATION` - CHANGED_DESTINATION + + * `CHANGED_SCOPES` - CHANGED_SCOPES + + * `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION + + * `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS + + * `ENABLED_INTEGRATION` - ENABLED_INTEGRATION + + * `DISABLED_INTEGRATION` - DISABLED_INTEGRATION + + * `ENABLED_CATEGORY` - ENABLED_CATEGORY + + * `DISABLED_CATEGORY` - DISABLED_CATEGORY + + * `CHANGED_PASSWORD` - CHANGED_PASSWORD + + * `RESET_PASSWORD` - RESET_PASSWORD + + * `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` - + ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION + + * `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` - + ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT + + * `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` - + DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION + + * `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` - + DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT + + * `CREATED_INTEGRATION_WIDE_FIELD_MAPPING` - + CREATED_INTEGRATION_WIDE_FIELD_MAPPING + + * `CREATED_LINKED_ACCOUNT_FIELD_MAPPING` - + CREATED_LINKED_ACCOUNT_FIELD_MAPPING + + * `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING` - + CHANGED_INTEGRATION_WIDE_FIELD_MAPPING + + * `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING` - + CHANGED_LINKED_ACCOUNT_FIELD_MAPPING + + * `DELETED_INTEGRATION_WIDE_FIELD_MAPPING` - + DELETED_INTEGRATION_WIDE_FIELD_MAPPING + + * `DELETED_LINKED_ACCOUNT_FIELD_MAPPING` - + DELETED_LINKED_ACCOUNT_FIELD_MAPPING + + * `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - + CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + + * `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - + CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + + * `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - + DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + + * `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC + + * `MUTED_ISSUE` - MUTED_ISSUE + + * `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK + + * `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK + + * `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK + + * `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED + + * `END_USER_CREDENTIALS_ACCESSED` - END_USER_CREDENTIALS_ACCESSED + union: + - EventTypeEnum + - string + source: + openapi: openapi/openapi.yml + inline: true + AuditLogEvent: + properties: + id: + type: optional + validation: + format: uuid + access: read-only + user_name: + type: optional + docs: The User's full name at the time of this Event occurring. + validation: + maxLength: 200 + user_email: + type: optional + docs: The User's email at the time of this Event occurring. + validation: + format: email + maxLength: 254 + role: + type: AuditLogEventRole + docs: >- + Designates the role of the user (or SYSTEM/API if action not taken by + a user) at the time of this Event occurring. + + + * `ADMIN` - ADMIN + + * `DEVELOPER` - DEVELOPER + + * `MEMBER` - MEMBER + + * `API` - API + + * `SYSTEM` - SYSTEM + + * `MERGE_TEAM` - MERGE_TEAM + ip_address: + type: string + validation: + maxLength: 45 + event_type: + type: AuditLogEventEventType + docs: >- + Designates the type of event that occurred. + + + * `CREATED_REMOTE_PRODUCTION_API_KEY` - + CREATED_REMOTE_PRODUCTION_API_KEY + + * `DELETED_REMOTE_PRODUCTION_API_KEY` - + DELETED_REMOTE_PRODUCTION_API_KEY + + * `CREATED_TEST_API_KEY` - CREATED_TEST_API_KEY + + * `DELETED_TEST_API_KEY` - DELETED_TEST_API_KEY + + * `REGENERATED_PRODUCTION_API_KEY` - REGENERATED_PRODUCTION_API_KEY + + * `REGENERATED_WEBHOOK_SIGNATURE` - REGENERATED_WEBHOOK_SIGNATURE + + * `INVITED_USER` - INVITED_USER + + * `TWO_FACTOR_AUTH_ENABLED` - TWO_FACTOR_AUTH_ENABLED + + * `TWO_FACTOR_AUTH_DISABLED` - TWO_FACTOR_AUTH_DISABLED + + * `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT + + * `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT` - + DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT + + * `CREATED_DESTINATION` - CREATED_DESTINATION + + * `DELETED_DESTINATION` - DELETED_DESTINATION + + * `CHANGED_DESTINATION` - CHANGED_DESTINATION + + * `CHANGED_SCOPES` - CHANGED_SCOPES + + * `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION + + * `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS + + * `ENABLED_INTEGRATION` - ENABLED_INTEGRATION + + * `DISABLED_INTEGRATION` - DISABLED_INTEGRATION + + * `ENABLED_CATEGORY` - ENABLED_CATEGORY + + * `DISABLED_CATEGORY` - DISABLED_CATEGORY + + * `CHANGED_PASSWORD` - CHANGED_PASSWORD + + * `RESET_PASSWORD` - RESET_PASSWORD + + * `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` - + ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION + + * `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` - + ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT + + * `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` - + DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION + + * `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` - + DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT + + * `CREATED_INTEGRATION_WIDE_FIELD_MAPPING` - + CREATED_INTEGRATION_WIDE_FIELD_MAPPING + + * `CREATED_LINKED_ACCOUNT_FIELD_MAPPING` - + CREATED_LINKED_ACCOUNT_FIELD_MAPPING + + * `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING` - + CHANGED_INTEGRATION_WIDE_FIELD_MAPPING + + * `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING` - + CHANGED_LINKED_ACCOUNT_FIELD_MAPPING + + * `DELETED_INTEGRATION_WIDE_FIELD_MAPPING` - + DELETED_INTEGRATION_WIDE_FIELD_MAPPING + + * `DELETED_LINKED_ACCOUNT_FIELD_MAPPING` - + DELETED_LINKED_ACCOUNT_FIELD_MAPPING + + * `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - + CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + + * `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - + CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + + * `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - + DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + + * `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC + + * `MUTED_ISSUE` - MUTED_ISSUE + + * `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK + + * `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK + + * `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK + + * `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED + + * `END_USER_CREDENTIALS_ACCESSED` - END_USER_CREDENTIALS_ACCESSED + event_description: string + created_at: + type: optional + access: read-only + source: + openapi: openapi/openapi.yml + AvailableActions: + docs: >- + # The AvailableActions Object + + ### Description + + The `Activity` object is used to see all available model/operation + combinations for an integration. + + + ### Usage Example + + Fetch all the actions available for the `Zenefits` integration. + properties: + integration: AccountIntegration + passthrough_available: boolean + available_model_operations: optional> + source: + openapi: openapi/openapi.yml + CategoriesEnum: + enum: + - hris + - ats + - accounting + - ticketing + - crm + - mktg + - filestorage + - knowledgebase + docs: |- + * `hris` - hris + * `ats` - ats + * `accounting` - accounting + * `ticketing` - ticketing + * `crm` - crm + * `mktg` - mktg + * `filestorage` - filestorage + * `knowledgebase` - knowledgebase + source: + openapi: openapi/openapi.yml + CategoryEnum: + enum: + - hris + - ats + - accounting + - ticketing + - crm + - mktg + - filestorage + - knowledgebase + docs: |- + * `hris` - hris + * `ats` - ats + * `accounting` - accounting + * `ticketing` - ticketing + * `crm` - crm + * `mktg` - mktg + * `filestorage` - filestorage + * `knowledgebase` - knowledgebase + source: + openapi: openapi/openapi.yml + CommonModelScopeApi: + properties: + common_models: + docs: The common models you want to update the scopes for + type: list + source: + openapi: openapi/openapi.yml + CommonModelScopesBodyRequest: + properties: + model_id: + type: string + validation: + minLength: 1 + enabled_actions: list + disabled_fields: list + source: + openapi: openapi/openapi.yml + CompletedAccountInitialScreenEnum: + type: literal<"SELECTIVE_SYNC"> + docs: '* `SELECTIVE_SYNC` - SELECTIVE_SYNC' + ContainerStatus: + discriminated: false + docs: |- + The container's status. + + * `DRAFT` - DRAFT + * `PUBLISHED` - PUBLISHED + * `ARCHIVED` - ARCHIVED + * `TRASH` - TRASH + union: + - Status3C6Enum + - string + source: + openapi: openapi/openapi.yml + inline: true + ContainerType: + discriminated: false + docs: |- + The container's type. + + * `FOLDER` - FOLDER + * `SPACE` - SPACE + * `COLLECTION` - COLLECTION + * `SECTION` - SECTION + * `CATEGORY` - CATEGORY + * `DATABASE` - DATABASE + union: + - ContainerTypeEnum + - string + source: + openapi: openapi/openapi.yml + inline: true + ContainerVisibility: + discriminated: false + docs: |- + The container's visibility. + + * `PUBLIC` - PUBLIC + * `INTERNAL` - INTERNAL + * `RESTRICTED` - RESTRICTED + union: + - VisibilityEnum + - string + source: + openapi: openapi/openapi.yml + inline: true + ContainerPermissionsItem: + discriminated: false + union: + - type: string + validation: + format: uuid + - Permission + source: + openapi: openapi/openapi.yml + inline: true + Container: + docs: >- + # The Container Object + + ### Description + + The Container object is used to represent a grouping of articles in the + knowledge base. This can include Spaces, Folders, Databases, etc. + + ### Usage Example + + Fetch from the `GET /api/knowledgebase/v1/containers` endpoint and view + their containers. + properties: + id: + type: optional + validation: + format: uuid + access: read-only + remote_id: + type: optional + docs: The third-party API ID of the matching object. + created_at: + type: optional + docs: The datetime that this object was created by Merge. + access: read-only + modified_at: + type: optional + docs: The datetime that this object was modified by Merge. + access: read-only + name: + type: optional + docs: Name of the container. + validation: + maxLength: 254 + description: + type: optional + docs: Description of the container. + validation: + maxLength: 2000 + status: + type: optional + docs: |- + The container's status. + + * `DRAFT` - DRAFT + * `PUBLISHED` - PUBLISHED + * `ARCHIVED` - ARCHIVED + * `TRASH` - TRASH + container_url: + type: optional + docs: The URL to the webpage of the container. + validation: + maxLength: 2000 + type: + type: optional + docs: |- + The container's type. + + * `FOLDER` - FOLDER + * `SPACE` - SPACE + * `COLLECTION` - COLLECTION + * `SECTION` - SECTION + * `CATEGORY` - CATEGORY + * `DATABASE` - DATABASE + visibility: + type: optional + docs: |- + The container's visibility. + + * `PUBLIC` - PUBLIC + * `INTERNAL` - INTERNAL + * `RESTRICTED` - RESTRICTED + remote_created_at: + type: optional + docs: When the third party's container was created. + remote_updated_at: + type: optional + docs: When the third party's container was updated. + parent_article: + type: optional + docs: The parent article a container is nested within. + validation: + format: uuid + parent_container: + type: optional + docs: The parent container a container is nested within. + validation: + format: uuid + permissions: optional> + remote_was_deleted: + type: optional + docs: >- + 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/). + access: read-only + field_mappings: + type: optional> + access: read-only + remote_data: + type: optional> + access: read-only + source: + openapi: openapi/openapi.yml + ContainerTypeEnum: + enum: + - FOLDER + - SPACE + - COLLECTION + - SECTION + - CATEGORY + - DATABASE + docs: |- + * `FOLDER` - FOLDER + * `SPACE` - SPACE + * `COLLECTION` - COLLECTION + * `SECTION` - SECTION + * `CATEGORY` - CATEGORY + * `DATABASE` - DATABASE + source: + openapi: openapi/openapi.yml + DataPassthroughRequestMethod: + discriminated: false + union: + - MethodEnum + - string + source: + openapi: openapi/openapi.yml + inline: true + DataPassthroughRequestRequestFormat: + discriminated: false + union: + - RequestFormatEnum + - string + source: + openapi: openapi/openapi.yml + inline: true + DataPassthroughRequest: + docs: >- + # The DataPassthrough Object + + ### Description + + The `DataPassthrough` object is used to send information to an + otherwise-unsupported third-party endpoint. + + + ### Usage Example + + Create a `DataPassthrough` to get team hierarchies from your Rippling + integration. + properties: + method: DataPassthroughRequestMethod + path: + type: string + docs: The path of the request in the third party's platform. + validation: + minLength: 1 + base_url_override: + type: optional + docs: An optional override of the third party's base url for the request. + validation: + minLength: 1 + data: + type: optional + docs: >- + The data with the request. You must include a `request_format` + parameter matching the data's format + validation: + minLength: 1 + multipart_form_data: + type: optional> + docs: >- + Pass an array of `MultipartFormField` objects in here instead of using + the `data` param if `request_format` is set to `MULTIPART`. + headers: + type: optional> + docs: >- + The headers to use for the request (Merge will handle the account's + authorization headers). `Content-Type` header is required for + passthrough. Choose content type corresponding to expected format of + receiving server. + request_format: optional + normalize_response: + type: optional + docs: >- + Optional. If true, the response will always be an object of the form + `{"type": T, "value": ...}` where `T` will be one of `string, boolean, + number, null, array, object`. + source: + openapi: openapi/openapi.yml + DebugModeLog: + properties: + log_id: string + dashboard_view: string + log_summary: DebugModelLogSummary + source: + openapi: openapi/openapi.yml + DebugModelLogSummary: + properties: + url: string + method: string + status_code: integer + source: + openapi: openapi/openapi.yml + EnabledActionsEnum: + enum: + - READ + - WRITE + docs: |- + * `READ` - READ + * `WRITE` - WRITE + source: + openapi: openapi/openapi.yml + EncodingEnum: + enum: + - RAW + - BASE64 + - GZIP_BASE64 + docs: |- + * `RAW` - RAW + * `BASE64` - BASE64 + * `GZIP_BASE64` - GZIP_BASE64 + source: + openapi: openapi/openapi.yml + ErrorValidationProblem: + properties: + source: optional + title: string + detail: string + problem_type: string + source: + openapi: openapi/openapi.yml + EventTypeEnum: + enum: + - CREATED_REMOTE_PRODUCTION_API_KEY + - DELETED_REMOTE_PRODUCTION_API_KEY + - CREATED_TEST_API_KEY + - DELETED_TEST_API_KEY + - REGENERATED_PRODUCTION_API_KEY + - REGENERATED_WEBHOOK_SIGNATURE + - INVITED_USER + - TWO_FACTOR_AUTH_ENABLED + - TWO_FACTOR_AUTH_DISABLED + - DELETED_LINKED_ACCOUNT + - DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT + - CREATED_DESTINATION + - DELETED_DESTINATION + - CHANGED_DESTINATION + - CHANGED_SCOPES + - CHANGED_PERSONAL_INFORMATION + - CHANGED_ORGANIZATION_SETTINGS + - ENABLED_INTEGRATION + - DISABLED_INTEGRATION + - ENABLED_CATEGORY + - DISABLED_CATEGORY + - CHANGED_PASSWORD + - RESET_PASSWORD + - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION + - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT + - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION + - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT + - CREATED_INTEGRATION_WIDE_FIELD_MAPPING + - CREATED_LINKED_ACCOUNT_FIELD_MAPPING + - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING + - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING + - DELETED_INTEGRATION_WIDE_FIELD_MAPPING + - DELETED_LINKED_ACCOUNT_FIELD_MAPPING + - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + - FORCED_LINKED_ACCOUNT_RESYNC + - MUTED_ISSUE + - GENERATED_MAGIC_LINK + - ENABLED_MERGE_WEBHOOK + - DISABLED_MERGE_WEBHOOK + - MERGE_WEBHOOK_TARGET_CHANGED + - END_USER_CREDENTIALS_ACCESSED + docs: >- + * `CREATED_REMOTE_PRODUCTION_API_KEY` - CREATED_REMOTE_PRODUCTION_API_KEY + + * `DELETED_REMOTE_PRODUCTION_API_KEY` - DELETED_REMOTE_PRODUCTION_API_KEY + + * `CREATED_TEST_API_KEY` - CREATED_TEST_API_KEY + + * `DELETED_TEST_API_KEY` - DELETED_TEST_API_KEY + + * `REGENERATED_PRODUCTION_API_KEY` - REGENERATED_PRODUCTION_API_KEY + + * `REGENERATED_WEBHOOK_SIGNATURE` - REGENERATED_WEBHOOK_SIGNATURE + + * `INVITED_USER` - INVITED_USER + + * `TWO_FACTOR_AUTH_ENABLED` - TWO_FACTOR_AUTH_ENABLED + + * `TWO_FACTOR_AUTH_DISABLED` - TWO_FACTOR_AUTH_DISABLED + + * `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT + + * `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT` - + DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT + + * `CREATED_DESTINATION` - CREATED_DESTINATION + + * `DELETED_DESTINATION` - DELETED_DESTINATION + + * `CHANGED_DESTINATION` - CHANGED_DESTINATION + + * `CHANGED_SCOPES` - CHANGED_SCOPES + + * `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION + + * `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS + + * `ENABLED_INTEGRATION` - ENABLED_INTEGRATION + + * `DISABLED_INTEGRATION` - DISABLED_INTEGRATION + + * `ENABLED_CATEGORY` - ENABLED_CATEGORY + + * `DISABLED_CATEGORY` - DISABLED_CATEGORY + + * `CHANGED_PASSWORD` - CHANGED_PASSWORD + + * `RESET_PASSWORD` - RESET_PASSWORD + + * `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` - + ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION + + * `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` - + ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT + + * `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` - + DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION + + * `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` - + DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT + + * `CREATED_INTEGRATION_WIDE_FIELD_MAPPING` - + CREATED_INTEGRATION_WIDE_FIELD_MAPPING + + * `CREATED_LINKED_ACCOUNT_FIELD_MAPPING` - + CREATED_LINKED_ACCOUNT_FIELD_MAPPING + + * `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING` - + CHANGED_INTEGRATION_WIDE_FIELD_MAPPING + + * `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING` - + CHANGED_LINKED_ACCOUNT_FIELD_MAPPING + + * `DELETED_INTEGRATION_WIDE_FIELD_MAPPING` - + DELETED_INTEGRATION_WIDE_FIELD_MAPPING + + * `DELETED_LINKED_ACCOUNT_FIELD_MAPPING` - + DELETED_LINKED_ACCOUNT_FIELD_MAPPING + + * `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - + CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + + * `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - + CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + + * `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - + DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + + * `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC + + * `MUTED_ISSUE` - MUTED_ISSUE + + * `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK + + * `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK + + * `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK + + * `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED + + * `END_USER_CREDENTIALS_ACCESSED` - END_USER_CREDENTIALS_ACCESSED + source: + openapi: openapi/openapi.yml + ExternalTargetFieldApi: + properties: + name: + type: optional + access: read-only + description: + type: optional + access: read-only + is_mapped: + type: optional + access: read-only + source: + openapi: openapi/openapi.yml + ExternalTargetFieldApiResponse: + properties: + Container: optional> + Article: optional> + Attachment: optional> + User: optional> + Group: optional> + source: + openapi: openapi/openapi.yml + FieldMappingApiInstanceTargetField: + properties: + name: string + description: string + is_organization_wide: boolean + source: + openapi: openapi/openapi.yml + inline: true + FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo: + properties: + method: optional + url_path: optional + field_traversal_path: optional> + source: + openapi: openapi/openapi.yml + inline: true + FieldMappingApiInstanceRemoteField: + properties: + remote_key_name: optional + schema: optional> + remote_endpoint_info: FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo + source: + openapi: openapi/openapi.yml + inline: true + FieldMappingApiInstance: + properties: + id: + type: optional + validation: + format: uuid + access: read-only + is_integration_wide: + type: optional + access: read-only + target_field: + type: optional + access: read-only + remote_field: + type: optional + access: read-only + jmes_path: + type: optional + access: read-only + source: + openapi: openapi/openapi.yml + FieldMappingApiInstanceResponse: + properties: + Container: optional> + Article: optional> + Attachment: optional> + User: optional> + Group: optional> + source: + openapi: openapi/openapi.yml + FieldMappingInstanceResponse: + properties: + model: FieldMappingApiInstance + warnings: list + errors: list + logs: optional> + source: + openapi: openapi/openapi.yml + FieldPermissionDeserializer: + properties: + enabled_fields: optional> + disabled_fields: optional> + source: + openapi: openapi/openapi.yml + FieldPermissionDeserializerRequest: + properties: + enabled_fields: optional> + disabled_fields: optional> + source: + openapi: openapi/openapi.yml + GroupParentGroup: + discriminated: false + docs: The parent group for this group. + union: + - type: string + validation: + format: uuid + - Group + source: + openapi: openapi/openapi.yml + inline: true + GroupUsersItem: + discriminated: false + union: + - type: string + validation: + format: uuid + - User + source: + openapi: openapi/openapi.yml + inline: true + Group: + docs: >- + # The Group Object + + ### Description + + The `Group` object is used to represent any subset of `Users`. This can + extend to company domains as well. + + ### Usage Example + + Fetch from the `GET /api/knowledgebase/v1/groups` endpoint and view their + groups. + properties: + id: + type: optional + validation: + format: uuid + access: read-only + remote_id: + type: optional + docs: The third-party API ID of the matching object. + created_at: + type: optional + docs: The datetime that this object was created by Merge. + access: read-only + modified_at: + type: optional + docs: The datetime that this object was modified by Merge. + access: read-only + name: + type: optional + docs: The group's name. + validation: + maxLength: 254 + parent_group: + type: optional + docs: The parent group for this group. + users: optional> + remote_was_deleted: + type: optional + docs: >- + 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/). + access: read-only + field_mappings: + type: optional> + access: read-only + remote_data: + type: optional> + access: read-only + source: + openapi: openapi/openapi.yml + IndividualCommonModelScopeDeserializer: + properties: + model_name: string + model_permissions: optional> + field_permissions: optional + source: + openapi: openapi/openapi.yml + IndividualCommonModelScopeDeserializerRequest: + properties: + model_name: + type: string + validation: + minLength: 1 + model_permissions: optional> + field_permissions: optional + source: + openapi: openapi/openapi.yml + IssueStatus: + discriminated: false + docs: |- + Status of the issue. Options: ('ONGOING', 'RESOLVED') + + * `ONGOING` - ONGOING + * `RESOLVED` - RESOLVED + union: + - IssueStatusEnum + - string + source: + openapi: openapi/openapi.yml + inline: true + Issue: + properties: + id: + type: optional + validation: + format: uuid + access: read-only + status: + type: optional + docs: |- + Status of the issue. Options: ('ONGOING', 'RESOLVED') + + * `ONGOING` - ONGOING + * `RESOLVED` - RESOLVED + error_description: string + end_user: + type: optional> + access: read-only + first_incident_time: optional + last_incident_time: optional + is_muted: + type: optional + access: read-only + error_details: + type: optional> + access: read-only + source: + openapi: openapi/openapi.yml + IssueStatusEnum: + enum: + - ONGOING + - RESOLVED + docs: |- + * `ONGOING` - ONGOING + * `RESOLVED` - RESOLVED + source: + openapi: openapi/openapi.yml + LanguageEnum: + enum: + - en + - de + docs: |- + * `en` - en + * `de` - de + source: + openapi: openapi/openapi.yml + LastSyncResultEnum: + enum: + - SYNCING + - DONE + - FAILED + - DISABLED + - PAUSED + - PARTIALLY_SYNCED + docs: |- + * `SYNCING` - SYNCING + * `DONE` - DONE + * `FAILED` - FAILED + * `DISABLED` - DISABLED + * `PAUSED` - PAUSED + * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED + source: + openapi: openapi/openapi.yml + LinkToken: + properties: + link_token: string + integration_name: optional + magic_link_url: optional + source: + openapi: openapi/openapi.yml + MethodEnum: + enum: + - GET + - OPTIONS + - HEAD + - POST + - PUT + - PATCH + - DELETE + docs: |- + * `GET` - GET + * `OPTIONS` - OPTIONS + * `HEAD` - HEAD + * `POST` - POST + * `PUT` - PUT + * `PATCH` - PATCH + * `DELETE` - DELETE + source: + openapi: openapi/openapi.yml + ModelOperation: + docs: >- + # The ModelOperation Object + + ### Description + + The `ModelOperation` object is used to represent the operations that are + currently supported for a given model. + + + ### Usage Example + + View what operations are supported for the `Candidate` endpoint. + properties: + model_name: string + available_operations: list + required_post_parameters: list + supported_fields: list + source: + openapi: openapi/openapi.yml + ModelPermissionDeserializer: + properties: + is_enabled: optional + source: + openapi: openapi/openapi.yml + ModelPermissionDeserializerRequest: + properties: + is_enabled: optional + source: + openapi: openapi/openapi.yml + MultipartFormFieldRequestEncoding: + discriminated: false + docs: |- + The encoding of the value of `data`. Defaults to `RAW` if not defined. + + * `RAW` - RAW + * `BASE64` - BASE64 + * `GZIP_BASE64` - GZIP_BASE64 + union: + - EncodingEnum + - string + source: + openapi: openapi/openapi.yml + inline: true + MultipartFormFieldRequest: + docs: >- + # The MultipartFormField Object + + ### Description + + The `MultipartFormField` object is used to represent fields in an HTTP + request using `multipart/form-data`. + + + ### Usage Example + + Create a `MultipartFormField` to define a multipart form entry. + properties: + name: + type: string + docs: The name of the form field + validation: + minLength: 1 + data: + type: string + docs: The data for the form field. + validation: + minLength: 1 + encoding: + type: optional + docs: |- + The encoding of the value of `data`. Defaults to `RAW` if not defined. + + * `RAW` - RAW + * `BASE64` - BASE64 + * `GZIP_BASE64` - GZIP_BASE64 + file_name: + type: optional + docs: The file name of the form field, if the field is for a file. + validation: + minLength: 1 + content_type: + type: optional + docs: The MIME type of the file, if the field is for a file. + validation: + minLength: 1 + source: + openapi: openapi/openapi.yml + PaginatedAccountDetailsAndActionsList: + properties: + next: optional + previous: optional + results: optional> + source: + openapi: openapi/openapi.yml + PaginatedArticleList: + properties: + next: optional + previous: optional + results: optional> + source: + openapi: openapi/openapi.yml + PaginatedAttachmentList: + properties: + next: optional + previous: optional + results: optional> + source: + openapi: openapi/openapi.yml + PaginatedAuditLogEventList: + properties: + next: optional + previous: optional + results: optional> + source: + openapi: openapi/openapi.yml + PaginatedContainerList: + properties: + next: optional + previous: optional + results: optional> + source: + openapi: openapi/openapi.yml + PaginatedGroupList: + properties: + next: optional + previous: optional + results: optional> + source: + openapi: openapi/openapi.yml + PaginatedIssueList: + properties: + next: optional + previous: optional + results: optional> + source: + openapi: openapi/openapi.yml + PaginatedSyncStatusList: + properties: + next: optional + previous: optional + results: optional> + source: + openapi: openapi/openapi.yml + PaginatedUserList: + properties: + next: optional + previous: optional + results: optional> + source: + openapi: openapi/openapi.yml + PermissionUser: + discriminated: false + union: + - type: string + validation: + format: uuid + - User + source: + openapi: openapi/openapi.yml + inline: true + PermissionGroup: + discriminated: false + union: + - type: string + validation: + format: uuid + - Group + source: + openapi: openapi/openapi.yml + inline: true + PermissionType: + discriminated: false + docs: |- + Denotes what type of people have access to the Article or Container. + + * `USER` - USER + * `GROUP` - GROUP + * `COMPANY` - COMPANY + * `ANYONE` - ANYONE + union: + - PermissionTypeEnum + - string + source: + openapi: openapi/openapi.yml + inline: true + Permission: + docs: >- + # The Permission Object + + ### Description + + The `Permission` object is used to represent a user's or group's access to + an article or container. Permissions are unexpanded by default. + + ### Usage Example + properties: + id: + type: optional + validation: + format: uuid + access: read-only + remote_id: + type: optional + docs: The third-party API ID of the matching object. + created_at: + type: optional + docs: The datetime that this object was created by Merge. + access: read-only + modified_at: + type: optional + docs: The datetime that this object was modified by Merge. + access: read-only + user: optional + group: optional + type: + type: optional + docs: |- + Denotes what type of people have access to the Article or Container. + + * `USER` - USER + * `GROUP` - GROUP + * `COMPANY` - COMPANY + * `ANYONE` - ANYONE + roles: + type: optional>> + docs: >- + The permissions that the user or group has for the Article or + Container. It is possible for a user or group to have multiple roles, + such as viewing & uploading. + remote_was_deleted: + type: optional + docs: >- + 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/). + access: read-only + field_mappings: + type: optional> + access: read-only + source: + openapi: openapi/openapi.yml + PermissionTypeEnum: + enum: + - USER + - GROUP + - COMPANY + - ANYONE + docs: |- + * `USER` - USER + * `GROUP` - GROUP + * `COMPANY` - COMPANY + * `ANYONE` - ANYONE + source: + openapi: openapi/openapi.yml + RemoteData: + docs: >- + # The RemoteData Object + + ### Description + + The `RemoteData` object is used to represent the full data pulled from the + third-party API for an object. + + + ### Usage Example + + TODO + properties: + path: + type: string + docs: The third-party API path that is being called. + data: + type: optional + access: read-only + source: + openapi: openapi/openapi.yml + RemoteEndpointInfo: + properties: + method: string + url_path: string + field_traversal_path: list + source: + openapi: openapi/openapi.yml + RemoteFieldApiAdvancedMetadata: + discriminated: false + union: + - AdvancedMetadata + - string + source: + openapi: openapi/openapi.yml + inline: true + RemoteFieldApiCoverage: + discriminated: false + union: + - integer + - double + source: + openapi: openapi/openapi.yml + inline: true + RemoteFieldApi: + properties: + schema: map + remote_key_name: string + remote_endpoint_info: RemoteEndpointInfo + example_values: optional> + advanced_metadata: optional + coverage: + type: optional + access: read-only + source: + openapi: openapi/openapi.yml + RemoteFieldApiResponse: + properties: + Container: optional> + Article: optional> + Attachment: optional> + User: optional> + Group: optional> + source: + openapi: openapi/openapi.yml + RemoteKey: + docs: >- + # The RemoteKey Object + + ### Description + + The `RemoteKey` object is used to represent a request for a new remote + key. + + + ### Usage Example + + Post a `GenerateRemoteKey` to receive a new `RemoteKey`. + properties: + name: string + key: string + source: + openapi: openapi/openapi.yml + RemoteResponseResponseType: + discriminated: false + union: + - ResponseTypeEnum + - string + source: + openapi: openapi/openapi.yml + inline: true + RemoteResponse: + docs: >- + # The RemoteResponse Object + + ### Description + + The `RemoteResponse` object is used to represent information returned from + a third-party endpoint. + + + ### Usage Example + + View the `RemoteResponse` returned from your `DataPassthrough`. + properties: + method: string + path: string + status: integer + response: unknown + response_headers: optional> + response_type: optional + headers: optional> + source: + openapi: openapi/openapi.yml + RequestFormatEnum: + enum: + - JSON + - XML + - MULTIPART + docs: |- + * `JSON` - JSON + * `XML` - XML + * `MULTIPART` - MULTIPART + source: + openapi: openapi/openapi.yml + ResponseTypeEnum: + enum: + - JSON + - BASE64_GZIP + docs: |- + * `JSON` - JSON + * `BASE64_GZIP` - BASE64_GZIP + source: + openapi: openapi/openapi.yml + RoleEnum: + enum: + - ADMIN + - DEVELOPER + - MEMBER + - API + - SYSTEM + - MERGE_TEAM + docs: |- + * `ADMIN` - ADMIN + * `DEVELOPER` - DEVELOPER + * `MEMBER` - MEMBER + * `API` - API + * `SYSTEM` - SYSTEM + * `MERGE_TEAM` - MERGE_TEAM + source: + openapi: openapi/openapi.yml + RolesEnum: + enum: + - READ + - WRITE + - OWNER + docs: |- + * `READ` - READ + * `WRITE` - WRITE + * `OWNER` - OWNER + source: + openapi: openapi/openapi.yml + SelectiveSyncConfigurationsUsageEnum: + enum: + - IN_NEXT_SYNC + - IN_LAST_SYNC + docs: |- + * `IN_NEXT_SYNC` - IN_NEXT_SYNC + * `IN_LAST_SYNC` - IN_LAST_SYNC + source: + openapi: openapi/openapi.yml + Status3C6Enum: + enum: + - DRAFT + - PUBLISHED + - ARCHIVED + - TRASH + docs: |- + * `DRAFT` - DRAFT + * `PUBLISHED` - PUBLISHED + * `ARCHIVED` - ARCHIVED + * `TRASH` - TRASH + source: + openapi: openapi/openapi.yml + StatusFd5Enum: + enum: + - SYNCING + - DONE + - FAILED + - DISABLED + - PAUSED + - PARTIALLY_SYNCED + docs: |- + * `SYNCING` - SYNCING + * `DONE` - DONE + * `FAILED` - FAILED + * `DISABLED` - DISABLED + * `PAUSED` - PAUSED + * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED + source: + openapi: openapi/openapi.yml + SyncStatusLastSyncResult: + discriminated: false + union: + - LastSyncResultEnum + - string + source: + openapi: openapi/openapi.yml + inline: true + SyncStatusStatus: + discriminated: false + union: + - StatusFd5Enum + - string + source: + openapi: openapi/openapi.yml + inline: true + SyncStatus: + docs: >- + # The SyncStatus Object + + ### Description + + The `SyncStatus` object is used to represent the syncing state of an + account + + + ### Usage Example + + View the `SyncStatus` for an account to see how recently its models were + synced. + properties: + model_name: string + model_id: string + last_sync_start: optional + next_sync_start: optional + last_sync_result: optional + last_sync_finished: optional + status: SyncStatusStatus + is_initial_sync: boolean + selective_sync_configurations_usage: optional + source: + openapi: openapi/openapi.yml + User: + docs: >- + # The User Object + + ### Description + + The `User` object is used to represent a user within the Knowledge Base + account. + + ### Usage Example + + Fetch from the `GET /api/knowledgebase/v1/users` endpoint and view their + users. + properties: + id: + type: optional + validation: + format: uuid + access: read-only + remote_id: + type: optional + docs: The third-party API ID of the matching object. + created_at: + type: optional + docs: The datetime that this object was created by Merge. + access: read-only + modified_at: + type: optional + docs: The datetime that this object was modified by Merge. + access: read-only + name: + type: optional + docs: The user's name. + validation: + maxLength: 254 + email_address: + type: optional + docs: The user's email address. + validation: + maxLength: 2000 + remote_was_deleted: + type: optional + docs: >- + 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/). + access: read-only + field_mappings: + type: optional> + access: read-only + source: + openapi: openapi/openapi.yml + ValidationProblemSource: + properties: + pointer: string + source: + openapi: openapi/openapi.yml + VisibilityEnum: + enum: + - PUBLIC + - INTERNAL + - RESTRICTED + docs: |- + * `PUBLIC` - PUBLIC + * `INTERNAL` - INTERNAL + * `RESTRICTED` - RESTRICTED + source: + openapi: openapi/openapi.yml + WarningValidationProblem: + properties: + source: optional + title: string + detail: string + problem_type: string + source: + openapi: openapi/openapi.yml + WebhookReceiver: + properties: + event: string + is_active: boolean + key: optional + source: + openapi: openapi/openapi.yml diff --git a/.mock/definition/knowledgebase/accountDetails.yml b/.mock/definition/knowledgebase/accountDetails.yml new file mode 100644 index 00000000..06ff462a --- /dev/null +++ b/.mock/definition/knowledgebase/accountDetails.yml @@ -0,0 +1,37 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + retrieve: + path: /knowledgebase/v1/account-details + method: GET + auth: true + docs: Get details for a linked account. + source: + openapi: openapi/openapi.yml + response: + docs: '' + type: root.AccountDetails + status-code: 200 + examples: + - headers: + X-Account-Token: X-Account-Token + response: + body: + id: 0496d4c2-42e6-4072-80b3-7b69bfdc76fd + integration: BambooHR + integration_slug: bamboohr + category: hris + end_user_origin_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + end_user_organization_name: Waystar Royco + end_user_email_address: kendall.roy@waystar-royco.com + status: COMPLETE + webhook_listener_url: >- + https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4 + is_duplicate: true + account_type: PRODUCTION + completed_at: '2024-08-26T20:11:19Z' + source: + openapi: openapi/openapi.yml diff --git a/.mock/definition/knowledgebase/accountToken.yml b/.mock/definition/knowledgebase/accountToken.yml new file mode 100644 index 00000000..7cbde0f3 --- /dev/null +++ b/.mock/definition/knowledgebase/accountToken.yml @@ -0,0 +1,46 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + retrieve: + path: /knowledgebase/v1/account-token/{public_token} + method: GET + auth: true + docs: >- + Returns the account token for the end user with the provided public + token. + source: + openapi: openapi/openapi.yml + path-parameters: + public_token: string + response: + docs: '' + type: root.AccountToken + status-code: 200 + examples: + - path-parameters: + public_token: public_token + headers: + X-Account-Token: '[object Object]' + response: + body: + account_token: T9klMDQrcHdm9jrtHuOS2Nf06BIHwMNjpPXPMB + integration: + name: name + abbreviated_name: abbreviated_name + categories: + - hris + image: image + square_image: square_image + color: color + slug: slug + api_endpoints_to_documentation_urls: + key: value + webhook_setup_guide_url: webhook_setup_guide_url + category_beta_status: + key: value + id: 0496d4c2-42e6-4072-80b3-7b69bfdc76fd + source: + openapi: openapi/openapi.yml diff --git a/.mock/definition/knowledgebase/articles.yml b/.mock/definition/knowledgebase/articles.yml new file mode 100644 index 00000000..b2d3fdc6 --- /dev/null +++ b/.mock/definition/knowledgebase/articles.yml @@ -0,0 +1,757 @@ +types: + ArticlesListRequestExpand: + enum: + - attachments + - value: attachments,author + name: AttachmentsAuthor + - value: attachments,author,last_edited_by + name: AttachmentsAuthorLastEditedBy + - value: attachments,author,last_edited_by,parent_article + name: AttachmentsAuthorLastEditedByParentArticle + - value: attachments,author,last_edited_by,parent_article,parent_container + name: AttachmentsAuthorLastEditedByParentArticleParentContainer + - value: >- + attachments,author,last_edited_by,parent_article,parent_container,root_container + name: AttachmentsAuthorLastEditedByParentArticleParentContainerRootContainer + - value: attachments,author,last_edited_by,parent_article,root_container + name: AttachmentsAuthorLastEditedByParentArticleRootContainer + - value: attachments,author,last_edited_by,parent_container + name: AttachmentsAuthorLastEditedByParentContainer + - value: attachments,author,last_edited_by,parent_container,root_container + name: AttachmentsAuthorLastEditedByParentContainerRootContainer + - value: attachments,author,last_edited_by,root_container + name: AttachmentsAuthorLastEditedByRootContainer + - value: attachments,author,parent_article + name: AttachmentsAuthorParentArticle + - value: attachments,author,parent_article,parent_container + name: AttachmentsAuthorParentArticleParentContainer + - value: attachments,author,parent_article,parent_container,root_container + name: AttachmentsAuthorParentArticleParentContainerRootContainer + - value: attachments,author,parent_article,root_container + name: AttachmentsAuthorParentArticleRootContainer + - value: attachments,author,parent_container + name: AttachmentsAuthorParentContainer + - value: attachments,author,parent_container,root_container + name: AttachmentsAuthorParentContainerRootContainer + - value: attachments,author,root_container + name: AttachmentsAuthorRootContainer + - value: attachments,last_edited_by + name: AttachmentsLastEditedBy + - value: attachments,last_edited_by,parent_article + name: AttachmentsLastEditedByParentArticle + - value: attachments,last_edited_by,parent_article,parent_container + name: AttachmentsLastEditedByParentArticleParentContainer + - value: >- + attachments,last_edited_by,parent_article,parent_container,root_container + name: AttachmentsLastEditedByParentArticleParentContainerRootContainer + - value: attachments,last_edited_by,parent_article,root_container + name: AttachmentsLastEditedByParentArticleRootContainer + - value: attachments,last_edited_by,parent_container + name: AttachmentsLastEditedByParentContainer + - value: attachments,last_edited_by,parent_container,root_container + name: AttachmentsLastEditedByParentContainerRootContainer + - value: attachments,last_edited_by,root_container + name: AttachmentsLastEditedByRootContainer + - value: attachments,parent_article + name: AttachmentsParentArticle + - value: attachments,parent_article,parent_container + name: AttachmentsParentArticleParentContainer + - value: attachments,parent_article,parent_container,root_container + name: AttachmentsParentArticleParentContainerRootContainer + - value: attachments,parent_article,root_container + name: AttachmentsParentArticleRootContainer + - value: attachments,parent_container + name: AttachmentsParentContainer + - value: attachments,parent_container,root_container + name: AttachmentsParentContainerRootContainer + - value: attachments,root_container + name: AttachmentsRootContainer + - author + - value: author,last_edited_by + name: AuthorLastEditedBy + - value: author,last_edited_by,parent_article + name: AuthorLastEditedByParentArticle + - value: author,last_edited_by,parent_article,parent_container + name: AuthorLastEditedByParentArticleParentContainer + - value: author,last_edited_by,parent_article,parent_container,root_container + name: AuthorLastEditedByParentArticleParentContainerRootContainer + - value: author,last_edited_by,parent_article,root_container + name: AuthorLastEditedByParentArticleRootContainer + - value: author,last_edited_by,parent_container + name: AuthorLastEditedByParentContainer + - value: author,last_edited_by,parent_container,root_container + name: AuthorLastEditedByParentContainerRootContainer + - value: author,last_edited_by,root_container + name: AuthorLastEditedByRootContainer + - value: author,parent_article + name: AuthorParentArticle + - value: author,parent_article,parent_container + name: AuthorParentArticleParentContainer + - value: author,parent_article,parent_container,root_container + name: AuthorParentArticleParentContainerRootContainer + - value: author,parent_article,root_container + name: AuthorParentArticleRootContainer + - value: author,parent_container + name: AuthorParentContainer + - value: author,parent_container,root_container + name: AuthorParentContainerRootContainer + - value: author,root_container + name: AuthorRootContainer + - last_edited_by + - value: last_edited_by,parent_article + name: LastEditedByParentArticle + - value: last_edited_by,parent_article,parent_container + name: LastEditedByParentArticleParentContainer + - value: last_edited_by,parent_article,parent_container,root_container + name: LastEditedByParentArticleParentContainerRootContainer + - value: last_edited_by,parent_article,root_container + name: LastEditedByParentArticleRootContainer + - value: last_edited_by,parent_container + name: LastEditedByParentContainer + - value: last_edited_by,parent_container,root_container + name: LastEditedByParentContainerRootContainer + - value: last_edited_by,root_container + name: LastEditedByRootContainer + - parent_article + - value: parent_article,parent_container + name: ParentArticleParentContainer + - value: parent_article,parent_container,root_container + name: ParentArticleParentContainerRootContainer + - value: parent_article,root_container + name: ParentArticleRootContainer + - parent_container + - value: parent_container,root_container + name: ParentContainerRootContainer + - permissions + - value: permissions,attachments + name: PermissionsAttachments + - value: permissions,attachments,author + name: PermissionsAttachmentsAuthor + - value: permissions,attachments,author,last_edited_by + name: PermissionsAttachmentsAuthorLastEditedBy + - value: permissions,attachments,author,last_edited_by,parent_article + name: PermissionsAttachmentsAuthorLastEditedByParentArticle + - value: >- + permissions,attachments,author,last_edited_by,parent_article,parent_container + name: PermissionsAttachmentsAuthorLastEditedByParentArticleParentContainer + - value: >- + permissions,attachments,author,last_edited_by,parent_article,parent_container,root_container + name: >- + PermissionsAttachmentsAuthorLastEditedByParentArticleParentContainerRootContainer + - value: >- + permissions,attachments,author,last_edited_by,parent_article,root_container + name: PermissionsAttachmentsAuthorLastEditedByParentArticleRootContainer + - value: permissions,attachments,author,last_edited_by,parent_container + name: PermissionsAttachmentsAuthorLastEditedByParentContainer + - value: >- + permissions,attachments,author,last_edited_by,parent_container,root_container + name: PermissionsAttachmentsAuthorLastEditedByParentContainerRootContainer + - value: permissions,attachments,author,last_edited_by,root_container + name: PermissionsAttachmentsAuthorLastEditedByRootContainer + - value: permissions,attachments,author,parent_article + name: PermissionsAttachmentsAuthorParentArticle + - value: permissions,attachments,author,parent_article,parent_container + name: PermissionsAttachmentsAuthorParentArticleParentContainer + - value: >- + permissions,attachments,author,parent_article,parent_container,root_container + name: PermissionsAttachmentsAuthorParentArticleParentContainerRootContainer + - value: permissions,attachments,author,parent_article,root_container + name: PermissionsAttachmentsAuthorParentArticleRootContainer + - value: permissions,attachments,author,parent_container + name: PermissionsAttachmentsAuthorParentContainer + - value: permissions,attachments,author,parent_container,root_container + name: PermissionsAttachmentsAuthorParentContainerRootContainer + - value: permissions,attachments,author,root_container + name: PermissionsAttachmentsAuthorRootContainer + - value: permissions,attachments,last_edited_by + name: PermissionsAttachmentsLastEditedBy + - value: permissions,attachments,last_edited_by,parent_article + name: PermissionsAttachmentsLastEditedByParentArticle + - value: permissions,attachments,last_edited_by,parent_article,parent_container + name: PermissionsAttachmentsLastEditedByParentArticleParentContainer + - value: >- + permissions,attachments,last_edited_by,parent_article,parent_container,root_container + name: >- + PermissionsAttachmentsLastEditedByParentArticleParentContainerRootContainer + - value: permissions,attachments,last_edited_by,parent_article,root_container + name: PermissionsAttachmentsLastEditedByParentArticleRootContainer + - value: permissions,attachments,last_edited_by,parent_container + name: PermissionsAttachmentsLastEditedByParentContainer + - value: permissions,attachments,last_edited_by,parent_container,root_container + name: PermissionsAttachmentsLastEditedByParentContainerRootContainer + - value: permissions,attachments,last_edited_by,root_container + name: PermissionsAttachmentsLastEditedByRootContainer + - value: permissions,attachments,parent_article + name: PermissionsAttachmentsParentArticle + - value: permissions,attachments,parent_article,parent_container + name: PermissionsAttachmentsParentArticleParentContainer + - value: permissions,attachments,parent_article,parent_container,root_container + name: PermissionsAttachmentsParentArticleParentContainerRootContainer + - value: permissions,attachments,parent_article,root_container + name: PermissionsAttachmentsParentArticleRootContainer + - value: permissions,attachments,parent_container + name: PermissionsAttachmentsParentContainer + - value: permissions,attachments,parent_container,root_container + name: PermissionsAttachmentsParentContainerRootContainer + - value: permissions,attachments,root_container + name: PermissionsAttachmentsRootContainer + - value: permissions,author + name: PermissionsAuthor + - value: permissions,author,last_edited_by + name: PermissionsAuthorLastEditedBy + - value: permissions,author,last_edited_by,parent_article + name: PermissionsAuthorLastEditedByParentArticle + - value: permissions,author,last_edited_by,parent_article,parent_container + name: PermissionsAuthorLastEditedByParentArticleParentContainer + - value: >- + permissions,author,last_edited_by,parent_article,parent_container,root_container + name: PermissionsAuthorLastEditedByParentArticleParentContainerRootContainer + - value: permissions,author,last_edited_by,parent_article,root_container + name: PermissionsAuthorLastEditedByParentArticleRootContainer + - value: permissions,author,last_edited_by,parent_container + name: PermissionsAuthorLastEditedByParentContainer + - value: permissions,author,last_edited_by,parent_container,root_container + name: PermissionsAuthorLastEditedByParentContainerRootContainer + - value: permissions,author,last_edited_by,root_container + name: PermissionsAuthorLastEditedByRootContainer + - value: permissions,author,parent_article + name: PermissionsAuthorParentArticle + - value: permissions,author,parent_article,parent_container + name: PermissionsAuthorParentArticleParentContainer + - value: permissions,author,parent_article,parent_container,root_container + name: PermissionsAuthorParentArticleParentContainerRootContainer + - value: permissions,author,parent_article,root_container + name: PermissionsAuthorParentArticleRootContainer + - value: permissions,author,parent_container + name: PermissionsAuthorParentContainer + - value: permissions,author,parent_container,root_container + name: PermissionsAuthorParentContainerRootContainer + - value: permissions,author,root_container + name: PermissionsAuthorRootContainer + - value: permissions,last_edited_by + name: PermissionsLastEditedBy + - value: permissions,last_edited_by,parent_article + name: PermissionsLastEditedByParentArticle + - value: permissions,last_edited_by,parent_article,parent_container + name: PermissionsLastEditedByParentArticleParentContainer + - value: >- + permissions,last_edited_by,parent_article,parent_container,root_container + name: PermissionsLastEditedByParentArticleParentContainerRootContainer + - value: permissions,last_edited_by,parent_article,root_container + name: PermissionsLastEditedByParentArticleRootContainer + - value: permissions,last_edited_by,parent_container + name: PermissionsLastEditedByParentContainer + - value: permissions,last_edited_by,parent_container,root_container + name: PermissionsLastEditedByParentContainerRootContainer + - value: permissions,last_edited_by,root_container + name: PermissionsLastEditedByRootContainer + - value: permissions,parent_article + name: PermissionsParentArticle + - value: permissions,parent_article,parent_container + name: PermissionsParentArticleParentContainer + - value: permissions,parent_article,parent_container,root_container + name: PermissionsParentArticleParentContainerRootContainer + - value: permissions,parent_article,root_container + name: PermissionsParentArticleRootContainer + - value: permissions,parent_container + name: PermissionsParentContainer + - value: permissions,parent_container,root_container + name: PermissionsParentContainerRootContainer + - value: permissions,root_container + name: PermissionsRootContainer + - root_container + source: + openapi: openapi/openapi.yml + ArticlesRetrieveRequestExpand: + enum: + - attachments + - value: attachments,author + name: AttachmentsAuthor + - value: attachments,author,last_edited_by + name: AttachmentsAuthorLastEditedBy + - value: attachments,author,last_edited_by,parent_article + name: AttachmentsAuthorLastEditedByParentArticle + - value: attachments,author,last_edited_by,parent_article,parent_container + name: AttachmentsAuthorLastEditedByParentArticleParentContainer + - value: >- + attachments,author,last_edited_by,parent_article,parent_container,root_container + name: AttachmentsAuthorLastEditedByParentArticleParentContainerRootContainer + - value: attachments,author,last_edited_by,parent_article,root_container + name: AttachmentsAuthorLastEditedByParentArticleRootContainer + - value: attachments,author,last_edited_by,parent_container + name: AttachmentsAuthorLastEditedByParentContainer + - value: attachments,author,last_edited_by,parent_container,root_container + name: AttachmentsAuthorLastEditedByParentContainerRootContainer + - value: attachments,author,last_edited_by,root_container + name: AttachmentsAuthorLastEditedByRootContainer + - value: attachments,author,parent_article + name: AttachmentsAuthorParentArticle + - value: attachments,author,parent_article,parent_container + name: AttachmentsAuthorParentArticleParentContainer + - value: attachments,author,parent_article,parent_container,root_container + name: AttachmentsAuthorParentArticleParentContainerRootContainer + - value: attachments,author,parent_article,root_container + name: AttachmentsAuthorParentArticleRootContainer + - value: attachments,author,parent_container + name: AttachmentsAuthorParentContainer + - value: attachments,author,parent_container,root_container + name: AttachmentsAuthorParentContainerRootContainer + - value: attachments,author,root_container + name: AttachmentsAuthorRootContainer + - value: attachments,last_edited_by + name: AttachmentsLastEditedBy + - value: attachments,last_edited_by,parent_article + name: AttachmentsLastEditedByParentArticle + - value: attachments,last_edited_by,parent_article,parent_container + name: AttachmentsLastEditedByParentArticleParentContainer + - value: >- + attachments,last_edited_by,parent_article,parent_container,root_container + name: AttachmentsLastEditedByParentArticleParentContainerRootContainer + - value: attachments,last_edited_by,parent_article,root_container + name: AttachmentsLastEditedByParentArticleRootContainer + - value: attachments,last_edited_by,parent_container + name: AttachmentsLastEditedByParentContainer + - value: attachments,last_edited_by,parent_container,root_container + name: AttachmentsLastEditedByParentContainerRootContainer + - value: attachments,last_edited_by,root_container + name: AttachmentsLastEditedByRootContainer + - value: attachments,parent_article + name: AttachmentsParentArticle + - value: attachments,parent_article,parent_container + name: AttachmentsParentArticleParentContainer + - value: attachments,parent_article,parent_container,root_container + name: AttachmentsParentArticleParentContainerRootContainer + - value: attachments,parent_article,root_container + name: AttachmentsParentArticleRootContainer + - value: attachments,parent_container + name: AttachmentsParentContainer + - value: attachments,parent_container,root_container + name: AttachmentsParentContainerRootContainer + - value: attachments,root_container + name: AttachmentsRootContainer + - author + - value: author,last_edited_by + name: AuthorLastEditedBy + - value: author,last_edited_by,parent_article + name: AuthorLastEditedByParentArticle + - value: author,last_edited_by,parent_article,parent_container + name: AuthorLastEditedByParentArticleParentContainer + - value: author,last_edited_by,parent_article,parent_container,root_container + name: AuthorLastEditedByParentArticleParentContainerRootContainer + - value: author,last_edited_by,parent_article,root_container + name: AuthorLastEditedByParentArticleRootContainer + - value: author,last_edited_by,parent_container + name: AuthorLastEditedByParentContainer + - value: author,last_edited_by,parent_container,root_container + name: AuthorLastEditedByParentContainerRootContainer + - value: author,last_edited_by,root_container + name: AuthorLastEditedByRootContainer + - value: author,parent_article + name: AuthorParentArticle + - value: author,parent_article,parent_container + name: AuthorParentArticleParentContainer + - value: author,parent_article,parent_container,root_container + name: AuthorParentArticleParentContainerRootContainer + - value: author,parent_article,root_container + name: AuthorParentArticleRootContainer + - value: author,parent_container + name: AuthorParentContainer + - value: author,parent_container,root_container + name: AuthorParentContainerRootContainer + - value: author,root_container + name: AuthorRootContainer + - last_edited_by + - value: last_edited_by,parent_article + name: LastEditedByParentArticle + - value: last_edited_by,parent_article,parent_container + name: LastEditedByParentArticleParentContainer + - value: last_edited_by,parent_article,parent_container,root_container + name: LastEditedByParentArticleParentContainerRootContainer + - value: last_edited_by,parent_article,root_container + name: LastEditedByParentArticleRootContainer + - value: last_edited_by,parent_container + name: LastEditedByParentContainer + - value: last_edited_by,parent_container,root_container + name: LastEditedByParentContainerRootContainer + - value: last_edited_by,root_container + name: LastEditedByRootContainer + - parent_article + - value: parent_article,parent_container + name: ParentArticleParentContainer + - value: parent_article,parent_container,root_container + name: ParentArticleParentContainerRootContainer + - value: parent_article,root_container + name: ParentArticleRootContainer + - parent_container + - value: parent_container,root_container + name: ParentContainerRootContainer + - permissions + - value: permissions,attachments + name: PermissionsAttachments + - value: permissions,attachments,author + name: PermissionsAttachmentsAuthor + - value: permissions,attachments,author,last_edited_by + name: PermissionsAttachmentsAuthorLastEditedBy + - value: permissions,attachments,author,last_edited_by,parent_article + name: PermissionsAttachmentsAuthorLastEditedByParentArticle + - value: >- + permissions,attachments,author,last_edited_by,parent_article,parent_container + name: PermissionsAttachmentsAuthorLastEditedByParentArticleParentContainer + - value: >- + permissions,attachments,author,last_edited_by,parent_article,parent_container,root_container + name: >- + PermissionsAttachmentsAuthorLastEditedByParentArticleParentContainerRootContainer + - value: >- + permissions,attachments,author,last_edited_by,parent_article,root_container + name: PermissionsAttachmentsAuthorLastEditedByParentArticleRootContainer + - value: permissions,attachments,author,last_edited_by,parent_container + name: PermissionsAttachmentsAuthorLastEditedByParentContainer + - value: >- + permissions,attachments,author,last_edited_by,parent_container,root_container + name: PermissionsAttachmentsAuthorLastEditedByParentContainerRootContainer + - value: permissions,attachments,author,last_edited_by,root_container + name: PermissionsAttachmentsAuthorLastEditedByRootContainer + - value: permissions,attachments,author,parent_article + name: PermissionsAttachmentsAuthorParentArticle + - value: permissions,attachments,author,parent_article,parent_container + name: PermissionsAttachmentsAuthorParentArticleParentContainer + - value: >- + permissions,attachments,author,parent_article,parent_container,root_container + name: PermissionsAttachmentsAuthorParentArticleParentContainerRootContainer + - value: permissions,attachments,author,parent_article,root_container + name: PermissionsAttachmentsAuthorParentArticleRootContainer + - value: permissions,attachments,author,parent_container + name: PermissionsAttachmentsAuthorParentContainer + - value: permissions,attachments,author,parent_container,root_container + name: PermissionsAttachmentsAuthorParentContainerRootContainer + - value: permissions,attachments,author,root_container + name: PermissionsAttachmentsAuthorRootContainer + - value: permissions,attachments,last_edited_by + name: PermissionsAttachmentsLastEditedBy + - value: permissions,attachments,last_edited_by,parent_article + name: PermissionsAttachmentsLastEditedByParentArticle + - value: permissions,attachments,last_edited_by,parent_article,parent_container + name: PermissionsAttachmentsLastEditedByParentArticleParentContainer + - value: >- + permissions,attachments,last_edited_by,parent_article,parent_container,root_container + name: >- + PermissionsAttachmentsLastEditedByParentArticleParentContainerRootContainer + - value: permissions,attachments,last_edited_by,parent_article,root_container + name: PermissionsAttachmentsLastEditedByParentArticleRootContainer + - value: permissions,attachments,last_edited_by,parent_container + name: PermissionsAttachmentsLastEditedByParentContainer + - value: permissions,attachments,last_edited_by,parent_container,root_container + name: PermissionsAttachmentsLastEditedByParentContainerRootContainer + - value: permissions,attachments,last_edited_by,root_container + name: PermissionsAttachmentsLastEditedByRootContainer + - value: permissions,attachments,parent_article + name: PermissionsAttachmentsParentArticle + - value: permissions,attachments,parent_article,parent_container + name: PermissionsAttachmentsParentArticleParentContainer + - value: permissions,attachments,parent_article,parent_container,root_container + name: PermissionsAttachmentsParentArticleParentContainerRootContainer + - value: permissions,attachments,parent_article,root_container + name: PermissionsAttachmentsParentArticleRootContainer + - value: permissions,attachments,parent_container + name: PermissionsAttachmentsParentContainer + - value: permissions,attachments,parent_container,root_container + name: PermissionsAttachmentsParentContainerRootContainer + - value: permissions,attachments,root_container + name: PermissionsAttachmentsRootContainer + - value: permissions,author + name: PermissionsAuthor + - value: permissions,author,last_edited_by + name: PermissionsAuthorLastEditedBy + - value: permissions,author,last_edited_by,parent_article + name: PermissionsAuthorLastEditedByParentArticle + - value: permissions,author,last_edited_by,parent_article,parent_container + name: PermissionsAuthorLastEditedByParentArticleParentContainer + - value: >- + permissions,author,last_edited_by,parent_article,parent_container,root_container + name: PermissionsAuthorLastEditedByParentArticleParentContainerRootContainer + - value: permissions,author,last_edited_by,parent_article,root_container + name: PermissionsAuthorLastEditedByParentArticleRootContainer + - value: permissions,author,last_edited_by,parent_container + name: PermissionsAuthorLastEditedByParentContainer + - value: permissions,author,last_edited_by,parent_container,root_container + name: PermissionsAuthorLastEditedByParentContainerRootContainer + - value: permissions,author,last_edited_by,root_container + name: PermissionsAuthorLastEditedByRootContainer + - value: permissions,author,parent_article + name: PermissionsAuthorParentArticle + - value: permissions,author,parent_article,parent_container + name: PermissionsAuthorParentArticleParentContainer + - value: permissions,author,parent_article,parent_container,root_container + name: PermissionsAuthorParentArticleParentContainerRootContainer + - value: permissions,author,parent_article,root_container + name: PermissionsAuthorParentArticleRootContainer + - value: permissions,author,parent_container + name: PermissionsAuthorParentContainer + - value: permissions,author,parent_container,root_container + name: PermissionsAuthorParentContainerRootContainer + - value: permissions,author,root_container + name: PermissionsAuthorRootContainer + - value: permissions,last_edited_by + name: PermissionsLastEditedBy + - value: permissions,last_edited_by,parent_article + name: PermissionsLastEditedByParentArticle + - value: permissions,last_edited_by,parent_article,parent_container + name: PermissionsLastEditedByParentArticleParentContainer + - value: >- + permissions,last_edited_by,parent_article,parent_container,root_container + name: PermissionsLastEditedByParentArticleParentContainerRootContainer + - value: permissions,last_edited_by,parent_article,root_container + name: PermissionsLastEditedByParentArticleRootContainer + - value: permissions,last_edited_by,parent_container + name: PermissionsLastEditedByParentContainer + - value: permissions,last_edited_by,parent_container,root_container + name: PermissionsLastEditedByParentContainerRootContainer + - value: permissions,last_edited_by,root_container + name: PermissionsLastEditedByRootContainer + - value: permissions,parent_article + name: PermissionsParentArticle + - value: permissions,parent_article,parent_container + name: PermissionsParentArticleParentContainer + - value: permissions,parent_article,parent_container,root_container + name: PermissionsParentArticleParentContainerRootContainer + - value: permissions,parent_article,root_container + name: PermissionsParentArticleRootContainer + - value: permissions,parent_container + name: PermissionsParentContainer + - value: permissions,parent_container,root_container + name: PermissionsParentContainerRootContainer + - value: permissions,root_container + name: PermissionsRootContainer + - root_container + source: + openapi: openapi/openapi.yml +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /knowledgebase/v1/articles + method: GET + auth: true + docs: Returns a list of `Article` objects. + source: + openapi: openapi/openapi.yml + request: + name: ArticlesListRequest + query-parameters: + created_after: + type: optional + docs: If provided, will only return objects created after this datetime. + created_before: + type: optional + docs: >- + If provided, will only return objects created before this + datetime. + cursor: + type: optional + docs: The pagination cursor value. + expand: + type: optional + docs: >- + Which relations should be returned in expanded form. Multiple + relation names should be comma separated without spaces. + include_deleted_data: + type: optional + docs: >- + 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: + type: optional + docs: >- + Whether to include the original data Merge fetched from the + third-party to produce these models. + include_shell_data: + type: optional + docs: >- + Whether to include shell records. Shell records are empty records + (they may contain some metadata but all other fields are null). + modified_after: + type: optional + docs: >- + If provided, only objects synced by Merge after this date time + will be returned. + modified_before: + type: optional + docs: >- + If provided, only objects synced by Merge before this date time + will be returned. + page_size: + type: optional + docs: Number of results to return per page. + parent_article_id: + type: optional + docs: >- + If provided, will only return sub articles of the + parent_article_id. + validation: + format: uuid + parent_container_id: + type: optional + docs: >- + If provided, will only return sub articles of the + parent_container_id. + validation: + format: uuid + remote_id: + type: optional + docs: The API provider's ID for the given object. + type: + type: optional + docs: If provided, will only return articles of the given type. + response: + docs: '' + type: root.PaginatedArticleList + status-code: 200 + examples: + - query-parameters: + cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + headers: + X-Account-Token: X-Account-Token + response: + body: + next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ + results: + - id: 134e0111-0f67-44f6-98f0-597000290bb3 + remote_id: '800293' + created_at: '2021-09-15T00:00:00Z' + modified_at: '2021-10-16T00:00:00Z' + title: Test Article + description: >- + This article describes how Merge is the #1 player in the + Unified API space + author: author + last_edited_by: last_edited_by + visibility: PUBLIC + article_content_download_url: >- + https://s3.amazonaws.com/finance-department-bucket/2022/tax-certificate.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA3SGQVQG7FGA6KKA6%2F20221104%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221104T140227Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=b228dbec8c1008c80c162e1210e4503dceead1e4d4751b4d9787314fd6da4d55 + checksum: >- + b228dbec8c1008c80c162e1210e4503dceead1e4d4751b4d9787314fd6da4d55 + article_url: myworkspace.atlassian.net/wiki/test-article + status: DRAFT + type: PAGE + remote_created_at: '2021-09-15T00:00:00Z' + remote_updated_at: '2021-09-16T00:00:00Z' + parent_article: parent_article + parent_container: parent_container + root_container: root_container + permissions: + - id: 31ce489c-asdf-68b1-754r-629f799f7123 + remote_id: '102895' + created_at: '2020-03-31T00:00:00Z' + modified_at: '2020-06-20T00:00:00Z' + user: 21ce474c-asdf-34a2-754r-629f799f7d12 + type: USER + roles: + - OWNER + attachments: + - 640b80b-fac9-409f-aa19-1f9221aec445 + remote_was_deleted: true + field_mappings: + organization_defined_targets: + custom_key: custom_value + linked_account_defined_targets: + custom_key: custom_value + remote_data: + - path: /articles + data: + - Varies by platform + retrieve: + path: /knowledgebase/v1/articles/{id} + method: GET + auth: true + docs: Returns an `Article` object with the given `id`. + source: + openapi: openapi/openapi.yml + path-parameters: + id: string + request: + name: ArticlesRetrieveRequest + query-parameters: + expand: + type: optional + docs: >- + Which relations should be returned in expanded form. Multiple + relation names should be comma separated without spaces. + include_remote_data: + type: optional + docs: >- + Whether to include the original data Merge fetched from the + third-party to produce these models. + include_shell_data: + type: optional + docs: >- + Whether to include shell records. Shell records are empty records + (they may contain some metadata but all other fields are null). + response: + docs: '' + type: root.Article + status-code: 200 + examples: + - path-parameters: + id: id + headers: + X-Account-Token: X-Account-Token + response: + body: + id: 134e0111-0f67-44f6-98f0-597000290bb3 + remote_id: '800293' + created_at: '2021-09-15T00:00:00Z' + modified_at: '2021-10-16T00:00:00Z' + title: Test Article + description: >- + This article describes how Merge is the #1 player in the Unified + API space + author: author + last_edited_by: last_edited_by + visibility: PUBLIC + article_content_download_url: >- + https://s3.amazonaws.com/finance-department-bucket/2022/tax-certificate.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA3SGQVQG7FGA6KKA6%2F20221104%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20221104T140227Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=b228dbec8c1008c80c162e1210e4503dceead1e4d4751b4d9787314fd6da4d55 + checksum: b228dbec8c1008c80c162e1210e4503dceead1e4d4751b4d9787314fd6da4d55 + article_url: myworkspace.atlassian.net/wiki/test-article + status: DRAFT + type: PAGE + remote_created_at: '2021-09-15T00:00:00Z' + remote_updated_at: '2021-09-16T00:00:00Z' + parent_article: parent_article + parent_container: parent_container + root_container: root_container + permissions: + - id: 31ce489c-asdf-68b1-754r-629f799f7123 + remote_id: '102895' + created_at: '2020-03-31T00:00:00Z' + modified_at: '2020-06-20T00:00:00Z' + user: 21ce474c-asdf-34a2-754r-629f799f7d12 + type: USER + roles: + - OWNER + remote_was_deleted: true + field_mappings: + organization_defined_targets: + custom_key: custom_value + linked_account_defined_targets: + custom_key: custom_value + attachments: + - 640b80b-fac9-409f-aa19-1f9221aec445 + remote_was_deleted: true + field_mappings: + organization_defined_targets: + custom_key: custom_value + linked_account_defined_targets: + custom_key: custom_value + remote_data: + - path: /articles + data: + - Varies by platform + source: + openapi: openapi/openapi.yml diff --git a/.mock/definition/knowledgebase/asyncPassthrough.yml b/.mock/definition/knowledgebase/asyncPassthrough.yml new file mode 100644 index 00000000..12e4aab7 --- /dev/null +++ b/.mock/definition/knowledgebase/asyncPassthrough.yml @@ -0,0 +1,72 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /knowledgebase/v1/async-passthrough + method: POST + auth: true + docs: >- + Asynchronously pull data from an endpoint not currently supported by + Merge. + source: + openapi: openapi/openapi.yml + request: + body: root.DataPassthroughRequest + content-type: application/json + response: + docs: '' + type: root.AsyncPassthroughReciept + status-code: 200 + examples: + - headers: + X-Account-Token: X-Account-Token + request: + method: GET + path: /scooters + response: + body: + async_passthrough_receipt_id: fd29020f-2695-445e-922e-dcd5e81903fd + retrieve: + path: /knowledgebase/v1/async-passthrough/{async_passthrough_receipt_id} + method: GET + auth: true + docs: Retrieves data from earlier async-passthrough POST request + source: + openapi: openapi/openapi.yml + path-parameters: + async_passthrough_receipt_id: string + response: + docs: '' + type: AsyncPassthroughRetrieveResponse + status-code: 200 + examples: + - path-parameters: + async_passthrough_receipt_id: async_passthrough_receipt_id + headers: + X-Account-Token: X-Account-Token + response: + body: + method: GET + path: /scooters + status: 200 + response: + key: value + response_headers: + X-Page-Token: value + response_type: JSON + headers: + EXTRA-HEADER: value + Authorization: + source: + openapi: openapi/openapi.yml +types: + AsyncPassthroughRetrieveResponse: + discriminated: false + union: + - root.RemoteResponse + - string + source: + openapi: openapi/openapi.yml diff --git a/.mock/definition/knowledgebase/attachments.yml b/.mock/definition/knowledgebase/attachments.yml new file mode 100644 index 00000000..f2826161 --- /dev/null +++ b/.mock/definition/knowledgebase/attachments.yml @@ -0,0 +1,144 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /knowledgebase/v1/attachments + method: GET + auth: true + docs: Returns a list of `Attachment` objects. + source: + openapi: openapi/openapi.yml + request: + name: AttachmentsListRequest + query-parameters: + created_after: + type: optional + docs: If provided, will only return objects created after this datetime. + created_before: + type: optional + docs: >- + If provided, will only return objects created before this + datetime. + cursor: + type: optional + docs: The pagination cursor value. + include_deleted_data: + type: optional + docs: >- + 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: + type: optional + docs: >- + Whether to include the original data Merge fetched from the + third-party to produce these models. + include_shell_data: + type: optional + docs: >- + Whether to include shell records. Shell records are empty records + (they may contain some metadata but all other fields are null). + modified_after: + type: optional + docs: >- + If provided, only objects synced by Merge after this date time + will be returned. + modified_before: + type: optional + docs: >- + If provided, only objects synced by Merge before this date time + will be returned. + page_size: + type: optional + docs: Number of results to return per page. + remote_id: + type: optional + docs: The API provider's ID for the given object. + response: + docs: '' + type: root.PaginatedAttachmentList + status-code: 200 + examples: + - query-parameters: + cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + headers: + X-Account-Token: X-Account-Token + response: + body: + next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ + results: + - id: c640b80b-fac9-409f-aa19-1f9221aec445 + remote_id: '11167' + created_at: '2021-09-15T00:00:00Z' + modified_at: '2021-10-16T00:00:00Z' + name: Article spec + description: This is an example attachment. + attachment_url: https://example.com/attachments/2039349 + remote_was_deleted: true + field_mappings: + organization_defined_targets: + custom_key: custom_value + linked_account_defined_targets: + custom_key: custom_value + remote_data: + - path: /attachments + data: + - Varies by platform + retrieve: + path: /knowledgebase/v1/attachments/{id} + method: GET + auth: true + docs: Returns an `Attachment` object with the given `id`. + source: + openapi: openapi/openapi.yml + path-parameters: + id: string + request: + name: AttachmentsRetrieveRequest + query-parameters: + include_remote_data: + type: optional + docs: >- + Whether to include the original data Merge fetched from the + third-party to produce these models. + include_shell_data: + type: optional + docs: >- + Whether to include shell records. Shell records are empty records + (they may contain some metadata but all other fields are null). + response: + docs: '' + type: root.Attachment + status-code: 200 + examples: + - path-parameters: + id: id + headers: + X-Account-Token: X-Account-Token + response: + body: + id: c640b80b-fac9-409f-aa19-1f9221aec445 + remote_id: '11167' + created_at: '2021-09-15T00:00:00Z' + modified_at: '2021-10-16T00:00:00Z' + name: Article spec + description: This is an example attachment. + attachment_url: https://example.com/attachments/2039349 + remote_was_deleted: true + field_mappings: + organization_defined_targets: + custom_key: custom_value + linked_account_defined_targets: + custom_key: custom_value + remote_data: + - path: /attachments + data: + - Varies by platform + source: + openapi: openapi/openapi.yml diff --git a/.mock/definition/knowledgebase/auditTrail.yml b/.mock/definition/knowledgebase/auditTrail.yml new file mode 100644 index 00000000..a3a1fa8b --- /dev/null +++ b/.mock/definition/knowledgebase/auditTrail.yml @@ -0,0 +1,98 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /knowledgebase/v1/audit-trail + method: GET + auth: true + docs: Gets a list of audit trail events. + source: + openapi: openapi/openapi.yml + request: + name: AuditTrailListRequest + query-parameters: + cursor: + type: optional + docs: The pagination cursor value. + end_date: + type: optional + docs: >- + If included, will only include audit trail events that occurred + before this time + event_type: + type: optional + docs: >- + If included, will only include events with the given event type. + Possible values include: `CREATED_REMOTE_PRODUCTION_API_KEY`, + `DELETED_REMOTE_PRODUCTION_API_KEY`, `CREATED_TEST_API_KEY`, + `DELETED_TEST_API_KEY`, `REGENERATED_PRODUCTION_API_KEY`, + `REGENERATED_WEBHOOK_SIGNATURE`, `INVITED_USER`, + `TWO_FACTOR_AUTH_ENABLED`, `TWO_FACTOR_AUTH_DISABLED`, + `DELETED_LINKED_ACCOUNT`, + `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT`, + `CREATED_DESTINATION`, `DELETED_DESTINATION`, + `CHANGED_DESTINATION`, `CHANGED_SCOPES`, + `CHANGED_PERSONAL_INFORMATION`, `CHANGED_ORGANIZATION_SETTINGS`, + `ENABLED_INTEGRATION`, `DISABLED_INTEGRATION`, `ENABLED_CATEGORY`, + `DISABLED_CATEGORY`, `CHANGED_PASSWORD`, `RESET_PASSWORD`, + `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, + `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, + `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, + `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, + `CREATED_INTEGRATION_WIDE_FIELD_MAPPING`, + `CREATED_LINKED_ACCOUNT_FIELD_MAPPING`, + `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING`, + `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING`, + `DELETED_INTEGRATION_WIDE_FIELD_MAPPING`, + `DELETED_LINKED_ACCOUNT_FIELD_MAPPING`, + `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, + `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, + `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, + `FORCED_LINKED_ACCOUNT_RESYNC`, `MUTED_ISSUE`, + `GENERATED_MAGIC_LINK`, `ENABLED_MERGE_WEBHOOK`, + `DISABLED_MERGE_WEBHOOK`, `MERGE_WEBHOOK_TARGET_CHANGED`, + `END_USER_CREDENTIALS_ACCESSED` + page_size: + type: optional + docs: Number of results to return per page. + start_date: + type: optional + docs: >- + If included, will only include audit trail events that occurred + after this time + user_email: + type: optional + docs: >- + If provided, this will return events associated with the specified + user email. Please note that the email address reflects the user's + email at the time of the event, and may not be their current + email. + response: + docs: '' + type: root.PaginatedAuditLogEventList + status-code: 200 + examples: + - query-parameters: + cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + headers: + X-Account-Token: '[object Object]' + response: + body: + next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ + results: + - id: b5ceea2a-7171-47ce-8090-165cfce5572c + user_name: Gil Feig + user_email: hello@merge.dev + role: ADMIN + ip_address: 192.0.2.123 + event_type: CREATED_REMOTE_PRODUCTION_API_KEY + event_description: >- + Organization-wide Scopes for model hris.Employee updated + from Read to Read+Write + created_at: '2024-01-15T09:30:00Z' + source: + openapi: openapi/openapi.yml diff --git a/.mock/definition/knowledgebase/availableActions.yml b/.mock/definition/knowledgebase/availableActions.yml new file mode 100644 index 00000000..d45ad3f5 --- /dev/null +++ b/.mock/definition/knowledgebase/availableActions.yml @@ -0,0 +1,51 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + retrieve: + path: /knowledgebase/v1/available-actions + method: GET + auth: true + docs: Returns a list of models and actions available for an account. + source: + openapi: openapi/openapi.yml + response: + docs: '' + type: root.AvailableActions + status-code: 200 + examples: + - headers: + X-Account-Token: X-Account-Token + response: + body: + integration: + name: name + abbreviated_name: abbreviated_name + categories: + - hris + image: image + square_image: square_image + color: color + slug: slug + api_endpoints_to_documentation_urls: + key: value + webhook_setup_guide_url: webhook_setup_guide_url + category_beta_status: + key: value + passthrough_available: true + available_model_operations: + - model_name: Candidate + available_operations: + - FETCH + - CREATE + required_post_parameters: + - remote_user_id + supported_fields: + - first_name + - last_name + - company + - title + source: + openapi: openapi/openapi.yml diff --git a/.mock/definition/knowledgebase/containers.yml b/.mock/definition/knowledgebase/containers.yml new file mode 100644 index 00000000..814ad7b9 --- /dev/null +++ b/.mock/definition/knowledgebase/containers.yml @@ -0,0 +1,244 @@ +types: + ContainersListRequestExpand: + enum: + - parent_article + - value: parent_article,parent_container + name: ParentArticleParentContainer + - parent_container + - permissions + - value: permissions,parent_article + name: PermissionsParentArticle + - value: permissions,parent_article,parent_container + name: PermissionsParentArticleParentContainer + - value: permissions,parent_container + name: PermissionsParentContainer + source: + openapi: openapi/openapi.yml + ContainersRetrieveRequestExpand: + enum: + - parent_article + - value: parent_article,parent_container + name: ParentArticleParentContainer + - parent_container + - permissions + - value: permissions,parent_article + name: PermissionsParentArticle + - value: permissions,parent_article,parent_container + name: PermissionsParentArticleParentContainer + - value: permissions,parent_container + name: PermissionsParentContainer + source: + openapi: openapi/openapi.yml +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /knowledgebase/v1/containers + method: GET + auth: true + docs: Returns a list of `Container` objects. + source: + openapi: openapi/openapi.yml + request: + name: ContainersListRequest + query-parameters: + created_after: + type: optional + docs: If provided, will only return objects created after this datetime. + created_before: + type: optional + docs: >- + If provided, will only return objects created before this + datetime. + cursor: + type: optional + docs: The pagination cursor value. + expand: + type: optional + docs: >- + Which relations should be returned in expanded form. Multiple + relation names should be comma separated without spaces. + include_deleted_data: + type: optional + docs: >- + 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: + type: optional + docs: >- + Whether to include the original data Merge fetched from the + third-party to produce these models. + include_shell_data: + type: optional + docs: >- + Whether to include shell records. Shell records are empty records + (they may contain some metadata but all other fields are null). + modified_after: + type: optional + docs: >- + If provided, only objects synced by Merge after this date time + will be returned. + modified_before: + type: optional + docs: >- + If provided, only objects synced by Merge before this date time + will be returned. + page_size: + type: optional + docs: Number of results to return per page. + parent_article_id: + type: optional + docs: >- + If provided, will only return sub containers of the + parent_article_id. + validation: + format: uuid + parent_container_id: + type: optional + docs: >- + If provided, will only return sub containers of the + parent_container_id. + validation: + format: uuid + remote_id: + type: optional + docs: The API provider's ID for the given object. + type: + type: optional + docs: If provided, will only return containers of the given type. + response: + docs: '' + type: root.PaginatedContainerList + status-code: 200 + examples: + - query-parameters: + cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + headers: + X-Account-Token: X-Account-Token + response: + body: + next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ + results: + - id: 134e0111-0f67-44f6-98f0-597000290bb3 + remote_id: '800293' + created_at: '2021-09-15T00:00:00Z' + modified_at: '2021-10-16T00:00:00Z' + name: Test Container + description: >- + This folder contains articles that describe how Merge is the + #1 player in the Unified API space + status: DRAFT + container_url: myworkspace.atlassian.net/wiki/test-container + type: FOLDER + visibility: PUBLIC + remote_created_at: '2021-09-15T00:00:00Z' + remote_updated_at: '2021-09-16T00:00:00Z' + parent_article: parent_article + parent_container: 8e889422-e086-42dc-b99e-24d732039b0b + permissions: + - id: 31ce489c-asdf-68b1-754r-629f799f7123 + remote_id: '102895' + created_at: '2020-03-31T00:00:00Z' + modified_at: '2020-06-20T00:00:00Z' + user: 21ce474c-asdf-34a2-754r-629f799f7d12 + type: USER + roles: + - OWNER + remote_was_deleted: true + field_mappings: + organization_defined_targets: + custom_key: custom_value + linked_account_defined_targets: + custom_key: custom_value + remote_data: + - path: /containers + data: + - Varies by platform + retrieve: + path: /knowledgebase/v1/containers/{id} + method: GET + auth: true + docs: Returns a `Container` object with the given `id`. + source: + openapi: openapi/openapi.yml + path-parameters: + id: string + request: + name: ContainersRetrieveRequest + query-parameters: + expand: + type: optional + docs: >- + Which relations should be returned in expanded form. Multiple + relation names should be comma separated without spaces. + include_remote_data: + type: optional + docs: >- + Whether to include the original data Merge fetched from the + third-party to produce these models. + include_shell_data: + type: optional + docs: >- + Whether to include shell records. Shell records are empty records + (they may contain some metadata but all other fields are null). + response: + docs: '' + type: root.Container + status-code: 200 + examples: + - path-parameters: + id: id + headers: + X-Account-Token: X-Account-Token + response: + body: + id: 134e0111-0f67-44f6-98f0-597000290bb3 + remote_id: '800293' + created_at: '2021-09-15T00:00:00Z' + modified_at: '2021-10-16T00:00:00Z' + name: Test Container + description: >- + This folder contains articles that describe how Merge is the #1 + player in the Unified API space + status: DRAFT + container_url: myworkspace.atlassian.net/wiki/test-container + type: FOLDER + visibility: PUBLIC + remote_created_at: '2021-09-15T00:00:00Z' + remote_updated_at: '2021-09-16T00:00:00Z' + parent_article: parent_article + parent_container: 8e889422-e086-42dc-b99e-24d732039b0b + permissions: + - id: 31ce489c-asdf-68b1-754r-629f799f7123 + remote_id: '102895' + created_at: '2020-03-31T00:00:00Z' + modified_at: '2020-06-20T00:00:00Z' + user: 21ce474c-asdf-34a2-754r-629f799f7d12 + type: USER + roles: + - OWNER + remote_was_deleted: true + field_mappings: + organization_defined_targets: + custom_key: custom_value + linked_account_defined_targets: + custom_key: custom_value + remote_was_deleted: true + field_mappings: + organization_defined_targets: + custom_key: custom_value + linked_account_defined_targets: + custom_key: custom_value + remote_data: + - path: /containers + data: + - Varies by platform + source: + openapi: openapi/openapi.yml diff --git a/.mock/definition/knowledgebase/deleteAccount.yml b/.mock/definition/knowledgebase/deleteAccount.yml new file mode 100644 index 00000000..fb61395f --- /dev/null +++ b/.mock/definition/knowledgebase/deleteAccount.yml @@ -0,0 +1,16 @@ +service: + auth: false + base-path: '' + endpoints: + delete: + path: /knowledgebase/v1/delete-account + method: POST + auth: true + docs: Delete a linked account. + source: + openapi: openapi/openapi.yml + examples: + - headers: + X-Account-Token: X-Account-Token + source: + openapi: openapi/openapi.yml diff --git a/.mock/definition/knowledgebase/fieldMapping.yml b/.mock/definition/knowledgebase/fieldMapping.yml new file mode 100644 index 00000000..311cd428 --- /dev/null +++ b/.mock/definition/knowledgebase/fieldMapping.yml @@ -0,0 +1,546 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + field_mappings_retrieve: + path: /knowledgebase/v1/field-mappings + method: GET + auth: true + docs: >- + Get all Field Mappings for this Linked Account. Field Mappings are + mappings between third-party Remote Fields and user defined Merge + fields. [Learn + more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). + source: + openapi: openapi/openapi.yml + request: + name: FieldMappingsRetrieveRequest + query-parameters: + exclude_remote_field_metadata: + type: optional + docs: >- + If `true`, remote fields metadata is excluded from each field + mapping instance (i.e. `remote_fields.remote_key_name` and + `remote_fields.schema` will be null). This will increase the speed + of the request since these fields require some calculations. + response: + docs: '' + type: root.FieldMappingApiInstanceResponse + status-code: 200 + examples: + - headers: + X-Account-Token: X-Account-Token + response: + body: + Container: + - id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + is_integration_wide: true + target_field: + name: example_target_field_name + description: this is a example description of a target field + is_organization_wide: true + remote_field: + remote_key_name: example_remote_field_key + schema: + type: string + remote_endpoint_info: + method: GET + url_path: /example-url-path + field_traversal_path: + - example_remote_field_key + jmes_path: '[0].example_jmes_path' + Article: + - id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + is_integration_wide: true + target_field: + name: example_target_field_name + description: this is a example description of a target field + is_organization_wide: true + remote_field: + remote_key_name: example_remote_field_key + schema: + type: string + remote_endpoint_info: + method: GET + url_path: /example-url-path + field_traversal_path: + - example_remote_field_key + jmes_path: '[0].example_jmes_path' + Attachment: + - id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + is_integration_wide: true + target_field: + name: example_target_field_name + description: this is a example description of a target field + is_organization_wide: true + remote_field: + remote_key_name: example_remote_field_key + schema: + type: string + remote_endpoint_info: + method: GET + url_path: /example-url-path + field_traversal_path: + - example_remote_field_key + jmes_path: '[0].example_jmes_path' + User: + - id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + is_integration_wide: true + target_field: + name: example_target_field_name + description: this is a example description of a target field + is_organization_wide: true + remote_field: + remote_key_name: example_remote_field_key + schema: + type: string + remote_endpoint_info: + method: GET + url_path: /example-url-path + field_traversal_path: + - example_remote_field_key + jmes_path: '[0].example_jmes_path' + Group: + - id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + is_integration_wide: true + target_field: + name: example_target_field_name + description: this is a example description of a target field + is_organization_wide: true + remote_field: + remote_key_name: example_remote_field_key + schema: + type: string + remote_endpoint_info: + method: GET + url_path: /example-url-path + field_traversal_path: + - example_remote_field_key + jmes_path: '[0].example_jmes_path' + field_mappings_create: + path: /knowledgebase/v1/field-mappings + method: POST + auth: true + docs: >- + Create new Field Mappings that will be available after the next + scheduled sync. This will cause the next sync for this Linked Account to + sync **ALL** data from start. + source: + openapi: openapi/openapi.yml + request: + name: CreateFieldMappingRequest + query-parameters: + exclude_remote_field_metadata: + type: optional + docs: >- + If `true`, remote fields metadata is excluded from each field + mapping instance (i.e. `remote_fields.remote_key_name` and + `remote_fields.schema` will be null). This will increase the speed + of the request since these fields require some calculations. + body: + properties: + target_field_name: + type: string + docs: >- + The name of the target field you want this remote field to map + to. + validation: + minLength: 1 + target_field_description: + type: string + docs: >- + The description of the target field you want this remote field + to map to. + validation: + minLength: 1 + remote_field_traversal_path: + docs: >- + The field traversal path of the remote field listed when you hit + the GET /remote-fields endpoint. + type: list + remote_method: + type: string + docs: >- + The method of the remote endpoint where the remote field is + coming from. + validation: + minLength: 1 + remote_url_path: + type: string + docs: >- + The path of the remote endpoint where the remote field is coming + from. + validation: + minLength: 1 + common_model_name: + type: string + docs: >- + The name of the Common Model that the remote field corresponds + to in a given category. + validation: + minLength: 1 + jmes_path: + type: optional + docs: >- + JMES path to specify json query expression to be used on field + mapping. + validation: + minLength: 1 + content-type: application/json + response: + docs: '' + type: root.FieldMappingInstanceResponse + status-code: 201 + examples: + - headers: + X-Account-Token: X-Account-Token + request: + target_field_name: example_target_field_name + target_field_description: this is a example description of the target field + remote_field_traversal_path: + - example_remote_field + remote_method: GET + remote_url_path: /example-url-path + common_model_name: ExampleCommonModel + response: + body: + model: + id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + is_integration_wide: true + target_field: + name: example_target_field_name + description: this is a example description of a target field + is_organization_wide: true + remote_field: + remote_key_name: example_remote_field_key + schema: + type: string + remote_endpoint_info: + method: GET + url_path: /example-url-path + field_traversal_path: + - example_remote_field_key + jmes_path: '[0].example_jmes_path' + warnings: + - source: + pointer: pointer + title: Unrecognized Field + detail: An unrecognized field, age, was passed in with request data. + problem_type: UNRECOGNIZED_FIELD + errors: + - source: + pointer: pointer + title: Missing Required Field + detail: custom_fields is a required field on model. + problem_type: MISSING_REQUIRED_FIELD + logs: + - log_id: 99433219-8017-4acd-bb3c-ceb23d663832 + dashboard_view: >- + https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832 + log_summary: + url: www.exampleintegration.com/api/v1/exampleapi + method: POST + status_code: 200 + field_mappings_destroy: + path: /knowledgebase/v1/field-mappings/{field_mapping_id} + method: DELETE + auth: true + docs: >- + Deletes Field Mappings for a Linked Account. All data related to this + Field Mapping will be deleted and these changes will be reflected after + the next scheduled sync. This will cause the next sync for this Linked + Account to sync **ALL** data from start. + source: + openapi: openapi/openapi.yml + path-parameters: + field_mapping_id: string + response: + docs: '' + type: root.FieldMappingInstanceResponse + status-code: 204 + examples: + - path-parameters: + field_mapping_id: field_mapping_id + headers: + X-Account-Token: X-Account-Token + response: + body: + model: + id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + is_integration_wide: true + target_field: + name: example_target_field_name + description: this is a example description of a target field + is_organization_wide: true + remote_field: + remote_key_name: example_remote_field_key + schema: + type: string + remote_endpoint_info: + method: GET + url_path: /example-url-path + field_traversal_path: + - example_remote_field_key + jmes_path: '[0].example_jmes_path' + warnings: + - source: + pointer: pointer + title: Unrecognized Field + detail: An unrecognized field, age, was passed in with request data. + problem_type: UNRECOGNIZED_FIELD + errors: + - source: + pointer: pointer + title: Missing Required Field + detail: custom_fields is a required field on model. + problem_type: MISSING_REQUIRED_FIELD + logs: + - log_id: 99433219-8017-4acd-bb3c-ceb23d663832 + dashboard_view: >- + https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832 + log_summary: + url: www.exampleintegration.com/api/v1/exampleapi + method: POST + status_code: 200 + field_mappings_partial_update: + path: /knowledgebase/v1/field-mappings/{field_mapping_id} + method: PATCH + auth: true + docs: >- + Create or update existing Field Mappings for a Linked Account. Changes + will be reflected after the next scheduled sync. This will cause the + next sync for this Linked Account to sync **ALL** data from start. + source: + openapi: openapi/openapi.yml + path-parameters: + field_mapping_id: string + request: + name: PatchedEditFieldMappingRequest + body: + properties: + remote_field_traversal_path: + type: optional> + docs: >- + The field traversal path of the remote field listed when you hit + the GET /remote-fields endpoint. + remote_method: + type: optional + docs: >- + The method of the remote endpoint where the remote field is + coming from. + validation: + minLength: 1 + remote_url_path: + type: optional + docs: >- + The path of the remote endpoint where the remote field is coming + from. + validation: + minLength: 1 + jmes_path: + type: optional + docs: >- + JMES path to specify json query expression to be used on field + mapping. + validation: + minLength: 1 + content-type: application/json + response: + docs: '' + type: root.FieldMappingInstanceResponse + status-code: 200 + examples: + - path-parameters: + field_mapping_id: field_mapping_id + headers: + X-Account-Token: X-Account-Token + request: {} + response: + body: + model: + id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + is_integration_wide: true + target_field: + name: example_target_field_name + description: this is a example description of a target field + is_organization_wide: true + remote_field: + remote_key_name: example_remote_field_key + schema: + type: string + remote_endpoint_info: + method: GET + url_path: /example-url-path + field_traversal_path: + - example_remote_field_key + jmes_path: '[0].example_jmes_path' + warnings: + - source: + pointer: pointer + title: Unrecognized Field + detail: An unrecognized field, age, was passed in with request data. + problem_type: UNRECOGNIZED_FIELD + errors: + - source: + pointer: pointer + title: Missing Required Field + detail: custom_fields is a required field on model. + problem_type: MISSING_REQUIRED_FIELD + logs: + - log_id: 99433219-8017-4acd-bb3c-ceb23d663832 + dashboard_view: >- + https://app.merge.dev/logs/99433219-8017-4acd-bb3c-ceb23d663832 + log_summary: + url: www.exampleintegration.com/api/v1/exampleapi + method: POST + status_code: 200 + remote_fields_retrieve: + path: /knowledgebase/v1/remote-fields + method: GET + auth: true + docs: >- + Get all remote fields for a Linked Account. Remote fields are + third-party fields that are accessible after initial sync if remote_data + is enabled. You can use remote fields to override existing Merge fields + or map a new Merge field. [Learn + more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). + source: + openapi: openapi/openapi.yml + request: + name: RemoteFieldsRetrieveRequest + query-parameters: + common_models: + type: optional + docs: >- + A comma seperated list of Common Model names. If included, will + only return Remote Fields for those Common Models. + include_example_values: + type: optional + docs: >- + If true, will include example values, where available, for remote + fields in the 3rd party platform. These examples come from active + data from your customers. + response: + docs: '' + type: root.RemoteFieldApiResponse + status-code: 200 + examples: + - headers: + X-Account-Token: X-Account-Token + response: + body: + Container: + - schema: + type: string + remote_key_name: example_remote_key_name + remote_endpoint_info: + method: GET + url_path: /example-url-path + field_traversal_path: + - example_key_name + example_values: + - example + advanced_metadata: + id: id + coverage: 1 + Article: + - schema: + type: string + remote_key_name: example_remote_key_name + remote_endpoint_info: + method: GET + url_path: /example-url-path + field_traversal_path: + - example_key_name + example_values: + - example + advanced_metadata: + id: id + coverage: 1 + Attachment: + - schema: + type: string + remote_key_name: example_remote_key_name + remote_endpoint_info: + method: GET + url_path: /example-url-path + field_traversal_path: + - example_key_name + example_values: + - example + advanced_metadata: + id: id + coverage: 1 + User: + - schema: + type: string + remote_key_name: example_remote_key_name + remote_endpoint_info: + method: GET + url_path: /example-url-path + field_traversal_path: + - example_key_name + example_values: + - example + advanced_metadata: + id: id + coverage: 1 + Group: + - schema: + type: string + remote_key_name: example_remote_key_name + remote_endpoint_info: + method: GET + url_path: /example-url-path + field_traversal_path: + - example_key_name + example_values: + - example + advanced_metadata: + id: id + coverage: 1 + target_fields_retrieve: + path: /knowledgebase/v1/target-fields + method: GET + auth: true + docs: >- + Get all organization-wide Target Fields, this will not include any + Linked Account specific Target Fields. Organization-wide Target Fields + are additional fields appended to the Merge Common Model for all Linked + Accounts in a category. [Learn + more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). + source: + openapi: openapi/openapi.yml + response: + docs: '' + type: root.ExternalTargetFieldApiResponse + status-code: 200 + examples: + - headers: + X-Account-Token: X-Account-Token + response: + body: + Container: + - name: example_target_field_name + description: this is a example description of a target field + is_mapped: is_mapped + Article: + - name: example_target_field_name + description: this is a example description of a target field + is_mapped: is_mapped + Attachment: + - name: example_target_field_name + description: this is a example description of a target field + is_mapped: is_mapped + User: + - name: example_target_field_name + description: this is a example description of a target field + is_mapped: is_mapped + Group: + - name: example_target_field_name + description: this is a example description of a target field + is_mapped: is_mapped + source: + openapi: openapi/openapi.yml diff --git a/.mock/definition/knowledgebase/forceResync.yml b/.mock/definition/knowledgebase/forceResync.yml new file mode 100644 index 00000000..22f60795 --- /dev/null +++ b/.mock/definition/knowledgebase/forceResync.yml @@ -0,0 +1,38 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + sync_status_resync_create: + path: /knowledgebase/v1/sync-status/resync + method: POST + auth: true + docs: >- + Force re-sync of all models. This endpoint is available for monthly, + quarterly, and highest sync frequency customers on the Professional or + Enterprise plans. Doing so will consume a sync credit for the relevant + linked account. Force re-syncs can also be triggered manually in the + Merge Dashboard and is available for all customers. + source: + openapi: openapi/openapi.yml + response: + docs: '' + type: list + status-code: 200 + examples: + - headers: + X-Account-Token: X-Account-Token + response: + body: + - model_name: Article + model_id: knowledgebase.KnowledgeBaseArticle + last_sync_start: '2021-03-30T19:44:18Z' + next_sync_start: '2021-03-30T20:44:18Z' + last_sync_result: SYNCING + last_sync_finished: '2021-03-30T19:55:18Z' + status: SYNCING + is_initial_sync: true + selective_sync_configurations_usage: IN_NEXT_SYNC + source: + openapi: openapi/openapi.yml diff --git a/.mock/definition/knowledgebase/generateKey.yml b/.mock/definition/knowledgebase/generateKey.yml new file mode 100644 index 00000000..28384f36 --- /dev/null +++ b/.mock/definition/knowledgebase/generateKey.yml @@ -0,0 +1,38 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /knowledgebase/v1/generate-key + method: POST + auth: true + docs: Create a remote key. + source: + openapi: openapi/openapi.yml + request: + name: GenerateRemoteKeyRequest + body: + properties: + name: + type: string + docs: The name of the remote key + validation: + minLength: 1 + content-type: application/json + response: + docs: '' + type: root.RemoteKey + status-code: 200 + examples: + - headers: + X-Account-Token: '[object Object]' + request: + name: Remote Deployment Key 1 + response: + body: + name: Remote Deployment Key 1 + key: hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA + source: + openapi: openapi/openapi.yml diff --git a/.mock/definition/knowledgebase/groups.yml b/.mock/definition/knowledgebase/groups.yml new file mode 100644 index 00000000..392f8af5 --- /dev/null +++ b/.mock/definition/knowledgebase/groups.yml @@ -0,0 +1,175 @@ +types: + GroupsListRequestExpand: + enum: + - parent_group + - users + - value: users,parent_group + name: UsersParentGroup + source: + openapi: openapi/openapi.yml + GroupsRetrieveRequestExpand: + enum: + - parent_group + - users + - value: users,parent_group + name: UsersParentGroup + source: + openapi: openapi/openapi.yml +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /knowledgebase/v1/groups + method: GET + auth: true + docs: Returns a list of `Group` objects. + source: + openapi: openapi/openapi.yml + request: + name: GroupsListRequest + query-parameters: + created_after: + type: optional + docs: If provided, will only return objects created after this datetime. + created_before: + type: optional + docs: >- + If provided, will only return objects created before this + datetime. + cursor: + type: optional + docs: The pagination cursor value. + expand: + type: optional + docs: >- + Which relations should be returned in expanded form. Multiple + relation names should be comma separated without spaces. + include_deleted_data: + type: optional + docs: >- + 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: + type: optional + docs: >- + Whether to include the original data Merge fetched from the + third-party to produce these models. + include_shell_data: + type: optional + docs: >- + Whether to include shell records. Shell records are empty records + (they may contain some metadata but all other fields are null). + modified_after: + type: optional + docs: >- + If provided, only objects synced by Merge after this date time + will be returned. + modified_before: + type: optional + docs: >- + If provided, only objects synced by Merge before this date time + will be returned. + page_size: + type: optional + docs: Number of results to return per page. + remote_id: + type: optional + docs: The API provider's ID for the given object. + response: + docs: '' + type: root.PaginatedGroupList + status-code: 200 + examples: + - query-parameters: + cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + headers: + X-Account-Token: X-Account-Token + response: + body: + next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ + results: + - id: 134e0111-0f67-44f6-98f0-597000290bb3 + remote_id: '800293' + created_at: '2021-09-15T00:00:00Z' + modified_at: '2021-10-16T00:00:00Z' + name: Engineering + parent_group: parent_group + users: + - 6e93361b-8ae7-444b-bfa2-71206cbbee24 + - a1f90b3c-633d-404e-a696-05cd54808676 + remote_was_deleted: true + field_mappings: + organization_defined_targets: + custom_key: custom_value + linked_account_defined_targets: + custom_key: custom_value + remote_data: + - path: /groups + data: + - Varies by platform + retrieve: + path: /knowledgebase/v1/groups/{id} + method: GET + auth: true + docs: Returns a `Group` object with the given `id`. + source: + openapi: openapi/openapi.yml + path-parameters: + id: string + request: + name: GroupsRetrieveRequest + query-parameters: + expand: + type: optional + docs: >- + Which relations should be returned in expanded form. Multiple + relation names should be comma separated without spaces. + include_remote_data: + type: optional + docs: >- + Whether to include the original data Merge fetched from the + third-party to produce these models. + include_shell_data: + type: optional + docs: >- + Whether to include shell records. Shell records are empty records + (they may contain some metadata but all other fields are null). + response: + docs: '' + type: root.Group + status-code: 200 + examples: + - path-parameters: + id: id + headers: + X-Account-Token: X-Account-Token + response: + body: + id: 134e0111-0f67-44f6-98f0-597000290bb3 + remote_id: '800293' + created_at: '2021-09-15T00:00:00Z' + modified_at: '2021-10-16T00:00:00Z' + name: Engineering + parent_group: parent_group + users: + - 6e93361b-8ae7-444b-bfa2-71206cbbee24 + - a1f90b3c-633d-404e-a696-05cd54808676 + remote_was_deleted: true + field_mappings: + organization_defined_targets: + custom_key: custom_value + linked_account_defined_targets: + custom_key: custom_value + remote_data: + - path: /groups + data: + - Varies by platform + source: + openapi: openapi/openapi.yml diff --git a/.mock/definition/knowledgebase/issues.yml b/.mock/definition/knowledgebase/issues.yml new file mode 100644 index 00000000..c2f6d4d8 --- /dev/null +++ b/.mock/definition/knowledgebase/issues.yml @@ -0,0 +1,135 @@ +types: + IssuesListRequestStatus: + enum: + - ONGOING + - RESOLVED + source: + openapi: openapi/openapi.yml +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /knowledgebase/v1/issues + method: GET + auth: true + docs: Gets all issues for Organization. + source: + openapi: openapi/openapi.yml + request: + name: IssuesListRequest + query-parameters: + account_token: optional + cursor: + type: optional + docs: The pagination cursor value. + end_date: + type: optional + docs: >- + If included, will only include issues whose most recent action + occurred before this time + end_user_organization_name: optional + first_incident_time_after: + type: optional + docs: >- + If provided, will only return issues whose first incident time was + after this datetime. + first_incident_time_before: + type: optional + docs: >- + If provided, will only return issues whose first incident time was + before this datetime. + include_muted: + type: optional + docs: If true, will include muted issues + integration_name: optional + last_incident_time_after: + type: optional + docs: >- + If provided, will only return issues whose last incident time was + after this datetime. + last_incident_time_before: + type: optional + docs: >- + If provided, will only return issues whose last incident time was + before this datetime. + linked_account_id: + type: optional + docs: >- + If provided, will only include issues pertaining to the linked + account passed in. + page_size: + type: optional + docs: Number of results to return per page. + start_date: + type: optional + docs: >- + If included, will only include issues whose most recent action + occurred after this time + status: + type: optional + docs: |- + Status of the issue. Options: ('ONGOING', 'RESOLVED') + + * `ONGOING` - ONGOING + * `RESOLVED` - RESOLVED + response: + docs: '' + type: root.PaginatedIssueList + status-code: 200 + examples: + - query-parameters: + cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + headers: + X-Account-Token: '[object Object]' + response: + body: + next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ + results: + - id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + status: ONGOING + error_description: Missing Permissions + end_user: + key: value + first_incident_time: '2022-12-05T16:19:15Z' + last_incident_time: '2022-12-05T16:19:15Z' + is_muted: true + error_details: + - Missing employee permissions. + - Missing time off permissions. + retrieve: + path: /knowledgebase/v1/issues/{id} + method: GET + auth: true + docs: Get a specific issue. + source: + openapi: openapi/openapi.yml + path-parameters: + id: string + response: + docs: '' + type: root.Issue + status-code: 200 + examples: + - path-parameters: + id: id + headers: + X-Account-Token: '[object Object]' + response: + body: + id: 3fa85f64-5717-4562-b3fc-2c963f66afa6 + status: ONGOING + error_description: Missing Permissions + end_user: + key: value + first_incident_time: '2022-12-05T16:19:15Z' + last_incident_time: '2022-12-05T16:19:15Z' + is_muted: true + error_details: + - Missing employee permissions. + - Missing time off permissions. + source: + openapi: openapi/openapi.yml diff --git a/.mock/definition/knowledgebase/linkToken.yml b/.mock/definition/knowledgebase/linkToken.yml new file mode 100644 index 00000000..0a256905 --- /dev/null +++ b/.mock/definition/knowledgebase/linkToken.yml @@ -0,0 +1,154 @@ +imports: + root: __package__.yml +types: + EndUserDetailsRequestLanguage: + discriminated: false + docs: >- + The following subset of IETF language tags can be used to configure + localization. + + + * `en` - en + + * `de` - de + union: + - root.LanguageEnum + - string + source: + openapi: openapi/openapi.yml + inline: true +service: + auth: false + base-path: '' + endpoints: + create: + path: /knowledgebase/v1/link-token + method: POST + auth: true + docs: Creates a link token to be used when linking a new end user. + source: + openapi: openapi/openapi.yml + request: + name: EndUserDetailsRequest + body: + properties: + end_user_email_address: + type: string + docs: >- + Your end user's email address. This is purely for identification + purposes - setting this value will not cause any emails to be + sent. + validation: + minLength: 1 + maxLength: 100 + end_user_organization_name: + type: string + docs: Your end user's organization. + validation: + minLength: 1 + maxLength: 100 + end_user_origin_id: + type: string + docs: >- + This unique identifier typically represents the ID for your end + user in your product's database. This value must be distinct + from other Linked Accounts' unique identifiers. + validation: + minLength: 1 + maxLength: 100 + categories: + docs: The integration categories to show in Merge Link. + type: list + integration: + type: optional + docs: >- + The slug of a specific pre-selected integration for this linking + flow token. For examples of slugs, see + https://docs.merge.dev/guides/merge-link/single-integration/. + validation: + minLength: 1 + link_expiry_mins: + type: optional + docs: >- + An integer number of minutes between [30, 720 or 10080 if for a + Magic Link URL] for how long this token is valid. Defaults to + 30. + default: 30 + validation: + min: 30 + max: 10080 + should_create_magic_link_url: + type: optional + docs: >- + Whether to generate a Magic Link URL. Defaults to false. For + more information on Magic Link, see + https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + default: false + hide_admin_magic_link: + type: optional + docs: >- + Whether to generate a Magic Link URL on the Admin Needed screen + during the linking flow. Defaults to false. For more information + on Magic Link, see + https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + default: false + common_models: + type: optional> + docs: >- + An array of objects to specify the models and fields that will + be disabled for a given Linked Account. Each object uses + model_id, enabled_actions, and disabled_fields to specify the + model, method, and fields that are scoped for a given Linked + Account. + category_common_model_scopes: + type: >- + optional>>> + docs: >- + When creating a Link Token, you can set permissions for Common + Models that will apply to the account that is going to be + linked. Any model or field not specified in link token payload + will default to existing settings. + language: + type: optional + docs: >- + The following subset of IETF language tags can be used to + configure localization. + + + * `en` - en + + * `de` - de + are_syncs_disabled: + type: optional + docs: >- + The boolean that indicates whether initial, periodic, and force + syncs will be disabled. + default: false + integration_specific_config: + type: optional> + docs: >- + A JSON object containing integration-specific configuration + options. + content-type: application/json + response: + docs: '' + type: root.LinkToken + status-code: 200 + examples: + - headers: + X-Account-Token: '[object Object]' + request: + end_user_email_address: example@gmail.com + end_user_organization_name: Test Organization + end_user_origin_id: '12345' + categories: + - hris + - ats + response: + body: + link_token: necdP7FtdASl1fQwm62be2_dM4wBG8_GactqoUV0 + integration_name: Lever + magic_link_url: https://link.merge.dev/asdfjkl12345jsndfgi2i83n + source: + openapi: openapi/openapi.yml diff --git a/.mock/definition/knowledgebase/linkedAccounts.yml b/.mock/definition/knowledgebase/linkedAccounts.yml new file mode 100644 index 00000000..3b7b13a0 --- /dev/null +++ b/.mock/definition/knowledgebase/linkedAccounts.yml @@ -0,0 +1,157 @@ +types: + LinkedAccountsListRequestCategory: + enum: + - accounting + - ats + - crm + - filestorage + - hris + - knowledgebase + - mktg + - ticketing + source: + openapi: openapi/openapi.yml +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /knowledgebase/v1/linked-accounts + method: GET + auth: true + docs: List linked accounts for your organization. + source: + openapi: openapi/openapi.yml + request: + name: LinkedAccountsListRequest + query-parameters: + category: + type: optional + docs: >- + Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, + `knowledgebase`, `mktg`, `ticketing` + + + * `hris` - hris + + * `ats` - ats + + * `accounting` - accounting + + * `ticketing` - ticketing + + * `crm` - crm + + * `mktg` - mktg + + * `filestorage` - filestorage + + * `knowledgebase` - knowledgebase + cursor: + type: optional + docs: The pagination cursor value. + end_user_email_address: + type: optional + docs: >- + If provided, will only return linked accounts associated with the + given email address. + end_user_organization_name: + type: optional + docs: >- + If provided, will only return linked accounts associated with the + given organization name. + end_user_origin_id: + type: optional + docs: >- + If provided, will only return linked accounts associated with the + given origin ID. + end_user_origin_ids: + type: optional + docs: >- + Comma-separated list of EndUser origin IDs, making it possible to + specify multiple EndUsers at once. + id: + type: optional + validation: + format: uuid + ids: + type: optional + docs: >- + Comma-separated list of LinkedAccount IDs, making it possible to + specify multiple LinkedAccounts at once. + include_duplicates: + type: optional + docs: >- + If `true`, will include complete production duplicates of the + account specified by the `id` query parameter in the response. + `id` must be for a complete production linked account. + integration_name: + type: optional + docs: >- + If provided, will only return linked accounts associated with the + given integration name. + is_test_account: + type: optional + docs: >- + If included, will only include test linked accounts. If not + included, will only include non-test linked accounts. + page_size: + type: optional + docs: Number of results to return per page. + status: + type: optional + docs: >- + Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, + `RELINK_NEEDED` + response: + docs: '' + type: root.PaginatedAccountDetailsAndActionsList + status-code: 200 + examples: + - query-parameters: + cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + headers: + X-Account-Token: '[object Object]' + response: + body: + next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ + results: + - id: e59b1821-f85c-4e28-a6b3-1804156f3563 + category: hris + status: COMPLETE + status_detail: Invalid login credentials + end_user_origin_id: 3ac95cde-6c7f-4eef-afec-be710b42308d + end_user_organization_name: Foo Bar, LLC + end_user_email_address: hradmin@foobar.dev + subdomain: foobar + webhook_listener_url: >- + https://api.merge.dev/api/integrations/webhook-listener/7fc3mee0UW8ecV4 + is_duplicate: true + integration: + name: name + categories: + - hris + color: color + slug: slug + passthrough_available: true + available_model_operations: + - model_name: Candidate + available_operations: + - FETCH + - CREATE + required_post_parameters: + - remote_user_id + supported_fields: + - first_name + - last_name + - company + - title + account_type: PRODUCTION + completed_at: '2024-08-26T20:11:19Z' + integration_specific_fields: + integration_specific_field: Varies by platform + source: + openapi: openapi/openapi.yml diff --git a/.mock/definition/knowledgebase/passthrough.yml b/.mock/definition/knowledgebase/passthrough.yml new file mode 100644 index 00000000..71171a07 --- /dev/null +++ b/.mock/definition/knowledgebase/passthrough.yml @@ -0,0 +1,41 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /knowledgebase/v1/passthrough + method: POST + auth: true + docs: Pull data from an endpoint not currently supported by Merge. + source: + openapi: openapi/openapi.yml + request: + body: root.DataPassthroughRequest + content-type: application/json + response: + docs: '' + type: root.RemoteResponse + status-code: 200 + examples: + - headers: + X-Account-Token: X-Account-Token + request: + method: GET + path: /scooters + response: + body: + method: GET + path: /scooters + status: 200 + response: + key: value + response_headers: + X-Page-Token: value + response_type: JSON + headers: + EXTRA-HEADER: value + Authorization: + source: + openapi: openapi/openapi.yml diff --git a/.mock/definition/knowledgebase/regenerateKey.yml b/.mock/definition/knowledgebase/regenerateKey.yml new file mode 100644 index 00000000..a1202626 --- /dev/null +++ b/.mock/definition/knowledgebase/regenerateKey.yml @@ -0,0 +1,38 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + create: + path: /knowledgebase/v1/regenerate-key + method: POST + auth: true + docs: Exchange remote keys. + source: + openapi: openapi/openapi.yml + request: + name: RemoteKeyForRegenerationRequest + body: + properties: + name: + type: string + docs: The name of the remote key + validation: + minLength: 1 + content-type: application/json + response: + docs: '' + type: root.RemoteKey + status-code: 200 + examples: + - headers: + X-Account-Token: '[object Object]' + request: + name: Remote Deployment Key 1 + response: + body: + name: Remote Deployment Key 1 + key: hXY57W0g0WkdRHjCaPvwijK63fwfN-o_Wh7f30SLTq_uPCOLo-WFcA + source: + openapi: openapi/openapi.yml diff --git a/.mock/definition/knowledgebase/scopes.yml b/.mock/definition/knowledgebase/scopes.yml new file mode 100644 index 00000000..80d5a8bb --- /dev/null +++ b/.mock/definition/knowledgebase/scopes.yml @@ -0,0 +1,164 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + default_scopes_retrieve: + path: /knowledgebase/v1/default-scopes + method: GET + auth: true + docs: >- + Get the default permissions for Merge Common Models and fields across + all Linked Accounts of a given category. [Learn + more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). + source: + openapi: openapi/openapi.yml + response: + docs: '' + type: root.CommonModelScopeApi + status-code: 200 + examples: + - headers: + X-Account-Token: '[object Object]' + response: + body: + common_models: + - model_name: Employee + model_permissions: + READ: + is_enabled: true + WRITE: + is_enabled: false + field_permissions: + enabled_fields: + - avatar + - created_at + - custom_fields + - date_of_birth + - first_name + - gender + - remote_created_at + - remote_data + disabled_fields: + - company + - employments + - groups + - home_location + - manager + - work_location + linked_account_scopes_retrieve: + path: /knowledgebase/v1/linked-account-scopes + method: GET + auth: true + docs: >- + Get all available permissions for Merge Common Models and fields for a + single Linked Account. [Learn + more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). + source: + openapi: openapi/openapi.yml + response: + docs: '' + type: root.CommonModelScopeApi + status-code: 200 + examples: + - headers: + X-Account-Token: X-Account-Token + response: + body: + common_models: + - model_name: Employee + model_permissions: + READ: + is_enabled: true + WRITE: + is_enabled: false + field_permissions: + enabled_fields: + - avatar + - created_at + - custom_fields + - date_of_birth + - first_name + - gender + - remote_created_at + - remote_data + disabled_fields: + - company + - employments + - groups + - home_location + - manager + - work_location + linked_account_scopes_create: + path: /knowledgebase/v1/linked-account-scopes + method: POST + auth: true + docs: >- + Update permissions for any Common Model or field for a single Linked + Account. Any Scopes not set in this POST request will inherit the + default Scopes. [Learn + more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes) + source: + openapi: openapi/openapi.yml + request: + name: LinkedAccountCommonModelScopeDeserializerRequest + body: + properties: + common_models: + docs: The common models you want to update the scopes for + type: list + content-type: application/json + response: + docs: '' + type: root.CommonModelScopeApi + status-code: 200 + examples: + - headers: + X-Account-Token: X-Account-Token + request: + common_models: + - model_name: Employee + model_permissions: + READ: + is_enabled: true + WRITE: + is_enabled: false + field_permissions: + enabled_fields: + - avatar + - home_location + disabled_fields: + - work_location + - model_name: Benefit + model_permissions: + WRITE: + is_enabled: false + response: + body: + common_models: + - model_name: Employee + model_permissions: + READ: + is_enabled: true + WRITE: + is_enabled: false + field_permissions: + enabled_fields: + - avatar + - created_at + - custom_fields + - date_of_birth + - first_name + - gender + - remote_created_at + - remote_data + disabled_fields: + - company + - employments + - groups + - home_location + - manager + - work_location + source: + openapi: openapi/openapi.yml diff --git a/.mock/definition/knowledgebase/syncStatus.yml b/.mock/definition/knowledgebase/syncStatus.yml new file mode 100644 index 00000000..0554650b --- /dev/null +++ b/.mock/definition/knowledgebase/syncStatus.yml @@ -0,0 +1,58 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /knowledgebase/v1/sync-status + method: GET + auth: true + docs: >- + Get sync status for the current sync and the most recently finished + sync. `last_sync_start` represents the most recent time any sync began. + `last_sync_finished` represents the most recent time any sync completed. + These timestamps may correspond to different sync instances which may + result in a sync start time being later than a separate sync completed + time. To ensure you are retrieving the latest available data reference + the `last_sync_finished` timestamp where `last_sync_result` is `DONE`. + Possible values for `status` and `last_sync_result` are `DISABLED`, + `DONE`, `FAILED`, `PARTIALLY_SYNCED`, `PAUSED`, `SYNCING`. Learn more + about sync status in our [Help + Center](https://help.merge.dev/en/articles/8184193-merge-sync-statuses). + source: + openapi: openapi/openapi.yml + request: + name: SyncStatusListRequest + query-parameters: + cursor: + type: optional + docs: The pagination cursor value. + page_size: + type: optional + docs: Number of results to return per page. + response: + docs: '' + type: root.PaginatedSyncStatusList + status-code: 200 + examples: + - query-parameters: + cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + headers: + X-Account-Token: X-Account-Token + response: + body: + next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ + results: + - model_name: Article + model_id: knowledgebase.KnowledgeBaseArticle + last_sync_start: '2021-03-30T19:44:18Z' + next_sync_start: '2021-03-30T20:44:18Z' + last_sync_result: SYNCING + last_sync_finished: '2021-03-30T19:55:18Z' + status: SYNCING + is_initial_sync: true + selective_sync_configurations_usage: IN_NEXT_SYNC + source: + openapi: openapi/openapi.yml diff --git a/.mock/definition/knowledgebase/users.yml b/.mock/definition/knowledgebase/users.yml new file mode 100644 index 00000000..e5c4f8ee --- /dev/null +++ b/.mock/definition/knowledgebase/users.yml @@ -0,0 +1,134 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /knowledgebase/v1/users + method: GET + auth: true + docs: Returns a list of `User` objects. + source: + openapi: openapi/openapi.yml + request: + name: UsersListRequest + query-parameters: + created_after: + type: optional + docs: If provided, will only return objects created after this datetime. + created_before: + type: optional + docs: >- + If provided, will only return objects created before this + datetime. + cursor: + type: optional + docs: The pagination cursor value. + include_deleted_data: + type: optional + docs: >- + 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: + type: optional + docs: >- + Whether to include the original data Merge fetched from the + third-party to produce these models. + include_shell_data: + type: optional + docs: >- + Whether to include shell records. Shell records are empty records + (they may contain some metadata but all other fields are null). + modified_after: + type: optional + docs: >- + If provided, only objects synced by Merge after this date time + will be returned. + modified_before: + type: optional + docs: >- + If provided, only objects synced by Merge before this date time + will be returned. + page_size: + type: optional + docs: Number of results to return per page. + remote_id: + type: optional + docs: The API provider's ID for the given object. + response: + docs: '' + type: root.PaginatedUserList + status-code: 200 + examples: + - query-parameters: + cursor: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + headers: + X-Account-Token: X-Account-Token + response: + body: + next: cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw + previous: cj1sZXdwd2VycWVtY29zZnNkc2NzUWxNMEUxTXk0ME16UXpNallsTWtJ + results: + - id: 83902e75-4362-4803-b76c-a7d6be292cbd + remote_id: '2039349' + created_at: '2021-09-15T00:00:00Z' + modified_at: '2021-10-16T00:00:00Z' + name: Gil Feig + email_address: hello@merge.dev + remote_was_deleted: true + field_mappings: + organization_defined_targets: + custom_key: custom_value + linked_account_defined_targets: + custom_key: custom_value + retrieve: + path: /knowledgebase/v1/users/{id} + method: GET + auth: true + docs: Returns a `User` object with the given `id`. + source: + openapi: openapi/openapi.yml + path-parameters: + id: string + request: + name: UsersRetrieveRequest + query-parameters: + include_remote_data: + type: optional + docs: >- + Whether to include the original data Merge fetched from the + third-party to produce these models. + include_shell_data: + type: optional + docs: >- + Whether to include shell records. Shell records are empty records + (they may contain some metadata but all other fields are null). + response: + docs: '' + type: root.User + status-code: 200 + examples: + - path-parameters: + id: id + headers: + X-Account-Token: X-Account-Token + response: + body: + id: 83902e75-4362-4803-b76c-a7d6be292cbd + remote_id: '2039349' + created_at: '2021-09-15T00:00:00Z' + modified_at: '2021-10-16T00:00:00Z' + name: Gil Feig + email_address: hello@merge.dev + remote_was_deleted: true + field_mappings: + organization_defined_targets: + custom_key: custom_value + linked_account_defined_targets: + custom_key: custom_value + source: + openapi: openapi/openapi.yml diff --git a/.mock/definition/knowledgebase/webhookReceivers.yml b/.mock/definition/knowledgebase/webhookReceivers.yml new file mode 100644 index 00000000..a3585da3 --- /dev/null +++ b/.mock/definition/knowledgebase/webhookReceivers.yml @@ -0,0 +1,63 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /knowledgebase/v1/webhook-receivers + method: GET + auth: true + docs: Returns a list of `WebhookReceiver` objects. + source: + openapi: openapi/openapi.yml + response: + docs: '' + type: list + status-code: 200 + examples: + - headers: + X-Account-Token: X-Account-Token + response: + body: + - event: event + is_active: true + key: key + create: + path: /knowledgebase/v1/webhook-receivers + method: POST + auth: true + docs: Creates a `WebhookReceiver` object with the given values. + source: + openapi: openapi/openapi.yml + request: + name: WebhookReceiverRequest + body: + properties: + event: + type: string + validation: + minLength: 1 + is_active: boolean + key: + type: optional + validation: + minLength: 1 + content-type: application/json + response: + docs: '' + type: root.WebhookReceiver + status-code: 201 + examples: + - headers: + X-Account-Token: X-Account-Token + request: + event: event + is_active: true + response: + body: + event: event + is_active: true + key: key + source: + openapi: openapi/openapi.yml diff --git a/README.md b/README.md index e003f4a1..2521236e 100644 --- a/README.md +++ b/README.md @@ -234,3 +234,4 @@ while response.next is not None: + diff --git a/pyproject.toml b/pyproject.toml index 411fd66a..b6e20abe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "MergePythonClient" [tool.poetry] name = "MergePythonClient" -version = "2.3.2" +version = "2.4.0" description = "" readme = "README.md" authors = [] diff --git a/reference.md b/reference.md index f1e59a3f..ba196199 100644 --- a/reference.md +++ b/reference.md @@ -7934,8 +7934,8 @@ client.ats.webhook_receivers.create( -## Crm AccountDetails -
client.crm.account_details.retrieve() +## Filestorage AccountDetails +
client.filestorage.account_details.retrieve()
@@ -7968,7 +7968,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.account_details.retrieve() +client.filestorage.account_details.retrieve() ```
@@ -7996,8 +7996,8 @@ client.crm.account_details.retrieve()
-## Crm AccountToken -
client.crm.account_token.retrieve(...) +## Filestorage AccountToken +
client.filestorage.account_token.retrieve(...)
@@ -8030,7 +8030,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.account_token.retrieve( +client.filestorage.account_token.retrieve( public_token="public_token", ) @@ -8068,8 +8068,8 @@ client.crm.account_token.retrieve(
-## Crm Accounts -
client.crm.accounts.list(...) +## Filestorage AsyncPassthrough +
client.filestorage.async_passthrough.create(...)
@@ -8081,7 +8081,7 @@ client.crm.account_token.retrieve(
-Returns a list of `Account` objects. +Asynchronously pull data from an endpoint not currently supported by Merge.
@@ -8097,13 +8097,17 @@ Returns a list of `Account` objects. ```python from merge import Merge +from merge.resources.filestorage import DataPassthroughRequest, MethodEnum client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.accounts.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +client.filestorage.async_passthrough.create( + request=DataPassthroughRequest( + method=MethodEnum.GET, + path="/scooters", + ), ) ``` @@ -8120,111 +8124,7 @@ client.crm.accounts.list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. - -
-
- -
-
- -**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The pagination cursor value. - -
-
- -
-
- -**expand:** `typing.Optional[typing.Literal["owner"]]` — 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_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. - -
-
- -
-
- -**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). - -
-
- -
-
- -**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. - -
-
- -
-
- -**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. - -
-
- -
-
- -**name:** `typing.Optional[str]` — If provided, will only return accounts with this name. - -
-
- -
-
- -**owner_id:** `typing.Optional[str]` — If provided, will only return accounts with this owner. - -
-
- -
-
- -**page_size:** `typing.Optional[int]` — Number of results to return per page. - -
-
- -
-
- -**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. +**request:** `DataPassthroughRequest`
@@ -8244,7 +8144,7 @@ client.crm.accounts.list(
-
client.crm.accounts.create(...) +
client.filestorage.async_passthrough.retrieve(...)
@@ -8256,7 +8156,7 @@ client.crm.accounts.list(
-Creates an `Account` object with the given values. +Retrieves data from earlier async-passthrough POST request
@@ -8272,14 +8172,13 @@ Creates an `Account` object with the given values. ```python from merge import Merge -from merge.resources.crm import AccountRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.accounts.create( - model=AccountRequest(), +client.filestorage.async_passthrough.retrieve( + async_passthrough_receipt_id="async_passthrough_receipt_id", ) ``` @@ -8296,23 +8195,7 @@ client.crm.accounts.create(
-**model:** `AccountRequest` - -
-
- -
-
- -**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. - -
-
- -
-
- -**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. +**async_passthrough_receipt_id:** `str`
@@ -8332,7 +8215,8 @@ client.crm.accounts.create(
-
client.crm.accounts.retrieve(...) +## Filestorage AuditTrail +
client.filestorage.audit_trail.list(...)
@@ -8344,7 +8228,7 @@ client.crm.accounts.create(
-Returns an `Account` object with the given `id`. +Gets a list of audit trail events.
@@ -8365,8 +8249,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.accounts.retrieve( - id="id", +client.filestorage.audit_trail.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) ``` @@ -8383,7 +8267,7 @@ client.crm.accounts.retrieve(
-**id:** `str` +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -8391,7 +8275,7 @@ client.crm.accounts.retrieve(
-**expand:** `typing.Optional[typing.Literal["owner"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**end_date:** `typing.Optional[str]` — If included, will only include audit trail events that occurred before this time
@@ -8399,7 +8283,7 @@ client.crm.accounts.retrieve(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**event_type:** `typing.Optional[str]` — If included, will only include events with the given event type. Possible values include: `CREATED_REMOTE_PRODUCTION_API_KEY`, `DELETED_REMOTE_PRODUCTION_API_KEY`, `CREATED_TEST_API_KEY`, `DELETED_TEST_API_KEY`, `REGENERATED_PRODUCTION_API_KEY`, `REGENERATED_WEBHOOK_SIGNATURE`, `INVITED_USER`, `TWO_FACTOR_AUTH_ENABLED`, `TWO_FACTOR_AUTH_DISABLED`, `DELETED_LINKED_ACCOUNT`, `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT`, `CREATED_DESTINATION`, `DELETED_DESTINATION`, `CHANGED_DESTINATION`, `CHANGED_SCOPES`, `CHANGED_PERSONAL_INFORMATION`, `CHANGED_ORGANIZATION_SETTINGS`, `ENABLED_INTEGRATION`, `DISABLED_INTEGRATION`, `ENABLED_CATEGORY`, `DISABLED_CATEGORY`, `CHANGED_PASSWORD`, `RESET_PASSWORD`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `CREATED_INTEGRATION_WIDE_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_FIELD_MAPPING`, `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING`, `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING`, `DELETED_INTEGRATION_WIDE_FIELD_MAPPING`, `DELETED_LINKED_ACCOUNT_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `FORCED_LINKED_ACCOUNT_RESYNC`, `MUTED_ISSUE`, `GENERATED_MAGIC_LINK`, `ENABLED_MERGE_WEBHOOK`, `DISABLED_MERGE_WEBHOOK`, `MERGE_WEBHOOK_TARGET_CHANGED`, `END_USER_CREDENTIALS_ACCESSED`
@@ -8407,7 +8291,7 @@ client.crm.accounts.retrieve(
-**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. +**page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -8415,7 +8299,15 @@ client.crm.accounts.retrieve(
-**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). +**start_date:** `typing.Optional[str]` — If included, will only include audit trail events that occurred after this time + +
+
+ +
+
+ +**user_email:** `typing.Optional[str]` — If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email.
@@ -8435,7 +8327,8 @@ client.crm.accounts.retrieve(
-
client.crm.accounts.partial_update(...) +## Filestorage AvailableActions +
client.filestorage.available_actions.retrieve()
@@ -8447,7 +8340,7 @@ client.crm.accounts.retrieve(
-Updates an `Account` object with the given `id`. +Returns a list of models and actions available for an account.
@@ -8463,16 +8356,12 @@ Updates an `Account` object with the given `id`. ```python from merge import Merge -from merge.resources.crm import PatchedAccountRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.accounts.partial_update( - id="id", - model=PatchedAccountRequest(), -) +client.filestorage.available_actions.retrieve() ``` @@ -8488,38 +8377,6 @@ client.crm.accounts.partial_update(
-**id:** `str` - -
-
- -
-
- -**model:** `PatchedAccountRequest` - -
-
- -
-
- -**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. - -
-
- -
-
- -**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -8532,7 +8389,8 @@ client.crm.accounts.partial_update(
-
client.crm.accounts.meta_patch_retrieve(...) +## Filestorage Scopes +
client.filestorage.scopes.default_scopes_retrieve()
@@ -8544,7 +8402,7 @@ client.crm.accounts.partial_update(
-Returns metadata for `CRMAccount` PATCHs. +Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes).
@@ -8565,9 +8423,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.accounts.meta_patch_retrieve( - id="id", -) +client.filestorage.scopes.default_scopes_retrieve() ``` @@ -8583,14 +8439,6 @@ client.crm.accounts.meta_patch_retrieve(
-**id:** `str` - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -8603,7 +8451,7 @@ client.crm.accounts.meta_patch_retrieve(
-
client.crm.accounts.meta_post_retrieve() +
client.filestorage.scopes.linked_account_scopes_retrieve()
@@ -8615,7 +8463,7 @@ client.crm.accounts.meta_patch_retrieve(
-Returns metadata for `CRMAccount` POSTs. +Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes).
@@ -8636,7 +8484,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.accounts.meta_post_retrieve() +client.filestorage.scopes.linked_account_scopes_retrieve() ``` @@ -8664,7 +8512,7 @@ client.crm.accounts.meta_post_retrieve()
-
client.crm.accounts.remote_field_classes_list(...) +
client.filestorage.scopes.linked_account_scopes_create(...)
@@ -8676,7 +8524,7 @@ client.crm.accounts.meta_post_retrieve()
-Returns a list of `RemoteFieldClass` objects. +Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes)
@@ -8692,13 +8540,42 @@ Returns a list of `RemoteFieldClass` objects. ```python from merge import Merge +from merge.resources.filestorage import ( + FieldPermissionDeserializerRequest, + IndividualCommonModelScopeDeserializerRequest, + ModelPermissionDeserializerRequest, +) client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.accounts.remote_field_classes_list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +client.filestorage.scopes.linked_account_scopes_create( + common_models=[ + IndividualCommonModelScopeDeserializerRequest( + model_name="Employee", + model_permissions={ + "READ": ModelPermissionDeserializerRequest( + is_enabled=True, + ), + "WRITE": ModelPermissionDeserializerRequest( + is_enabled=False, + ), + }, + field_permissions=FieldPermissionDeserializerRequest( + enabled_fields=["avatar", "home_location"], + disabled_fields=["work_location"], + ), + ), + IndividualCommonModelScopeDeserializerRequest( + model_name="Benefit", + model_permissions={ + "WRITE": ModelPermissionDeserializerRequest( + is_enabled=False, + ) + }, + ), + ], ) ``` @@ -8715,7 +8592,7 @@ client.crm.accounts.remote_field_classes_list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**common_models:** `typing.Sequence[IndividualCommonModelScopeDeserializerRequest]` — The common models you want to update the scopes for
@@ -8723,58 +8600,64 @@ client.crm.accounts.remote_field_classes_list(
-**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/). +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. -
+
+## Filestorage DeleteAccount +
client.filestorage.delete_account.delete()
-**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. - -
-
+#### 📝 Description
-**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). - -
-
-
-**is_common_model_field:** `typing.Optional[bool]` — If provided, will only return remote field classes with this is_common_model_field value - +Delete a linked account. +
+
+#### 🔌 Usage +
-**is_custom:** `typing.Optional[bool]` — If provided, will only return remote fields classes with this is_custom value - -
-
-
-**page_size:** `typing.Optional[int]` — Number of results to return per page. - +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.filestorage.delete_account.delete() + +```
+ + + +#### ⚙️ Parameters + +
+
@@ -8791,8 +8674,8 @@ client.crm.accounts.remote_field_classes_list(
-## Crm AsyncPassthrough -
client.crm.async_passthrough.create(...) +## Filestorage Drives +
client.filestorage.drives.list(...)
@@ -8804,7 +8687,7 @@ client.crm.accounts.remote_field_classes_list(
-Asynchronously pull data from an endpoint not currently supported by Merge. +Returns a list of `Drive` objects.
@@ -8820,17 +8703,13 @@ Asynchronously pull data from an endpoint not currently supported by Merge. ```python from merge import Merge -from merge.resources.crm import DataPassthroughRequest, MethodEnum client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.async_passthrough.create( - request=DataPassthroughRequest( - method=MethodEnum.GET, - path="/scooters", - ), +client.filestorage.drives.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) ``` @@ -8847,7 +8726,7 @@ client.crm.async_passthrough.create(
-**request:** `DataPassthroughRequest` +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
@@ -8855,70 +8734,79 @@ client.crm.async_passthrough.create(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime.
- -
+
+
+**cursor:** `typing.Optional[str]` — The pagination cursor value. +
-
-
client.crm.async_passthrough.retrieve(...)
-#### 📝 Description +**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. + +
+
+
-Retrieves data from earlier async-passthrough POST request -
-
+**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). + -#### 🔌 Usage -
+**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+
-```python -from merge import Merge - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.crm.async_passthrough.retrieve( - async_passthrough_receipt_id="async_passthrough_receipt_id", -) - -``` +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. +
+ +
+
+ +**name:** `typing.Optional[str]` — If provided, will only return drives with this name. This performs an exact match. +
-#### ⚙️ Parameters -
+**page_size:** `typing.Optional[int]` — Number of results to return per page. + +
+
+
-**async_passthrough_receipt_id:** `str` +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -8938,8 +8826,7 @@ client.crm.async_passthrough.retrieve(
-## Crm AuditTrail -
client.crm.audit_trail.list(...) +
client.filestorage.drives.retrieve(...)
@@ -8951,7 +8838,7 @@ client.crm.async_passthrough.retrieve(
-Gets a list of audit trail events. +Returns a `Drive` object with the given `id`.
@@ -8972,8 +8859,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.audit_trail.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +client.filestorage.drives.retrieve( + id="id", ) ``` @@ -8990,31 +8877,7 @@ client.crm.audit_trail.list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — If included, will only include audit trail events that occurred before this time - -
-
- -
-
- -**event_type:** `typing.Optional[str]` — If included, will only include events with the given event type. Possible values include: `CREATED_REMOTE_PRODUCTION_API_KEY`, `DELETED_REMOTE_PRODUCTION_API_KEY`, `CREATED_TEST_API_KEY`, `DELETED_TEST_API_KEY`, `REGENERATED_PRODUCTION_API_KEY`, `REGENERATED_WEBHOOK_SIGNATURE`, `INVITED_USER`, `TWO_FACTOR_AUTH_ENABLED`, `TWO_FACTOR_AUTH_DISABLED`, `DELETED_LINKED_ACCOUNT`, `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT`, `CREATED_DESTINATION`, `DELETED_DESTINATION`, `CHANGED_DESTINATION`, `CHANGED_SCOPES`, `CHANGED_PERSONAL_INFORMATION`, `CHANGED_ORGANIZATION_SETTINGS`, `ENABLED_INTEGRATION`, `DISABLED_INTEGRATION`, `ENABLED_CATEGORY`, `DISABLED_CATEGORY`, `CHANGED_PASSWORD`, `RESET_PASSWORD`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `CREATED_INTEGRATION_WIDE_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_FIELD_MAPPING`, `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING`, `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING`, `DELETED_INTEGRATION_WIDE_FIELD_MAPPING`, `DELETED_LINKED_ACCOUNT_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `FORCED_LINKED_ACCOUNT_RESYNC`, `MUTED_ISSUE`, `GENERATED_MAGIC_LINK`, `ENABLED_MERGE_WEBHOOK`, `DISABLED_MERGE_WEBHOOK`, `MERGE_WEBHOOK_TARGET_CHANGED`, `END_USER_CREDENTIALS_ACCESSED` - -
-
- -
-
- -**page_size:** `typing.Optional[int]` — Number of results to return per page. +**id:** `str`
@@ -9022,7 +8885,7 @@ client.crm.audit_trail.list(
-**start_date:** `typing.Optional[str]` — If included, will only include audit trail events that occurred after this time +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -9030,7 +8893,7 @@ client.crm.audit_trail.list(
-**user_email:** `typing.Optional[str]` — If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email. +**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).
@@ -9050,8 +8913,8 @@ client.crm.audit_trail.list(
-## Crm AvailableActions -
client.crm.available_actions.retrieve() +## Filestorage FieldMapping +
client.filestorage.field_mapping.field_mappings_retrieve(...)
@@ -9063,7 +8926,7 @@ client.crm.audit_trail.list(
-Returns a list of models and actions available for an account. +Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/).
@@ -9084,7 +8947,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.available_actions.retrieve() +client.filestorage.field_mapping.field_mappings_retrieve() ``` @@ -9100,6 +8963,14 @@ client.crm.available_actions.retrieve()
+**exclude_remote_field_metadata:** `typing.Optional[bool]` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -9112,8 +8983,7 @@ client.crm.available_actions.retrieve()
-## Crm Contacts -
client.crm.contacts.list(...) +
client.filestorage.field_mapping.field_mappings_create(...)
@@ -9125,7 +8995,7 @@ client.crm.available_actions.retrieve()
-Returns a list of `Contact` objects. +Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start.
@@ -9146,8 +9016,13 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.contacts.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +client.filestorage.field_mapping.field_mappings_create( + target_field_name="example_target_field_name", + target_field_description="this is a example description of the target field", + remote_field_traversal_path=["example_remote_field"], + remote_method="GET", + remote_url_path="/example-url-path", + common_model_name="ExampleCommonModel", ) ``` @@ -9164,7 +9039,7 @@ client.crm.contacts.list(
-**account_id:** `typing.Optional[str]` — If provided, will only return contacts with this account. +**target_field_name:** `str` — The name of the target field you want this remote field to map to.
@@ -9172,7 +9047,7 @@ client.crm.contacts.list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. +**target_field_description:** `str` — The description of the target field you want this remote field to map to.
@@ -9180,7 +9055,7 @@ client.crm.contacts.list(
-**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +**remote_field_traversal_path:** `typing.Sequence[typing.Optional[typing.Any]]` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.
@@ -9188,7 +9063,7 @@ client.crm.contacts.list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**remote_method:** `str` — The method of the remote endpoint where the remote field is coming from.
@@ -9196,7 +9071,7 @@ client.crm.contacts.list(
-**email_addresses:** `typing.Optional[str]` — If provided, will only return contacts matching the email addresses; multiple email_addresses can be separated by commas. +**remote_url_path:** `str` — The path of the remote endpoint where the remote field is coming from.
@@ -9204,7 +9079,7 @@ client.crm.contacts.list(
-**expand:** `typing.Optional[ContactsListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**common_model_name:** `str` — The name of the Common Model that the remote field corresponds to in a given category.
@@ -9212,7 +9087,7 @@ client.crm.contacts.list(
-**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/). +**exclude_remote_field_metadata:** `typing.Optional[bool]` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations.
@@ -9220,63 +9095,70 @@ client.crm.contacts.list(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. -
+
+
client.filestorage.field_mapping.field_mappings_destroy(...)
-**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). - -
-
+#### 📝 Description
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. - -
-
-
-**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. - +Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +
+
+#### 🔌 Usage +
-**page_size:** `typing.Optional[int]` — Number of results to return per page. - -
-
-
-**phone_numbers:** `typing.Optional[str]` — If provided, will only return contacts matching the phone numbers; multiple phone numbers can be separated by commas. - +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.filestorage.field_mapping.field_mappings_destroy( + field_mapping_id="field_mapping_id", +) + +``` +
+
+#### ⚙️ Parameters +
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. +
+
+ +**field_mapping_id:** `str`
@@ -9296,7 +9178,7 @@ client.crm.contacts.list(
-
client.crm.contacts.create(...) +
client.filestorage.field_mapping.field_mappings_partial_update(...)
@@ -9308,7 +9190,7 @@ client.crm.contacts.list(
-Creates a `Contact` object with the given values. +Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start.
@@ -9324,14 +9206,13 @@ Creates a `Contact` object with the given values. ```python from merge import Merge -from merge.resources.crm import ContactRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.contacts.create( - model=ContactRequest(), +client.filestorage.field_mapping.field_mappings_partial_update( + field_mapping_id="field_mapping_id", ) ``` @@ -9348,7 +9229,7 @@ client.crm.contacts.create(
-**model:** `ContactRequest` +**field_mapping_id:** `str`
@@ -9356,7 +9237,7 @@ client.crm.contacts.create(
-**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. +**remote_field_traversal_path:** `typing.Optional[typing.Sequence[typing.Optional[typing.Any]]]` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.
@@ -9364,7 +9245,15 @@ client.crm.contacts.create(
-**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. +**remote_method:** `typing.Optional[str]` — The method of the remote endpoint where the remote field is coming from. + +
+
+ +
+
+ +**remote_url_path:** `typing.Optional[str]` — The path of the remote endpoint where the remote field is coming from.
@@ -9384,7 +9273,7 @@ client.crm.contacts.create(
-
client.crm.contacts.retrieve(...) +
client.filestorage.field_mapping.remote_fields_retrieve(...)
@@ -9396,7 +9285,7 @@ client.crm.contacts.create(
-Returns a `Contact` object with the given `id`. +Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/).
@@ -9417,9 +9306,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.contacts.retrieve( - id="id", -) +client.filestorage.field_mapping.remote_fields_retrieve() ``` @@ -9435,7 +9322,7 @@ client.crm.contacts.retrieve(
-**id:** `str` +**common_models:** `typing.Optional[str]` — A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models.
@@ -9443,7 +9330,7 @@ client.crm.contacts.retrieve(
-**expand:** `typing.Optional[ContactsRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**include_example_values:** `typing.Optional[str]` — If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers.
@@ -9451,27 +9338,64 @@ client.crm.contacts.retrieve(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
+ + + + +
+
client.filestorage.field_mapping.target_fields_retrieve()
-**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. - +#### 📝 Description + +
+
+ +
+
+ +Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). +
+
+#### 🔌 Usage +
-**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). - +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.filestorage.field_mapping.target_fields_retrieve() + +``` +
+
+#### ⚙️ Parameters + +
+
+
@@ -9487,7 +9411,8 @@ client.crm.contacts.retrieve(
-
client.crm.contacts.partial_update(...) +## Filestorage Files +
client.filestorage.files.list(...)
@@ -9499,7 +9424,7 @@ client.crm.contacts.retrieve(
-Updates a `Contact` object with the given `id`. +Returns a list of `File` objects.
@@ -9515,15 +9440,13 @@ Updates a `Contact` object with the given `id`. ```python from merge import Merge -from merge.resources.crm import PatchedContactRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.contacts.partial_update( - id="id", - model=PatchedContactRequest(), +client.filestorage.files.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) ``` @@ -9540,7 +9463,7 @@ client.crm.contacts.partial_update(
-**id:** `str` +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
@@ -9548,7 +9471,7 @@ client.crm.contacts.partial_update(
-**model:** `PatchedContactRequest` +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime.
@@ -9556,7 +9479,7 @@ client.crm.contacts.partial_update(
-**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -9564,7 +9487,7 @@ client.crm.contacts.partial_update(
-**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. +**drive_id:** `typing.Optional[str]` — Specifying a drive id returns only the files in that drive. Specifying null returns only the files outside the top-level drive.
@@ -9572,74 +9495,103 @@ client.crm.contacts.partial_update(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**expand:** `typing.Optional[FilesListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
+ +
+
+ +**folder_id:** `typing.Optional[str]` — Specifying a folder id returns only the files in that folder. Specifying null returns only the files in root directory. +
+
+
+**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/). +
-
-
client.crm.contacts.ignore_create(...)
-#### 📝 Description +**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). + +
+
+
-Ignores a specific row based on the `model_id` in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. +**mime_type:** `typing.Optional[str]` — If provided, will only return files with these mime_types. Multiple values can be separated by commas. +
+ +
+
+ +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +
-#### 🔌 Usage -
+**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+
-```python -from merge import Merge -from merge.resources.crm import IgnoreCommonModelRequest, ReasonEnum +**name:** `typing.Optional[str]` — If provided, will only return files with this name. This performs an exact match. + +
+
-client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.crm.contacts.ignore_create( - model_id="model_id", - request=IgnoreCommonModelRequest( - reason=ReasonEnum.GENERAL_CUSTOMER_REQUEST, - ), -) +
+
-``` +**order_by:** `typing.Optional[FilesListRequestOrderBy]` — Overrides the default ordering for this endpoint. Possible values include: created_at, -created_at, modified_at, -modified_at. +
+ +
+
+ +**page_size:** `typing.Optional[int]` — Number of results to return per page. +
-#### ⚙️ Parameters -
+**remote_created_after:** `typing.Optional[dt.datetime]` — If provided, will only return files created in the third party platform after this datetime. + +
+
+
-**model_id:** `str` +**remote_created_before:** `typing.Optional[dt.datetime]` — If provided, will only return files created in the third party platform before this datetime.
@@ -9647,7 +9599,7 @@ client.crm.contacts.ignore_create(
-**request:** `IgnoreCommonModelRequest` +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -9667,7 +9619,7 @@ client.crm.contacts.ignore_create(
-
client.crm.contacts.meta_patch_retrieve(...) +
client.filestorage.files.create(...)
@@ -9679,7 +9631,7 @@ client.crm.contacts.ignore_create(
-Returns metadata for `CRMContact` PATCHs. +Creates a `File` object with the given values.
@@ -9695,13 +9647,14 @@ Returns metadata for `CRMContact` PATCHs. ```python from merge import Merge +from merge.resources.filestorage import FileRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.contacts.meta_patch_retrieve( - id="id", +client.filestorage.files.create( + model=FileRequest(), ) ``` @@ -9718,7 +9671,23 @@ client.crm.contacts.meta_patch_retrieve(
-**id:** `str` +**model:** `FileRequest` + +
+
+ +
+
+ +**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously.
@@ -9738,7 +9707,7 @@ client.crm.contacts.meta_patch_retrieve(
-
client.crm.contacts.meta_post_retrieve() +
client.filestorage.files.retrieve(...)
@@ -9750,7 +9719,7 @@ client.crm.contacts.meta_patch_retrieve(
-Returns metadata for `CRMContact` POSTs. +Returns a `File` object with the given `id`.
@@ -9771,7 +9740,9 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.contacts.meta_post_retrieve() +client.filestorage.files.retrieve( + id="id", +) ``` @@ -9787,6 +9758,38 @@ client.crm.contacts.meta_post_retrieve()
+**id:** `str` + +
+
+ +
+
+ +**expand:** `typing.Optional[FilesRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**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). + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -9799,7 +9802,7 @@ client.crm.contacts.meta_post_retrieve()
-
client.crm.contacts.remote_field_classes_list(...) +
client.filestorage.files.download_request_meta_retrieve(...)
@@ -9811,7 +9814,7 @@ client.crm.contacts.meta_post_retrieve()
-Returns a list of `RemoteFieldClass` objects. +Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party.
@@ -9832,8 +9835,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.contacts.remote_field_classes_list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +client.filestorage.files.download_request_meta_retrieve( + id="id", ) ``` @@ -9850,55 +9853,7 @@ client.crm.contacts.remote_field_classes_list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. - -
-
- -
-
- -**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_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. - -
-
- -
-
- -**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). - -
-
- -
-
- -**is_common_model_field:** `typing.Optional[bool]` — If provided, will only return remote field classes with this is_common_model_field value - -
-
- -
-
- -**is_custom:** `typing.Optional[bool]` — If provided, will only return remote fields classes with this is_custom value +**id:** `str`
@@ -9906,7 +9861,7 @@ client.crm.contacts.remote_field_classes_list(
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +**mime_type:** `typing.Optional[str]` — If provided, specifies the export format of the file to be downloaded. For information on supported export formats, please refer to our export format help center article.
@@ -9926,8 +9881,7 @@ client.crm.contacts.remote_field_classes_list(
-## Crm CustomObjectClasses -
client.crm.custom_object_classes.list(...) +
client.filestorage.files.download_request_meta_list(...)
@@ -9939,7 +9893,7 @@ client.crm.contacts.remote_field_classes_list(
-Returns a list of `CustomObjectClass` objects. +Returns metadata to construct authenticated file download requests, allowing you to download files directly from the third-party.
@@ -9960,7 +9914,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.custom_object_classes.list( +client.filestorage.files.download_request_meta_list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -9978,7 +9932,7 @@ client.crm.custom_object_classes.list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. +**created_after:** `typing.Optional[str]` — If provided, will only return objects created after this datetime.
@@ -9986,7 +9940,7 @@ client.crm.custom_object_classes.list(
-**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +**created_before:** `typing.Optional[str]` — If provided, will only return objects created before this datetime.
@@ -10002,7 +9956,7 @@ client.crm.custom_object_classes.list(
-**expand:** `typing.Optional[typing.Literal["fields"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — If provided, will only return objects with the given IDs. Comma-separated list of strings.
@@ -10018,7 +9972,7 @@ client.crm.custom_object_classes.list(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**mime_types:** `typing.Optional[str]` — A comma-separated list of preferred MIME types in order of priority. If supported by the third-party provider, the file(s) will be returned in the first supported MIME type from the list. The default MIME type is PDF. To see supported MIME types by file type, refer to our export format help center article.
@@ -10026,7 +9980,7 @@ client.crm.custom_object_classes.list(
-**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). +**modified_after:** `typing.Optional[str]` — If provided, will only return objects modified after this datetime.
@@ -10034,7 +9988,7 @@ client.crm.custom_object_classes.list(
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +**modified_before:** `typing.Optional[str]` — If provided, will only return objects modified before this datetime.
@@ -10042,7 +9996,7 @@ client.crm.custom_object_classes.list(
-**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. +**order_by:** `typing.Optional[FilesDownloadRequestMetaListRequestOrderBy]` — Overrides the default ordering for this endpoint. Possible values include: created_at, -created_at, modified_at, -modified_at.
@@ -10058,14 +10012,6 @@ client.crm.custom_object_classes.list(
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -10078,7 +10024,7 @@ client.crm.custom_object_classes.list(
-
client.crm.custom_object_classes.retrieve(...) +
client.filestorage.files.meta_post_retrieve()
@@ -10090,7 +10036,7 @@ client.crm.custom_object_classes.list(
-Returns a `CustomObjectClass` object with the given `id`. +Returns metadata for `FileStorageFile` POSTs.
@@ -10111,9 +10057,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.custom_object_classes.retrieve( - id="id", -) +client.filestorage.files.meta_post_retrieve() ``` @@ -10129,38 +10073,6 @@ client.crm.custom_object_classes.retrieve(
-**id:** `str` - -
-
- -
-
- -**expand:** `typing.Optional[typing.Literal["fields"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - -
-
- -
-
- -**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). - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -10173,8 +10085,8 @@ client.crm.custom_object_classes.retrieve(
-## Crm AssociationTypes -
client.crm.association_types.custom_object_classes_association_types_list(...) +## Filestorage Folders +
client.filestorage.folders.list(...)
@@ -10186,7 +10098,7 @@ client.crm.custom_object_classes.retrieve(
-Returns a list of `AssociationType` objects. +Returns a list of `Folder` objects.
@@ -10207,8 +10119,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.association_types.custom_object_classes_association_types_list( - custom_object_class_id="custom_object_class_id", +client.filestorage.folders.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -10226,7 +10137,7 @@ client.crm.association_types.custom_object_classes_association_types_list(
-**custom_object_class_id:** `str` +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
@@ -10234,7 +10145,7 @@ client.crm.association_types.custom_object_classes_association_types_list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime.
@@ -10242,7 +10153,7 @@ client.crm.association_types.custom_object_classes_association_types_list(
-**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -10250,7 +10161,7 @@ client.crm.association_types.custom_object_classes_association_types_list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**drive_id:** `typing.Optional[str]` — If provided, will only return folders in this drive.
@@ -10258,7 +10169,7 @@ client.crm.association_types.custom_object_classes_association_types_list(
-**expand:** `typing.Optional[typing.Literal["target_object_classes"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**expand:** `typing.Optional[FoldersListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -10306,6 +10217,14 @@ client.crm.association_types.custom_object_classes_association_types_list(
+**name:** `typing.Optional[str]` — If provided, will only return folders with this name. This performs an exact match. + +
+
+ +
+
+ **page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -10314,6 +10233,14 @@ client.crm.association_types.custom_object_classes_association_types_list(
+**parent_folder_id:** `typing.Optional[str]` — If provided, will only return folders in this parent folder. If null, will return folders in root directory. + +
+
+ +
+
+ **remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -10334,7 +10261,7 @@ client.crm.association_types.custom_object_classes_association_types_list(
-
client.crm.association_types.custom_object_classes_association_types_create(...) +
client.filestorage.folders.create(...)
@@ -10346,7 +10273,7 @@ client.crm.association_types.custom_object_classes_association_types_list(
-Creates an `AssociationType` object with the given values. +Creates a `Folder` object with the given values.
@@ -10362,31 +10289,14 @@ Creates an `AssociationType` object with the given values. ```python from merge import Merge -from merge.resources.crm import ( - AssociationTypeRequestRequest, - ObjectClassDescriptionRequest, - OriginTypeEnum, -) +from merge.resources.filestorage import FolderRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.association_types.custom_object_classes_association_types_create( - custom_object_class_id="custom_object_class_id", - model=AssociationTypeRequestRequest( - source_object_class=ObjectClassDescriptionRequest( - id="id", - origin_type=OriginTypeEnum.CUSTOM_OBJECT, - ), - target_object_classes=[ - ObjectClassDescriptionRequest( - id="id", - origin_type=OriginTypeEnum.CUSTOM_OBJECT, - ) - ], - remote_key_name="remote_key_name", - ), +client.filestorage.folders.create( + model=FolderRequest(), ) ``` @@ -10403,15 +10313,7 @@ client.crm.association_types.custom_object_classes_association_types_create(
-**custom_object_class_id:** `str` - -
-
- -
-
- -**model:** `AssociationTypeRequestRequest` +**model:** `FolderRequest`
@@ -10447,7 +10349,7 @@ client.crm.association_types.custom_object_classes_association_types_create(
-
client.crm.association_types.custom_object_classes_association_types_retrieve(...) +
client.filestorage.folders.retrieve(...)
@@ -10459,7 +10361,7 @@ client.crm.association_types.custom_object_classes_association_types_create(
-Returns an `AssociationType` object with the given `id`. +Returns a `Folder` object with the given `id`.
@@ -10480,8 +10382,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.association_types.custom_object_classes_association_types_retrieve( - custom_object_class_id="custom_object_class_id", +client.filestorage.folders.retrieve( id="id", ) @@ -10499,14 +10400,6 @@ client.crm.association_types.custom_object_classes_association_types_retrieve(
-**custom_object_class_id:** `str` - -
-
- -
-
- **id:** `str`
@@ -10515,7 +10408,7 @@ client.crm.association_types.custom_object_classes_association_types_retrieve(
-**expand:** `typing.Optional[typing.Literal["target_object_classes"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**expand:** `typing.Optional[FoldersRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -10551,7 +10444,7 @@ client.crm.association_types.custom_object_classes_association_types_retrieve(
-
client.crm.association_types.custom_object_classes_association_types_meta_post_retrieve(...) +
client.filestorage.folders.meta_post_retrieve()
@@ -10563,7 +10456,7 @@ client.crm.association_types.custom_object_classes_association_types_retrieve(
-Returns metadata for `CRMAssociationType` POSTs. +Returns metadata for `FileStorageFolder` POSTs.
@@ -10584,8 +10477,70 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.association_types.custom_object_classes_association_types_meta_post_retrieve( - custom_object_class_id="custom_object_class_id", +client.filestorage.folders.meta_post_retrieve() + +``` + +
+ + + +#### ⚙️ Parameters + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + + + +
+ +## Filestorage GenerateKey +
client.filestorage.generate_key.create(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a remote key. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.filestorage.generate_key.create( + name="Remote Deployment Key 1", ) ``` @@ -10602,7 +10557,7 @@ client.crm.association_types.custom_object_classes_association_types_meta_post_r
-**custom_object_class_id:** `str` +**name:** `str` — The name of the remote key
@@ -10622,8 +10577,8 @@ client.crm.association_types.custom_object_classes_association_types_meta_post_r
-## Crm CustomObjects -
client.crm.custom_objects.custom_object_classes_custom_objects_list(...) +## Filestorage Groups +
client.filestorage.groups.list(...)
@@ -10635,7 +10590,7 @@ client.crm.association_types.custom_object_classes_association_types_meta_post_r
-Returns a list of `CustomObject` objects. +Returns a list of `Group` objects.
@@ -10656,8 +10611,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.custom_objects.custom_object_classes_custom_objects_list( - custom_object_class_id="custom_object_class_id", +client.filestorage.groups.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -10675,14 +10629,6 @@ client.crm.custom_objects.custom_object_classes_custom_objects_list(
-**custom_object_class_id:** `str` - -
-
- -
-
- **created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
@@ -10707,7 +10653,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_list(
-**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/). +**expand:** `typing.Optional[typing.Literal["child_groups"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -10715,7 +10661,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_list(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**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/).
@@ -10723,7 +10669,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_list(
-**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -10783,7 +10729,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_list(
-
client.crm.custom_objects.custom_object_classes_custom_objects_create(...) +
client.filestorage.groups.retrieve(...)
@@ -10795,7 +10741,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_list(
-Creates a `CustomObject` object with the given values. +Returns a `Group` object with the given `id`.
@@ -10811,17 +10757,13 @@ Creates a `CustomObject` object with the given values. ```python from merge import Merge -from merge.resources.crm import CustomObjectRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.custom_objects.custom_object_classes_custom_objects_create( - custom_object_class_id="custom_object_class_id", - model=CustomObjectRequest( - fields={"test_field": "hello"}, - ), +client.filestorage.groups.retrieve( + id="id", ) ``` @@ -10838,7 +10780,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_create(
-**custom_object_class_id:** `str` +**id:** `str`
@@ -10846,7 +10788,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_create(
-**model:** `CustomObjectRequest` +**expand:** `typing.Optional[typing.Literal["child_groups"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -10854,7 +10796,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_create(
-**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -10862,7 +10804,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_create(
-**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. +**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).
@@ -10882,7 +10824,8 @@ client.crm.custom_objects.custom_object_classes_custom_objects_create(
-
client.crm.custom_objects.custom_object_classes_custom_objects_retrieve(...) +## Filestorage Issues +
client.filestorage.issues.list(...)
@@ -10894,7 +10837,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_create(
-Returns a `CustomObject` object with the given `id`. +Gets all issues for Organization.
@@ -10915,9 +10858,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.custom_objects.custom_object_classes_custom_objects_retrieve( - custom_object_class_id="custom_object_class_id", - id="id", +client.filestorage.issues.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) ``` @@ -10934,7 +10876,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_retrieve(
-**custom_object_class_id:** `str` +**account_token:** `typing.Optional[str]`
@@ -10942,7 +10884,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_retrieve(
-**id:** `str` +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -10950,7 +10892,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_retrieve(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**end_date:** `typing.Optional[str]` — If included, will only include issues whose most recent action occurred before this time
@@ -10958,7 +10900,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_retrieve(
-**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. +**end_user_organization_name:** `typing.Optional[str]`
@@ -10966,7 +10908,84 @@ client.crm.custom_objects.custom_object_classes_custom_objects_retrieve(
-**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). +**first_incident_time_after:** `typing.Optional[dt.datetime]` — If provided, will only return issues whose first incident time was after this datetime. + +
+
+ +
+
+ +**first_incident_time_before:** `typing.Optional[dt.datetime]` — If provided, will only return issues whose first incident time was before this datetime. + +
+
+ +
+
+ +**include_muted:** `typing.Optional[str]` — If true, will include muted issues + +
+
+ +
+
+ +**integration_name:** `typing.Optional[str]` + +
+
+ +
+
+ +**last_incident_time_after:** `typing.Optional[dt.datetime]` — If provided, will only return issues whose last incident time was after this datetime. + +
+
+ +
+
+ +**last_incident_time_before:** `typing.Optional[dt.datetime]` — If provided, will only return issues whose last incident time was before this datetime. + +
+
+ +
+
+ +**linked_account_id:** `typing.Optional[str]` — If provided, will only include issues pertaining to the linked account passed in. + +
+
+ +
+
+ +**page_size:** `typing.Optional[int]` — Number of results to return per page. + +
+
+ +
+
+ +**start_date:** `typing.Optional[str]` — If included, will only include issues whose most recent action occurred after this time + +
+
+ +
+
+ +**status:** `typing.Optional[IssuesListRequestStatus]` + +Status of the issue. Options: ('ONGOING', 'RESOLVED') + +* `ONGOING` - ONGOING +* `RESOLVED` - RESOLVED
@@ -10986,7 +11005,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_retrieve(
-
client.crm.custom_objects.custom_object_classes_custom_objects_meta_post_retrieve(...) +
client.filestorage.issues.retrieve(...)
@@ -10998,7 +11017,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_retrieve(
-Returns metadata for `CRMCustomObject` POSTs. +Get a specific issue.
@@ -11019,8 +11038,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.custom_objects.custom_object_classes_custom_objects_meta_post_retrieve( - custom_object_class_id="custom_object_class_id", +client.filestorage.issues.retrieve( + id="id", ) ``` @@ -11037,7 +11056,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_meta_post_retriev
-**custom_object_class_id:** `str` +**id:** `str`
@@ -11057,7 +11076,8 @@ client.crm.custom_objects.custom_object_classes_custom_objects_meta_post_retriev
-
client.crm.custom_objects.custom_object_classes_custom_objects_remote_field_classes_list(...) +## Filestorage LinkToken +
client.filestorage.link_token.create(...)
@@ -11069,7 +11089,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_meta_post_retriev
-Returns a list of `RemoteFieldClass` objects. +Creates a link token to be used when linking a new end user.
@@ -11085,13 +11105,17 @@ Returns a list of `RemoteFieldClass` objects. ```python from merge import Merge +from merge.resources.filestorage import CategoriesEnum client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.custom_objects.custom_object_classes_custom_objects_remote_field_classes_list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +client.filestorage.link_token.create( + end_user_email_address="example@gmail.com", + end_user_organization_name="Test Organization", + end_user_origin_id="12345", + categories=[CategoriesEnum.HRIS, CategoriesEnum.ATS], ) ``` @@ -11108,7 +11132,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_remote_field_clas
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**end_user_email_address:** `str` — Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent.
@@ -11116,7 +11140,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_remote_field_clas
-**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/). +**end_user_organization_name:** `str` — Your end user's organization.
@@ -11124,7 +11148,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_remote_field_clas
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**end_user_origin_id:** `str` — This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers.
@@ -11132,7 +11156,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_remote_field_clas
-**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. +**categories:** `typing.Sequence[CategoriesEnum]` — The integration categories to show in Merge Link.
@@ -11140,7 +11164,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_remote_field_clas
-**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). +**integration:** `typing.Optional[str]` — The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/.
@@ -11148,7 +11172,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_remote_field_clas
-**is_common_model_field:** `typing.Optional[bool]` — If provided, will only return remote field classes with this is_common_model_field value +**link_expiry_mins:** `typing.Optional[int]` — An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30.
@@ -11156,7 +11180,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_remote_field_clas
-**is_custom:** `typing.Optional[bool]` — If provided, will only return remote fields classes with this is_custom value +**should_create_magic_link_url:** `typing.Optional[bool]` — Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.
@@ -11164,7 +11188,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_remote_field_clas
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +**hide_admin_magic_link:** `typing.Optional[bool]` — Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.
@@ -11172,20 +11196,72 @@ client.crm.custom_objects.custom_object_classes_custom_objects_remote_field_clas
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**common_models:** `typing.Optional[typing.Sequence[CommonModelScopesBodyRequest]]` — An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account.
- -
+ +
+
+ +**category_common_model_scopes:** `typing.Optional[ + typing.Dict[ + str, + typing.Optional[ + typing.Sequence[IndividualCommonModelScopeDeserializerRequest] + ], + ] +]` — When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. + +
+
+ +
+
+ +**language:** `typing.Optional[LanguageEnum]` + +The following subset of IETF language tags can be used to configure localization. + +* `en` - en +* `de` - de + +
+
+ +
+
+ +**are_syncs_disabled:** `typing.Optional[bool]` — The boolean that indicates whether initial, periodic, and force syncs will be disabled. + +
+
+ +
+
+ +**integration_specific_config:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — A JSON object containing integration-specific configuration options. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+ +
-## Crm Associations -
client.crm.associations.custom_object_classes_custom_objects_associations_list(...) +## Filestorage LinkedAccounts +
client.filestorage.linked_accounts.list(...)
@@ -11197,7 +11273,7 @@ client.crm.custom_objects.custom_object_classes_custom_objects_remote_field_clas
-Returns a list of `Association` objects. +List linked accounts for your organization.
@@ -11218,9 +11294,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.associations.custom_object_classes_custom_objects_associations_list( - custom_object_class_id="custom_object_class_id", - object_id="object_id", +client.filestorage.linked_accounts.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -11238,15 +11312,17 @@ client.crm.associations.custom_object_classes_custom_objects_associations_list(
-**custom_object_class_id:** `str` - -
-
+**category:** `typing.Optional[LinkedAccountsListRequestCategory]` -
-
+Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing` -**object_id:** `str` +* `hris` - hris +* `ats` - ats +* `accounting` - accounting +* `ticketing` - ticketing +* `crm` - crm +* `mktg` - mktg +* `filestorage` - filestorage
@@ -11254,7 +11330,7 @@ client.crm.associations.custom_object_classes_custom_objects_associations_list(
-**association_type_id:** `typing.Optional[str]` — If provided, will only return opportunities with this association_type. +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -11262,7 +11338,7 @@ client.crm.associations.custom_object_classes_custom_objects_associations_list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. +**end_user_email_address:** `typing.Optional[str]` — If provided, will only return linked accounts associated with the given email address.
@@ -11270,7 +11346,7 @@ client.crm.associations.custom_object_classes_custom_objects_associations_list(
-**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +**end_user_organization_name:** `typing.Optional[str]` — If provided, will only return linked accounts associated with the given organization name.
@@ -11278,7 +11354,7 @@ client.crm.associations.custom_object_classes_custom_objects_associations_list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**end_user_origin_id:** `typing.Optional[str]` — If provided, will only return linked accounts associated with the given origin ID.
@@ -11286,7 +11362,7 @@ client.crm.associations.custom_object_classes_custom_objects_associations_list(
-**expand:** `typing.Optional[typing.Literal["association_type"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**end_user_origin_ids:** `typing.Optional[str]` — Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once.
@@ -11294,7 +11370,7 @@ client.crm.associations.custom_object_classes_custom_objects_associations_list(
-**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/). +**id:** `typing.Optional[str]`
@@ -11302,7 +11378,7 @@ client.crm.associations.custom_object_classes_custom_objects_associations_list(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**ids:** `typing.Optional[str]` — Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once.
@@ -11310,7 +11386,7 @@ client.crm.associations.custom_object_classes_custom_objects_associations_list(
-**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). +**include_duplicates:** `typing.Optional[bool]` — If `true`, will include complete production duplicates of the account specified by the `id` query parameter in the response. `id` must be for a complete production linked account.
@@ -11318,7 +11394,7 @@ client.crm.associations.custom_object_classes_custom_objects_associations_list(
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +**integration_name:** `typing.Optional[str]` — If provided, will only return linked accounts associated with the given integration name.
@@ -11326,7 +11402,7 @@ client.crm.associations.custom_object_classes_custom_objects_associations_list(
-**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. +**is_test_account:** `typing.Optional[str]` — If included, will only include test linked accounts. If not included, will only include non-test linked accounts.
@@ -11342,7 +11418,7 @@ client.crm.associations.custom_object_classes_custom_objects_associations_list(
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. +**status:** `typing.Optional[str]` — Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, `RELINK_NEEDED`
@@ -11362,7 +11438,8 @@ client.crm.associations.custom_object_classes_custom_objects_associations_list(
-
client.crm.associations.custom_object_classes_custom_objects_associations_update(...) +## Filestorage Passthrough +
client.filestorage.passthrough.create(...)
@@ -11374,7 +11451,7 @@ client.crm.associations.custom_object_classes_custom_objects_associations_list(
-Creates an Association between `source_object_id` and `target_object_id` of type `association_type_id`. +Pull data from an endpoint not currently supported by Merge.
@@ -11390,17 +11467,17 @@ Creates an Association between `source_object_id` and `target_object_id` of type ```python from merge import Merge +from merge.resources.filestorage import DataPassthroughRequest, MethodEnum client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.associations.custom_object_classes_custom_objects_associations_update( - association_type_id="association_type_id", - source_class_id="source_class_id", - source_object_id="source_object_id", - target_class_id="target_class_id", - target_object_id="target_object_id", +client.filestorage.passthrough.create( + request=DataPassthroughRequest( + method=MethodEnum.GET, + path="/scooters", + ), ) ``` @@ -11417,7 +11494,7 @@ client.crm.associations.custom_object_classes_custom_objects_associations_update
-**association_type_id:** `str` +**request:** `DataPassthroughRequest`
@@ -11425,47 +11502,71 @@ client.crm.associations.custom_object_classes_custom_objects_associations_update
-**source_class_id:** `str` +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**source_object_id:** `str` -
+
+## Filestorage RegenerateKey +
client.filestorage.regenerate_key.create(...)
-**target_class_id:** `str` - -
-
+#### 📝 Description
-**target_object_id:** `str` - +
+
+ +Exchange remote keys. +
+
+#### 🔌 Usage +
-**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. - +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.filestorage.regenerate_key.create( + name="Remote Deployment Key 1", +) + +``` +
+
+#### ⚙️ Parameters +
-**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. +
+
+ +**name:** `str` — The name of the remote key
@@ -11485,8 +11586,8 @@ client.crm.associations.custom_object_classes_custom_objects_associations_update
-## Crm Scopes -
client.crm.scopes.default_scopes_retrieve() +## Filestorage SyncStatus +
client.filestorage.sync_status.list(...)
@@ -11498,7 +11599,7 @@ client.crm.associations.custom_object_classes_custom_objects_associations_update
-Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). +Get sync status for the current sync and the most recently finished sync. `last_sync_start` represents the most recent time any sync began. `last_sync_finished` represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the `last_sync_finished` timestamp where `last_sync_result` is `DONE`. Possible values for `status` and `last_sync_result` are `DISABLED`, `DONE`, `FAILED`, `PARTIALLY_SYNCED`, `PAUSED`, `SYNCING`. Learn more about sync status in our [Help Center](https://help.merge.dev/en/articles/8184193-merge-sync-statuses).
@@ -11519,7 +11620,9 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.scopes.default_scopes_retrieve() +client.filestorage.sync_status.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +) ``` @@ -11535,6 +11638,22 @@ client.crm.scopes.default_scopes_retrieve()
+**cursor:** `typing.Optional[str]` — The pagination cursor value. + +
+
+ +
+
+ +**page_size:** `typing.Optional[int]` — Number of results to return per page. + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -11547,7 +11666,8 @@ client.crm.scopes.default_scopes_retrieve()
-
client.crm.scopes.linked_account_scopes_retrieve() +## Filestorage ForceResync +
client.filestorage.force_resync.sync_status_resync_create()
@@ -11559,7 +11679,7 @@ client.crm.scopes.default_scopes_retrieve()
-Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). +Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers.
@@ -11580,7 +11700,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.scopes.linked_account_scopes_retrieve() +client.filestorage.force_resync.sync_status_resync_create() ``` @@ -11608,7 +11728,8 @@ client.crm.scopes.linked_account_scopes_retrieve()
-
client.crm.scopes.linked_account_scopes_create(...) +## Filestorage Users +
client.filestorage.users.list(...)
@@ -11620,7 +11741,7 @@ client.crm.scopes.linked_account_scopes_retrieve()
-Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes) +Returns a list of `User` objects.
@@ -11636,42 +11757,13 @@ Update permissions for any Common Model or field for a single Linked Account. An ```python from merge import Merge -from merge.resources.crm import ( - FieldPermissionDeserializerRequest, - IndividualCommonModelScopeDeserializerRequest, - ModelPermissionDeserializerRequest, -) client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.scopes.linked_account_scopes_create( - common_models=[ - IndividualCommonModelScopeDeserializerRequest( - model_name="Employee", - model_permissions={ - "READ": ModelPermissionDeserializerRequest( - is_enabled=True, - ), - "WRITE": ModelPermissionDeserializerRequest( - is_enabled=False, - ), - }, - field_permissions=FieldPermissionDeserializerRequest( - enabled_fields=["avatar", "home_location"], - disabled_fields=["work_location"], - ), - ), - IndividualCommonModelScopeDeserializerRequest( - model_name="Benefit", - model_permissions={ - "WRITE": ModelPermissionDeserializerRequest( - is_enabled=False, - ) - }, - ), - ], +client.filestorage.users.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) ``` @@ -11688,7 +11780,7 @@ client.crm.scopes.linked_account_scopes_create(
-**common_models:** `typing.Sequence[IndividualCommonModelScopeDeserializerRequest]` — The common models you want to update the scopes for +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
@@ -11696,65 +11788,83 @@ client.crm.scopes.linked_account_scopes_create(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime.
- -
+
+
+**cursor:** `typing.Optional[str]` — The pagination cursor value. +
-
-## Crm DeleteAccount -
client.crm.delete_account.delete()
-#### 📝 Description +**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. + +
+
+
-Delete a linked account. -
-
+**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). + -#### 🔌 Usage -
+**is_me:** `typing.Optional[str]` — If provided, will only return the user object for requestor. + +
+
+
-```python -from merge import Merge +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. + +
+
-client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.crm.delete_account.delete() +
+
-``` +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. +
+ +
+
+ +**page_size:** `typing.Optional[int]` — Number of results to return per page. +
-#### ⚙️ Parameters -
+**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. + +
+
+
@@ -11770,8 +11880,7 @@ client.crm.delete_account.delete()
-## Crm EngagementTypes -
client.crm.engagement_types.list(...) +
client.filestorage.users.retrieve(...)
@@ -11783,7 +11892,7 @@ client.crm.delete_account.delete()
-Returns a list of `EngagementType` objects. +Returns a `User` object with the given `id`.
@@ -11804,8 +11913,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.engagement_types.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +client.filestorage.users.retrieve( + id="id", ) ``` @@ -11822,7 +11931,7 @@ client.crm.engagement_types.list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. +**id:** `str`
@@ -11830,7 +11939,7 @@ client.crm.engagement_types.list(
-**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -11838,7 +11947,7 @@ client.crm.engagement_types.list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**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).
@@ -11846,67 +11955,65 @@ client.crm.engagement_types.list(
-**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/). +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. -
+
+## Filestorage WebhookReceivers +
client.filestorage.webhook_receivers.list()
-**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. - -
-
+#### 📝 Description
-**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). - -
-
-
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. - +Returns a list of `WebhookReceiver` objects. +
+
+#### 🔌 Usage +
-**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. - -
-
-
-**page_size:** `typing.Optional[int]` — Number of results to return per page. - +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.filestorage.webhook_receivers.list() + +``` +
+
+#### ⚙️ Parameters +
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. - -
-
-
@@ -11922,7 +12029,7 @@ client.crm.engagement_types.list(
-
client.crm.engagement_types.retrieve(...) +
client.filestorage.webhook_receivers.create(...)
@@ -11934,7 +12041,7 @@ client.crm.engagement_types.list(
-Returns an `EngagementType` object with the given `id`. +Creates a `WebhookReceiver` object with the given values.
@@ -11955,8 +12062,9 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.engagement_types.retrieve( - id="id", +client.filestorage.webhook_receivers.create( + event="event", + is_active=True, ) ``` @@ -11973,15 +12081,7 @@ client.crm.engagement_types.retrieve(
-**id:** `str` - -
-
- -
-
- -**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**event:** `str`
@@ -11989,7 +12089,7 @@ client.crm.engagement_types.retrieve(
-**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. +**is_active:** `bool`
@@ -11997,7 +12097,7 @@ client.crm.engagement_types.retrieve(
-**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). +**key:** `typing.Optional[str]`
@@ -12017,7 +12117,8 @@ client.crm.engagement_types.retrieve(
-
client.crm.engagement_types.remote_field_classes_list(...) +## Crm AccountDetails +
client.crm.account_details.retrieve()
@@ -12029,7 +12130,7 @@ client.crm.engagement_types.retrieve(
-Returns a list of `RemoteFieldClass` objects. +Get details for a linked account.
@@ -12050,9 +12151,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.engagement_types.remote_field_classes_list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", -) +client.crm.account_details.retrieve() ``` @@ -12068,63 +12167,71 @@ client.crm.engagement_types.remote_field_classes_list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**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/). -
+
+## Crm AccountToken +
client.crm.account_token.retrieve(...)
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. - -
-
+#### 📝 Description
-**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. - -
-
-
-**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). - +Returns the account token for the end user with the provided public token. +
+
+#### 🔌 Usage +
-**is_common_model_field:** `typing.Optional[bool]` — If provided, will only return remote field classes with this is_common_model_field value - -
-
-
-**is_custom:** `typing.Optional[bool]` — If provided, will only return remote fields classes with this is_custom value - +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.account_token.retrieve( + public_token="public_token", +) + +``` +
+
+#### ⚙️ Parameters +
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +
+
+ +**public_token:** `str`
@@ -12144,8 +12251,8 @@ client.crm.engagement_types.remote_field_classes_list(
-## Crm Engagements -
client.crm.engagements.list(...) +## Crm Accounts +
client.crm.accounts.list(...)
@@ -12157,7 +12264,7 @@ client.crm.engagement_types.remote_field_classes_list(
-Returns a list of `Engagement` objects. +Returns a list of `Account` objects.
@@ -12178,7 +12285,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.engagements.list( +client.crm.accounts.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -12220,7 +12327,7 @@ client.crm.engagements.list(
-**expand:** `typing.Optional[EngagementsListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**expand:** `typing.Optional[typing.Literal["owner"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -12276,7 +12383,7 @@ client.crm.engagements.list(
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +**name:** `typing.Optional[str]` — If provided, will only return accounts with this name.
@@ -12284,7 +12391,7 @@ client.crm.engagements.list(
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. +**owner_id:** `typing.Optional[str]` — If provided, will only return accounts with this owner.
@@ -12292,7 +12399,7 @@ client.crm.engagements.list(
-**started_after:** `typing.Optional[dt.datetime]` — If provided, will only return engagements started after this datetime. +**page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -12300,7 +12407,7 @@ client.crm.engagements.list(
-**started_before:** `typing.Optional[dt.datetime]` — If provided, will only return engagements started before this datetime. +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -12320,7 +12427,7 @@ client.crm.engagements.list(
-
client.crm.engagements.create(...) +
client.crm.accounts.create(...)
@@ -12332,7 +12439,7 @@ client.crm.engagements.list(
-Creates an `Engagement` object with the given values. +Creates an `Account` object with the given values.
@@ -12348,14 +12455,14 @@ Creates an `Engagement` object with the given values. ```python from merge import Merge -from merge.resources.crm import EngagementRequest +from merge.resources.crm import AccountRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.engagements.create( - model=EngagementRequest(), +client.crm.accounts.create( + model=AccountRequest(), ) ``` @@ -12372,7 +12479,7 @@ client.crm.engagements.create(
-**model:** `EngagementRequest` +**model:** `AccountRequest`
@@ -12408,7 +12515,7 @@ client.crm.engagements.create(
-
client.crm.engagements.retrieve(...) +
client.crm.accounts.retrieve(...)
@@ -12420,7 +12527,7 @@ client.crm.engagements.create(
-Returns an `Engagement` object with the given `id`. +Returns an `Account` object with the given `id`.
@@ -12441,7 +12548,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.engagements.retrieve( +client.crm.accounts.retrieve( id="id", ) @@ -12467,7 +12574,7 @@ client.crm.engagements.retrieve(
-**expand:** `typing.Optional[EngagementsRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**expand:** `typing.Optional[typing.Literal["owner"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -12511,7 +12618,7 @@ client.crm.engagements.retrieve(
-
client.crm.engagements.partial_update(...) +
client.crm.accounts.partial_update(...)
@@ -12523,7 +12630,7 @@ client.crm.engagements.retrieve(
-Updates an `Engagement` object with the given `id`. +Updates an `Account` object with the given `id`.
@@ -12539,15 +12646,15 @@ Updates an `Engagement` object with the given `id`. ```python from merge import Merge -from merge.resources.crm import PatchedEngagementRequest +from merge.resources.crm import PatchedAccountRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.engagements.partial_update( +client.crm.accounts.partial_update( id="id", - model=PatchedEngagementRequest(), + model=PatchedAccountRequest(), ) ``` @@ -12572,7 +12679,7 @@ client.crm.engagements.partial_update(
-**model:** `PatchedEngagementRequest` +**model:** `PatchedAccountRequest`
@@ -12608,7 +12715,7 @@ client.crm.engagements.partial_update(
-
client.crm.engagements.meta_patch_retrieve(...) +
client.crm.accounts.meta_patch_retrieve(...)
@@ -12620,7 +12727,7 @@ client.crm.engagements.partial_update(
-Returns metadata for `Engagement` PATCHs. +Returns metadata for `CRMAccount` PATCHs.
@@ -12641,7 +12748,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.engagements.meta_patch_retrieve( +client.crm.accounts.meta_patch_retrieve( id="id", ) @@ -12679,7 +12786,7 @@ client.crm.engagements.meta_patch_retrieve(
-
client.crm.engagements.meta_post_retrieve() +
client.crm.accounts.meta_post_retrieve()
@@ -12691,7 +12798,7 @@ client.crm.engagements.meta_patch_retrieve(
-Returns metadata for `Engagement` POSTs. +Returns metadata for `CRMAccount` POSTs.
@@ -12712,7 +12819,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.engagements.meta_post_retrieve() +client.crm.accounts.meta_post_retrieve() ``` @@ -12740,7 +12847,7 @@ client.crm.engagements.meta_post_retrieve()
-
client.crm.engagements.remote_field_classes_list(...) +
client.crm.accounts.remote_field_classes_list(...)
@@ -12773,7 +12880,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.engagements.remote_field_classes_list( +client.crm.accounts.remote_field_classes_list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -12867,8 +12974,8 @@ client.crm.engagements.remote_field_classes_list(
-## Crm FieldMapping -
client.crm.field_mapping.field_mappings_retrieve(...) +## Crm AsyncPassthrough +
client.crm.async_passthrough.create(...)
@@ -12880,7 +12987,7 @@ client.crm.engagements.remote_field_classes_list(
-Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +Asynchronously pull data from an endpoint not currently supported by Merge.
@@ -12896,12 +13003,18 @@ Get all Field Mappings for this Linked Account. Field Mappings are mappings betw ```python from merge import Merge +from merge.resources.crm import DataPassthroughRequest, MethodEnum client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.field_mapping.field_mappings_retrieve() +client.crm.async_passthrough.create( + request=DataPassthroughRequest( + method=MethodEnum.GET, + path="/scooters", + ), +) ``` @@ -12917,7 +13030,7 @@ client.crm.field_mapping.field_mappings_retrieve()
-**exclude_remote_field_metadata:** `typing.Optional[bool]` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. +**request:** `DataPassthroughRequest`
@@ -12937,7 +13050,7 @@ client.crm.field_mapping.field_mappings_retrieve()
-
client.crm.field_mapping.field_mappings_create(...) +
client.crm.async_passthrough.retrieve(...)
@@ -12949,7 +13062,7 @@ client.crm.field_mapping.field_mappings_retrieve()
-Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +Retrieves data from earlier async-passthrough POST request
@@ -12970,13 +13083,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.field_mapping.field_mappings_create( - target_field_name="example_target_field_name", - target_field_description="this is a example description of the target field", - remote_field_traversal_path=["example_remote_field"], - remote_method="GET", - remote_url_path="/example-url-path", - common_model_name="ExampleCommonModel", +client.crm.async_passthrough.retrieve( + async_passthrough_receipt_id="async_passthrough_receipt_id", ) ``` @@ -12993,7 +13101,7 @@ client.crm.field_mapping.field_mappings_create(
-**target_field_name:** `str` — The name of the target field you want this remote field to map to. +**async_passthrough_receipt_id:** `str`
@@ -13001,15 +13109,71 @@ client.crm.field_mapping.field_mappings_create(
-**target_field_description:** `str` — The description of the target field you want this remote field to map to. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
+ + + + +
+## Crm AuditTrail +
client.crm.audit_trail.list(...)
-**remote_field_traversal_path:** `typing.Sequence[typing.Optional[typing.Any]]` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. +#### 📝 Description + +
+
+ +
+
+ +Gets a list of audit trail events. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.audit_trail.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -13017,7 +13181,7 @@ client.crm.field_mapping.field_mappings_create(
-**remote_method:** `str` — The method of the remote endpoint where the remote field is coming from. +**end_date:** `typing.Optional[str]` — If included, will only include audit trail events that occurred before this time
@@ -13025,7 +13189,7 @@ client.crm.field_mapping.field_mappings_create(
-**remote_url_path:** `str` — The path of the remote endpoint where the remote field is coming from. +**event_type:** `typing.Optional[str]` — If included, will only include events with the given event type. Possible values include: `CREATED_REMOTE_PRODUCTION_API_KEY`, `DELETED_REMOTE_PRODUCTION_API_KEY`, `CREATED_TEST_API_KEY`, `DELETED_TEST_API_KEY`, `REGENERATED_PRODUCTION_API_KEY`, `REGENERATED_WEBHOOK_SIGNATURE`, `INVITED_USER`, `TWO_FACTOR_AUTH_ENABLED`, `TWO_FACTOR_AUTH_DISABLED`, `DELETED_LINKED_ACCOUNT`, `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT`, `CREATED_DESTINATION`, `DELETED_DESTINATION`, `CHANGED_DESTINATION`, `CHANGED_SCOPES`, `CHANGED_PERSONAL_INFORMATION`, `CHANGED_ORGANIZATION_SETTINGS`, `ENABLED_INTEGRATION`, `DISABLED_INTEGRATION`, `ENABLED_CATEGORY`, `DISABLED_CATEGORY`, `CHANGED_PASSWORD`, `RESET_PASSWORD`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `CREATED_INTEGRATION_WIDE_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_FIELD_MAPPING`, `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING`, `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING`, `DELETED_INTEGRATION_WIDE_FIELD_MAPPING`, `DELETED_LINKED_ACCOUNT_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `FORCED_LINKED_ACCOUNT_RESYNC`, `MUTED_ISSUE`, `GENERATED_MAGIC_LINK`, `ENABLED_MERGE_WEBHOOK`, `DISABLED_MERGE_WEBHOOK`, `MERGE_WEBHOOK_TARGET_CHANGED`, `END_USER_CREDENTIALS_ACCESSED`
@@ -13033,7 +13197,7 @@ client.crm.field_mapping.field_mappings_create(
-**common_model_name:** `str` — The name of the Common Model that the remote field corresponds to in a given category. +**page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -13041,7 +13205,15 @@ client.crm.field_mapping.field_mappings_create(
-**exclude_remote_field_metadata:** `typing.Optional[bool]` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. +**start_date:** `typing.Optional[str]` — If included, will only include audit trail events that occurred after this time + +
+
+ +
+
+ +**user_email:** `typing.Optional[str]` — If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email.
@@ -13061,7 +13233,8 @@ client.crm.field_mapping.field_mappings_create(
-
client.crm.field_mapping.field_mappings_destroy(...) +## Crm AvailableActions +
client.crm.available_actions.retrieve()
@@ -13073,7 +13246,7 @@ client.crm.field_mapping.field_mappings_create(
-Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +Returns a list of models and actions available for an account.
@@ -13094,9 +13267,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.field_mapping.field_mappings_destroy( - field_mapping_id="field_mapping_id", -) +client.crm.available_actions.retrieve() ``` @@ -13112,14 +13283,6 @@ client.crm.field_mapping.field_mappings_destroy(
-**field_mapping_id:** `str` - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -13132,7 +13295,8 @@ client.crm.field_mapping.field_mappings_destroy(
-
client.crm.field_mapping.field_mappings_partial_update(...) +## Crm Contacts +
client.crm.contacts.list(...)
@@ -13144,7 +13308,7 @@ client.crm.field_mapping.field_mappings_destroy(
-Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +Returns a list of `Contact` objects.
@@ -13165,8 +13329,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.field_mapping.field_mappings_partial_update( - field_mapping_id="field_mapping_id", +client.crm.contacts.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) ``` @@ -13183,7 +13347,7 @@ client.crm.field_mapping.field_mappings_partial_update(
-**field_mapping_id:** `str` +**account_id:** `typing.Optional[str]` — If provided, will only return contacts with this account.
@@ -13191,7 +13355,7 @@ client.crm.field_mapping.field_mappings_partial_update(
-**remote_field_traversal_path:** `typing.Optional[typing.Sequence[typing.Optional[typing.Any]]]` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
@@ -13199,7 +13363,7 @@ client.crm.field_mapping.field_mappings_partial_update(
-**remote_method:** `typing.Optional[str]` — The method of the remote endpoint where the remote field is coming from. +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime.
@@ -13207,7 +13371,7 @@ client.crm.field_mapping.field_mappings_partial_update(
-**remote_url_path:** `typing.Optional[str]` — The path of the remote endpoint where the remote field is coming from. +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -13215,68 +13379,79 @@ client.crm.field_mapping.field_mappings_partial_update(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**email_addresses:** `typing.Optional[str]` — If provided, will only return contacts matching the email addresses; multiple email_addresses can be separated by commas.
- -
+
+
+**expand:** `typing.Optional[ContactsListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +
-
-
client.crm.field_mapping.remote_fields_retrieve(...)
-#### 📝 Description +**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. + +
+
+
-Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). -
-
+**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + -#### 🔌 Usage -
+**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). + +
+
+
-```python -from merge import Merge - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.crm.field_mapping.remote_fields_retrieve() - -``` +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +
+ +
+
+ +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. +
-#### ⚙️ Parameters -
+**page_size:** `typing.Optional[int]` — Number of results to return per page. + +
+
+
-**common_models:** `typing.Optional[str]` — A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. +**phone_numbers:** `typing.Optional[str]` — If provided, will only return contacts matching the phone numbers; multiple phone numbers can be separated by commas.
@@ -13284,7 +13459,7 @@ client.crm.field_mapping.remote_fields_retrieve()
-**include_example_values:** `typing.Optional[str]` — If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -13304,7 +13479,7 @@ client.crm.field_mapping.remote_fields_retrieve()
-
client.crm.field_mapping.target_fields_retrieve() +
client.crm.contacts.create(...)
@@ -13316,7 +13491,7 @@ client.crm.field_mapping.remote_fields_retrieve()
-Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). +Creates a `Contact` object with the given values.
@@ -13332,12 +13507,15 @@ Get all organization-wide Target Fields, this will not include any Linked Accoun ```python from merge import Merge +from merge.resources.crm import ContactRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.field_mapping.target_fields_retrieve() +client.crm.contacts.create( + model=ContactRequest(), +) ``` @@ -13353,38 +13531,61 @@ client.crm.field_mapping.target_fields_retrieve()
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**model:** `ContactRequest`
- -
+
+
+**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. +
-
-## Crm GenerateKey -
client.crm.generate_key.create(...)
-#### 📝 Description - -
-
+**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. + +
+
-Create a remote key. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +
-#### 🔌 Usage + + + +
+ +
client.crm.contacts.retrieve(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Contact` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage
@@ -13399,8 +13600,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.generate_key.create( - name="Remote Deployment Key 1", +client.crm.contacts.retrieve( + id="id", ) ``` @@ -13417,7 +13618,39 @@ client.crm.generate_key.create(
-**name:** `str` — The name of the remote key +**id:** `str` + +
+
+ +
+
+ +**expand:** `typing.Optional[ContactsRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**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).
@@ -13437,8 +13670,7 @@ client.crm.generate_key.create(
-## Crm Issues -
client.crm.issues.list(...) +
client.crm.contacts.partial_update(...)
@@ -13450,7 +13682,7 @@ client.crm.generate_key.create(
-Gets all issues for Organization. +Updates a `Contact` object with the given `id`.
@@ -13466,13 +13698,15 @@ Gets all issues for Organization. ```python from merge import Merge +from merge.resources.crm import PatchedContactRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.issues.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +client.crm.contacts.partial_update( + id="id", + model=PatchedContactRequest(), ) ``` @@ -13489,7 +13723,7 @@ client.crm.issues.list(
-**account_token:** `typing.Optional[str]` +**id:** `str`
@@ -13497,7 +13731,7 @@ client.crm.issues.list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**model:** `PatchedContactRequest`
@@ -13505,7 +13739,7 @@ client.crm.issues.list(
-**end_date:** `typing.Optional[str]` — If included, will only include issues whose most recent action occurred before this time +**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response.
@@ -13513,7 +13747,7 @@ client.crm.issues.list(
-**end_user_organization_name:** `typing.Optional[str]` +**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously.
@@ -13521,71 +13755,74 @@ client.crm.issues.list(
-**first_incident_time_after:** `typing.Optional[dt.datetime]` — If provided, will only return issues whose first incident time was after this datetime. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**first_incident_time_before:** `typing.Optional[dt.datetime]` — If provided, will only return issues whose first incident time was before this datetime. -
+
+
client.crm.contacts.ignore_create(...)
-**include_muted:** `typing.Optional[str]` — If true, will include muted issues - -
-
+#### 📝 Description
-**integration_name:** `typing.Optional[str]` - -
-
-
-**last_incident_time_after:** `typing.Optional[dt.datetime]` — If provided, will only return issues whose last incident time was after this datetime. - +Ignores a specific row based on the `model_id` in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. +
+
+#### 🔌 Usage +
-**last_incident_time_before:** `typing.Optional[dt.datetime]` — If provided, will only return issues whose last incident time was before this datetime. - -
-
-
-**linked_account_id:** `typing.Optional[str]` — If provided, will only include issues pertaining to the linked account passed in. - +```python +from merge import Merge +from merge.resources.crm import IgnoreCommonModelRequest, ReasonEnum + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.contacts.ignore_create( + model_id="model_id", + request=IgnoreCommonModelRequest( + reason=ReasonEnum.GENERAL_CUSTOMER_REQUEST, + ), +) + +``` +
+
+#### ⚙️ Parameters +
-**page_size:** `typing.Optional[int]` — Number of results to return per page. - -
-
-
-**start_date:** `typing.Optional[str]` — If included, will only include issues whose most recent action occurred after this time +**model_id:** `str`
@@ -13593,12 +13830,7 @@ client.crm.issues.list(
-**status:** `typing.Optional[IssuesListRequestStatus]` - -Status of the issue. Options: ('ONGOING', 'RESOLVED') - -* `ONGOING` - ONGOING -* `RESOLVED` - RESOLVED +**request:** `IgnoreCommonModelRequest`
@@ -13618,7 +13850,7 @@ Status of the issue. Options: ('ONGOING', 'RESOLVED')
-
client.crm.issues.retrieve(...) +
client.crm.contacts.meta_patch_retrieve(...)
@@ -13630,7 +13862,7 @@ Status of the issue. Options: ('ONGOING', 'RESOLVED')
-Get a specific issue. +Returns metadata for `CRMContact` PATCHs.
@@ -13651,7 +13883,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.issues.retrieve( +client.crm.contacts.meta_patch_retrieve( id="id", ) @@ -13689,8 +13921,7 @@ client.crm.issues.retrieve(
-## Crm Leads -
client.crm.leads.list(...) +
client.crm.contacts.meta_post_retrieve()
@@ -13702,7 +13933,7 @@ client.crm.issues.retrieve(
-Returns a list of `Lead` objects. +Returns metadata for `CRMContact` POSTs.
@@ -13723,9 +13954,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.leads.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", -) +client.crm.contacts.meta_post_retrieve() ``` @@ -13741,79 +13970,70 @@ client.crm.leads.list(
-**converted_account_id:** `typing.Optional[str]` — If provided, will only return leads with this account. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
- -
-
- -**converted_contact_id:** `typing.Optional[str]` — If provided, will only return leads with this contact. -
-
-
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. -
+
+
client.crm.contacts.remote_field_classes_list(...)
-**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. - -
-
+#### 📝 Description
-**cursor:** `typing.Optional[str]` — The pagination cursor value. - -
-
-
-**email_addresses:** `typing.Optional[str]` — If provided, will only return contacts matching the email addresses; multiple email_addresses can be separated by commas. - +Returns a list of `RemoteFieldClass` objects. +
+
+#### 🔌 Usage +
-**expand:** `typing.Optional[LeadsListRequestExpand]` — 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/). - +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.contacts.remote_field_classes_list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +) + +``` +
+
+#### ⚙️ Parameters +
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. - -
-
-
-**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -13821,7 +14041,7 @@ client.crm.leads.list(
-**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). +**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/).
@@ -13829,7 +14049,7 @@ client.crm.leads.list(
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -13837,7 +14057,7 @@ client.crm.leads.list(
-**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. +**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format.
@@ -13845,7 +14065,7 @@ client.crm.leads.list(
-**owner_id:** `typing.Optional[str]` — If provided, will only return leads with this owner. +**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).
@@ -13853,7 +14073,7 @@ client.crm.leads.list(
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +**is_common_model_field:** `typing.Optional[bool]` — If provided, will only return remote field classes with this is_common_model_field value
@@ -13861,7 +14081,7 @@ client.crm.leads.list(
-**phone_numbers:** `typing.Optional[str]` — If provided, will only return contacts matching the phone numbers; multiple phone numbers can be separated by commas. +**is_custom:** `typing.Optional[bool]` — If provided, will only return remote fields classes with this is_custom value
@@ -13869,7 +14089,7 @@ client.crm.leads.list(
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. +**page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -13889,7 +14109,8 @@ client.crm.leads.list(
-
client.crm.leads.create(...) +## Crm CustomObjectClasses +
client.crm.custom_object_classes.list(...)
@@ -13901,7 +14122,7 @@ client.crm.leads.list(
-Creates a `Lead` object with the given values. +Returns a list of `CustomObjectClass` objects.
@@ -13917,14 +14138,13 @@ Creates a `Lead` object with the given values. ```python from merge import Merge -from merge.resources.crm import LeadRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.leads.create( - model=LeadRequest(), +client.crm.custom_object_classes.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) ``` @@ -13941,7 +14161,7 @@ client.crm.leads.create(
-**model:** `LeadRequest` +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
@@ -13949,7 +14169,7 @@ client.crm.leads.create(
-**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime.
@@ -13957,7 +14177,7 @@ client.crm.leads.create(
-**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -13965,70 +14185,31 @@ client.crm.leads.create(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**expand:** `typing.Optional[typing.Literal["fields"]]` — 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/). +
-
- -
client.crm.leads.retrieve(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns a `Lead` object with the given `id`. -
-
-
-
- -#### 🔌 Usage - -
-
-```python -from merge import Merge - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.crm.leads.retrieve( - id="id", -) - -``` -
-
+**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +
-#### ⚙️ Parameters -
-
-
- -**id:** `str` +**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).
@@ -14036,7 +14217,7 @@ client.crm.leads.retrieve(
-**expand:** `typing.Optional[LeadsRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned.
@@ -14044,7 +14225,7 @@ client.crm.leads.retrieve(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned.
@@ -14052,7 +14233,7 @@ client.crm.leads.retrieve(
-**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. +**page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -14060,7 +14241,7 @@ client.crm.leads.retrieve(
-**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). +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -14080,7 +14261,7 @@ client.crm.leads.retrieve(
-
client.crm.leads.meta_post_retrieve() +
client.crm.custom_object_classes.retrieve(...)
@@ -14092,7 +14273,7 @@ client.crm.leads.retrieve(
-Returns metadata for `Lead` POSTs. +Returns a `CustomObjectClass` object with the given `id`.
@@ -14113,7 +14294,9 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.leads.meta_post_retrieve() +client.crm.custom_object_classes.retrieve( + id="id", +) ``` @@ -14129,6 +14312,38 @@ client.crm.leads.meta_post_retrieve()
+**id:** `str` + +
+
+ +
+
+ +**expand:** `typing.Optional[typing.Literal["fields"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**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). + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -14141,7 +14356,8 @@ client.crm.leads.meta_post_retrieve()
-
client.crm.leads.remote_field_classes_list(...) +## Crm AssociationTypes +
client.crm.association_types.custom_object_classes_association_types_list(...)
@@ -14153,7 +14369,7 @@ client.crm.leads.meta_post_retrieve()
-Returns a list of `RemoteFieldClass` objects. +Returns a list of `AssociationType` objects.
@@ -14174,7 +14390,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.leads.remote_field_classes_list( +client.crm.association_types.custom_object_classes_association_types_list( + custom_object_class_id="custom_object_class_id", cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -14192,6 +14409,30 @@ client.crm.leads.remote_field_classes_list(
+**custom_object_class_id:** `str` + +
+
+ +
+
+ +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ **cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -14200,7 +14441,7 @@ client.crm.leads.remote_field_classes_list(
-**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/). +**expand:** `typing.Optional[typing.Literal["target_object_classes"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -14208,7 +14449,7 @@ client.crm.leads.remote_field_classes_list(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**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/).
@@ -14216,7 +14457,7 @@ client.crm.leads.remote_field_classes_list(
-**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -14232,7 +14473,7 @@ client.crm.leads.remote_field_classes_list(
-**is_common_model_field:** `typing.Optional[bool]` — If provided, will only return remote field classes with this is_common_model_field value +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned.
@@ -14240,7 +14481,7 @@ client.crm.leads.remote_field_classes_list(
-**is_custom:** `typing.Optional[bool]` — If provided, will only return remote fields classes with this is_custom value +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned.
@@ -14256,6 +14497,14 @@ client.crm.leads.remote_field_classes_list(
+**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -14268,8 +14517,7 @@ client.crm.leads.remote_field_classes_list(
-## Crm LinkToken -
client.crm.link_token.create(...) +
client.crm.association_types.custom_object_classes_association_types_create(...)
@@ -14281,7 +14529,7 @@ client.crm.leads.remote_field_classes_list(
-Creates a link token to be used when linking a new end user. +Creates an `AssociationType` object with the given values.
@@ -14297,17 +14545,31 @@ Creates a link token to be used when linking a new end user. ```python from merge import Merge -from merge.resources.crm import CategoriesEnum +from merge.resources.crm import ( + AssociationTypeRequestRequest, + ObjectClassDescriptionRequest, + OriginTypeEnum, +) client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.link_token.create( - end_user_email_address="example@gmail.com", - end_user_organization_name="Test Organization", - end_user_origin_id="12345", - categories=[CategoriesEnum.HRIS, CategoriesEnum.ATS], +client.crm.association_types.custom_object_classes_association_types_create( + custom_object_class_id="custom_object_class_id", + model=AssociationTypeRequestRequest( + source_object_class=ObjectClassDescriptionRequest( + id="id", + origin_type=OriginTypeEnum.CUSTOM_OBJECT, + ), + target_object_classes=[ + ObjectClassDescriptionRequest( + id="id", + origin_type=OriginTypeEnum.CUSTOM_OBJECT, + ) + ], + remote_key_name="remote_key_name", + ), ) ``` @@ -14324,7 +14586,7 @@ client.crm.link_token.create(
-**end_user_email_address:** `str` — Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent. +**custom_object_class_id:** `str`
@@ -14332,7 +14594,7 @@ client.crm.link_token.create(
-**end_user_organization_name:** `str` — Your end user's organization. +**model:** `AssociationTypeRequestRequest`
@@ -14340,7 +14602,7 @@ client.crm.link_token.create(
-**end_user_origin_id:** `str` — This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers. +**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response.
@@ -14348,7 +14610,7 @@ client.crm.link_token.create(
-**categories:** `typing.Sequence[CategoriesEnum]` — The integration categories to show in Merge Link. +**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously.
@@ -14356,67 +14618,71 @@ client.crm.link_token.create(
-**integration:** `typing.Optional[str]` — The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**link_expiry_mins:** `typing.Optional[int]` — An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30. -
+
+
client.crm.association_types.custom_object_classes_association_types_retrieve(...)
-**should_create_magic_link_url:** `typing.Optional[bool]` — Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. - -
-
+#### 📝 Description
-**hide_admin_magic_link:** `typing.Optional[bool]` — Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. - -
-
-
-**common_models:** `typing.Optional[typing.Sequence[CommonModelScopesBodyRequest]]` — An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. - +Returns an `AssociationType` object with the given `id`. +
+
+#### 🔌 Usage +
-**category_common_model_scopes:** `typing.Optional[ - typing.Dict[ - str, - typing.Optional[ - typing.Sequence[IndividualCommonModelScopeDeserializerRequest] - ], - ] -]` — When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. - +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.association_types.custom_object_classes_association_types_retrieve( + custom_object_class_id="custom_object_class_id", + id="id", +) + +``` +
+
+#### ⚙️ Parameters +
-**language:** `typing.Optional[EndUserDetailsRequestLanguage]` - -The following subset of IETF language tags can be used to configure localization. +
+
-* `en` - en -* `de` - de +**custom_object_class_id:** `str`
@@ -14424,7 +14690,7 @@ The following subset of IETF language tags can be used to configure localization
-**are_syncs_disabled:** `typing.Optional[bool]` — The boolean that indicates whether initial, periodic, and force syncs will be disabled. +**id:** `str`
@@ -14432,7 +14698,7 @@ The following subset of IETF language tags can be used to configure localization
-**integration_specific_config:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — A JSON object containing integration-specific configuration options. +**expand:** `typing.Optional[typing.Literal["target_object_classes"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -14440,177 +14706,86 @@ The following subset of IETF language tags can be used to configure localization
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
-
-
- - - - -
- -## Crm LinkedAccounts -
client.crm.linked_accounts.list(...) -
-
- -#### 📝 Description - -
-
-List linked accounts for your organization. -
-
+**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). +
-#### 🔌 Usage -
-
-
- -```python -from merge import Merge - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.crm.linked_accounts.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", -) - -``` +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +
-#### ⚙️ Parameters - -
-
- -
-
- -**category:** `typing.Optional[LinkedAccountsListRequestCategory]` - -Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing` -* `hris` - hris -* `ats` - ats -* `accounting` - accounting -* `ticketing` - ticketing -* `crm` - crm -* `mktg` - mktg -* `filestorage` - filestorage -
+
+
client.crm.association_types.custom_object_classes_association_types_meta_post_retrieve(...)
-**cursor:** `typing.Optional[str]` — The pagination cursor value. - -
-
+#### 📝 Description
-**end_user_email_address:** `typing.Optional[str]` — If provided, will only return linked accounts associated with the given email address. - -
-
-
-**end_user_organization_name:** `typing.Optional[str]` — If provided, will only return linked accounts associated with the given organization name. - +Returns metadata for `CRMAssociationType` POSTs.
- -
-
- -**end_user_origin_id:** `typing.Optional[str]` — If provided, will only return linked accounts associated with the given origin ID. -
-
-
- -**end_user_origin_ids:** `typing.Optional[str]` — Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. - -
-
+#### 🔌 Usage
-**id:** `typing.Optional[str]` - -
-
-
-**ids:** `typing.Optional[str]` — Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. - -
-
+```python +from merge import Merge -
-
+client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.association_types.custom_object_classes_association_types_meta_post_retrieve( + custom_object_class_id="custom_object_class_id", +) -**include_duplicates:** `typing.Optional[bool]` — If `true`, will include complete production duplicates of the account specified by the `id` query parameter in the response. `id` must be for a complete production linked account. - +```
- -
-
- -**integration_name:** `typing.Optional[str]` — If provided, will only return linked accounts associated with the given integration name. -
-
-
- -**is_test_account:** `typing.Optional[str]` — If included, will only include test linked accounts. If not included, will only include non-test linked accounts. - -
-
+#### ⚙️ Parameters
-**page_size:** `typing.Optional[int]` — Number of results to return per page. - -
-
-
-**status:** `typing.Optional[str]` — Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, `RELINK_NEEDED` +**custom_object_class_id:** `str`
@@ -14630,8 +14805,8 @@ Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing`
-## Crm Notes -
client.crm.notes.list(...) +## Crm CustomObjects +
client.crm.custom_objects.custom_object_classes_custom_objects_list(...)
@@ -14643,7 +14818,7 @@ Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing`
-Returns a list of `Note` objects. +Returns a list of `CustomObject` objects.
@@ -14664,7 +14839,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.notes.list( +client.crm.custom_objects.custom_object_classes_custom_objects_list( + custom_object_class_id="custom_object_class_id", cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -14682,15 +14858,7 @@ client.crm.notes.list(
-**account_id:** `typing.Optional[str]` — If provided, will only return notes with this account. - -
-
- -
-
- -**contact_id:** `typing.Optional[str]` — If provided, will only return notes with this contact. +**custom_object_class_id:** `str`
@@ -14722,14 +14890,6 @@ client.crm.notes.list(
-**expand:** `typing.Optional[NotesListRequestExpand]` — 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/).
@@ -14778,22 +14938,6 @@ client.crm.notes.list(
-**opportunity_id:** `typing.Optional[str]` — If provided, will only return notes with this opportunity. - -
-
- -
-
- -**owner_id:** `typing.Optional[str]` — If provided, will only return notes with this owner. - -
-
- -
-
- **page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -14822,7 +14966,7 @@ client.crm.notes.list(
-
client.crm.notes.create(...) +
client.crm.custom_objects.custom_object_classes_custom_objects_create(...)
@@ -14834,7 +14978,7 @@ client.crm.notes.list(
-Creates a `Note` object with the given values. +Creates a `CustomObject` object with the given values.
@@ -14850,14 +14994,17 @@ Creates a `Note` object with the given values. ```python from merge import Merge -from merge.resources.crm import NoteRequest +from merge.resources.crm import CustomObjectRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.notes.create( - model=NoteRequest(), +client.crm.custom_objects.custom_object_classes_custom_objects_create( + custom_object_class_id="custom_object_class_id", + model=CustomObjectRequest( + fields={"test_field": "hello"}, + ), ) ``` @@ -14874,7 +15021,15 @@ client.crm.notes.create(
-**model:** `NoteRequest` +**custom_object_class_id:** `str` + +
+
+ +
+
+ +**model:** `CustomObjectRequest`
@@ -14910,7 +15065,7 @@ client.crm.notes.create(
-
client.crm.notes.retrieve(...) +
client.crm.custom_objects.custom_object_classes_custom_objects_retrieve(...)
@@ -14922,7 +15077,7 @@ client.crm.notes.create(
-Returns a `Note` object with the given `id`. +Returns a `CustomObject` object with the given `id`.
@@ -14943,7 +15098,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.notes.retrieve( +client.crm.custom_objects.custom_object_classes_custom_objects_retrieve( + custom_object_class_id="custom_object_class_id", id="id", ) @@ -14961,7 +15117,7 @@ client.crm.notes.retrieve(
-**id:** `str` +**custom_object_class_id:** `str`
@@ -14969,7 +15125,7 @@ client.crm.notes.retrieve(
-**expand:** `typing.Optional[NotesRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**id:** `str`
@@ -15013,7 +15169,7 @@ client.crm.notes.retrieve(
-
client.crm.notes.meta_post_retrieve() +
client.crm.custom_objects.custom_object_classes_custom_objects_meta_post_retrieve(...)
@@ -15025,7 +15181,7 @@ client.crm.notes.retrieve(
-Returns metadata for `Note` POSTs. +Returns metadata for `CRMCustomObject` POSTs.
@@ -15046,7 +15202,9 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.notes.meta_post_retrieve() +client.crm.custom_objects.custom_object_classes_custom_objects_meta_post_retrieve( + custom_object_class_id="custom_object_class_id", +) ``` @@ -15062,6 +15220,14 @@ client.crm.notes.meta_post_retrieve()
+**custom_object_class_id:** `str` + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -15074,7 +15240,7 @@ client.crm.notes.meta_post_retrieve()
-
client.crm.notes.remote_field_classes_list(...) +
client.crm.custom_objects.custom_object_classes_custom_objects_remote_field_classes_list(...)
@@ -15107,7 +15273,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.notes.remote_field_classes_list( +client.crm.custom_objects.custom_object_classes_custom_objects_remote_field_classes_list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -15201,8 +15367,8 @@ client.crm.notes.remote_field_classes_list(
-## Crm Opportunities -
client.crm.opportunities.list(...) +## Crm Associations +
client.crm.associations.custom_object_classes_custom_objects_associations_list(...)
@@ -15214,7 +15380,7 @@ client.crm.notes.remote_field_classes_list(
-Returns a list of `Opportunity` objects. +Returns a list of `Association` objects.
@@ -15235,7 +15401,9 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.opportunities.list( +client.crm.associations.custom_object_classes_custom_objects_associations_list( + custom_object_class_id="custom_object_class_id", + object_id="object_id", cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -15253,7 +15421,7 @@ client.crm.opportunities.list(
-**account_id:** `typing.Optional[str]` — If provided, will only return opportunities with this account. +**custom_object_class_id:** `str`
@@ -15261,7 +15429,7 @@ client.crm.opportunities.list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. +**object_id:** `str`
@@ -15269,7 +15437,7 @@ client.crm.opportunities.list(
-**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +**association_type_id:** `typing.Optional[str]` — If provided, will only return opportunities with this association_type.
@@ -15277,7 +15445,7 @@ client.crm.opportunities.list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
@@ -15285,7 +15453,7 @@ client.crm.opportunities.list(
-**expand:** `typing.Optional[OpportunitiesListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime.
@@ -15293,7 +15461,7 @@ client.crm.opportunities.list(
-**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/). +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -15301,7 +15469,7 @@ client.crm.opportunities.list(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**expand:** `typing.Optional[typing.Literal["association_type"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -15309,7 +15477,7 @@ client.crm.opportunities.list(
-**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. +**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/).
@@ -15317,7 +15485,7 @@ client.crm.opportunities.list(
-**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). +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -15325,7 +15493,7 @@ client.crm.opportunities.list(
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +**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).
@@ -15333,7 +15501,7 @@ client.crm.opportunities.list(
-**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned.
@@ -15341,7 +15509,7 @@ client.crm.opportunities.list(
-**owner_id:** `typing.Optional[str]` — If provided, will only return opportunities with this owner. +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned.
@@ -15357,22 +15525,6 @@ client.crm.opportunities.list(
-**remote_created_after:** `typing.Optional[dt.datetime]` — If provided, will only return opportunities created in the third party platform after this datetime. - -
-
- -
-
- -**remote_fields:** `typing.Optional[typing.Literal["status"]]` — Deprecated. Use show_enum_origins. - -
-
- -
-
- **remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -15381,36 +15533,6 @@ client.crm.opportunities.list(
-**show_enum_origins:** `typing.Optional[typing.Literal["status"]]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) - -
-
- -
-
- -**stage_id:** `typing.Optional[str]` — If provided, will only return opportunities with this stage. - -
-
- -
-
- -**status:** `typing.Optional[OpportunitiesListRequestStatus]` - -If provided, will only return opportunities with this status. Options: ('OPEN', 'WON', 'LOST') - -* `OPEN` - OPEN -* `WON` - WON -* `LOST` - LOST - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -15423,7 +15545,7 @@ If provided, will only return opportunities with this status. Options: ('OPEN',
-
client.crm.opportunities.create(...) +
client.crm.associations.custom_object_classes_custom_objects_associations_update(...)
@@ -15435,7 +15557,7 @@ If provided, will only return opportunities with this status. Options: ('OPEN',
-Creates an `Opportunity` object with the given values. +Creates an Association between `source_object_id` and `target_object_id` of type `association_type_id`.
@@ -15451,14 +15573,17 @@ Creates an `Opportunity` object with the given values. ```python from merge import Merge -from merge.resources.crm import OpportunityRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.opportunities.create( - model=OpportunityRequest(), +client.crm.associations.custom_object_classes_custom_objects_associations_update( + association_type_id="association_type_id", + source_class_id="source_class_id", + source_object_id="source_object_id", + target_class_id="target_class_id", + target_object_id="target_object_id", ) ``` @@ -15475,7 +15600,39 @@ client.crm.opportunities.create(
-**model:** `OpportunityRequest` +**association_type_id:** `str` + +
+
+ +
+
+ +**source_class_id:** `str` + +
+
+ +
+
+ +**source_object_id:** `str` + +
+
+ +
+
+ +**target_class_id:** `str` + +
+
+ +
+
+ +**target_object_id:** `str`
@@ -15511,7 +15668,8 @@ client.crm.opportunities.create(
-
client.crm.opportunities.retrieve(...) +## Crm Scopes +
client.crm.scopes.default_scopes_retrieve()
@@ -15523,7 +15681,7 @@ client.crm.opportunities.create(
-Returns an `Opportunity` object with the given `id`. +Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes).
@@ -15544,9 +15702,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.opportunities.retrieve( - id="id", -) +client.crm.scopes.default_scopes_retrieve() ``` @@ -15562,59 +15718,64 @@ client.crm.opportunities.retrieve(
-**id:** `str` +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**expand:** `typing.Optional[OpportunitiesRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. -
+
+
client.crm.scopes.linked_account_scopes_retrieve()
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. - -
-
+#### 📝 Description
-**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. - -
-
-
-**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). - +Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). +
+
+#### 🔌 Usage +
-**remote_fields:** `typing.Optional[typing.Literal["status"]]` — Deprecated. Use show_enum_origins. - -
-
-
-**show_enum_origins:** `typing.Optional[typing.Literal["status"]]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) - +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.scopes.linked_account_scopes_retrieve() + +``` +
+
+#### ⚙️ Parameters + +
+
+
@@ -15630,7 +15791,7 @@ client.crm.opportunities.retrieve(
-
client.crm.opportunities.partial_update(...) +
client.crm.scopes.linked_account_scopes_create(...)
@@ -15642,7 +15803,7 @@ client.crm.opportunities.retrieve(
-Updates an `Opportunity` object with the given `id`. +Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes)
@@ -15658,15 +15819,42 @@ Updates an `Opportunity` object with the given `id`. ```python from merge import Merge -from merge.resources.crm import PatchedOpportunityRequest +from merge.resources.crm import ( + FieldPermissionDeserializerRequest, + IndividualCommonModelScopeDeserializerRequest, + ModelPermissionDeserializerRequest, +) client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.opportunities.partial_update( - id="id", - model=PatchedOpportunityRequest(), +client.crm.scopes.linked_account_scopes_create( + common_models=[ + IndividualCommonModelScopeDeserializerRequest( + model_name="Employee", + model_permissions={ + "READ": ModelPermissionDeserializerRequest( + is_enabled=True, + ), + "WRITE": ModelPermissionDeserializerRequest( + is_enabled=False, + ), + }, + field_permissions=FieldPermissionDeserializerRequest( + enabled_fields=["avatar", "home_location"], + disabled_fields=["work_location"], + ), + ), + IndividualCommonModelScopeDeserializerRequest( + model_name="Benefit", + model_permissions={ + "WRITE": ModelPermissionDeserializerRequest( + is_enabled=False, + ) + }, + ), + ], ) ``` @@ -15683,31 +15871,7 @@ client.crm.opportunities.partial_update(
-**id:** `str` - -
-
- -
-
- -**model:** `PatchedOpportunityRequest` - -
-
- -
-
- -**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. - -
-
- -
-
- -**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. +**common_models:** `typing.Sequence[IndividualCommonModelScopeDeserializerRequest]` — The common models you want to update the scopes for
@@ -15727,7 +15891,8 @@ client.crm.opportunities.partial_update(
-
client.crm.opportunities.meta_patch_retrieve(...) +## Crm DeleteAccount +
client.crm.delete_account.delete()
@@ -15739,7 +15904,7 @@ client.crm.opportunities.partial_update(
-Returns metadata for `Opportunity` PATCHs. +Delete a linked account.
@@ -15760,9 +15925,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.opportunities.meta_patch_retrieve( - id="id", -) +client.crm.delete_account.delete() ``` @@ -15778,14 +15941,6 @@ client.crm.opportunities.meta_patch_retrieve(
-**id:** `str` - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -15798,7 +15953,8 @@ client.crm.opportunities.meta_patch_retrieve(
-
client.crm.opportunities.meta_post_retrieve() +## Crm EngagementTypes +
client.crm.engagement_types.list(...)
@@ -15810,7 +15966,7 @@ client.crm.opportunities.meta_patch_retrieve(
-Returns metadata for `Opportunity` POSTs. +Returns a list of `EngagementType` objects.
@@ -15831,7 +15987,9 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.opportunities.meta_post_retrieve() +client.crm.engagement_types.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +) ``` @@ -15847,66 +16005,19 @@ client.crm.opportunities.meta_post_retrieve()
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
- -
- - - - -
- -
client.crm.opportunities.remote_field_classes_list(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns a list of `RemoteFieldClass` objects. -
-
-
-
- -#### 🔌 Usage - -
-
-```python -from merge import Merge - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.crm.opportunities.remote_field_classes_list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", -) - -``` -
-
+**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +
-#### ⚙️ Parameters - -
-
-
@@ -15950,7 +16061,7 @@ client.crm.opportunities.remote_field_classes_list(
-**is_common_model_field:** `typing.Optional[bool]` — If provided, will only return remote field classes with this is_common_model_field value +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned.
@@ -15958,7 +16069,7 @@ client.crm.opportunities.remote_field_classes_list(
-**is_custom:** `typing.Optional[bool]` — If provided, will only return remote fields classes with this is_custom value +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned.
@@ -15974,6 +16085,14 @@ client.crm.opportunities.remote_field_classes_list(
+**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -15986,8 +16105,7 @@ client.crm.opportunities.remote_field_classes_list(
-## Crm Passthrough -
client.crm.passthrough.create(...) +
client.crm.engagement_types.retrieve(...)
@@ -15999,7 +16117,7 @@ client.crm.opportunities.remote_field_classes_list(
-Pull data from an endpoint not currently supported by Merge. +Returns an `EngagementType` object with the given `id`.
@@ -16015,17 +16133,13 @@ Pull data from an endpoint not currently supported by Merge. ```python from merge import Merge -from merge.resources.crm import DataPassthroughRequest, MethodEnum client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.passthrough.create( - request=DataPassthroughRequest( - method=MethodEnum.GET, - path="/scooters", - ), +client.crm.engagement_types.retrieve( + id="id", ) ``` @@ -16042,7 +16156,31 @@ client.crm.passthrough.create(
-**request:** `DataPassthroughRequest` +**id:** `str` + +
+
+ +
+
+ +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**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).
@@ -16062,8 +16200,7 @@ client.crm.passthrough.create(
-## Crm RegenerateKey -
client.crm.regenerate_key.create(...) +
client.crm.engagement_types.remote_field_classes_list(...)
@@ -16075,7 +16212,7 @@ client.crm.passthrough.create(
-Exchange remote keys. +Returns a list of `RemoteFieldClass` objects.
@@ -16096,8 +16233,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.regenerate_key.create( - name="Remote Deployment Key 1", +client.crm.engagement_types.remote_field_classes_list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) ``` @@ -16114,7 +16251,63 @@ client.crm.regenerate_key.create(
-**name:** `str` — The name of the remote key +**cursor:** `typing.Optional[str]` — The pagination cursor value. + +
+
+ +
+
+ +**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_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**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). + +
+
+ +
+
+ +**is_common_model_field:** `typing.Optional[bool]` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**is_custom:** `typing.Optional[bool]` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -16134,8 +16327,8 @@ client.crm.regenerate_key.create(
-## Crm Stages -
client.crm.stages.list(...) +## Crm Engagements +
client.crm.engagements.list(...)
@@ -16147,7 +16340,7 @@ client.crm.regenerate_key.create(
-Returns a list of `Stage` objects. +Returns a list of `Engagement` objects.
@@ -16168,7 +16361,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.stages.list( +client.crm.engagements.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -16210,6 +16403,14 @@ client.crm.stages.list(
+**expand:** `typing.Optional[EngagementsListRequestExpand]` — 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/).
@@ -16274,6 +16475,22 @@ client.crm.stages.list(
+**started_after:** `typing.Optional[dt.datetime]` — If provided, will only return engagements started after this datetime. + +
+
+ +
+
+ +**started_before:** `typing.Optional[dt.datetime]` — If provided, will only return engagements started before this datetime. + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -16286,7 +16503,7 @@ client.crm.stages.list(
-
client.crm.stages.retrieve(...) +
client.crm.engagements.create(...)
@@ -16298,7 +16515,7 @@ client.crm.stages.list(
-Returns a `Stage` object with the given `id`. +Creates an `Engagement` object with the given values.
@@ -16314,13 +16531,14 @@ Returns a `Stage` object with the given `id`. ```python from merge import Merge +from merge.resources.crm import EngagementRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.stages.retrieve( - id="id", +client.crm.engagements.create( + model=EngagementRequest(), ) ``` @@ -16337,15 +16555,7 @@ client.crm.stages.retrieve(
-**id:** `str` - -
-
- -
-
- -**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**model:** `EngagementRequest`
@@ -16353,7 +16563,7 @@ client.crm.stages.retrieve(
-**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. +**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response.
@@ -16361,7 +16571,7 @@ client.crm.stages.retrieve(
-**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). +**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously.
@@ -16381,7 +16591,7 @@ client.crm.stages.retrieve(
-
client.crm.stages.remote_field_classes_list(...) +
client.crm.engagements.retrieve(...)
@@ -16393,7 +16603,7 @@ client.crm.stages.retrieve(
-Returns a list of `RemoteFieldClass` objects. +Returns an `Engagement` object with the given `id`.
@@ -16414,8 +16624,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.stages.remote_field_classes_list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +client.crm.engagements.retrieve( + id="id", ) ``` @@ -16432,7 +16642,7 @@ client.crm.stages.remote_field_classes_list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**id:** `str`
@@ -16440,7 +16650,7 @@ client.crm.stages.remote_field_classes_list(
-**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/). +**expand:** `typing.Optional[EngagementsRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -16472,62 +16682,37 @@ client.crm.stages.remote_field_classes_list(
-**is_common_model_field:** `typing.Optional[bool]` — If provided, will only return remote field classes with this is_common_model_field value +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**is_custom:** `typing.Optional[bool]` — If provided, will only return remote fields classes with this is_custom value -
+
+
client.crm.engagements.partial_update(...)
-**page_size:** `typing.Optional[int]` — Number of results to return per page. - -
-
+#### 📝 Description
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - +
+
+ +Updates an `Engagement` object with the given `id`.
- - - -
- -## Crm SyncStatus -
client.crm.sync_status.list(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get sync status for the current sync and the most recently finished sync. `last_sync_start` represents the most recent time any sync began. `last_sync_finished` represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the `last_sync_finished` timestamp where `last_sync_result` is `DONE`. Possible values for `status` and `last_sync_result` are `DISABLED`, `DONE`, `FAILED`, `PARTIALLY_SYNCED`, `PAUSED`, `SYNCING`. Learn more about sync status in our [Help Center](https://help.merge.dev/en/articles/8184193-merge-sync-statuses). -
-
-
-
- -#### 🔌 Usage +#### 🔌 Usage
@@ -16537,13 +16722,15 @@ Get sync status for the current sync and the most recently finished sync. `last_ ```python from merge import Merge +from merge.resources.crm import PatchedEngagementRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.sync_status.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +client.crm.engagements.partial_update( + id="id", + model=PatchedEngagementRequest(), ) ``` @@ -16560,7 +16747,7 @@ client.crm.sync_status.list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**id:** `str`
@@ -16568,7 +16755,23 @@ client.crm.sync_status.list(
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +**model:** `PatchedEngagementRequest` + +
+
+ +
+
+ +**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously.
@@ -16588,8 +16791,7 @@ client.crm.sync_status.list(
-## Crm ForceResync -
client.crm.force_resync.sync_status_resync_create() +
client.crm.engagements.meta_patch_retrieve(...)
@@ -16601,7 +16803,7 @@ client.crm.sync_status.list(
-Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. +Returns metadata for `Engagement` PATCHs.
@@ -16622,7 +16824,9 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.force_resync.sync_status_resync_create() +client.crm.engagements.meta_patch_retrieve( + id="id", +) ``` @@ -16638,6 +16842,14 @@ client.crm.force_resync.sync_status_resync_create()
+**id:** `str` + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -16650,8 +16862,7 @@ client.crm.force_resync.sync_status_resync_create()
-## Crm Tasks -
client.crm.tasks.list(...) +
client.crm.engagements.meta_post_retrieve()
@@ -16663,7 +16874,7 @@ client.crm.force_resync.sync_status_resync_create()
-Returns a list of `Task` objects. +Returns metadata for `Engagement` POSTs.
@@ -16684,9 +16895,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.tasks.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", -) +client.crm.engagements.meta_post_retrieve() ``` @@ -16702,31 +16911,70 @@ client.crm.tasks.list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
+ + + + +
+
client.crm.engagements.remote_field_classes_list(...)
-**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. - +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+#### 🔌 Usage +
-**cursor:** `typing.Optional[str]` — The pagination cursor value. - +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.engagements.remote_field_classes_list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +) + +``` +
+
+#### ⚙️ Parameters +
-**expand:** `typing.Optional[TasksListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +
+
+ +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -16766,7 +17014,7 @@ client.crm.tasks.list(
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +**is_common_model_field:** `typing.Optional[bool]` — If provided, will only return remote field classes with this is_common_model_field value
@@ -16774,7 +17022,7 @@ client.crm.tasks.list(
-**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. +**is_custom:** `typing.Optional[bool]` — If provided, will only return remote fields classes with this is_custom value
@@ -16790,14 +17038,6 @@ client.crm.tasks.list(
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -16810,7 +17050,8 @@ client.crm.tasks.list(
-
client.crm.tasks.create(...) +## Crm FieldMapping +
client.crm.field_mapping.field_mappings_retrieve(...)
@@ -16822,7 +17063,7 @@ client.crm.tasks.list(
-Creates a `Task` object with the given values. +Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/).
@@ -16838,15 +17079,12 @@ Creates a `Task` object with the given values. ```python from merge import Merge -from merge.resources.crm import TaskRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.tasks.create( - model=TaskRequest(), -) +client.crm.field_mapping.field_mappings_retrieve() ``` @@ -16862,23 +17100,7 @@ client.crm.tasks.create(
-**model:** `TaskRequest` - -
-
- -
-
- -**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. - -
-
- -
-
- -**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. +**exclude_remote_field_metadata:** `typing.Optional[bool]` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations.
@@ -16898,7 +17120,7 @@ client.crm.tasks.create(
-
client.crm.tasks.retrieve(...) +
client.crm.field_mapping.field_mappings_create(...)
@@ -16910,7 +17132,7 @@ client.crm.tasks.create(
-Returns a `Task` object with the given `id`. +Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start.
@@ -16931,8 +17153,13 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.tasks.retrieve( - id="id", +client.crm.field_mapping.field_mappings_create( + target_field_name="example_target_field_name", + target_field_description="this is a example description of the target field", + remote_field_traversal_path=["example_remote_field"], + remote_method="GET", + remote_url_path="/example-url-path", + common_model_name="ExampleCommonModel", ) ``` @@ -16949,7 +17176,7 @@ client.crm.tasks.retrieve(
-**id:** `str` +**target_field_name:** `str` — The name of the target field you want this remote field to map to.
@@ -16957,7 +17184,7 @@ client.crm.tasks.retrieve(
-**expand:** `typing.Optional[TasksRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**target_field_description:** `str` — The description of the target field you want this remote field to map to.
@@ -16965,7 +17192,7 @@ client.crm.tasks.retrieve(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**remote_field_traversal_path:** `typing.Sequence[typing.Optional[typing.Any]]` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.
@@ -16973,7 +17200,7 @@ client.crm.tasks.retrieve(
-**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. +**remote_method:** `str` — The method of the remote endpoint where the remote field is coming from.
@@ -16981,7 +17208,23 @@ client.crm.tasks.retrieve(
-**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). +**remote_url_path:** `str` — The path of the remote endpoint where the remote field is coming from. + +
+
+ +
+
+ +**common_model_name:** `str` — The name of the Common Model that the remote field corresponds to in a given category. + +
+
+ +
+
+ +**exclude_remote_field_metadata:** `typing.Optional[bool]` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations.
@@ -17001,7 +17244,7 @@ client.crm.tasks.retrieve(
-
client.crm.tasks.partial_update(...) +
client.crm.field_mapping.field_mappings_destroy(...)
@@ -17013,7 +17256,7 @@ client.crm.tasks.retrieve(
-Updates a `Task` object with the given `id`. +Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start.
@@ -17029,15 +17272,13 @@ Updates a `Task` object with the given `id`. ```python from merge import Merge -from merge.resources.crm import PatchedTaskRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.tasks.partial_update( - id="id", - model=PatchedTaskRequest(), +client.crm.field_mapping.field_mappings_destroy( + field_mapping_id="field_mapping_id", ) ``` @@ -17054,31 +17295,7 @@ client.crm.tasks.partial_update(
-**id:** `str` - -
-
- -
-
- -**model:** `PatchedTaskRequest` - -
-
- -
-
- -**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. - -
-
- -
-
- -**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. +**field_mapping_id:** `str`
@@ -17098,7 +17315,7 @@ client.crm.tasks.partial_update(
-
client.crm.tasks.meta_patch_retrieve(...) +
client.crm.field_mapping.field_mappings_partial_update(...)
@@ -17110,7 +17327,7 @@ client.crm.tasks.partial_update(
-Returns metadata for `Task` PATCHs. +Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start.
@@ -17131,8 +17348,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.tasks.meta_patch_retrieve( - id="id", +client.crm.field_mapping.field_mappings_partial_update( + field_mapping_id="field_mapping_id", ) ``` @@ -17149,7 +17366,7 @@ client.crm.tasks.meta_patch_retrieve(
-**id:** `str` +**field_mapping_id:** `str`
@@ -17157,11 +17374,35 @@ client.crm.tasks.meta_patch_retrieve(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**remote_field_traversal_path:** `typing.Optional[typing.Sequence[typing.Optional[typing.Any]]]` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.
- + +
+
+ +**remote_method:** `typing.Optional[str]` — The method of the remote endpoint where the remote field is coming from. + +
+
+ +
+
+ +**remote_url_path:** `typing.Optional[str]` — The path of the remote endpoint where the remote field is coming from. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
@@ -17169,7 +17410,7 @@ client.crm.tasks.meta_patch_retrieve(
-
client.crm.tasks.meta_post_retrieve() +
client.crm.field_mapping.remote_fields_retrieve(...)
@@ -17181,7 +17422,7 @@ client.crm.tasks.meta_patch_retrieve(
-Returns metadata for `Task` POSTs. +Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/).
@@ -17202,7 +17443,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.tasks.meta_post_retrieve() +client.crm.field_mapping.remote_fields_retrieve() ``` @@ -17218,6 +17459,22 @@ client.crm.tasks.meta_post_retrieve()
+**common_models:** `typing.Optional[str]` — A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. + +
+
+ +
+
+ +**include_example_values:** `typing.Optional[str]` — If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -17230,7 +17487,7 @@ client.crm.tasks.meta_post_retrieve()
-
client.crm.tasks.remote_field_classes_list(...) +
client.crm.field_mapping.target_fields_retrieve()
@@ -17242,7 +17499,7 @@ client.crm.tasks.meta_post_retrieve()
-Returns a list of `RemoteFieldClass` objects. +Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/).
@@ -17263,9 +17520,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.tasks.remote_field_classes_list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", -) +client.crm.field_mapping.target_fields_retrieve() ``` @@ -17281,63 +17536,71 @@ client.crm.tasks.remote_field_classes_list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**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/). -
+
+## Crm GenerateKey +
client.crm.generate_key.create(...)
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. - -
-
+#### 📝 Description
-**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. - -
-
-
-**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). - +Create a remote key. +
+
+#### 🔌 Usage +
-**is_common_model_field:** `typing.Optional[bool]` — If provided, will only return remote field classes with this is_common_model_field value - -
-
-
-**is_custom:** `typing.Optional[bool]` — If provided, will only return remote fields classes with this is_custom value - +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.generate_key.create( + name="Remote Deployment Key 1", +) + +``` +
+
+#### ⚙️ Parameters +
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +
+
+ +**name:** `str` — The name of the remote key
@@ -17357,8 +17620,8 @@ client.crm.tasks.remote_field_classes_list(
-## Crm Users -
client.crm.users.list(...) +## Crm Issues +
client.crm.issues.list(...)
@@ -17370,7 +17633,7 @@ client.crm.tasks.remote_field_classes_list(
-Returns a list of `User` objects. +Gets all issues for Organization.
@@ -17391,7 +17654,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.users.list( +client.crm.issues.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -17409,7 +17672,7 @@ client.crm.users.list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. +**account_token:** `typing.Optional[str]`
@@ -17417,7 +17680,7 @@ client.crm.users.list(
-**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -17425,7 +17688,7 @@ client.crm.users.list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**end_date:** `typing.Optional[str]` — If included, will only include issues whose most recent action occurred before this time
@@ -17433,7 +17696,7 @@ client.crm.users.list(
-**email:** `typing.Optional[str]` — If provided, will only return users with this email. +**end_user_organization_name:** `typing.Optional[str]`
@@ -17441,7 +17704,7 @@ client.crm.users.list(
-**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/). +**first_incident_time_after:** `typing.Optional[dt.datetime]` — If provided, will only return issues whose first incident time was after this datetime.
@@ -17449,7 +17712,7 @@ client.crm.users.list(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**first_incident_time_before:** `typing.Optional[dt.datetime]` — If provided, will only return issues whose first incident time was before this datetime.
@@ -17457,7 +17720,7 @@ client.crm.users.list(
-**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. +**include_muted:** `typing.Optional[str]` — If true, will include muted issues
@@ -17465,7 +17728,7 @@ client.crm.users.list(
-**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). +**integration_name:** `typing.Optional[str]`
@@ -17473,7 +17736,7 @@ client.crm.users.list(
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +**last_incident_time_after:** `typing.Optional[dt.datetime]` — If provided, will only return issues whose last incident time was after this datetime.
@@ -17481,7 +17744,15 @@ client.crm.users.list(
-**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. +**last_incident_time_before:** `typing.Optional[dt.datetime]` — If provided, will only return issues whose last incident time was before this datetime. + +
+
+ +
+
+ +**linked_account_id:** `typing.Optional[str]` — If provided, will only include issues pertaining to the linked account passed in.
@@ -17497,7 +17768,20 @@ client.crm.users.list(
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. +**start_date:** `typing.Optional[str]` — If included, will only include issues whose most recent action occurred after this time + +
+
+ +
+
+ +**status:** `typing.Optional[IssuesListRequestStatus]` + +Status of the issue. Options: ('ONGOING', 'RESOLVED') + +* `ONGOING` - ONGOING +* `RESOLVED` - RESOLVED
@@ -17517,7 +17801,7 @@ client.crm.users.list(
-
client.crm.users.retrieve(...) +
client.crm.issues.retrieve(...)
@@ -17529,7 +17813,7 @@ client.crm.users.list(
-Returns a `User` object with the given `id`. +Get a specific issue.
@@ -17550,7 +17834,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.users.retrieve( +client.crm.issues.retrieve( id="id", ) @@ -17576,30 +17860,6 @@ client.crm.users.retrieve(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. - -
-
- -
-
- -**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. - -
-
- -
-
- -**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). - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -17612,7 +17872,8 @@ client.crm.users.retrieve(
-
client.crm.users.ignore_create(...) +## Crm Leads +
client.crm.leads.list(...)
@@ -17624,7 +17885,7 @@ client.crm.users.retrieve(
-Ignores a specific row based on the `model_id` in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. +Returns a list of `Lead` objects.
@@ -17640,17 +17901,13 @@ Ignores a specific row based on the `model_id` in the url. These records will ha ```python from merge import Merge -from merge.resources.crm import IgnoreCommonModelRequest, ReasonEnum client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.users.ignore_create( - model_id="model_id", - request=IgnoreCommonModelRequest( - reason=ReasonEnum.GENERAL_CUSTOMER_REQUEST, - ), +client.crm.leads.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) ``` @@ -17667,7 +17924,7 @@ client.crm.users.ignore_create(
-**model_id:** `str` +**converted_account_id:** `typing.Optional[str]` — If provided, will only return leads with this account.
@@ -17675,7 +17932,7 @@ client.crm.users.ignore_create(
-**request:** `IgnoreCommonModelRequest` +**converted_contact_id:** `typing.Optional[str]` — If provided, will only return leads with this contact.
@@ -17683,86 +17940,79 @@ client.crm.users.ignore_create(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
+ +
+
+ +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +
+
+
+**cursor:** `typing.Optional[str]` — The pagination cursor value. +
-
-
client.crm.users.remote_field_classes_list(...)
-#### 📝 Description +**email_addresses:** `typing.Optional[str]` — If provided, will only return contacts matching the email addresses; multiple email_addresses can be separated by commas. + +
+
+**expand:** `typing.Optional[LeadsListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+
-Returns a list of `RemoteFieldClass` objects. +**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. +
-#### 🔌 Usage -
+**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+
-```python -from merge import Merge - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.crm.users.remote_field_classes_list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", -) - -``` -
-
- - - -#### ⚙️ Parameters - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The pagination cursor value. - -
-
- -
-
- -**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_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). + +
+
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned.
@@ -17770,7 +18020,7 @@ client.crm.users.remote_field_classes_list(
-**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned.
@@ -17778,7 +18028,7 @@ client.crm.users.remote_field_classes_list(
-**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). +**owner_id:** `typing.Optional[str]` — If provided, will only return leads with this owner.
@@ -17786,7 +18036,7 @@ client.crm.users.remote_field_classes_list(
-**is_common_model_field:** `typing.Optional[bool]` — If provided, will only return remote field classes with this is_common_model_field value +**page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -17794,7 +18044,7 @@ client.crm.users.remote_field_classes_list(
-**is_custom:** `typing.Optional[bool]` — If provided, will only return remote fields classes with this is_custom value +**phone_numbers:** `typing.Optional[str]` — If provided, will only return contacts matching the phone numbers; multiple phone numbers can be separated by commas.
@@ -17802,7 +18052,7 @@ client.crm.users.remote_field_classes_list(
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -17822,8 +18072,7 @@ client.crm.users.remote_field_classes_list(
-## Crm WebhookReceivers -
client.crm.webhook_receivers.list() +
client.crm.leads.create(...)
@@ -17835,7 +18084,7 @@ client.crm.users.remote_field_classes_list(
-Returns a list of `WebhookReceiver` objects. +Creates a `Lead` object with the given values.
@@ -17851,12 +18100,15 @@ Returns a list of `WebhookReceiver` objects. ```python from merge import Merge +from merge.resources.crm import LeadRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.webhook_receivers.list() +client.crm.leads.create( + model=LeadRequest(), +) ``` @@ -17872,6 +18124,30 @@ client.crm.webhook_receivers.list()
+**model:** `LeadRequest` + +
+
+ +
+
+ +**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -17884,7 +18160,7 @@ client.crm.webhook_receivers.list()
-
client.crm.webhook_receivers.create(...) +
client.crm.leads.retrieve(...)
@@ -17896,7 +18172,7 @@ client.crm.webhook_receivers.list()
-Creates a `WebhookReceiver` object with the given values. +Returns a `Lead` object with the given `id`.
@@ -17917,9 +18193,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.crm.webhook_receivers.create( - event="event", - is_active=True, +client.crm.leads.retrieve( + id="id", ) ``` @@ -17936,7 +18211,7 @@ client.crm.webhook_receivers.create(
-**event:** `str` +**id:** `str`
@@ -17944,7 +18219,7 @@ client.crm.webhook_receivers.create(
-**is_active:** `bool` +**expand:** `typing.Optional[LeadsRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -17952,7 +18227,7 @@ client.crm.webhook_receivers.create(
-**key:** `typing.Optional[str]` +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -17960,65 +18235,19 @@ client.crm.webhook_receivers.create(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format.
- -
- - - - -
- -## Filestorage AccountDetails -
client.filestorage.account_details.retrieve() -
-
- -#### 📝 Description - -
-
- -
-
- -Get details for a linked account. -
-
-
-
- -#### 🔌 Usage - -
-
-```python -from merge import Merge - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.filestorage.account_details.retrieve() - -``` -
-
+**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). +
-#### ⚙️ Parameters - -
-
-
@@ -18034,8 +18263,7 @@ client.filestorage.account_details.retrieve()
-## Filestorage AccountToken -
client.filestorage.account_token.retrieve(...) +
client.crm.leads.meta_post_retrieve()
@@ -18047,7 +18275,7 @@ client.filestorage.account_details.retrieve()
-Returns the account token for the end user with the provided public token. +Returns metadata for `Lead` POSTs.
@@ -18068,9 +18296,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.account_token.retrieve( - public_token="public_token", -) +client.crm.leads.meta_post_retrieve() ``` @@ -18086,14 +18312,6 @@ client.filestorage.account_token.retrieve(
-**public_token:** `str` - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -18106,8 +18324,7 @@ client.filestorage.account_token.retrieve(
-## Filestorage AsyncPassthrough -
client.filestorage.async_passthrough.create(...) +
client.crm.leads.remote_field_classes_list(...)
@@ -18119,7 +18336,7 @@ client.filestorage.account_token.retrieve(
-Asynchronously pull data from an endpoint not currently supported by Merge. +Returns a list of `RemoteFieldClass` objects.
@@ -18135,17 +18352,13 @@ Asynchronously pull data from an endpoint not currently supported by Merge. ```python from merge import Merge -from merge.resources.filestorage import DataPassthroughRequest, MethodEnum client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.async_passthrough.create( - request=DataPassthroughRequest( - method=MethodEnum.GET, - path="/scooters", - ), +client.crm.leads.remote_field_classes_list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) ``` @@ -18162,7 +18375,7 @@ client.filestorage.async_passthrough.create(
-**request:** `DataPassthroughRequest` +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -18170,70 +18383,55 @@ client.filestorage.async_passthrough.create(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**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. +
-
-
client.filestorage.async_passthrough.retrieve(...)
-#### 📝 Description - -
-
+**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
-Retrieves data from earlier async-passthrough POST request -
-
+**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). +
-#### 🔌 Usage -
-
-
- -```python -from merge import Merge - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.filestorage.async_passthrough.retrieve( - async_passthrough_receipt_id="async_passthrough_receipt_id", -) - -``` -
-
+**is_common_model_field:** `typing.Optional[bool]` — If provided, will only return remote field classes with this is_common_model_field value +
-#### ⚙️ Parameters -
+**is_custom:** `typing.Optional[bool]` — If provided, will only return remote fields classes with this is_custom value + +
+
+
-**async_passthrough_receipt_id:** `str` +**page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -18253,8 +18451,8 @@ client.filestorage.async_passthrough.retrieve(
-## Filestorage AuditTrail -
client.filestorage.audit_trail.list(...) +## Crm LinkToken +
client.crm.link_token.create(...)
@@ -18266,7 +18464,7 @@ client.filestorage.async_passthrough.retrieve(
-Gets a list of audit trail events. +Creates a link token to be used when linking a new end user.
@@ -18282,13 +18480,17 @@ Gets a list of audit trail events. ```python from merge import Merge +from merge.resources.crm import CategoriesEnum client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.audit_trail.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +client.crm.link_token.create( + end_user_email_address="example@gmail.com", + end_user_organization_name="Test Organization", + end_user_origin_id="12345", + categories=[CategoriesEnum.HRIS, CategoriesEnum.ATS], ) ``` @@ -18305,7 +18507,7 @@ client.filestorage.audit_trail.list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**end_user_email_address:** `str` — Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent.
@@ -18313,7 +18515,7 @@ client.filestorage.audit_trail.list(
-**end_date:** `typing.Optional[str]` — If included, will only include audit trail events that occurred before this time +**end_user_organization_name:** `str` — Your end user's organization.
@@ -18321,7 +18523,7 @@ client.filestorage.audit_trail.list(
-**event_type:** `typing.Optional[str]` — If included, will only include events with the given event type. Possible values include: `CREATED_REMOTE_PRODUCTION_API_KEY`, `DELETED_REMOTE_PRODUCTION_API_KEY`, `CREATED_TEST_API_KEY`, `DELETED_TEST_API_KEY`, `REGENERATED_PRODUCTION_API_KEY`, `REGENERATED_WEBHOOK_SIGNATURE`, `INVITED_USER`, `TWO_FACTOR_AUTH_ENABLED`, `TWO_FACTOR_AUTH_DISABLED`, `DELETED_LINKED_ACCOUNT`, `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT`, `CREATED_DESTINATION`, `DELETED_DESTINATION`, `CHANGED_DESTINATION`, `CHANGED_SCOPES`, `CHANGED_PERSONAL_INFORMATION`, `CHANGED_ORGANIZATION_SETTINGS`, `ENABLED_INTEGRATION`, `DISABLED_INTEGRATION`, `ENABLED_CATEGORY`, `DISABLED_CATEGORY`, `CHANGED_PASSWORD`, `RESET_PASSWORD`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `CREATED_INTEGRATION_WIDE_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_FIELD_MAPPING`, `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING`, `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING`, `DELETED_INTEGRATION_WIDE_FIELD_MAPPING`, `DELETED_LINKED_ACCOUNT_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `FORCED_LINKED_ACCOUNT_RESYNC`, `MUTED_ISSUE`, `GENERATED_MAGIC_LINK`, `ENABLED_MERGE_WEBHOOK`, `DISABLED_MERGE_WEBHOOK`, `MERGE_WEBHOOK_TARGET_CHANGED`, `END_USER_CREDENTIALS_ACCESSED` +**end_user_origin_id:** `str` — This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers.
@@ -18329,7 +18531,7 @@ client.filestorage.audit_trail.list(
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +**categories:** `typing.Sequence[CategoriesEnum]` — The integration categories to show in Merge Link.
@@ -18337,7 +18539,7 @@ client.filestorage.audit_trail.list(
-**start_date:** `typing.Optional[str]` — If included, will only include audit trail events that occurred after this time +**integration:** `typing.Optional[str]` — The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/.
@@ -18345,7 +18547,3140 @@ client.filestorage.audit_trail.list(
-**user_email:** `typing.Optional[str]` — If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email. +**link_expiry_mins:** `typing.Optional[int]` — An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30. + +
+
+ +
+
+ +**should_create_magic_link_url:** `typing.Optional[bool]` — Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + +
+
+ +
+
+ +**hide_admin_magic_link:** `typing.Optional[bool]` — Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + +
+
+ +
+
+ +**common_models:** `typing.Optional[typing.Sequence[CommonModelScopesBodyRequest]]` — An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. + +
+
+ +
+
+ +**category_common_model_scopes:** `typing.Optional[ + typing.Dict[ + str, + typing.Optional[ + typing.Sequence[IndividualCommonModelScopeDeserializerRequest] + ], + ] +]` — When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. + +
+
+ +
+
+ +**language:** `typing.Optional[EndUserDetailsRequestLanguage]` + +The following subset of IETF language tags can be used to configure localization. + +* `en` - en +* `de` - de + +
+
+ +
+
+ +**are_syncs_disabled:** `typing.Optional[bool]` — The boolean that indicates whether initial, periodic, and force syncs will be disabled. + +
+
+ +
+
+ +**integration_specific_config:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — A JSON object containing integration-specific configuration options. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+ +
+ + + + +
+ +## Crm LinkedAccounts +
client.crm.linked_accounts.list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List linked accounts for your organization. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.linked_accounts.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**category:** `typing.Optional[LinkedAccountsListRequestCategory]` + +Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing` + +* `hris` - hris +* `ats` - ats +* `accounting` - accounting +* `ticketing` - ticketing +* `crm` - crm +* `mktg` - mktg +* `filestorage` - filestorage + +
+
+ +
+
+ +**cursor:** `typing.Optional[str]` — The pagination cursor value. + +
+
+ +
+
+ +**end_user_email_address:** `typing.Optional[str]` — If provided, will only return linked accounts associated with the given email address. + +
+
+ +
+
+ +**end_user_organization_name:** `typing.Optional[str]` — If provided, will only return linked accounts associated with the given organization name. + +
+
+ +
+
+ +**end_user_origin_id:** `typing.Optional[str]` — If provided, will only return linked accounts associated with the given origin ID. + +
+
+ +
+
+ +**end_user_origin_ids:** `typing.Optional[str]` — Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. + +
+
+ +
+
+ +**id:** `typing.Optional[str]` + +
+
+ +
+
+ +**ids:** `typing.Optional[str]` — Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. + +
+
+ +
+
+ +**include_duplicates:** `typing.Optional[bool]` — If `true`, will include complete production duplicates of the account specified by the `id` query parameter in the response. `id` must be for a complete production linked account. + +
+
+ +
+
+ +**integration_name:** `typing.Optional[str]` — If provided, will only return linked accounts associated with the given integration name. + +
+
+ +
+
+ +**is_test_account:** `typing.Optional[str]` — If included, will only include test linked accounts. If not included, will only include non-test linked accounts. + +
+
+ +
+
+ +**page_size:** `typing.Optional[int]` — Number of results to return per page. + +
+
+ +
+
+ +**status:** `typing.Optional[str]` — Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, `RELINK_NEEDED` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Crm Notes +
client.crm.notes.list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Note` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.notes.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**account_id:** `typing.Optional[str]` — If provided, will only return notes with this account. + +
+
+ +
+
+ +**contact_id:** `typing.Optional[str]` — If provided, will only return notes with this contact. + +
+
+ +
+
+ +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `typing.Optional[str]` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `typing.Optional[NotesListRequestExpand]` — 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_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**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). + +
+
+ +
+
+ +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**opportunity_id:** `typing.Optional[str]` — If provided, will only return notes with this opportunity. + +
+
+ +
+
+ +**owner_id:** `typing.Optional[str]` — If provided, will only return notes with this owner. + +
+
+ +
+
+ +**page_size:** `typing.Optional[int]` — Number of results to return per page. + +
+
+ +
+
+ +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.crm.notes.create(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `Note` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge +from merge.resources.crm import NoteRequest + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.notes.create( + model=NoteRequest(), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**model:** `NoteRequest` + +
+
+ +
+
+ +**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.crm.notes.retrieve(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Note` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.notes.retrieve( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**expand:** `typing.Optional[NotesRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**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). + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.crm.notes.meta_post_retrieve() +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Note` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.notes.meta_post_retrieve() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.crm.notes.remote_field_classes_list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.notes.remote_field_classes_list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `typing.Optional[str]` — The pagination cursor value. + +
+
+ +
+
+ +**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_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**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). + +
+
+ +
+
+ +**is_common_model_field:** `typing.Optional[bool]` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**is_custom:** `typing.Optional[bool]` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**page_size:** `typing.Optional[int]` — Number of results to return per page. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Crm Opportunities +
client.crm.opportunities.list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Opportunity` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.opportunities.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**account_id:** `typing.Optional[str]` — If provided, will only return opportunities with this account. + +
+
+ +
+
+ +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `typing.Optional[str]` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `typing.Optional[OpportunitiesListRequestExpand]` — 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_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**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). + +
+
+ +
+
+ +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**owner_id:** `typing.Optional[str]` — If provided, will only return opportunities with this owner. + +
+
+ +
+
+ +**page_size:** `typing.Optional[int]` — Number of results to return per page. + +
+
+ +
+
+ +**remote_created_after:** `typing.Optional[dt.datetime]` — If provided, will only return opportunities created in the third party platform after this datetime. + +
+
+ +
+
+ +**remote_fields:** `typing.Optional[typing.Literal["status"]]` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. + +
+
+ +
+
+ +**show_enum_origins:** `typing.Optional[typing.Literal["status"]]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) + +
+
+ +
+
+ +**stage_id:** `typing.Optional[str]` — If provided, will only return opportunities with this stage. + +
+
+ +
+
+ +**status:** `typing.Optional[OpportunitiesListRequestStatus]` + +If provided, will only return opportunities with this status. Options: ('OPEN', 'WON', 'LOST') + +* `OPEN` - OPEN +* `WON` - WON +* `LOST` - LOST + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.crm.opportunities.create(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates an `Opportunity` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge +from merge.resources.crm import OpportunityRequest + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.opportunities.create( + model=OpportunityRequest(), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**model:** `OpportunityRequest` + +
+
+ +
+
+ +**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.crm.opportunities.retrieve(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns an `Opportunity` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.opportunities.retrieve( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**expand:** `typing.Optional[OpportunitiesRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**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). + +
+
+ +
+
+ +**remote_fields:** `typing.Optional[typing.Literal["status"]]` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**show_enum_origins:** `typing.Optional[typing.Literal["status"]]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.crm.opportunities.partial_update(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates an `Opportunity` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge +from merge.resources.crm import PatchedOpportunityRequest + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.opportunities.partial_update( + id="id", + model=PatchedOpportunityRequest(), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**model:** `PatchedOpportunityRequest` + +
+
+ +
+
+ +**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.crm.opportunities.meta_patch_retrieve(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Opportunity` PATCHs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.opportunities.meta_patch_retrieve( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.crm.opportunities.meta_post_retrieve() +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Opportunity` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.opportunities.meta_post_retrieve() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.crm.opportunities.remote_field_classes_list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.opportunities.remote_field_classes_list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `typing.Optional[str]` — The pagination cursor value. + +
+
+ +
+
+ +**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_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**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). + +
+
+ +
+
+ +**is_common_model_field:** `typing.Optional[bool]` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**is_custom:** `typing.Optional[bool]` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**page_size:** `typing.Optional[int]` — Number of results to return per page. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Crm Passthrough +
client.crm.passthrough.create(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Pull data from an endpoint not currently supported by Merge. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge +from merge.resources.crm import DataPassthroughRequest, MethodEnum + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.passthrough.create( + request=DataPassthroughRequest( + method=MethodEnum.GET, + path="/scooters", + ), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request:** `DataPassthroughRequest` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Crm RegenerateKey +
client.crm.regenerate_key.create(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Exchange remote keys. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.regenerate_key.create( + name="Remote Deployment Key 1", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**name:** `str` — The name of the remote key + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Crm Stages +
client.crm.stages.list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Stage` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.stages.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `typing.Optional[str]` — The pagination cursor value. + +
+
+ +
+
+ +**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_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**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). + +
+
+ +
+
+ +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**page_size:** `typing.Optional[int]` — Number of results to return per page. + +
+
+ +
+
+ +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.crm.stages.retrieve(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Stage` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.stages.retrieve( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**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). + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.crm.stages.remote_field_classes_list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.stages.remote_field_classes_list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `typing.Optional[str]` — The pagination cursor value. + +
+
+ +
+
+ +**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_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**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). + +
+
+ +
+
+ +**is_common_model_field:** `typing.Optional[bool]` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**is_custom:** `typing.Optional[bool]` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**page_size:** `typing.Optional[int]` — Number of results to return per page. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Crm SyncStatus +
client.crm.sync_status.list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get sync status for the current sync and the most recently finished sync. `last_sync_start` represents the most recent time any sync began. `last_sync_finished` represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the `last_sync_finished` timestamp where `last_sync_result` is `DONE`. Possible values for `status` and `last_sync_result` are `DISABLED`, `DONE`, `FAILED`, `PARTIALLY_SYNCED`, `PAUSED`, `SYNCING`. Learn more about sync status in our [Help Center](https://help.merge.dev/en/articles/8184193-merge-sync-statuses). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.sync_status.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `typing.Optional[str]` — The pagination cursor value. + +
+
+ +
+
+ +**page_size:** `typing.Optional[int]` — Number of results to return per page. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Crm ForceResync +
client.crm.force_resync.sync_status_resync_create() +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.force_resync.sync_status_resync_create() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Crm Tasks +
client.crm.tasks.list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Task` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.tasks.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `typing.Optional[str]` — The pagination cursor value. + +
+
+ +
+
+ +**expand:** `typing.Optional[TasksListRequestExpand]` — 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_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**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). + +
+
+ +
+
+ +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**page_size:** `typing.Optional[int]` — Number of results to return per page. + +
+
+ +
+
+ +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.crm.tasks.create(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Creates a `Task` object with the given values. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge +from merge.resources.crm import TaskRequest + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.tasks.create( + model=TaskRequest(), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**model:** `TaskRequest` + +
+
+ +
+
+ +**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.crm.tasks.retrieve(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a `Task` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.tasks.retrieve( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**expand:** `typing.Optional[TasksRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**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). + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.crm.tasks.partial_update(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Updates a `Task` object with the given `id`. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge +from merge.resources.crm import PatchedTaskRequest + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.tasks.partial_update( + id="id", + model=PatchedTaskRequest(), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**model:** `PatchedTaskRequest` + +
+
+ +
+
+ +**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.crm.tasks.meta_patch_retrieve(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Task` PATCHs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.tasks.meta_patch_retrieve( + id="id", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.crm.tasks.meta_post_retrieve() +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `Task` POSTs. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.tasks.meta_post_retrieve() + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.crm.tasks.remote_field_classes_list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.tasks.remote_field_classes_list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `typing.Optional[str]` — The pagination cursor value. + +
+
+ +
+
+ +**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_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**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). + +
+
+ +
+
+ +**is_common_model_field:** `typing.Optional[bool]` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**is_custom:** `typing.Optional[bool]` — If provided, will only return remote fields classes with this is_custom value + +
+
+ +
+
+ +**page_size:** `typing.Optional[int]` — Number of results to return per page. + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +## Crm Users +
client.crm.users.list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `User` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.users.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `typing.Optional[str]` — The pagination cursor value. + +
+
+ +
+
+ +**email:** `typing.Optional[str]` — If provided, will only return users with this email. + +
+
+ +
+
+ +**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_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**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). + +
+
+ +
+
+ +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**page_size:** `typing.Optional[int]` — Number of results to return per page. + +
+
+ +
+
+ +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -18365,8 +21700,7 @@ client.filestorage.audit_trail.list(
-## Filestorage AvailableActions -
client.filestorage.available_actions.retrieve() +
client.crm.users.retrieve(...)
@@ -18378,7 +21712,7 @@ client.filestorage.audit_trail.list(
-Returns a list of models and actions available for an account. +Returns a `User` object with the given `id`.
@@ -18399,7 +21733,187 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.available_actions.retrieve() +client.crm.users.retrieve( + id="id", +) + +``` + +
+ + + +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `str` + +
+
+ +
+
+ +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
+ +
+
+ +**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**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). + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + + + +
+ +
client.crm.users.ignore_create(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Ignores a specific row based on the `model_id` in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge +from merge.resources.crm import IgnoreCommonModelRequest, ReasonEnum + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.users.ignore_create( + model_id="model_id", + request=IgnoreCommonModelRequest( + reason=ReasonEnum.GENERAL_CUSTOMER_REQUEST, + ), +) + +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**model_id:** `str` + +
+
+ +
+
+ +**request:** `IgnoreCommonModelRequest` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + +
+
+
+ +
client.crm.users.remote_field_classes_list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `RemoteFieldClass` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.crm.users.remote_field_classes_list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +) ```
@@ -18407,11 +21921,75 @@ client.filestorage.available_actions.retrieve()
-#### ⚙️ Parameters - +#### ⚙️ Parameters + +
+
+ +
+
+ +**cursor:** `typing.Optional[str]` — The pagination cursor value. + +
+
+ +
+
+ +**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_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ +**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). + +
+
+ +
+
+ +**is_common_model_field:** `typing.Optional[bool]` — If provided, will only return remote field classes with this is_common_model_field value + +
+
+ +
+
+ +**is_custom:** `typing.Optional[bool]` — If provided, will only return remote fields classes with this is_custom value + +
+
+
+**page_size:** `typing.Optional[int]` — Number of results to return per page. + +
+
+
@@ -18427,8 +22005,8 @@ client.filestorage.available_actions.retrieve()
-## Filestorage Scopes -
client.filestorage.scopes.default_scopes_retrieve() +## Crm WebhookReceivers +
client.crm.webhook_receivers.list()
@@ -18440,7 +22018,7 @@ client.filestorage.available_actions.retrieve()
-Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). +Returns a list of `WebhookReceiver` objects.
@@ -18461,7 +22039,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.scopes.default_scopes_retrieve() +client.crm.webhook_receivers.list() ``` @@ -18489,7 +22067,7 @@ client.filestorage.scopes.default_scopes_retrieve()
-
client.filestorage.scopes.linked_account_scopes_retrieve() +
client.crm.webhook_receivers.create(...)
@@ -18501,7 +22079,7 @@ client.filestorage.scopes.default_scopes_retrieve()
-Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). +Creates a `WebhookReceiver` object with the given values.
@@ -18522,7 +22100,10 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.scopes.linked_account_scopes_retrieve() +client.crm.webhook_receivers.create( + event="event", + is_active=True, +) ``` @@ -18538,6 +22119,30 @@ client.filestorage.scopes.linked_account_scopes_retrieve()
+**event:** `str` + +
+
+ +
+
+ +**is_active:** `bool` + +
+
+ +
+
+ +**key:** `typing.Optional[str]` + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -18550,7 +22155,8 @@ client.filestorage.scopes.linked_account_scopes_retrieve()
-
client.filestorage.scopes.linked_account_scopes_create(...) +## Knowledgebase AccountDetails +
client.knowledgebase.account_details.retrieve()
@@ -18562,7 +22168,7 @@ client.filestorage.scopes.linked_account_scopes_retrieve()
-Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes) +Get details for a linked account.
@@ -18578,43 +22184,12 @@ Update permissions for any Common Model or field for a single Linked Account. An ```python from merge import Merge -from merge.resources.filestorage import ( - FieldPermissionDeserializerRequest, - IndividualCommonModelScopeDeserializerRequest, - ModelPermissionDeserializerRequest, -) client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.scopes.linked_account_scopes_create( - common_models=[ - IndividualCommonModelScopeDeserializerRequest( - model_name="Employee", - model_permissions={ - "READ": ModelPermissionDeserializerRequest( - is_enabled=True, - ), - "WRITE": ModelPermissionDeserializerRequest( - is_enabled=False, - ), - }, - field_permissions=FieldPermissionDeserializerRequest( - enabled_fields=["avatar", "home_location"], - disabled_fields=["work_location"], - ), - ), - IndividualCommonModelScopeDeserializerRequest( - model_name="Benefit", - model_permissions={ - "WRITE": ModelPermissionDeserializerRequest( - is_enabled=False, - ) - }, - ), - ], -) +client.knowledgebase.account_details.retrieve() ``` @@ -18630,14 +22205,6 @@ client.filestorage.scopes.linked_account_scopes_create(
-**common_models:** `typing.Sequence[IndividualCommonModelScopeDeserializerRequest]` — The common models you want to update the scopes for - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -18650,8 +22217,8 @@ client.filestorage.scopes.linked_account_scopes_create(
-## Filestorage DeleteAccount -
client.filestorage.delete_account.delete() +## Knowledgebase AccountToken +
client.knowledgebase.account_token.retrieve(...)
@@ -18663,7 +22230,7 @@ client.filestorage.scopes.linked_account_scopes_create(
-Delete a linked account. +Returns the account token for the end user with the provided public token.
@@ -18684,7 +22251,9 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.delete_account.delete() +client.knowledgebase.account_token.retrieve( + public_token="public_token", +) ``` @@ -18700,6 +22269,14 @@ client.filestorage.delete_account.delete()
+**public_token:** `str` + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -18712,8 +22289,8 @@ client.filestorage.delete_account.delete()
-## Filestorage Drives -
client.filestorage.drives.list(...) +## Knowledgebase Articles +
client.knowledgebase.articles.list(...)
@@ -18725,7 +22302,7 @@ client.filestorage.delete_account.delete()
-Returns a list of `Drive` objects. +Returns a list of `Article` objects.
@@ -18746,7 +22323,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.drives.list( +client.knowledgebase.articles.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -18788,6 +22365,14 @@ client.filestorage.drives.list(
+**expand:** `typing.Optional[ArticlesListRequestExpand]` — 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/).
@@ -18828,7 +22413,7 @@ client.filestorage.drives.list(
-**name:** `typing.Optional[str]` — If provided, will only return drives with this name. This performs an exact match. +**page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -18836,7 +22421,15 @@ client.filestorage.drives.list(
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +**parent_article_id:** `typing.Optional[str]` — If provided, will only return sub articles of the parent_article_id. + +
+
+ +
+
+ +**parent_container_id:** `typing.Optional[str]` — If provided, will only return sub articles of the parent_container_id.
@@ -18852,6 +22445,14 @@ client.filestorage.drives.list(
+**type:** `typing.Optional[str]` — If provided, will only return articles of the given type. + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -18864,7 +22465,7 @@ client.filestorage.drives.list(
-
client.filestorage.drives.retrieve(...) +
client.knowledgebase.articles.retrieve(...)
@@ -18876,7 +22477,7 @@ client.filestorage.drives.list(
-Returns a `Drive` object with the given `id`. +Returns an `Article` object with the given `id`.
@@ -18897,7 +22498,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.drives.retrieve( +client.knowledgebase.articles.retrieve( id="id", ) @@ -18923,6 +22524,14 @@ client.filestorage.drives.retrieve(
+**expand:** `typing.Optional[ArticlesRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ **include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -18951,8 +22560,8 @@ client.filestorage.drives.retrieve(
-## Filestorage FieldMapping -
client.filestorage.field_mapping.field_mappings_retrieve(...) +## Knowledgebase AsyncPassthrough +
client.knowledgebase.async_passthrough.create(...)
@@ -18964,7 +22573,7 @@ client.filestorage.drives.retrieve(
-Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +Asynchronously pull data from an endpoint not currently supported by Merge.
@@ -18980,12 +22589,18 @@ Get all Field Mappings for this Linked Account. Field Mappings are mappings betw ```python from merge import Merge +from merge.resources.knowledgebase import DataPassthroughRequest, MethodEnum client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.field_mapping.field_mappings_retrieve() +client.knowledgebase.async_passthrough.create( + request=DataPassthroughRequest( + method=MethodEnum.GET, + path="/scooters", + ), +) ``` @@ -19001,7 +22616,7 @@ client.filestorage.field_mapping.field_mappings_retrieve()
-**exclude_remote_field_metadata:** `typing.Optional[bool]` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. +**request:** `DataPassthroughRequest`
@@ -19021,7 +22636,7 @@ client.filestorage.field_mapping.field_mappings_retrieve()
-
client.filestorage.field_mapping.field_mappings_create(...) +
client.knowledgebase.async_passthrough.retrieve(...)
@@ -19033,7 +22648,7 @@ client.filestorage.field_mapping.field_mappings_retrieve()
-Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +Retrieves data from earlier async-passthrough POST request
@@ -19054,13 +22669,80 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.field_mapping.field_mappings_create( - target_field_name="example_target_field_name", - target_field_description="this is a example description of the target field", - remote_field_traversal_path=["example_remote_field"], - remote_method="GET", - remote_url_path="/example-url-path", - common_model_name="ExampleCommonModel", +client.knowledgebase.async_passthrough.retrieve( + async_passthrough_receipt_id="async_passthrough_receipt_id", +) + +``` + +
+ + + +#### ⚙️ Parameters + +
+
+ +
+
+ +**async_passthrough_receipt_id:** `str` + +
+
+ +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. + +
+
+
+
+ + + + +
+ +## Knowledgebase Attachments +
client.knowledgebase.attachments.list(...) +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Attachment` objects. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.knowledgebase.attachments.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) ``` @@ -19077,7 +22759,31 @@ client.filestorage.field_mapping.field_mappings_create(
-**target_field_name:** `str` — The name of the target field you want this remote field to map to. +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `typing.Optional[str]` — The pagination cursor value. + +
+
+ +
+
+ +**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/).
@@ -19085,7 +22791,7 @@ client.filestorage.field_mapping.field_mappings_create(
-**target_field_description:** `str` — The description of the target field you want this remote field to map to. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -19093,7 +22799,7 @@ client.filestorage.field_mapping.field_mappings_create(
-**remote_field_traversal_path:** `typing.Sequence[typing.Optional[typing.Any]]` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. +**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).
@@ -19101,7 +22807,7 @@ client.filestorage.field_mapping.field_mappings_create(
-**remote_method:** `str` — The method of the remote endpoint where the remote field is coming from. +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned.
@@ -19109,7 +22815,7 @@ client.filestorage.field_mapping.field_mappings_create(
-**remote_url_path:** `str` — The path of the remote endpoint where the remote field is coming from. +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned.
@@ -19117,7 +22823,7 @@ client.filestorage.field_mapping.field_mappings_create(
-**common_model_name:** `str` — The name of the Common Model that the remote field corresponds to in a given category. +**page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -19125,7 +22831,7 @@ client.filestorage.field_mapping.field_mappings_create(
-**exclude_remote_field_metadata:** `typing.Optional[bool]` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -19145,7 +22851,7 @@ client.filestorage.field_mapping.field_mappings_create(
-
client.filestorage.field_mapping.field_mappings_destroy(...) +
client.knowledgebase.attachments.retrieve(...)
@@ -19157,7 +22863,7 @@ client.filestorage.field_mapping.field_mappings_create(
-Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +Returns an `Attachment` object with the given `id`.
@@ -19178,8 +22884,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.field_mapping.field_mappings_destroy( - field_mapping_id="field_mapping_id", +client.knowledgebase.attachments.retrieve( + id="id", ) ``` @@ -19196,7 +22902,23 @@ client.filestorage.field_mapping.field_mappings_destroy(
-**field_mapping_id:** `str` +**id:** `str` + +
+
+ +
+
+ +**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).
@@ -19216,7 +22938,8 @@ client.filestorage.field_mapping.field_mappings_destroy(
-
client.filestorage.field_mapping.field_mappings_partial_update(...) +## Knowledgebase AuditTrail +
client.knowledgebase.audit_trail.list(...)
@@ -19228,7 +22951,7 @@ client.filestorage.field_mapping.field_mappings_destroy(
-Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +Gets a list of audit trail events.
@@ -19249,8 +22972,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.field_mapping.field_mappings_partial_update( - field_mapping_id="field_mapping_id", +client.knowledgebase.audit_trail.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) ``` @@ -19267,15 +22990,7 @@ client.filestorage.field_mapping.field_mappings_partial_update(
-**field_mapping_id:** `str` - -
-
- -
-
- -**remote_field_traversal_path:** `typing.Optional[typing.Sequence[typing.Optional[typing.Any]]]` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -19283,7 +22998,7 @@ client.filestorage.field_mapping.field_mappings_partial_update(
-**remote_method:** `typing.Optional[str]` — The method of the remote endpoint where the remote field is coming from. +**end_date:** `typing.Optional[str]` — If included, will only include audit trail events that occurred before this time
@@ -19291,7 +23006,7 @@ client.filestorage.field_mapping.field_mappings_partial_update(
-**remote_url_path:** `typing.Optional[str]` — The path of the remote endpoint where the remote field is coming from. +**event_type:** `typing.Optional[str]` — If included, will only include events with the given event type. Possible values include: `CREATED_REMOTE_PRODUCTION_API_KEY`, `DELETED_REMOTE_PRODUCTION_API_KEY`, `CREATED_TEST_API_KEY`, `DELETED_TEST_API_KEY`, `REGENERATED_PRODUCTION_API_KEY`, `REGENERATED_WEBHOOK_SIGNATURE`, `INVITED_USER`, `TWO_FACTOR_AUTH_ENABLED`, `TWO_FACTOR_AUTH_DISABLED`, `DELETED_LINKED_ACCOUNT`, `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT`, `CREATED_DESTINATION`, `DELETED_DESTINATION`, `CHANGED_DESTINATION`, `CHANGED_SCOPES`, `CHANGED_PERSONAL_INFORMATION`, `CHANGED_ORGANIZATION_SETTINGS`, `ENABLED_INTEGRATION`, `DISABLED_INTEGRATION`, `ENABLED_CATEGORY`, `DISABLED_CATEGORY`, `CHANGED_PASSWORD`, `RESET_PASSWORD`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `CREATED_INTEGRATION_WIDE_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_FIELD_MAPPING`, `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING`, `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING`, `DELETED_INTEGRATION_WIDE_FIELD_MAPPING`, `DELETED_LINKED_ACCOUNT_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `FORCED_LINKED_ACCOUNT_RESYNC`, `MUTED_ISSUE`, `GENERATED_MAGIC_LINK`, `ENABLED_MERGE_WEBHOOK`, `DISABLED_MERGE_WEBHOOK`, `MERGE_WEBHOOK_TARGET_CHANGED`, `END_USER_CREDENTIALS_ACCESSED`
@@ -19299,68 +23014,15 @@ client.filestorage.field_mapping.field_mappings_partial_update(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**page_size:** `typing.Optional[int]` — Number of results to return per page.
- -
- - - - -
- -
client.filestorage.field_mapping.remote_fields_retrieve(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from merge import Merge - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.filestorage.field_mapping.remote_fields_retrieve() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
-**common_models:** `typing.Optional[str]` — A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. +**start_date:** `typing.Optional[str]` — If included, will only include audit trail events that occurred after this time
@@ -19368,7 +23030,7 @@ client.filestorage.field_mapping.remote_fields_retrieve()
-**include_example_values:** `typing.Optional[str]` — If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. +**user_email:** `typing.Optional[str]` — If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email.
@@ -19388,7 +23050,8 @@ client.filestorage.field_mapping.remote_fields_retrieve()
-
client.filestorage.field_mapping.target_fields_retrieve() +## Knowledgebase AvailableActions +
client.knowledgebase.available_actions.retrieve()
@@ -19400,7 +23063,7 @@ client.filestorage.field_mapping.remote_fields_retrieve()
-Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). +Returns a list of models and actions available for an account.
@@ -19421,7 +23084,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.field_mapping.target_fields_retrieve() +client.knowledgebase.available_actions.retrieve() ``` @@ -19449,8 +23112,8 @@ client.filestorage.field_mapping.target_fields_retrieve()
-## Filestorage Files -
client.filestorage.files.list(...) +## Knowledgebase Containers +
client.knowledgebase.containers.list(...)
@@ -19462,7 +23125,7 @@ client.filestorage.field_mapping.target_fields_retrieve()
-Returns a list of `File` objects. +Returns a list of `Container` objects.
@@ -19483,7 +23146,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.files.list( +client.knowledgebase.containers.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -19525,23 +23188,7 @@ client.filestorage.files.list(
-**drive_id:** `typing.Optional[str]` — Specifying a drive id returns only the files in that drive. Specifying null returns only the files outside the top-level drive. - -
-
- -
-
- -**expand:** `typing.Optional[FilesListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - -
-
- -
-
- -**folder_id:** `typing.Optional[str]` — Specifying a folder id returns only the files in that folder. Specifying null returns only the files in root directory. +**expand:** `typing.Optional[ContainersListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -19573,14 +23220,6 @@ client.filestorage.files.list(
-**mime_type:** `typing.Optional[str]` — If provided, will only return files with these mime_types. Multiple values can be separated by commas. - -
-
- -
-
- **modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned.
@@ -19597,22 +23236,6 @@ client.filestorage.files.list(
-**name:** `typing.Optional[str]` — If provided, will only return files with this name. This performs an exact match. - -
-
- -
-
- -**order_by:** `typing.Optional[FilesListRequestOrderBy]` — Overrides the default ordering for this endpoint. Possible values include: created_at, -created_at, modified_at, -modified_at. - -
-
- -
-
- **page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -19621,7 +23244,7 @@ client.filestorage.files.list(
-**remote_created_after:** `typing.Optional[dt.datetime]` — If provided, will only return files created in the third party platform after this datetime. +**parent_article_id:** `typing.Optional[str]` — If provided, will only return sub containers of the parent_article_id.
@@ -19629,7 +23252,7 @@ client.filestorage.files.list(
-**remote_created_before:** `typing.Optional[dt.datetime]` — If provided, will only return files created in the third party platform before this datetime. +**parent_container_id:** `typing.Optional[str]` — If provided, will only return sub containers of the parent_container_id.
@@ -19645,87 +23268,7 @@ client.filestorage.files.list(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. - -
-
- -
- - - -
-
- -
client.filestorage.files.create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Creates a `File` object with the given values. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from merge import Merge -from merge.resources.filestorage import FileRequest - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.filestorage.files.create( - model=FileRequest(), -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
- -
-
- -**model:** `FileRequest` - -
-
- -
-
- -**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. - -
-
- -
-
- -**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. +**type:** `typing.Optional[str]` — If provided, will only return containers of the given type.
@@ -19745,7 +23288,7 @@ client.filestorage.files.create(
-
client.filestorage.files.retrieve(...) +
client.knowledgebase.containers.retrieve(...)
@@ -19757,7 +23300,7 @@ client.filestorage.files.create(
-Returns a `File` object with the given `id`. +Returns a `Container` object with the given `id`.
@@ -19778,7 +23321,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.files.retrieve( +client.knowledgebase.containers.retrieve( id="id", ) @@ -19804,7 +23347,7 @@ client.filestorage.files.retrieve(
-**expand:** `typing.Optional[FilesRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**expand:** `typing.Optional[ContainersRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -19840,7 +23383,8 @@ client.filestorage.files.retrieve(
-
client.filestorage.files.download_request_meta_retrieve(...) +## Knowledgebase Scopes +
client.knowledgebase.scopes.default_scopes_retrieve()
@@ -19852,7 +23396,7 @@ client.filestorage.files.retrieve(
-Returns metadata to construct an authenticated file download request for a singular file, allowing you to download file directly from the third-party. +Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes).
@@ -19873,9 +23417,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.files.download_request_meta_retrieve( - id="id", -) +client.knowledgebase.scopes.default_scopes_retrieve() ``` @@ -19891,19 +23433,64 @@ client.filestorage.files.download_request_meta_retrieve(
-**id:** `str` +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
+ + + + +
+
client.knowledgebase.scopes.linked_account_scopes_retrieve()
-**mime_type:** `typing.Optional[str]` — If provided, specifies the export format of the file to be downloaded. For information on supported export formats, please refer to our export format help center article. - +#### 📝 Description + +
+
+ +
+
+ +Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.knowledgebase.scopes.linked_account_scopes_retrieve() + +``` +
+
+#### ⚙️ Parameters + +
+
+
@@ -19919,7 +23506,7 @@ client.filestorage.files.download_request_meta_retrieve(
-
client.filestorage.files.download_request_meta_list(...) +
client.knowledgebase.scopes.linked_account_scopes_create(...)
@@ -19931,7 +23518,7 @@ client.filestorage.files.download_request_meta_retrieve(
-Returns metadata to construct authenticated file download requests, allowing you to download files directly from the third-party. +Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes)
@@ -19947,13 +23534,42 @@ Returns metadata to construct authenticated file download requests, allowing you ```python from merge import Merge +from merge.resources.knowledgebase import ( + FieldPermissionDeserializerRequest, + IndividualCommonModelScopeDeserializerRequest, + ModelPermissionDeserializerRequest, +) client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.files.download_request_meta_list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +client.knowledgebase.scopes.linked_account_scopes_create( + common_models=[ + IndividualCommonModelScopeDeserializerRequest( + model_name="Employee", + model_permissions={ + "READ": ModelPermissionDeserializerRequest( + is_enabled=True, + ), + "WRITE": ModelPermissionDeserializerRequest( + is_enabled=False, + ), + }, + field_permissions=FieldPermissionDeserializerRequest( + enabled_fields=["avatar", "home_location"], + disabled_fields=["work_location"], + ), + ), + IndividualCommonModelScopeDeserializerRequest( + model_name="Benefit", + model_permissions={ + "WRITE": ModelPermissionDeserializerRequest( + is_enabled=False, + ) + }, + ), + ], ) ``` @@ -19970,7 +23586,7 @@ client.filestorage.files.download_request_meta_list(
-**created_after:** `typing.Optional[str]` — If provided, will only return objects created after this datetime. +**common_models:** `typing.Sequence[IndividualCommonModelScopeDeserializerRequest]` — The common models you want to update the scopes for
@@ -19978,75 +23594,65 @@ client.filestorage.files.download_request_meta_list(
-**created_before:** `typing.Optional[str]` — If provided, will only return objects created before this datetime. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
- -
-
- -**cursor:** `typing.Optional[str]` — The pagination cursor value. -
-
-
-**ids:** `typing.Optional[typing.Union[str, typing.Sequence[str]]]` — If provided, will only return objects with the given IDs. Comma-separated list of strings. -
+
+## Knowledgebase DeleteAccount +
client.knowledgebase.delete_account.delete()
-**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/). - -
-
+#### 📝 Description
-**mime_types:** `typing.Optional[str]` — A comma-separated list of preferred MIME types in order of priority. If supported by the third-party provider, the file(s) will be returned in the first supported MIME type from the list. The default MIME type is PDF. To see supported MIME types by file type, refer to our export format help center article. - -
-
-
-**modified_after:** `typing.Optional[str]` — If provided, will only return objects modified after this datetime. - +Delete a linked account. +
+
+#### 🔌 Usage +
-**modified_before:** `typing.Optional[str]` — If provided, will only return objects modified before this datetime. - -
-
-
-**order_by:** `typing.Optional[FilesDownloadRequestMetaListRequestOrderBy]` — Overrides the default ordering for this endpoint. Possible values include: created_at, -created_at, modified_at, -modified_at. - +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.knowledgebase.delete_account.delete() + +``` +
+
+#### ⚙️ Parameters +
-**page_size:** `typing.Optional[int]` — Number of results to return per page. - -
-
-
@@ -20062,7 +23668,8 @@ client.filestorage.files.download_request_meta_list(
-
client.filestorage.files.meta_post_retrieve() +## Knowledgebase FieldMapping +
client.knowledgebase.field_mapping.field_mappings_retrieve(...)
@@ -20074,7 +23681,7 @@ client.filestorage.files.download_request_meta_list(
-Returns metadata for `FileStorageFile` POSTs. +Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/).
@@ -20095,7 +23702,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.files.meta_post_retrieve() +client.knowledgebase.field_mapping.field_mappings_retrieve() ``` @@ -20111,6 +23718,14 @@ client.filestorage.files.meta_post_retrieve()
+**exclude_remote_field_metadata:** `typing.Optional[bool]` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -20123,8 +23738,7 @@ client.filestorage.files.meta_post_retrieve()
-## Filestorage Folders -
client.filestorage.folders.list(...) +
client.knowledgebase.field_mapping.field_mappings_create(...)
@@ -20136,7 +23750,7 @@ client.filestorage.files.meta_post_retrieve()
-Returns a list of `Folder` objects. +Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start.
@@ -20157,8 +23771,13 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.folders.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +client.knowledgebase.field_mapping.field_mappings_create( + target_field_name="example_target_field_name", + target_field_description="this is a example description of the target field", + remote_field_traversal_path=["example_remote_field"], + remote_method="GET", + remote_url_path="/example-url-path", + common_model_name="ExampleCommonModel", ) ``` @@ -20175,7 +23794,7 @@ client.filestorage.folders.list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. +**target_field_name:** `str` — The name of the target field you want this remote field to map to.
@@ -20183,7 +23802,7 @@ client.filestorage.folders.list(
-**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +**target_field_description:** `str` — The description of the target field you want this remote field to map to.
@@ -20191,7 +23810,7 @@ client.filestorage.folders.list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**remote_field_traversal_path:** `typing.Sequence[typing.Optional[typing.Any]]` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.
@@ -20199,7 +23818,7 @@ client.filestorage.folders.list(
-**drive_id:** `typing.Optional[str]` — If provided, will only return folders in this drive. +**remote_method:** `str` — The method of the remote endpoint where the remote field is coming from.
@@ -20207,7 +23826,7 @@ client.filestorage.folders.list(
-**expand:** `typing.Optional[FoldersListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**remote_url_path:** `str` — The path of the remote endpoint where the remote field is coming from.
@@ -20215,7 +23834,7 @@ client.filestorage.folders.list(
-**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/). +**common_model_name:** `str` — The name of the Common Model that the remote field corresponds to in a given category.
@@ -20223,7 +23842,7 @@ client.filestorage.folders.list(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**exclude_remote_field_metadata:** `typing.Optional[bool]` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations.
@@ -20231,7 +23850,7 @@ client.filestorage.folders.list(
-**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). +**jmes_path:** `typing.Optional[str]` — JMES path to specify json query expression to be used on field mapping.
@@ -20239,47 +23858,70 @@ client.filestorage.folders.list(
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. -
+
+
client.knowledgebase.field_mapping.field_mappings_destroy(...)
-**name:** `typing.Optional[str]` — If provided, will only return folders with this name. This performs an exact match. - -
-
+#### 📝 Description
-**page_size:** `typing.Optional[int]` — Number of results to return per page. - +
+
+ +Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +
+
+#### 🔌 Usage +
-**parent_folder_id:** `typing.Optional[str]` — If provided, will only return folders in this parent folder. If null, will return folders in root directory. - +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.knowledgebase.field_mapping.field_mappings_destroy( + field_mapping_id="field_mapping_id", +) + +``` +
+
+#### ⚙️ Parameters +
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. +
+
+ +**field_mapping_id:** `str`
@@ -20299,7 +23941,7 @@ client.filestorage.folders.list(
-
client.filestorage.folders.create(...) +
client.knowledgebase.field_mapping.field_mappings_partial_update(...)
@@ -20311,7 +23953,7 @@ client.filestorage.folders.list(
-Creates a `Folder` object with the given values. +Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start.
@@ -20327,14 +23969,13 @@ Creates a `Folder` object with the given values. ```python from merge import Merge -from merge.resources.filestorage import FolderRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.folders.create( - model=FolderRequest(), +client.knowledgebase.field_mapping.field_mappings_partial_update( + field_mapping_id="field_mapping_id", ) ``` @@ -20343,15 +23984,31 @@ client.filestorage.folders.create(
-#### ⚙️ Parameters - +#### ⚙️ Parameters + +
+
+ +
+
+ +**field_mapping_id:** `str` + +
+
+
+**remote_field_traversal_path:** `typing.Optional[typing.Sequence[typing.Optional[typing.Any]]]` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + +
+
+
-**model:** `FolderRequest` +**remote_method:** `typing.Optional[str]` — The method of the remote endpoint where the remote field is coming from.
@@ -20359,7 +24016,7 @@ client.filestorage.folders.create(
-**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. +**remote_url_path:** `typing.Optional[str]` — The path of the remote endpoint where the remote field is coming from.
@@ -20367,7 +24024,7 @@ client.filestorage.folders.create(
-**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. +**jmes_path:** `typing.Optional[str]` — JMES path to specify json query expression to be used on field mapping.
@@ -20387,7 +24044,7 @@ client.filestorage.folders.create(
-
client.filestorage.folders.retrieve(...) +
client.knowledgebase.field_mapping.remote_fields_retrieve(...)
@@ -20399,7 +24056,7 @@ client.filestorage.folders.create(
-Returns a `Folder` object with the given `id`. +Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/).
@@ -20420,9 +24077,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.folders.retrieve( - id="id", -) +client.knowledgebase.field_mapping.remote_fields_retrieve() ``` @@ -20438,23 +24093,7 @@ client.filestorage.folders.retrieve(
-**id:** `str` - -
-
- -
-
- -**expand:** `typing.Optional[FoldersRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - -
-
- -
-
- -**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**common_models:** `typing.Optional[str]` — A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models.
@@ -20462,7 +24101,7 @@ client.filestorage.folders.retrieve(
-**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). +**include_example_values:** `typing.Optional[str]` — If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers.
@@ -20482,7 +24121,7 @@ client.filestorage.folders.retrieve(
-
client.filestorage.folders.meta_post_retrieve() +
client.knowledgebase.field_mapping.target_fields_retrieve()
@@ -20494,7 +24133,7 @@ client.filestorage.folders.retrieve(
-Returns metadata for `FileStorageFolder` POSTs. +Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/).
@@ -20515,7 +24154,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.folders.meta_post_retrieve() +client.knowledgebase.field_mapping.target_fields_retrieve() ``` @@ -20543,8 +24182,8 @@ client.filestorage.folders.meta_post_retrieve()
-## Filestorage GenerateKey -
client.filestorage.generate_key.create(...) +## Knowledgebase GenerateKey +
client.knowledgebase.generate_key.create(...)
@@ -20577,7 +24216,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.generate_key.create( +client.knowledgebase.generate_key.create( name="Remote Deployment Key 1", ) @@ -20615,8 +24254,8 @@ client.filestorage.generate_key.create(
-## Filestorage Groups -
client.filestorage.groups.list(...) +## Knowledgebase Groups +
client.knowledgebase.groups.list(...)
@@ -20649,7 +24288,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.groups.list( +client.knowledgebase.groups.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -20691,7 +24330,7 @@ client.filestorage.groups.list(
-**expand:** `typing.Optional[typing.Literal["child_groups"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**expand:** `typing.Optional[GroupsListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -20767,7 +24406,7 @@ client.filestorage.groups.list(
-
client.filestorage.groups.retrieve(...) +
client.knowledgebase.groups.retrieve(...)
@@ -20800,7 +24439,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.groups.retrieve( +client.knowledgebase.groups.retrieve( id="id", ) @@ -20826,7 +24465,7 @@ client.filestorage.groups.retrieve(
-**expand:** `typing.Optional[typing.Literal["child_groups"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**expand:** `typing.Optional[GroupsRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -20862,8 +24501,8 @@ client.filestorage.groups.retrieve(
-## Filestorage Issues -
client.filestorage.issues.list(...) +## Knowledgebase Issues +
client.knowledgebase.issues.list(...)
@@ -20896,7 +24535,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.issues.list( +client.knowledgebase.issues.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -21043,7 +24682,7 @@ Status of the issue. Options: ('ONGOING', 'RESOLVED')
-
client.filestorage.issues.retrieve(...) +
client.knowledgebase.issues.retrieve(...)
@@ -21076,7 +24715,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.issues.retrieve( +client.knowledgebase.issues.retrieve( id="id", ) @@ -21114,8 +24753,8 @@ client.filestorage.issues.retrieve(
-## Filestorage LinkToken -
client.filestorage.link_token.create(...) +## Knowledgebase LinkToken +
client.knowledgebase.link_token.create(...)
@@ -21143,13 +24782,13 @@ Creates a link token to be used when linking a new end user. ```python from merge import Merge -from merge.resources.filestorage import CategoriesEnum +from merge.resources.knowledgebase import CategoriesEnum client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.link_token.create( +client.knowledgebase.link_token.create( end_user_email_address="example@gmail.com", end_user_organization_name="Test Organization", end_user_origin_id="12345", @@ -21257,7 +24896,7 @@ client.filestorage.link_token.create(
-**language:** `typing.Optional[LanguageEnum]` +**language:** `typing.Optional[EndUserDetailsRequestLanguage]` The following subset of IETF language tags can be used to configure localization. @@ -21298,8 +24937,8 @@ The following subset of IETF language tags can be used to configure localization
-## Filestorage LinkedAccounts -
client.filestorage.linked_accounts.list(...) +## Knowledgebase LinkedAccounts +
client.knowledgebase.linked_accounts.list(...)
@@ -21332,7 +24971,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.linked_accounts.list( +client.knowledgebase.linked_accounts.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -21352,7 +24991,7 @@ client.filestorage.linked_accounts.list( **category:** `typing.Optional[LinkedAccountsListRequestCategory]` -Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing` +Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `knowledgebase`, `mktg`, `ticketing` * `hris` - hris * `ats` - ats @@ -21361,6 +25000,7 @@ Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing` * `crm` - crm * `mktg` - mktg * `filestorage` - filestorage +* `knowledgebase` - knowledgebase
@@ -21476,8 +25116,8 @@ Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing`
-## Filestorage Passthrough -
client.filestorage.passthrough.create(...) +## Knowledgebase Passthrough +
client.knowledgebase.passthrough.create(...)
@@ -21505,13 +25145,13 @@ Pull data from an endpoint not currently supported by Merge. ```python from merge import Merge -from merge.resources.filestorage import DataPassthroughRequest, MethodEnum +from merge.resources.knowledgebase import DataPassthroughRequest, MethodEnum client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.passthrough.create( +client.knowledgebase.passthrough.create( request=DataPassthroughRequest( method=MethodEnum.GET, path="/scooters", @@ -21552,8 +25192,8 @@ client.filestorage.passthrough.create(
-## Filestorage RegenerateKey -
client.filestorage.regenerate_key.create(...) +## Knowledgebase RegenerateKey +
client.knowledgebase.regenerate_key.create(...)
@@ -21586,7 +25226,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.regenerate_key.create( +client.knowledgebase.regenerate_key.create( name="Remote Deployment Key 1", ) @@ -21624,8 +25264,8 @@ client.filestorage.regenerate_key.create(
-## Filestorage SyncStatus -
client.filestorage.sync_status.list(...) +## Knowledgebase SyncStatus +
client.knowledgebase.sync_status.list(...)
@@ -21658,7 +25298,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.sync_status.list( +client.knowledgebase.sync_status.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -21704,8 +25344,8 @@ client.filestorage.sync_status.list(
-## Filestorage ForceResync -
client.filestorage.force_resync.sync_status_resync_create() +## Knowledgebase ForceResync +
client.knowledgebase.force_resync.sync_status_resync_create()
@@ -21738,7 +25378,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.force_resync.sync_status_resync_create() +client.knowledgebase.force_resync.sync_status_resync_create() ```
@@ -21766,8 +25406,8 @@ client.filestorage.force_resync.sync_status_resync_create()
-## Filestorage Users -
client.filestorage.users.list(...) +## Knowledgebase Users +
client.knowledgebase.users.list(...)
@@ -21800,7 +25440,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.users.list( +client.knowledgebase.users.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -21866,14 +25506,6 @@ client.filestorage.users.list(
-**is_me:** `typing.Optional[str]` — If provided, will only return the user object for requestor. - -
-
- -
-
- **modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned.
@@ -21918,7 +25550,7 @@ client.filestorage.users.list(
-
client.filestorage.users.retrieve(...) +
client.knowledgebase.users.retrieve(...)
@@ -21951,7 +25583,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.users.retrieve( +client.knowledgebase.users.retrieve( id="id", ) @@ -22005,8 +25637,8 @@ client.filestorage.users.retrieve(
-## Filestorage WebhookReceivers -
client.filestorage.webhook_receivers.list() +## Knowledgebase WebhookReceivers +
client.knowledgebase.webhook_receivers.list()
@@ -22039,7 +25671,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.webhook_receivers.list() +client.knowledgebase.webhook_receivers.list() ```
@@ -22067,7 +25699,7 @@ client.filestorage.webhook_receivers.list()
-
client.filestorage.webhook_receivers.create(...) +
client.knowledgebase.webhook_receivers.create(...)
@@ -22100,7 +25732,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.filestorage.webhook_receivers.create( +client.knowledgebase.webhook_receivers.create( event="event", is_active=True, ) @@ -22155,8 +25787,8 @@ client.filestorage.webhook_receivers.create(
-## Ticketing AccountDetails -
client.ticketing.account_details.retrieve() +## Hris AccountDetails +
client.hris.account_details.retrieve()
@@ -22189,7 +25821,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.account_details.retrieve() +client.hris.account_details.retrieve() ```
@@ -22217,8 +25849,8 @@ client.ticketing.account_details.retrieve()
-## Ticketing AccountToken -
client.ticketing.account_token.retrieve(...) +## Hris AccountToken +
client.hris.account_token.retrieve(...)
@@ -22251,7 +25883,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.account_token.retrieve( +client.hris.account_token.retrieve( public_token="public_token", ) @@ -22289,8 +25921,8 @@ client.ticketing.account_token.retrieve(
-## Ticketing Accounts -
client.ticketing.accounts.list(...) +## Hris AsyncPassthrough +
client.hris.async_passthrough.create(...)
@@ -22302,7 +25934,7 @@ client.ticketing.account_token.retrieve(
-Returns a list of `Account` objects. +Asynchronously pull data from an endpoint not currently supported by Merge.
@@ -22318,13 +25950,17 @@ Returns a list of `Account` objects. ```python from merge import Merge +from merge.resources.hris import DataPassthroughRequest, MethodEnum client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.accounts.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +client.hris.async_passthrough.create( + request=DataPassthroughRequest( + method=MethodEnum.GET, + path="/scooters", + ), ) ``` @@ -22341,7 +25977,7 @@ client.ticketing.accounts.list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. +**request:** `DataPassthroughRequest`
@@ -22349,71 +25985,70 @@ client.ticketing.accounts.list(
-**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**cursor:** `typing.Optional[str]` — The pagination cursor value. -
+
+
client.hris.async_passthrough.retrieve(...)
-**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/). - -
-
+#### 📝 Description
-**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). - +Retrieves data from earlier async-passthrough POST request +
+
+#### 🔌 Usage +
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. - -
-
-
-**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. - +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.hris.async_passthrough.retrieve( + async_passthrough_receipt_id="async_passthrough_receipt_id", +) + +```
+ + + +#### ⚙️ Parameters
-**page_size:** `typing.Optional[int]` — Number of results to return per page. - -
-
-
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. +**async_passthrough_receipt_id:** `str`
@@ -22433,7 +26068,8 @@ client.ticketing.accounts.list(
-
client.ticketing.accounts.retrieve(...) +## Hris AuditTrail +
client.hris.audit_trail.list(...)
@@ -22445,7 +26081,7 @@ client.ticketing.accounts.list(
-Returns an `Account` object with the given `id`. +Gets a list of audit trail events.
@@ -22466,8 +26102,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.accounts.retrieve( - id="id", +client.hris.audit_trail.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) ``` @@ -22484,7 +26120,7 @@ client.ticketing.accounts.retrieve(
-**id:** `str` +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -22492,7 +26128,7 @@ client.ticketing.accounts.retrieve(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**end_date:** `typing.Optional[str]` — If included, will only include audit trail events that occurred before this time
@@ -22500,7 +26136,7 @@ client.ticketing.accounts.retrieve(
-**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). +**event_type:** `typing.Optional[str]` — If included, will only include events with the given event type. Possible values include: `CREATED_REMOTE_PRODUCTION_API_KEY`, `DELETED_REMOTE_PRODUCTION_API_KEY`, `CREATED_TEST_API_KEY`, `DELETED_TEST_API_KEY`, `REGENERATED_PRODUCTION_API_KEY`, `REGENERATED_WEBHOOK_SIGNATURE`, `INVITED_USER`, `TWO_FACTOR_AUTH_ENABLED`, `TWO_FACTOR_AUTH_DISABLED`, `DELETED_LINKED_ACCOUNT`, `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT`, `CREATED_DESTINATION`, `DELETED_DESTINATION`, `CHANGED_DESTINATION`, `CHANGED_SCOPES`, `CHANGED_PERSONAL_INFORMATION`, `CHANGED_ORGANIZATION_SETTINGS`, `ENABLED_INTEGRATION`, `DISABLED_INTEGRATION`, `ENABLED_CATEGORY`, `DISABLED_CATEGORY`, `CHANGED_PASSWORD`, `RESET_PASSWORD`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `CREATED_INTEGRATION_WIDE_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_FIELD_MAPPING`, `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING`, `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING`, `DELETED_INTEGRATION_WIDE_FIELD_MAPPING`, `DELETED_LINKED_ACCOUNT_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `FORCED_LINKED_ACCOUNT_RESYNC`, `MUTED_ISSUE`, `GENERATED_MAGIC_LINK`, `ENABLED_MERGE_WEBHOOK`, `DISABLED_MERGE_WEBHOOK`, `MERGE_WEBHOOK_TARGET_CHANGED`, `END_USER_CREDENTIALS_ACCESSED`
@@ -22508,75 +26144,23 @@ client.ticketing.accounts.retrieve(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**page_size:** `typing.Optional[int]` — Number of results to return per page.
- -
- - - - -
- -## Ticketing AsyncPassthrough -
client.ticketing.async_passthrough.create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Asynchronously pull data from an endpoint not currently supported by Merge. -
-
-
-
- -#### 🔌 Usage
-
-
- -```python -from merge import Merge -from merge.resources.ticketing import DataPassthroughRequest, MethodEnum - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.ticketing.async_passthrough.create( - request=DataPassthroughRequest( - method=MethodEnum.GET, - path="/scooters", - ), -) - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
+**start_date:** `typing.Optional[str]` — If included, will only include audit trail events that occurred after this time + +
+
-**request:** `DataPassthroughRequest` +**user_email:** `typing.Optional[str]` — If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email.
@@ -22596,7 +26180,8 @@ client.ticketing.async_passthrough.create(
-
client.ticketing.async_passthrough.retrieve(...) +## Hris AvailableActions +
client.hris.available_actions.retrieve()
@@ -22608,7 +26193,7 @@ client.ticketing.async_passthrough.create(
-Retrieves data from earlier async-passthrough POST request +Returns a list of models and actions available for an account.
@@ -22629,9 +26214,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.async_passthrough.retrieve( - async_passthrough_receipt_id="async_passthrough_receipt_id", -) +client.hris.available_actions.retrieve() ``` @@ -22647,14 +26230,6 @@ client.ticketing.async_passthrough.retrieve(
-**async_passthrough_receipt_id:** `str` - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -22667,8 +26242,8 @@ client.ticketing.async_passthrough.retrieve(
-## Ticketing Attachments -
client.ticketing.attachments.list(...) +## Hris BankInfo +
client.hris.bank_info.list(...)
@@ -22680,7 +26255,7 @@ client.ticketing.async_passthrough.retrieve(
-Returns a list of `Attachment` objects. +Returns a list of `BankInfo` objects.
@@ -22701,7 +26276,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.attachments.list( +client.hris.bank_info.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -22719,15 +26294,12 @@ client.ticketing.attachments.list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. - -
-
+**account_type:** `typing.Optional[BankInfoListRequestAccountType]` -
-
+If provided, will only return BankInfo's with this account type. Options: ('SAVINGS', 'CHECKING') -**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +* `SAVINGS` - SAVINGS +* `CHECKING` - CHECKING
@@ -22735,7 +26307,7 @@ client.ticketing.attachments.list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**bank_name:** `typing.Optional[str]` — If provided, will only return BankInfo's with this bank name.
@@ -22743,7 +26315,7 @@ client.ticketing.attachments.list(
-**expand:** `typing.Optional[typing.Literal["ticket"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
@@ -22751,7 +26323,7 @@ client.ticketing.attachments.list(
-**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/). +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime.
@@ -22759,7 +26331,7 @@ client.ticketing.attachments.list(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -22767,7 +26339,7 @@ client.ticketing.attachments.list(
-**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). +**employee_id:** `typing.Optional[str]` — If provided, will only return bank accounts for this employee.
@@ -22775,7 +26347,7 @@ client.ticketing.attachments.list(
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +**expand:** `typing.Optional[typing.Literal["employee"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -22783,7 +26355,7 @@ client.ticketing.attachments.list(
-**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. +**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/).
@@ -22791,7 +26363,7 @@ client.ticketing.attachments.list(
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -22799,7 +26371,7 @@ client.ticketing.attachments.list(
-**remote_created_after:** `typing.Optional[dt.datetime]` — If provided, will only return attachments created in the third party platform after this datetime. +**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).
@@ -22807,7 +26379,7 @@ client.ticketing.attachments.list(
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned.
@@ -22815,7 +26387,7 @@ client.ticketing.attachments.list(
-**ticket_id:** `typing.Optional[str]` — If provided, will only return comments for this ticket. +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned.
@@ -22823,71 +26395,23 @@ client.ticketing.attachments.list(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**order_by:** `typing.Optional[BankInfoListRequestOrderBy]` — Overrides the default ordering for this endpoint. Possible values include: remote_created_at, -remote_created_at.
- -
- - - - -
- -
client.ticketing.attachments.create(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Creates an `Attachment` object with the given values. -
-
-
-
- -#### 🔌 Usage - -
-
-```python -from merge import Merge -from merge.resources.ticketing import AttachmentRequest - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.ticketing.attachments.create( - model=AttachmentRequest(), -) - -``` -
-
+**page_size:** `typing.Optional[int]` — Number of results to return per page. +
-#### ⚙️ Parameters - -
-
-
-**model:** `AttachmentRequest` +**remote_fields:** `typing.Optional[typing.Literal["account_type"]]` — Deprecated. Use show_enum_origins.
@@ -22895,7 +26419,7 @@ client.ticketing.attachments.create(
-**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -22903,7 +26427,7 @@ client.ticketing.attachments.create(
-**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. +**show_enum_origins:** `typing.Optional[typing.Literal["account_type"]]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter)
@@ -22923,7 +26447,7 @@ client.ticketing.attachments.create(
-
client.ticketing.attachments.retrieve(...) +
client.hris.bank_info.retrieve(...)
@@ -22935,7 +26459,7 @@ client.ticketing.attachments.create(
-Returns an `Attachment` object with the given `id`. +Returns a `BankInfo` object with the given `id`.
@@ -22956,7 +26480,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.attachments.retrieve( +client.hris.bank_info.retrieve( id="id", ) @@ -22982,7 +26506,7 @@ client.ticketing.attachments.retrieve(
-**expand:** `typing.Optional[typing.Literal["ticket"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**expand:** `typing.Optional[typing.Literal["employee"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -23006,6 +26530,22 @@ client.ticketing.attachments.retrieve(
+**remote_fields:** `typing.Optional[typing.Literal["account_type"]]` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**show_enum_origins:** `typing.Optional[typing.Literal["account_type"]]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -23018,7 +26558,8 @@ client.ticketing.attachments.retrieve(
-
client.ticketing.attachments.meta_post_retrieve() +## Hris Benefits +
client.hris.benefits.list(...)
@@ -23030,7 +26571,7 @@ client.ticketing.attachments.retrieve(
-Returns metadata for `TicketingAttachment` POSTs. +Returns a list of `Benefit` objects.
@@ -23051,7 +26592,9 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.attachments.meta_post_retrieve() +client.hris.benefits.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +) ``` @@ -23067,71 +26610,55 @@ client.ticketing.attachments.meta_post_retrieve()
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
- -
+
+
+**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +
-
-## Ticketing AuditTrail -
client.ticketing.audit_trail.list(...)
-#### 📝 Description - -
-
+**cursor:** `typing.Optional[str]` — The pagination cursor value. + +
+
-Gets a list of audit trail events. -
-
+**employee_id:** `typing.Optional[str]` — If provided, will return the benefits associated with the employee. +
-#### 🔌 Usage - -
-
-
-```python -from merge import Merge - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.ticketing.audit_trail.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", -) - -``` -
-
+**expand:** `typing.Optional[typing.Literal["employee"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +
-#### ⚙️ Parameters -
+**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/). + +
+
+
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -23139,7 +26666,7 @@ client.ticketing.audit_trail.list(
-**end_date:** `typing.Optional[str]` — If included, will only include audit trail events that occurred before this time +**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).
@@ -23147,7 +26674,7 @@ client.ticketing.audit_trail.list(
-**event_type:** `typing.Optional[str]` — If included, will only include events with the given event type. Possible values include: `CREATED_REMOTE_PRODUCTION_API_KEY`, `DELETED_REMOTE_PRODUCTION_API_KEY`, `CREATED_TEST_API_KEY`, `DELETED_TEST_API_KEY`, `REGENERATED_PRODUCTION_API_KEY`, `REGENERATED_WEBHOOK_SIGNATURE`, `INVITED_USER`, `TWO_FACTOR_AUTH_ENABLED`, `TWO_FACTOR_AUTH_DISABLED`, `DELETED_LINKED_ACCOUNT`, `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT`, `CREATED_DESTINATION`, `DELETED_DESTINATION`, `CHANGED_DESTINATION`, `CHANGED_SCOPES`, `CHANGED_PERSONAL_INFORMATION`, `CHANGED_ORGANIZATION_SETTINGS`, `ENABLED_INTEGRATION`, `DISABLED_INTEGRATION`, `ENABLED_CATEGORY`, `DISABLED_CATEGORY`, `CHANGED_PASSWORD`, `RESET_PASSWORD`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `CREATED_INTEGRATION_WIDE_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_FIELD_MAPPING`, `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING`, `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING`, `DELETED_INTEGRATION_WIDE_FIELD_MAPPING`, `DELETED_LINKED_ACCOUNT_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `FORCED_LINKED_ACCOUNT_RESYNC`, `MUTED_ISSUE`, `GENERATED_MAGIC_LINK`, `ENABLED_MERGE_WEBHOOK`, `DISABLED_MERGE_WEBHOOK`, `MERGE_WEBHOOK_TARGET_CHANGED`, `END_USER_CREDENTIALS_ACCESSED` +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned.
@@ -23155,7 +26682,7 @@ client.ticketing.audit_trail.list(
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned.
@@ -23163,7 +26690,7 @@ client.ticketing.audit_trail.list(
-**start_date:** `typing.Optional[str]` — If included, will only include audit trail events that occurred after this time +**page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -23171,7 +26698,7 @@ client.ticketing.audit_trail.list(
-**user_email:** `typing.Optional[str]` — If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email. +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -23191,8 +26718,7 @@ client.ticketing.audit_trail.list(
-## Ticketing AvailableActions -
client.ticketing.available_actions.retrieve() +
client.hris.benefits.retrieve(...)
@@ -23204,7 +26730,7 @@ client.ticketing.audit_trail.list(
-Returns a list of models and actions available for an account. +Returns a `Benefit` object with the given `id`.
@@ -23225,7 +26751,9 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.available_actions.retrieve() +client.hris.benefits.retrieve( + id="id", +) ``` @@ -23241,6 +26769,38 @@ client.ticketing.available_actions.retrieve()
+**id:** `str` + +
+
+ +
+
+ +**expand:** `typing.Optional[typing.Literal["employee"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**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). + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -23253,8 +26813,8 @@ client.ticketing.available_actions.retrieve()
-## Ticketing Collections -
client.ticketing.collections.list(...) +## Hris Companies +
client.hris.companies.list(...)
@@ -23266,7 +26826,7 @@ client.ticketing.available_actions.retrieve()
-Returns a list of `Collection` objects. +Returns a list of `Company` objects.
@@ -23287,7 +26847,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.collections.list( +client.hris.companies.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -23305,7 +26865,7 @@ client.ticketing.collections.list(
-**collection_type:** `typing.Optional[str]` — If provided, will only return collections of the given type. +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
@@ -23313,7 +26873,7 @@ client.ticketing.collections.list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime.
@@ -23321,7 +26881,7 @@ client.ticketing.collections.list(
-**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -23329,7 +26889,7 @@ client.ticketing.collections.list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**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/).
@@ -23337,7 +26897,7 @@ client.ticketing.collections.list(
-**expand:** `typing.Optional[typing.Literal["parent_collection"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -23345,7 +26905,7 @@ client.ticketing.collections.list(
-**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_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).
@@ -23353,7 +26913,7 @@ client.ticketing.collections.list(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned.
@@ -23361,7 +26921,7 @@ client.ticketing.collections.list(
-**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). +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned.
@@ -23369,7 +26929,7 @@ client.ticketing.collections.list(
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +**page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -23377,7 +26937,7 @@ client.ticketing.collections.list(
-**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -23385,31 +26945,70 @@ client.ticketing.collections.list(
-**name:** `typing.Optional[str]` — If provided, will only return collections with this name. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
+ + + + +
+
client.hris.companies.retrieve(...)
-**page_size:** `typing.Optional[int]` — Number of results to return per page. - +#### 📝 Description + +
+
+ +
+
+ +Returns a `Company` object with the given `id`. +
+
+#### 🔌 Usage +
-**parent_collection_id:** `typing.Optional[str]` — If provided, will only return collections whose parent collection matches the given id. - +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.hris.companies.retrieve( + id="id", +) + +```
+
+
+ +#### ⚙️ Parameters
-**remote_fields:** `typing.Optional[typing.Literal["collection_type"]]` — Deprecated. Use show_enum_origins. +
+
+ +**id:** `str`
@@ -23417,7 +27016,7 @@ client.ticketing.collections.list(
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -23425,7 +27024,7 @@ client.ticketing.collections.list(
-**show_enum_origins:** `typing.Optional[typing.Literal["collection_type"]]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) +**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).
@@ -23445,7 +27044,8 @@ client.ticketing.collections.list(
-
client.ticketing.collections.viewers_list(...) +## Hris Scopes +
client.hris.scopes.default_scopes_retrieve()
@@ -23457,7 +27057,7 @@ client.ticketing.collections.list(
-Returns a list of `Viewer` objects that point to a User id or Team id that is either an assignee or viewer on a `Collection` with the given id. [Learn more.](https://help.merge.dev/en/articles/10333658-ticketing-access-control-list-acls) +Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes).
@@ -23478,10 +27078,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.collections.viewers_list( - collection_id="collection_id", - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", -) +client.hris.scopes.default_scopes_retrieve() ``` @@ -23497,59 +27094,64 @@ client.ticketing.collections.viewers_list(
-**collection_id:** `str` +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**cursor:** `typing.Optional[str]` — The pagination cursor value. -
+
+
client.hris.scopes.linked_account_scopes_retrieve()
-**expand:** `typing.Optional[CollectionsViewersListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - -
-
+#### 📝 Description
-**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. - +Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). +
+
+#### 🔌 Usage +
-**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. - +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.hris.scopes.linked_account_scopes_retrieve() + +``` +
+
+#### ⚙️ Parameters + +
+
+
@@ -23565,7 +27167,7 @@ client.ticketing.collections.viewers_list(
-
client.ticketing.collections.retrieve(...) +
client.hris.scopes.linked_account_scopes_create(...)
@@ -23577,7 +27179,7 @@ client.ticketing.collections.viewers_list(
-Returns a `Collection` object with the given `id`. +Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes)
@@ -23593,13 +27195,42 @@ Returns a `Collection` object with the given `id`. ```python from merge import Merge +from merge.resources.hris import ( + FieldPermissionDeserializerRequest, + IndividualCommonModelScopeDeserializerRequest, + ModelPermissionDeserializerRequest, +) client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.collections.retrieve( - id="id", +client.hris.scopes.linked_account_scopes_create( + common_models=[ + IndividualCommonModelScopeDeserializerRequest( + model_name="Employee", + model_permissions={ + "READ": ModelPermissionDeserializerRequest( + is_enabled=True, + ), + "WRITE": ModelPermissionDeserializerRequest( + is_enabled=False, + ), + }, + field_permissions=FieldPermissionDeserializerRequest( + enabled_fields=["avatar", "home_location"], + disabled_fields=["work_location"], + ), + ), + IndividualCommonModelScopeDeserializerRequest( + model_name="Benefit", + model_permissions={ + "WRITE": ModelPermissionDeserializerRequest( + is_enabled=False, + ) + }, + ), + ], ) ``` @@ -23616,7 +27247,7 @@ client.ticketing.collections.retrieve(
-**id:** `str` +**common_models:** `typing.Sequence[IndividualCommonModelScopeDeserializerRequest]` — The common models you want to update the scopes for
@@ -23624,43 +27255,65 @@ client.ticketing.collections.retrieve(
-**expand:** `typing.Optional[typing.Literal["parent_collection"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. -
+
+## Hris DeleteAccount +
client.hris.delete_account.delete()
-**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). - -
-
+#### 📝 Description
-**remote_fields:** `typing.Optional[typing.Literal["collection_type"]]` — Deprecated. Use show_enum_origins. - +
+
+ +Delete a linked account. +
+
+#### 🔌 Usage +
-**show_enum_origins:** `typing.Optional[typing.Literal["collection_type"]]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) - +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.hris.delete_account.delete() + +``` +
+
+#### ⚙️ Parameters + +
+
+
@@ -23676,8 +27329,8 @@ client.ticketing.collections.retrieve(
-## Ticketing Comments -
client.ticketing.comments.list(...) +## Hris Dependents +
client.hris.dependents.list(...)
@@ -23689,7 +27342,7 @@ client.ticketing.collections.retrieve(
-Returns a list of `Comment` objects. +Returns a list of `Dependent` objects.
@@ -23710,7 +27363,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.comments.list( +client.hris.dependents.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -23752,15 +27405,7 @@ client.ticketing.comments.list(
-**expand:** `typing.Optional[CommentsListRequestExpand]` — 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/). +**employee_id:** `typing.Optional[str]` — If provided, will only return dependents for this employee.
@@ -23768,7 +27413,7 @@ client.ticketing.comments.list(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**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/).
@@ -23776,7 +27421,7 @@ client.ticketing.comments.list(
-**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). +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -23784,7 +27429,7 @@ client.ticketing.comments.list(
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +**include_sensitive_fields:** `typing.Optional[bool]` — Whether to include sensitive fields (such as social security numbers) in the response.
@@ -23792,7 +27437,7 @@ client.ticketing.comments.list(
-**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. +**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).
@@ -23800,7 +27445,7 @@ client.ticketing.comments.list(
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned.
@@ -23808,7 +27453,7 @@ client.ticketing.comments.list(
-**remote_created_after:** `typing.Optional[dt.datetime]` — If provided, will only return Comments created in the third party platform after this datetime. +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned.
@@ -23816,7 +27461,7 @@ client.ticketing.comments.list(
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. +**page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -23824,7 +27469,7 @@ client.ticketing.comments.list(
-**ticket_id:** `typing.Optional[str]` — If provided, will only return comments for this ticket. +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -23844,7 +27489,7 @@ client.ticketing.comments.list(
-
client.ticketing.comments.create(...) +
client.hris.dependents.retrieve(...)
@@ -23856,7 +27501,7 @@ client.ticketing.comments.list(
-Creates a `Comment` object with the given values. +Returns a `Dependent` object with the given `id`.
@@ -23872,14 +27517,13 @@ Creates a `Comment` object with the given values. ```python from merge import Merge -from merge.resources.ticketing import CommentRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.comments.create( - model=CommentRequest(), +client.hris.dependents.retrieve( + id="id", ) ``` @@ -23896,7 +27540,7 @@ client.ticketing.comments.create(
-**model:** `CommentRequest` +**id:** `str`
@@ -23904,7 +27548,7 @@ client.ticketing.comments.create(
-**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -23912,7 +27556,15 @@ client.ticketing.comments.create(
-**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. +**include_sensitive_fields:** `typing.Optional[bool]` — Whether to include sensitive fields (such as social security numbers) in the response. + +
+
+ +
+
+ +**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).
@@ -23932,7 +27584,8 @@ client.ticketing.comments.create(
-
client.ticketing.comments.retrieve(...) +## Hris EmployeePayrollRuns +
client.hris.employee_payroll_runs.list(...)
@@ -23944,7 +27597,7 @@ client.ticketing.comments.create(
-Returns a `Comment` object with the given `id`. +Returns a list of `EmployeePayrollRun` objects.
@@ -23965,8 +27618,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.comments.retrieve( - id="id", +client.hris.employee_payroll_runs.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) ``` @@ -23983,7 +27636,7 @@ client.ticketing.comments.retrieve(
-**id:** `str` +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
@@ -23991,7 +27644,7 @@ client.ticketing.comments.retrieve(
-**expand:** `typing.Optional[CommentsRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime.
@@ -23999,7 +27652,7 @@ client.ticketing.comments.retrieve(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -24007,7 +27660,7 @@ client.ticketing.comments.retrieve(
-**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). +**employee_id:** `typing.Optional[str]` — If provided, will only return employee payroll runs for this employee.
@@ -24015,64 +27668,107 @@ client.ticketing.comments.retrieve(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**ended_after:** `typing.Optional[dt.datetime]` — If provided, will only return employee payroll runs ended after this datetime.
+ +
+
+ +**ended_before:** `typing.Optional[dt.datetime]` — If provided, will only return employee payroll runs ended before this datetime. +
+
+
+**expand:** `typing.Optional[EmployeePayrollRunsListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +
-
-
client.ticketing.comments.meta_post_retrieve()
-#### 📝 Description +**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. + +
+
+
-Returns metadata for `Comment` POSTs. +**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). +
+ +
+
+ +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +
-#### 🔌 Usage -
+**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+
-```python -from merge import Merge +**page_size:** `typing.Optional[int]` — Number of results to return per page. + +
+
-client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.ticketing.comments.meta_post_retrieve() +
+
-``` +**payroll_run_id:** `typing.Optional[str]` — If provided, will only return employee payroll runs for this employee. +
+ +
+
+ +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. +
-#### ⚙️ Parameters +
+
+ +**started_after:** `typing.Optional[dt.datetime]` — If provided, will only return employee payroll runs started after this datetime. + +
+
+**started_before:** `typing.Optional[dt.datetime]` — If provided, will only return employee payroll runs started before this datetime. + +
+
+
@@ -24088,8 +27784,7 @@ client.ticketing.comments.meta_post_retrieve()
-## Ticketing Contacts -
client.ticketing.contacts.list(...) +
client.hris.employee_payroll_runs.retrieve(...)
@@ -24101,7 +27796,7 @@ client.ticketing.comments.meta_post_retrieve()
-Returns a list of `Contact` objects. +Returns an `EmployeePayrollRun` object with the given `id`.
@@ -24122,8 +27817,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.contacts.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +client.hris.employee_payroll_runs.retrieve( + id="id", ) ``` @@ -24140,7 +27835,7 @@ client.ticketing.contacts.list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. +**id:** `str`
@@ -24148,7 +27843,7 @@ client.ticketing.contacts.list(
-**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +**expand:** `typing.Optional[EmployeePayrollRunsRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -24156,7 +27851,7 @@ client.ticketing.contacts.list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -24164,7 +27859,7 @@ client.ticketing.contacts.list(
-**email_address:** `typing.Optional[str]` — If provided, will only return Contacts that match this email. +**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).
@@ -24172,39 +27867,71 @@ client.ticketing.contacts.list(
-**expand:** `typing.Optional[typing.Literal["account"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**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/). -
+
+## Hris Employees +
client.hris.employees.list(...)
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. - +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Employee` objects. +
+
+#### 🔌 Usage +
-**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). - +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.hris.employees.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +) + +``` +
+
+#### ⚙️ Parameters +
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +
+
+ +**company_id:** `typing.Optional[str]` — If provided, will only return employees for this company.
@@ -24212,7 +27939,7 @@ client.ticketing.contacts.list(
-**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
@@ -24220,7 +27947,7 @@ client.ticketing.contacts.list(
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime.
@@ -24228,7 +27955,7 @@ client.ticketing.contacts.list(
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -24236,71 +27963,69 @@ client.ticketing.contacts.list(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**display_full_name:** `typing.Optional[str]` — If provided, will only return employees with this display name.
-
-
+
+
+**employee_number:** `typing.Optional[str]` — If provided, will only return employees with this employee number. +
-
-
client.ticketing.contacts.create(...)
-#### 📝 Description +**employment_status:** `typing.Optional[EmployeesListRequestEmploymentStatus]` -
-
+If provided, will only return employees with this employment status. + +* `ACTIVE` - ACTIVE +* `PENDING` - PENDING +* `INACTIVE` - INACTIVE + +
+
-Creates a `Contact` object with the given values. -
-
+**employment_type:** `typing.Optional[str]` — If provided, will only return employees that have an employment of the specified employment_type. +
-#### 🔌 Usage -
+**expand:** `typing.Optional[EmployeesListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+
-```python -from merge import Merge -from merge.resources.ticketing import ContactRequest - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.ticketing.contacts.create( - model=ContactRequest(), -) - -``` -
-
+**first_name:** `typing.Optional[str]` — If provided, will only return employees with this first name. + -#### ⚙️ Parameters -
+**groups:** `typing.Optional[str]` — If provided, will only return employees matching the group ids; multiple groups can be separated by commas. + +
+
+
-**model:** `ContactRequest` +**home_location_id:** `typing.Optional[str]` — If provided, will only return employees for this home location.
@@ -24308,7 +28033,7 @@ client.ticketing.contacts.create(
-**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. +**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/).
@@ -24316,7 +28041,7 @@ client.ticketing.contacts.create(
-**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -24324,70 +28049,71 @@ client.ticketing.contacts.create(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**include_sensitive_fields:** `typing.Optional[bool]` — Whether to include sensitive fields (such as social security numbers) in the response.
- - +
+
+**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). +
-
-
client.ticketing.contacts.retrieve(...)
-#### 📝 Description +**job_title:** `typing.Optional[str]` — If provided, will only return employees that have an employment of the specified job_title. + +
+
+**last_name:** `typing.Optional[str]` — If provided, will only return employees with this last name. + +
+
+
-Returns a `Contact` object with the given `id`. -
-
+**manager_id:** `typing.Optional[str]` — If provided, will only return employees for this manager. + -#### 🔌 Usage -
+**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+
-```python -from merge import Merge - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.ticketing.contacts.retrieve( - id="id", -) - -``` -
-
+**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. + -#### ⚙️ Parameters -
+**page_size:** `typing.Optional[int]` — Number of results to return per page. + +
+
+
-**id:** `str` +**pay_group_id:** `typing.Optional[str]` — If provided, will only return employees for this pay group
@@ -24395,7 +28121,7 @@ client.ticketing.contacts.retrieve(
-**expand:** `typing.Optional[typing.Literal["account"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**personal_email:** `typing.Optional[str]` — If provided, will only return Employees with this personal email
@@ -24403,7 +28129,7 @@ client.ticketing.contacts.retrieve(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**remote_fields:** `typing.Optional[EmployeesListRequestRemoteFields]` — Deprecated. Use show_enum_origins.
@@ -24411,7 +28137,7 @@ client.ticketing.contacts.retrieve(
-**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). +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -24419,64 +28145,67 @@ client.ticketing.contacts.retrieve(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**show_enum_origins:** `typing.Optional[EmployeesListRequestShowEnumOrigins]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter)
- - +
+
+**started_after:** `typing.Optional[dt.datetime]` — If provided, will only return employees that started after this datetime. +
-
-
client.ticketing.contacts.meta_post_retrieve()
-#### 📝 Description +**started_before:** `typing.Optional[dt.datetime]` — If provided, will only return employees that started before this datetime. + +
+
+**team_id:** `typing.Optional[str]` — If provided, will only return employees for this team. + +
+
+
-Returns metadata for `TicketingContact` POSTs. -
-
+**terminated_after:** `typing.Optional[dt.datetime]` — If provided, will only return employees that were terminated after this datetime. + -#### 🔌 Usage -
+**terminated_before:** `typing.Optional[dt.datetime]` — If provided, will only return employees that were terminated before this datetime. + +
+
+
-```python -from merge import Merge - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.ticketing.contacts.meta_post_retrieve() - -``` -
-
+**work_email:** `typing.Optional[str]` — If provided, will only return Employees with this work email + -#### ⚙️ Parameters -
+**work_location_id:** `typing.Optional[str]` — If provided, will only return employees for this location. + +
+
+
@@ -24492,8 +28221,7 @@ client.ticketing.contacts.meta_post_retrieve()
-## Ticketing Scopes -
client.ticketing.scopes.default_scopes_retrieve() +
client.hris.employees.create(...)
@@ -24505,7 +28233,7 @@ client.ticketing.contacts.meta_post_retrieve()
-Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). +Creates an `Employee` object with the given values.
@@ -24521,12 +28249,15 @@ Get the default permissions for Merge Common Models and fields across all Linked ```python from merge import Merge +from merge.resources.hris import EmployeeRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.scopes.default_scopes_retrieve() +client.hris.employees.create( + model=EmployeeRequest(), +) ``` @@ -24542,6 +28273,30 @@ client.ticketing.scopes.default_scopes_retrieve()
+**model:** `EmployeeRequest` + +
+
+ +
+
+ +**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -24554,7 +28309,7 @@ client.ticketing.scopes.default_scopes_retrieve()
-
client.ticketing.scopes.linked_account_scopes_retrieve() +
client.hris.employees.retrieve(...)
@@ -24566,7 +28321,7 @@ client.ticketing.scopes.default_scopes_retrieve()
-Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). +Returns an `Employee` object with the given `id`.
@@ -24587,7 +28342,9 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.scopes.linked_account_scopes_retrieve() +client.hris.employees.retrieve( + id="id", +) ``` @@ -24603,99 +28360,55 @@ client.ticketing.scopes.linked_account_scopes_retrieve()
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**id:** `str`
- -
+
+
+**expand:** `typing.Optional[EmployeesRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +
-
-
client.ticketing.scopes.linked_account_scopes_create(...)
-#### 📝 Description - -
-
+**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
-Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes) -
-
+**include_sensitive_fields:** `typing.Optional[bool]` — Whether to include sensitive fields (such as social security numbers) in the response. +
-#### 🔌 Usage -
-
-
- -```python -from merge import Merge -from merge.resources.ticketing import ( - FieldPermissionDeserializerRequest, - IndividualCommonModelScopeDeserializerRequest, - ModelPermissionDeserializerRequest, -) - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.ticketing.scopes.linked_account_scopes_create( - common_models=[ - IndividualCommonModelScopeDeserializerRequest( - model_name="Employee", - model_permissions={ - "READ": ModelPermissionDeserializerRequest( - is_enabled=True, - ), - "WRITE": ModelPermissionDeserializerRequest( - is_enabled=False, - ), - }, - field_permissions=FieldPermissionDeserializerRequest( - enabled_fields=["avatar", "home_location"], - disabled_fields=["work_location"], - ), - ), - IndividualCommonModelScopeDeserializerRequest( - model_name="Benefit", - model_permissions={ - "WRITE": ModelPermissionDeserializerRequest( - is_enabled=False, - ) - }, - ), - ], -) - -``` -
-
+**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). +
-#### ⚙️ Parameters -
+**remote_fields:** `typing.Optional[EmployeesRetrieveRequestRemoteFields]` — Deprecated. Use show_enum_origins. + +
+
+
-**common_models:** `typing.Sequence[IndividualCommonModelScopeDeserializerRequest]` — The common models you want to update the scopes for +**show_enum_origins:** `typing.Optional[EmployeesRetrieveRequestShowEnumOrigins]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter)
@@ -24714,9 +28427,8 @@ client.ticketing.scopes.linked_account_scopes_create(
- -## Ticketing DeleteAccount -
client.ticketing.delete_account.delete() + +
client.hris.employees.ignore_create(...)
@@ -24728,7 +28440,7 @@ client.ticketing.scopes.linked_account_scopes_create(
-Delete a linked account. +Ignores a specific row based on the `model_id` in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes.
@@ -24744,12 +28456,16 @@ Delete a linked account. ```python from merge import Merge +from merge.resources.hris import ReasonEnum client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.delete_account.delete() +client.hris.employees.ignore_create( + model_id="model_id", + reason=ReasonEnum.GENERAL_CUSTOMER_REQUEST, +) ``` @@ -24765,6 +28481,30 @@ client.ticketing.delete_account.delete()
+**model_id:** `str` + +
+
+ +
+
+ +**reason:** `IgnoreCommonModelRequestReason` + +
+
+ +
+
+ +**message:** `typing.Optional[str]` + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -24777,8 +28517,7 @@ client.ticketing.delete_account.delete()
-## Ticketing FieldMapping -
client.ticketing.field_mapping.field_mappings_retrieve(...) +
client.hris.employees.meta_post_retrieve()
@@ -24790,7 +28529,7 @@ client.ticketing.delete_account.delete()
-Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +Returns metadata for `Employee` POSTs.
@@ -24811,7 +28550,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.field_mapping.field_mappings_retrieve() +client.hris.employees.meta_post_retrieve() ``` @@ -24827,14 +28566,6 @@ client.ticketing.field_mapping.field_mappings_retrieve()
-**exclude_remote_field_metadata:** `typing.Optional[bool]` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -24847,7 +28578,8 @@ client.ticketing.field_mapping.field_mappings_retrieve()
-
client.ticketing.field_mapping.field_mappings_create(...) +## Hris EmployerBenefits +
client.hris.employer_benefits.list(...)
@@ -24859,7 +28591,7 @@ client.ticketing.field_mapping.field_mappings_retrieve()
-Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +Returns a list of `EmployerBenefit` objects.
@@ -24880,13 +28612,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.field_mapping.field_mappings_create( - target_field_name="example_target_field_name", - target_field_description="this is a example description of the target field", - remote_field_traversal_path=["example_remote_field"], - remote_method="GET", - remote_url_path="/example-url-path", - common_model_name="ExampleCommonModel", +client.hris.employer_benefits.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) ``` @@ -24903,7 +28630,7 @@ client.ticketing.field_mapping.field_mappings_create(
-**target_field_name:** `str` — The name of the target field you want this remote field to map to. +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
@@ -24911,7 +28638,7 @@ client.ticketing.field_mapping.field_mappings_create(
-**target_field_description:** `str` — The description of the target field you want this remote field to map to. +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime.
@@ -24919,7 +28646,7 @@ client.ticketing.field_mapping.field_mappings_create(
-**remote_field_traversal_path:** `typing.Sequence[typing.Optional[typing.Any]]` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -24927,7 +28654,7 @@ client.ticketing.field_mapping.field_mappings_create(
-**remote_method:** `str` — The method of the remote endpoint where the remote field is coming from. +**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/).
@@ -24935,7 +28662,7 @@ client.ticketing.field_mapping.field_mappings_create(
-**remote_url_path:** `str` — The path of the remote endpoint where the remote field is coming from. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -24943,7 +28670,7 @@ client.ticketing.field_mapping.field_mappings_create(
-**common_model_name:** `str` — The name of the Common Model that the remote field corresponds to in a given category. +**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).
@@ -24951,7 +28678,31 @@ client.ticketing.field_mapping.field_mappings_create(
-**exclude_remote_field_metadata:** `typing.Optional[bool]` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**page_size:** `typing.Optional[int]` — Number of results to return per page. + +
+
+ +
+
+ +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -24971,7 +28722,7 @@ client.ticketing.field_mapping.field_mappings_create(
-
client.ticketing.field_mapping.field_mappings_destroy(...) +
client.hris.employer_benefits.retrieve(...)
@@ -24983,7 +28734,7 @@ client.ticketing.field_mapping.field_mappings_create(
-Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +Returns an `EmployerBenefit` object with the given `id`.
@@ -25004,8 +28755,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.field_mapping.field_mappings_destroy( - field_mapping_id="field_mapping_id", +client.hris.employer_benefits.retrieve( + id="id", ) ``` @@ -25022,7 +28773,23 @@ client.ticketing.field_mapping.field_mappings_destroy(
-**field_mapping_id:** `str` +**id:** `str` + +
+
+ +
+
+ +**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).
@@ -25042,7 +28809,8 @@ client.ticketing.field_mapping.field_mappings_destroy(
-
client.ticketing.field_mapping.field_mappings_partial_update(...) +## Hris Employments +
client.hris.employments.list(...)
@@ -25054,7 +28822,7 @@ client.ticketing.field_mapping.field_mappings_destroy(
-Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +Returns a list of `Employment` objects.
@@ -25075,8 +28843,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.field_mapping.field_mappings_partial_update( - field_mapping_id="field_mapping_id", +client.hris.employments.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) ``` @@ -25093,7 +28861,7 @@ client.ticketing.field_mapping.field_mappings_partial_update(
-**field_mapping_id:** `str` +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
@@ -25101,7 +28869,7 @@ client.ticketing.field_mapping.field_mappings_partial_update(
-**remote_field_traversal_path:** `typing.Optional[typing.Sequence[typing.Optional[typing.Any]]]` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime.
@@ -25109,7 +28877,7 @@ client.ticketing.field_mapping.field_mappings_partial_update(
-**remote_method:** `typing.Optional[str]` — The method of the remote endpoint where the remote field is coming from. +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -25117,7 +28885,7 @@ client.ticketing.field_mapping.field_mappings_partial_update(
-**remote_url_path:** `typing.Optional[str]` — The path of the remote endpoint where the remote field is coming from. +**employee_id:** `typing.Optional[str]` — If provided, will only return employments for this employee.
@@ -25125,68 +28893,79 @@ client.ticketing.field_mapping.field_mappings_partial_update(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**expand:** `typing.Optional[EmploymentsListRequestExpand]` — 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/). +
-
-
client.ticketing.field_mapping.remote_fields_retrieve(...)
-#### 📝 Description +**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). + +
+
+
-Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). -
-
+**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. + -#### 🔌 Usage -
+**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+
-```python -from merge import Merge - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.ticketing.field_mapping.remote_fields_retrieve() - -``` +**order_by:** `typing.Optional[EmploymentsListRequestOrderBy]` — Overrides the default ordering for this endpoint. Possible values include: effective_date, -effective_date. +
+ +
+
+ +**page_size:** `typing.Optional[int]` — Number of results to return per page. +
-#### ⚙️ Parameters -
+**remote_fields:** `typing.Optional[EmploymentsListRequestRemoteFields]` — Deprecated. Use show_enum_origins. + +
+
+
-**common_models:** `typing.Optional[str]` — A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -25194,7 +28973,7 @@ client.ticketing.field_mapping.remote_fields_retrieve()
-**include_example_values:** `typing.Optional[str]` — If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. +**show_enum_origins:** `typing.Optional[EmploymentsListRequestShowEnumOrigins]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter)
@@ -25214,7 +28993,7 @@ client.ticketing.field_mapping.remote_fields_retrieve()
-
client.ticketing.field_mapping.target_fields_retrieve() +
client.hris.employments.retrieve(...)
@@ -25226,7 +29005,7 @@ client.ticketing.field_mapping.remote_fields_retrieve()
-Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). +Returns an `Employment` object with the given `id`.
@@ -25247,7 +29026,9 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.field_mapping.target_fields_retrieve() +client.hris.employments.retrieve( + id="id", +) ``` @@ -25263,6 +29044,54 @@ client.ticketing.field_mapping.target_fields_retrieve()
+**id:** `str` + +
+
+ +
+
+ +**expand:** `typing.Optional[EmploymentsRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**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). + +
+
+ +
+
+ +**remote_fields:** `typing.Optional[EmploymentsRetrieveRequestRemoteFields]` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**show_enum_origins:** `typing.Optional[EmploymentsRetrieveRequestShowEnumOrigins]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -25275,8 +29104,8 @@ client.ticketing.field_mapping.target_fields_retrieve()
-## Ticketing GenerateKey -
client.ticketing.generate_key.create(...) +## Hris FieldMapping +
client.hris.field_mapping.field_mappings_retrieve(...)
@@ -25288,7 +29117,7 @@ client.ticketing.field_mapping.target_fields_retrieve()
-Create a remote key. +Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/).
@@ -25309,9 +29138,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.generate_key.create( - name="Remote Deployment Key 1", -) +client.hris.field_mapping.field_mappings_retrieve() ``` @@ -25327,7 +29154,7 @@ client.ticketing.generate_key.create(
-**name:** `str` — The name of the remote key +**exclude_remote_field_metadata:** `typing.Optional[bool]` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations.
@@ -25347,8 +29174,7 @@ client.ticketing.generate_key.create(
-## Ticketing Issues -
client.ticketing.issues.list(...) +
client.hris.field_mapping.field_mappings_create(...)
@@ -25360,7 +29186,7 @@ client.ticketing.generate_key.create(
-Gets all issues for Organization. +Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start.
@@ -25381,8 +29207,13 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.issues.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +client.hris.field_mapping.field_mappings_create( + target_field_name="example_target_field_name", + target_field_description="this is a example description of the target field", + remote_field_traversal_path=["example_remote_field"], + remote_method="GET", + remote_url_path="/example-url-path", + common_model_name="ExampleCommonModel", ) ``` @@ -25399,7 +29230,7 @@ client.ticketing.issues.list(
-**account_token:** `typing.Optional[str]` +**target_field_name:** `str` — The name of the target field you want this remote field to map to.
@@ -25407,7 +29238,7 @@ client.ticketing.issues.list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**target_field_description:** `str` — The description of the target field you want this remote field to map to.
@@ -25415,7 +29246,7 @@ client.ticketing.issues.list(
-**end_date:** `typing.Optional[str]` — If included, will only include issues whose most recent action occurred before this time +**remote_field_traversal_path:** `typing.Sequence[typing.Optional[typing.Any]]` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.
@@ -25423,7 +29254,7 @@ client.ticketing.issues.list(
-**end_user_organization_name:** `typing.Optional[str]` +**remote_method:** `str` — The method of the remote endpoint where the remote field is coming from.
@@ -25431,7 +29262,7 @@ client.ticketing.issues.list(
-**first_incident_time_after:** `typing.Optional[dt.datetime]` — If provided, will only return issues whose first incident time was after this datetime. +**remote_url_path:** `str` — The path of the remote endpoint where the remote field is coming from.
@@ -25439,7 +29270,7 @@ client.ticketing.issues.list(
-**first_incident_time_before:** `typing.Optional[dt.datetime]` — If provided, will only return issues whose first incident time was before this datetime. +**common_model_name:** `str` — The name of the Common Model that the remote field corresponds to in a given category.
@@ -25447,7 +29278,7 @@ client.ticketing.issues.list(
-**include_muted:** `typing.Optional[str]` — If true, will include muted issues +**exclude_remote_field_metadata:** `typing.Optional[bool]` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations.
@@ -25455,60 +29286,70 @@ client.ticketing.issues.list(
-**integration_name:** `typing.Optional[str]` +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**last_incident_time_after:** `typing.Optional[dt.datetime]` — If provided, will only return issues whose last incident time was after this datetime. -
+
+
client.hris.field_mapping.field_mappings_destroy(...)
-**last_incident_time_before:** `typing.Optional[dt.datetime]` — If provided, will only return issues whose last incident time was before this datetime. - -
-
+#### 📝 Description
-**linked_account_id:** `typing.Optional[str]` — If provided, will only include issues pertaining to the linked account passed in. - -
-
-
-**page_size:** `typing.Optional[int]` — Number of results to return per page. - +Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start.
+ + + +#### 🔌 Usage
-**start_date:** `typing.Optional[str]` — If included, will only include issues whose most recent action occurred after this time - +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.hris.field_mapping.field_mappings_destroy( + field_mapping_id="field_mapping_id", +) + +``` +
+
+#### ⚙️ Parameters +
-**status:** `typing.Optional[IssuesListRequestStatus]` - -Status of the issue. Options: ('ONGOING', 'RESOLVED') +
+
-* `ONGOING` - ONGOING -* `RESOLVED` - RESOLVED +**field_mapping_id:** `str`
@@ -25528,7 +29369,7 @@ Status of the issue. Options: ('ONGOING', 'RESOLVED')
-
client.ticketing.issues.retrieve(...) +
client.hris.field_mapping.field_mappings_partial_update(...)
@@ -25540,7 +29381,7 @@ Status of the issue. Options: ('ONGOING', 'RESOLVED')
-Get a specific issue. +Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start.
@@ -25561,8 +29402,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.issues.retrieve( - id="id", +client.hris.field_mapping.field_mappings_partial_update( + field_mapping_id="field_mapping_id", ) ``` @@ -25579,7 +29420,31 @@ client.ticketing.issues.retrieve(
-**id:** `str` +**field_mapping_id:** `str` + +
+
+ +
+
+ +**remote_field_traversal_path:** `typing.Optional[typing.Sequence[typing.Optional[typing.Any]]]` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + +
+
+ +
+
+ +**remote_method:** `typing.Optional[str]` — The method of the remote endpoint where the remote field is coming from. + +
+
+ +
+
+ +**remote_url_path:** `typing.Optional[str]` — The path of the remote endpoint where the remote field is coming from.
@@ -25599,8 +29464,7 @@ client.ticketing.issues.retrieve(
-## Ticketing LinkToken -
client.ticketing.link_token.create(...) +
client.hris.field_mapping.remote_fields_retrieve(...)
@@ -25612,7 +29476,7 @@ client.ticketing.issues.retrieve(
-Creates a link token to be used when linking a new end user. +Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/).
@@ -25628,18 +29492,12 @@ Creates a link token to be used when linking a new end user. ```python from merge import Merge -from merge.resources.ticketing import CategoriesEnum client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.link_token.create( - end_user_email_address="example@gmail.com", - end_user_organization_name="Test Organization", - end_user_origin_id="12345", - categories=[CategoriesEnum.HRIS, CategoriesEnum.ATS], -) +client.hris.field_mapping.remote_fields_retrieve() ``` @@ -25655,7 +29513,7 @@ client.ticketing.link_token.create(
-**end_user_email_address:** `str` — Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent. +**common_models:** `typing.Optional[str]` — A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models.
@@ -25663,7 +29521,7 @@ client.ticketing.link_token.create(
-**end_user_organization_name:** `str` — Your end user's organization. +**include_example_values:** `typing.Optional[str]` — If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers.
@@ -25671,99 +29529,132 @@ client.ticketing.link_token.create(
-**end_user_origin_id:** `str` — This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**categories:** `typing.Sequence[CategoriesEnum]` — The integration categories to show in Merge Link. -
+
+
client.hris.field_mapping.target_fields_retrieve()
-**integration:** `typing.Optional[str]` — The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/. - -
-
+#### 📝 Description
-**link_expiry_mins:** `typing.Optional[int]` — An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30. - -
-
-
-**should_create_magic_link_url:** `typing.Optional[bool]` — Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. - +Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). +
+
+#### 🔌 Usage +
-**hide_admin_magic_link:** `typing.Optional[bool]` — Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. - +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.hris.field_mapping.target_fields_retrieve() + +``` +
+
+#### ⚙️ Parameters +
-**common_models:** `typing.Optional[typing.Sequence[CommonModelScopesBodyRequest]]` — An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
-
-
-**category_common_model_scopes:** `typing.Optional[ - typing.Dict[ - str, - typing.Optional[ - typing.Sequence[IndividualCommonModelScopeDeserializerRequest] - ], - ] -]` — When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. -
+
+## Hris GenerateKey +
client.hris.generate_key.create(...)
-**language:** `typing.Optional[EndUserDetailsRequestLanguage]` +#### 📝 Description -The following subset of IETF language tags can be used to configure localization. +
+
-* `en` - en -* `de` - de - +
+
+ +Create a remote key. +
+
+#### 🔌 Usage +
-**are_syncs_disabled:** `typing.Optional[bool]` — The boolean that indicates whether initial, periodic, and force syncs will be disabled. - +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.hris.generate_key.create( + name="Remote Deployment Key 1", +) + +```
+
+
+ +#### ⚙️ Parameters
-**integration_specific_config:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — A JSON object containing integration-specific configuration options. +
+
+ +**name:** `str` — The name of the remote key
@@ -25783,8 +29674,8 @@ The following subset of IETF language tags can be used to configure localization
-## Ticketing LinkedAccounts -
client.ticketing.linked_accounts.list(...) +## Hris Groups +
client.hris.groups.list(...)
@@ -25796,7 +29687,7 @@ The following subset of IETF language tags can be used to configure localization
-List linked accounts for your organization. +Returns a list of `Group` objects.
@@ -25817,7 +29708,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.linked_accounts.list( +client.hris.groups.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -25835,17 +29726,15 @@ client.ticketing.linked_accounts.list(
-**category:** `typing.Optional[LinkedAccountsListRequestCategory]` +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. + +
+
-Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing` +
+
-* `hris` - hris -* `ats` - ats -* `accounting` - accounting -* `ticketing` - ticketing -* `crm` - crm -* `mktg` - mktg -* `filestorage` - filestorage +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime.
@@ -25861,7 +29750,7 @@ Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing`
-**end_user_email_address:** `typing.Optional[str]` — If provided, will only return linked accounts associated with the given email address. +**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/).
@@ -25869,7 +29758,7 @@ Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing`
-**end_user_organization_name:** `typing.Optional[str]` — If provided, will only return linked accounts associated with the given organization name. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -25877,7 +29766,7 @@ Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing`
-**end_user_origin_id:** `typing.Optional[str]` — If provided, will only return linked accounts associated with the given origin ID. +**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).
@@ -25885,7 +29774,7 @@ Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing`
-**end_user_origin_ids:** `typing.Optional[str]` — Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. +**is_commonly_used_as_team:** `typing.Optional[str]` — If provided, specifies whether to return only Group objects which refer to a team in the third party platform. Note that this is an opinionated view based on how a team may be represented in the third party platform.
@@ -25893,7 +29782,7 @@ Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing`
-**id:** `typing.Optional[str]` +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned.
@@ -25901,7 +29790,7 @@ Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing`
-**ids:** `typing.Optional[str]` — Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned.
@@ -25909,7 +29798,7 @@ Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing`
-**include_duplicates:** `typing.Optional[bool]` — If `true`, will include complete production duplicates of the account specified by the `id` query parameter in the response. `id` must be for a complete production linked account. +**names:** `typing.Optional[str]` — If provided, will only return groups with these names. Multiple values can be separated by commas.
@@ -25917,7 +29806,7 @@ Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing`
-**integration_name:** `typing.Optional[str]` — If provided, will only return linked accounts associated with the given integration name. +**page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -25925,7 +29814,7 @@ Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing`
-**is_test_account:** `typing.Optional[str]` — If included, will only include test linked accounts. If not included, will only include non-test linked accounts. +**remote_fields:** `typing.Optional[typing.Literal["type"]]` — Deprecated. Use show_enum_origins.
@@ -25933,7 +29822,7 @@ Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing`
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -25941,7 +29830,15 @@ Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing`
-**status:** `typing.Optional[str]` — Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, `RELINK_NEEDED` +**show_enum_origins:** `typing.Optional[typing.Literal["type"]]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) + +
+
+ +
+
+ +**types:** `typing.Optional[str]` — If provided, will only return groups of these types. Multiple values can be separated by commas.
@@ -25961,8 +29858,7 @@ Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing`
-## Ticketing Passthrough -
client.ticketing.passthrough.create(...) +
client.hris.groups.retrieve(...)
@@ -25974,7 +29870,7 @@ Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing`
-Pull data from an endpoint not currently supported by Merge. +Returns a `Group` object with the given `id`.
@@ -25990,17 +29886,13 @@ Pull data from an endpoint not currently supported by Merge. ```python from merge import Merge -from merge.resources.ticketing import DataPassthroughRequest, MethodEnum client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.passthrough.create( - request=DataPassthroughRequest( - method=MethodEnum.GET, - path="/scooters", - ), +client.hris.groups.retrieve( + id="id", ) ``` @@ -26017,7 +29909,39 @@ client.ticketing.passthrough.create(
-**request:** `DataPassthroughRequest` +**id:** `str` + +
+
+ +
+
+ +**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). + +
+
+ +
+
+ +**remote_fields:** `typing.Optional[typing.Literal["type"]]` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**show_enum_origins:** `typing.Optional[typing.Literal["type"]]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter)
@@ -26037,8 +29961,8 @@ client.ticketing.passthrough.create(
-## Ticketing Projects -
client.ticketing.projects.list(...) +## Hris Issues +
client.hris.issues.list(...)
@@ -26050,7 +29974,7 @@ client.ticketing.passthrough.create(
-Returns a list of `Project` objects. +Gets all issues for Organization.
@@ -26071,7 +29995,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.projects.list( +client.hris.issues.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -26089,7 +30013,7 @@ client.ticketing.projects.list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. +**account_token:** `typing.Optional[str]`
@@ -26097,7 +30021,7 @@ client.ticketing.projects.list(
-**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -26105,7 +30029,7 @@ client.ticketing.projects.list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**end_date:** `typing.Optional[str]` — If included, will only include issues whose most recent action occurred before this time
@@ -26113,7 +30037,7 @@ client.ticketing.projects.list(
-**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/). +**end_user_organization_name:** `typing.Optional[str]`
@@ -26121,7 +30045,7 @@ client.ticketing.projects.list(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**first_incident_time_after:** `typing.Optional[dt.datetime]` — If provided, will only return issues whose first incident time was after this datetime.
@@ -26129,7 +30053,7 @@ client.ticketing.projects.list(
-**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). +**first_incident_time_before:** `typing.Optional[dt.datetime]` — If provided, will only return issues whose first incident time was before this datetime.
@@ -26137,7 +30061,7 @@ client.ticketing.projects.list(
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +**include_muted:** `typing.Optional[str]` — If true, will include muted issues
@@ -26145,7 +30069,31 @@ client.ticketing.projects.list(
-**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. +**integration_name:** `typing.Optional[str]` + +
+
+ +
+
+ +**last_incident_time_after:** `typing.Optional[dt.datetime]` — If provided, will only return issues whose last incident time was after this datetime. + +
+
+ +
+
+ +**last_incident_time_before:** `typing.Optional[dt.datetime]` — If provided, will only return issues whose last incident time was before this datetime. + +
+
+ +
+
+ +**linked_account_id:** `typing.Optional[str]` — If provided, will only include issues pertaining to the linked account passed in.
@@ -26161,7 +30109,20 @@ client.ticketing.projects.list(
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. +**start_date:** `typing.Optional[str]` — If included, will only include issues whose most recent action occurred after this time + +
+
+ +
+
+ +**status:** `typing.Optional[IssuesListRequestStatus]` + +Status of the issue. Options: ('ONGOING', 'RESOLVED') + +* `ONGOING` - ONGOING +* `RESOLVED` - RESOLVED
@@ -26181,7 +30142,7 @@ client.ticketing.projects.list(
-
client.ticketing.projects.retrieve(...) +
client.hris.issues.retrieve(...)
@@ -26193,7 +30154,7 @@ client.ticketing.projects.list(
-Returns a `Project` object with the given `id`. +Get a specific issue.
@@ -26214,7 +30175,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.projects.retrieve( +client.hris.issues.retrieve( id="id", ) @@ -26240,22 +30201,6 @@ client.ticketing.projects.retrieve(
-**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). - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -26268,7 +30213,8 @@ client.ticketing.projects.retrieve(
-
client.ticketing.projects.users_list(...) +## Hris LinkToken +
client.hris.link_token.create(...)
@@ -26280,7 +30226,7 @@ client.ticketing.projects.retrieve(
-Returns a list of `User` objects. +Creates a link token to be used when linking a new end user.
@@ -26296,14 +30242,17 @@ Returns a list of `User` objects. ```python from merge import Merge +from merge.resources.hris import CategoriesEnum client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.projects.users_list( - parent_id="parent_id", - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +client.hris.link_token.create( + end_user_email_address="example@gmail.com", + end_user_organization_name="Test Organization", + end_user_origin_id="12345", + categories=[CategoriesEnum.HRIS, CategoriesEnum.ATS], ) ``` @@ -26320,7 +30269,7 @@ client.ticketing.projects.users_list(
-**parent_id:** `str` +**end_user_email_address:** `str` — Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent.
@@ -26328,7 +30277,7 @@ client.ticketing.projects.users_list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**end_user_organization_name:** `str` — Your end user's organization.
@@ -26336,7 +30285,7 @@ client.ticketing.projects.users_list(
-**expand:** `typing.Optional[ProjectsUsersListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**end_user_origin_id:** `str` — This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers.
@@ -26344,7 +30293,7 @@ client.ticketing.projects.users_list(
-**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/). +**categories:** `typing.Sequence[CategoriesEnum]` — The integration categories to show in Merge Link.
@@ -26352,7 +30301,7 @@ client.ticketing.projects.users_list(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**integration:** `typing.Optional[str]` — The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/.
@@ -26360,7 +30309,7 @@ client.ticketing.projects.users_list(
-**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). +**link_expiry_mins:** `typing.Optional[int]` — An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30.
@@ -26368,7 +30317,7 @@ client.ticketing.projects.users_list(
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +**should_create_magic_link_url:** `typing.Optional[bool]` — Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.
@@ -26376,71 +30325,59 @@ client.ticketing.projects.users_list(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**hide_admin_magic_link:** `typing.Optional[bool]` — Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link.
- -
- - - - -
- -## Ticketing RegenerateKey -
client.ticketing.regenerate_key.create(...) -
-
- -#### 📝 Description - -
-
-Exchange remote keys. -
-
+**common_models:** `typing.Optional[typing.Sequence[CommonModelScopesBodyRequest]]` — An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. +
-#### 🔌 Usage -
+**category_common_model_scopes:** `typing.Optional[ + typing.Dict[ + str, + typing.Optional[ + typing.Sequence[IndividualCommonModelScopeDeserializerRequest] + ], + ] +]` — When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. + +
+
+
-```python -from merge import Merge +**language:** `typing.Optional[EndUserDetailsRequestLanguage]` -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.ticketing.regenerate_key.create( - name="Remote Deployment Key 1", -) +The following subset of IETF language tags can be used to configure localization. -``` -
-
+* `en` - en +* `de` - de +
-#### ⚙️ Parameters -
+**are_syncs_disabled:** `typing.Optional[bool]` — The boolean that indicates whether initial, periodic, and force syncs will be disabled. + +
+
+
-**name:** `str` — The name of the remote key +**integration_specific_config:** `typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]` — A JSON object containing integration-specific configuration options.
@@ -26460,8 +30397,8 @@ client.ticketing.regenerate_key.create(
-## Ticketing Roles -
client.ticketing.roles.list(...) +## Hris LinkedAccounts +
client.hris.linked_accounts.list(...)
@@ -26473,7 +30410,7 @@ client.ticketing.regenerate_key.create(
-Returns a list of `Role` objects. +List linked accounts for your organization.
@@ -26494,7 +30431,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.roles.list( +client.hris.linked_accounts.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -26512,7 +30449,17 @@ client.ticketing.roles.list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. +**category:** `typing.Optional[LinkedAccountsListRequestCategory]` + +Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing` + +* `hris` - hris +* `ats` - ats +* `accounting` - accounting +* `ticketing` - ticketing +* `crm` - crm +* `mktg` - mktg +* `filestorage` - filestorage
@@ -26520,7 +30467,7 @@ client.ticketing.roles.list(
-**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -26528,7 +30475,7 @@ client.ticketing.roles.list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**end_user_email_address:** `typing.Optional[str]` — If provided, will only return linked accounts associated with the given email address.
@@ -26536,7 +30483,7 @@ client.ticketing.roles.list(
-**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/). +**end_user_organization_name:** `typing.Optional[str]` — If provided, will only return linked accounts associated with the given organization name.
@@ -26544,7 +30491,7 @@ client.ticketing.roles.list(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**end_user_origin_id:** `typing.Optional[str]` — If provided, will only return linked accounts associated with the given origin ID.
@@ -26552,7 +30499,7 @@ client.ticketing.roles.list(
-**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). +**end_user_origin_ids:** `typing.Optional[str]` — Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once.
@@ -26560,7 +30507,7 @@ client.ticketing.roles.list(
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +**id:** `typing.Optional[str]`
@@ -26568,7 +30515,31 @@ client.ticketing.roles.list(
-**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. +**ids:** `typing.Optional[str]` — Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. + +
+
+ +
+
+ +**include_duplicates:** `typing.Optional[bool]` — If `true`, will include complete production duplicates of the account specified by the `id` query parameter in the response. `id` must be for a complete production linked account. + +
+
+ +
+
+ +**integration_name:** `typing.Optional[str]` — If provided, will only return linked accounts associated with the given integration name. + +
+
+ +
+
+ +**is_test_account:** `typing.Optional[str]` — If included, will only include test linked accounts. If not included, will only include non-test linked accounts.
@@ -26584,7 +30555,7 @@ client.ticketing.roles.list(
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. +**status:** `typing.Optional[str]` — Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, `RELINK_NEEDED`
@@ -26604,7 +30575,8 @@ client.ticketing.roles.list(
-
client.ticketing.roles.retrieve(...) +## Hris Locations +
client.hris.locations.list(...)
@@ -26616,7 +30588,7 @@ client.ticketing.roles.list(
-Returns a `Role` object with the given `id`. +Returns a list of `Location` objects.
@@ -26637,8 +30609,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.roles.retrieve( - id="id", +client.hris.locations.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) ``` @@ -26655,7 +30627,7 @@ client.ticketing.roles.retrieve(
-**id:** `str` +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
@@ -26663,7 +30635,7 @@ client.ticketing.roles.retrieve(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime.
@@ -26671,7 +30643,7 @@ client.ticketing.roles.retrieve(
-**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). +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -26679,71 +30651,44 @@ client.ticketing.roles.retrieve(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**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/).
- -
- - - - -
-## Ticketing SyncStatus -
client.ticketing.sync_status.list(...)
-#### 📝 Description - -
-
+**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. + +
+
-Get sync status for the current sync and the most recently finished sync. `last_sync_start` represents the most recent time any sync began. `last_sync_finished` represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the `last_sync_finished` timestamp where `last_sync_result` is `DONE`. Possible values for `status` and `last_sync_result` are `DISABLED`, `DONE`, `FAILED`, `PARTIALLY_SYNCED`, `PAUSED`, `SYNCING`. Learn more about sync status in our [Help Center](https://help.merge.dev/en/articles/8184193-merge-sync-statuses). -
-
+**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). +
-#### 🔌 Usage -
-
-
- -```python -from merge import Merge +**location_type:** `typing.Optional[LocationsListRequestLocationType]` -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.ticketing.sync_status.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", -) +If provided, will only return locations with this location_type -``` -
-
+* `HOME` - HOME +* `WORK` - WORK +
-#### ⚙️ Parameters - -
-
-
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned.
@@ -26751,7 +30696,7 @@ client.ticketing.sync_status.list(
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned.
@@ -26759,65 +30704,35 @@ client.ticketing.sync_status.list(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**page_size:** `typing.Optional[int]` — Number of results to return per page.
-
-
- - - - -
-## Ticketing ForceResync -
client.ticketing.force_resync.sync_status_resync_create()
-#### 📝 Description - -
-
+**remote_fields:** `typing.Optional[LocationsListRequestRemoteFields]` — Deprecated. Use show_enum_origins. + +
+
-Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. -
-
+**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. +
-#### 🔌 Usage - -
-
-
-```python -from merge import Merge - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.ticketing.force_resync.sync_status_resync_create() - -``` -
-
+**show_enum_origins:** `typing.Optional[LocationsListRequestShowEnumOrigins]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) +
-#### ⚙️ Parameters - -
-
-
@@ -26833,8 +30748,7 @@ client.ticketing.force_resync.sync_status_resync_create()
-## Ticketing Tags -
client.ticketing.tags.list(...) +
client.hris.locations.retrieve(...)
@@ -26846,7 +30760,7 @@ client.ticketing.force_resync.sync_status_resync_create()
-Returns a list of `Tag` objects. +Returns a `Location` object with the given `id`.
@@ -26867,8 +30781,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.tags.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +client.hris.locations.retrieve( + id="id", ) ``` @@ -26885,31 +30799,7 @@ client.ticketing.tags.list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. - -
-
- -
-
- -**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The pagination cursor value. - -
-
- -
-
- -**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/). +**id:** `str`
@@ -26925,23 +30815,7 @@ client.ticketing.tags.list(
-**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). - -
-
- -
-
- -**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. - -
-
- -
-
- -**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. +**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).
@@ -26949,7 +30823,7 @@ client.ticketing.tags.list(
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +**remote_fields:** `typing.Optional[LocationsRetrieveRequestRemoteFields]` — Deprecated. Use show_enum_origins.
@@ -26957,7 +30831,7 @@ client.ticketing.tags.list(
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. +**show_enum_origins:** `typing.Optional[LocationsRetrieveRequestShowEnumOrigins]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter)
@@ -26977,7 +30851,8 @@ client.ticketing.tags.list(
-
client.ticketing.tags.retrieve(...) +## Hris Passthrough +
client.hris.passthrough.create(...)
@@ -26989,7 +30864,7 @@ client.ticketing.tags.list(
-Returns a `Tag` object with the given `id`. +Pull data from an endpoint not currently supported by Merge.
@@ -27005,13 +30880,17 @@ Returns a `Tag` object with the given `id`. ```python from merge import Merge +from merge.resources.hris import DataPassthroughRequest, MethodEnum client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.tags.retrieve( - id="id", +client.hris.passthrough.create( + request=DataPassthroughRequest( + method=MethodEnum.GET, + path="/scooters", + ), ) ``` @@ -27028,23 +30907,7 @@ client.ticketing.tags.retrieve(
-**id:** `str` - -
-
- -
-
- -**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). +**request:** `DataPassthroughRequest`
@@ -27064,8 +30927,8 @@ client.ticketing.tags.retrieve(
-## Ticketing Teams -
client.ticketing.teams.list(...) +## Hris PayGroups +
client.hris.pay_groups.list(...)
@@ -27077,7 +30940,7 @@ client.ticketing.tags.retrieve(
-Returns a list of `Team` objects. +Returns a list of `PayGroup` objects.
@@ -27098,7 +30961,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.teams.list( +client.hris.pay_groups.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -27208,7 +31071,7 @@ client.ticketing.teams.list(
-
client.ticketing.teams.retrieve(...) +
client.hris.pay_groups.retrieve(...)
@@ -27220,7 +31083,7 @@ client.ticketing.teams.list(
-Returns a `Team` object with the given `id`. +Returns a `PayGroup` object with the given `id`.
@@ -27241,7 +31104,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.teams.retrieve( +client.hris.pay_groups.retrieve( id="id", ) @@ -27295,8 +31158,8 @@ client.ticketing.teams.retrieve(
-## Ticketing Tickets -
client.ticketing.tickets.list(...) +## Hris PayrollRuns +
client.hris.payroll_runs.list(...)
@@ -27308,7 +31171,7 @@ client.ticketing.teams.retrieve(
-Returns a list of `Ticket` objects. +Returns a list of `PayrollRun` objects.
@@ -27329,7 +31192,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.tickets.list( +client.hris.payroll_runs.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -27347,7 +31210,7 @@ client.ticketing.tickets.list(
-**account_id:** `typing.Optional[str]` — If provided, will only return tickets for this account. +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
@@ -27355,7 +31218,7 @@ client.ticketing.tickets.list(
-**assignee_ids:** `typing.Optional[str]` — If provided, will only return tickets assigned to the assignee_ids; multiple assignee_ids can be separated by commas. +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime.
@@ -27363,7 +31226,7 @@ client.ticketing.tickets.list(
-**collection_ids:** `typing.Optional[str]` — If provided, will only return tickets assigned to the collection_ids; multiple collection_ids can be separated by commas. +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -27371,7 +31234,7 @@ client.ticketing.tickets.list(
-**completed_after:** `typing.Optional[dt.datetime]` — If provided, will only return tickets completed after this datetime. +**ended_after:** `typing.Optional[dt.datetime]` — If provided, will only return payroll runs ended after this datetime.
@@ -27379,7 +31242,7 @@ client.ticketing.tickets.list(
-**completed_before:** `typing.Optional[dt.datetime]` — If provided, will only return tickets completed before this datetime. +**ended_before:** `typing.Optional[dt.datetime]` — If provided, will only return payroll runs ended before this datetime.
@@ -27387,7 +31250,7 @@ client.ticketing.tickets.list(
-**contact_id:** `typing.Optional[str]` — If provided, will only return tickets for this contact. +**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/).
@@ -27395,7 +31258,7 @@ client.ticketing.tickets.list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -27403,7 +31266,7 @@ client.ticketing.tickets.list(
-**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +**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).
@@ -27411,7 +31274,7 @@ client.ticketing.tickets.list(
-**creator_id:** `typing.Optional[str]` — If provided, will only return tickets created by this creator_id. +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned.
@@ -27419,7 +31282,7 @@ client.ticketing.tickets.list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned.
@@ -27427,7 +31290,7 @@ client.ticketing.tickets.list(
-**due_after:** `typing.Optional[dt.datetime]` — If provided, will only return tickets due after this datetime. +**page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -27435,7 +31298,7 @@ client.ticketing.tickets.list(
-**due_before:** `typing.Optional[dt.datetime]` — If provided, will only return tickets due before this datetime. +**remote_fields:** `typing.Optional[PayrollRunsListRequestRemoteFields]` — Deprecated. Use show_enum_origins.
@@ -27443,7 +31306,7 @@ client.ticketing.tickets.list(
-**expand:** `typing.Optional[TicketsListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -27451,15 +31314,15 @@ client.ticketing.tickets.list(
-**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/). - -
-
+**run_type:** `typing.Optional[PayrollRunsListRequestRunType]` -
-
+If provided, will only return PayrollRun's with this status. Options: ('REGULAR', 'OFF_CYCLE', 'CORRECTION', 'TERMINATION', 'SIGN_ON_BONUS') -**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +* `REGULAR` - REGULAR +* `OFF_CYCLE` - OFF_CYCLE +* `CORRECTION` - CORRECTION +* `TERMINATION` - TERMINATION +* `SIGN_ON_BONUS` - SIGN_ON_BONUS
@@ -27467,7 +31330,7 @@ client.ticketing.tickets.list(
-**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. +**show_enum_origins:** `typing.Optional[PayrollRunsListRequestShowEnumOrigins]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter)
@@ -27475,7 +31338,7 @@ client.ticketing.tickets.list(
-**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). +**started_after:** `typing.Optional[dt.datetime]` — If provided, will only return payroll runs started after this datetime.
@@ -27483,7 +31346,7 @@ client.ticketing.tickets.list(
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +**started_before:** `typing.Optional[dt.datetime]` — If provided, will only return payroll runs started before this datetime.
@@ -27491,102 +31354,70 @@ client.ticketing.tickets.list(
-**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
- -
-
- -**name:** `typing.Optional[str]` — If provided, will only return tickets with this name. -
-
-
-**page_size:** `typing.Optional[int]` — Number of results to return per page. -
+
+
client.hris.payroll_runs.retrieve(...)
-**parent_ticket_id:** `typing.Optional[str]` — If provided, will only return sub tickets of the parent_ticket_id. - -
-
+#### 📝 Description
-**priority:** `typing.Optional[TicketsListRequestPriority]` - -If provided, will only return tickets of this priority. - -* `URGENT` - URGENT -* `HIGH` - HIGH -* `NORMAL` - NORMAL -* `LOW` - LOW - -
-
-
-**remote_created_after:** `typing.Optional[dt.datetime]` — If provided, will only return tickets created in the third party platform after this datetime. - +Returns a `PayrollRun` object with the given `id`.
- -
-
- -**remote_created_before:** `typing.Optional[dt.datetime]` — If provided, will only return tickets created in the third party platform before this datetime. -
+#### 🔌 Usage +
-**remote_fields:** `typing.Optional[TicketsListRequestRemoteFields]` — Deprecated. Use show_enum_origins. - -
-
-
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. - -
-
+```python +from merge import Merge -
-
+client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.hris.payroll_runs.retrieve( + id="id", +) -**remote_updated_after:** `typing.Optional[dt.datetime]` — If provided, will only return tickets updated in the third party platform after this datetime. - +``` +
+
+#### ⚙️ Parameters +
-**remote_updated_before:** `typing.Optional[dt.datetime]` — If provided, will only return tickets updated in the third party platform before this datetime. - -
-
-
-**show_enum_origins:** `typing.Optional[TicketsListRequestShowEnumOrigins]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) +**id:** `str`
@@ -27594,7 +31425,7 @@ If provided, will only return tickets of this priority.
-**status:** `typing.Optional[str]` — If provided, will only return tickets of this status. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -27602,7 +31433,7 @@ If provided, will only return tickets of this priority.
-**tags:** `typing.Optional[str]` — If provided, will only return tickets matching the tags; multiple tags can be separated by commas. +**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).
@@ -27610,7 +31441,7 @@ If provided, will only return tickets of this priority.
-**ticket_type:** `typing.Optional[str]` — If provided, will only return tickets of this type. +**remote_fields:** `typing.Optional[PayrollRunsRetrieveRequestRemoteFields]` — Deprecated. Use show_enum_origins.
@@ -27618,7 +31449,7 @@ If provided, will only return tickets of this priority.
-**ticket_url:** `typing.Optional[str]` — If provided, will only return tickets where the URL matches or contains the substring +**show_enum_origins:** `typing.Optional[PayrollRunsRetrieveRequestShowEnumOrigins]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter)
@@ -27638,7 +31469,8 @@ If provided, will only return tickets of this priority.
-
client.ticketing.tickets.create(...) +## Hris RegenerateKey +
client.hris.regenerate_key.create(...)
@@ -27650,7 +31482,7 @@ If provided, will only return tickets of this priority.
-Creates a `Ticket` object with the given values. +Exchange remote keys.
@@ -27666,14 +31498,13 @@ Creates a `Ticket` object with the given values. ```python from merge import Merge -from merge.resources.ticketing import TicketRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.tickets.create( - model=TicketRequest(), +client.hris.regenerate_key.create( + name="Remote Deployment Key 1", ) ``` @@ -27690,23 +31521,7 @@ client.ticketing.tickets.create(
-**model:** `TicketRequest` - -
-
- -
-
- -**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. - -
-
- -
-
- -**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. +**name:** `str` — The name of the remote key
@@ -27726,7 +31541,8 @@ client.ticketing.tickets.create(
-
client.ticketing.tickets.retrieve(...) +## Hris SyncStatus +
client.hris.sync_status.list(...)
@@ -27738,7 +31554,7 @@ client.ticketing.tickets.create(
-Returns a `Ticket` object with the given `id`. +Get sync status for the current sync and the most recently finished sync. `last_sync_start` represents the most recent time any sync began. `last_sync_finished` represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the `last_sync_finished` timestamp where `last_sync_result` is `DONE`. Possible values for `status` and `last_sync_result` are `DISABLED`, `DONE`, `FAILED`, `PARTIALLY_SYNCED`, `PAUSED`, `SYNCING`. Learn more about sync status in our [Help Center](https://help.merge.dev/en/articles/8184193-merge-sync-statuses).
@@ -27759,65 +31575,25 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.tickets.retrieve( - id="id", -) - -``` - -
- - - -#### ⚙️ Parameters - -
-
- -
-
- -**id:** `str` - -
-
- -
-
- -**expand:** `typing.Optional[TicketsRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - -
-
- -
-
+client.hris.sync_status.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +) -**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. - +```
- -
-
- -**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. -
+#### ⚙️ Parameters +
-**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). - -
-
-
-**remote_fields:** `typing.Optional[TicketsRetrieveRequestRemoteFields]` — Deprecated. Use show_enum_origins. +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -27825,7 +31601,7 @@ client.ticketing.tickets.retrieve(
-**show_enum_origins:** `typing.Optional[TicketsRetrieveRequestShowEnumOrigins]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) +**page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -27845,7 +31621,8 @@ client.ticketing.tickets.retrieve(
-
client.ticketing.tickets.partial_update(...) +## Hris ForceResync +
client.hris.force_resync.sync_status_resync_create()
@@ -27857,7 +31634,7 @@ client.ticketing.tickets.retrieve(
-Updates a `Ticket` object with the given `id`. +Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers.
@@ -27873,16 +31650,12 @@ Updates a `Ticket` object with the given `id`. ```python from merge import Merge -from merge.resources.ticketing import PatchedTicketRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.tickets.partial_update( - id="id", - model=PatchedTicketRequest(), -) +client.hris.force_resync.sync_status_resync_create() ``` @@ -27898,38 +31671,6 @@ client.ticketing.tickets.partial_update(
-**id:** `str` - -
-
- -
-
- -**model:** `PatchedTicketRequest` - -
-
- -
-
- -**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. - -
-
- -
-
- -**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -27942,7 +31683,8 @@ client.ticketing.tickets.partial_update(
-
client.ticketing.tickets.viewers_list(...) +## Hris Teams +
client.hris.teams.list(...)
@@ -27954,7 +31696,7 @@ client.ticketing.tickets.partial_update(
-Returns a list of `Viewer` objects that point to a User id or Team id that is either an assignee or viewer on a `Ticket` with the given id. [Learn more.](https://help.merge.dev/en/articles/10333658-ticketing-access-control-list-acls) +Returns a list of `Team` objects.
@@ -27975,8 +31717,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.tickets.viewers_list( - ticket_id="ticket_id", +client.hris.teams.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -27994,7 +31735,7 @@ client.ticketing.tickets.viewers_list(
-**ticket_id:** `str` +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
@@ -28002,7 +31743,7 @@ client.ticketing.tickets.viewers_list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime.
@@ -28010,7 +31751,7 @@ client.ticketing.tickets.viewers_list(
-**expand:** `typing.Optional[TicketsViewersListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -28018,7 +31759,7 @@ client.ticketing.tickets.viewers_list(
-**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/). +**expand:** `typing.Optional[typing.Literal["parent_team"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -28026,7 +31767,7 @@ client.ticketing.tickets.viewers_list(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**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/).
@@ -28034,7 +31775,7 @@ client.ticketing.tickets.viewers_list(
-**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). +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -28042,7 +31783,7 @@ client.ticketing.tickets.viewers_list(
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +**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).
@@ -28050,70 +31791,39 @@ client.ticketing.tickets.viewers_list(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned.
- -
- - - - -
-
client.ticketing.tickets.meta_patch_retrieve(...)
-#### 📝 Description - -
-
+**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. + +
+
-Returns metadata for `Ticket` PATCHs. -
-
+**page_size:** `typing.Optional[int]` — Number of results to return per page. +
-#### 🔌 Usage -
-
-
- -```python -from merge import Merge - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.ticketing.tickets.meta_patch_retrieve( - id="id", -) - -``` -
-
+**parent_team_id:** `typing.Optional[str]` — If provided, will only return teams with this parent team. +
-#### ⚙️ Parameters - -
-
-
-**id:** `str` +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -28133,7 +31843,7 @@ client.ticketing.tickets.meta_patch_retrieve(
-
client.ticketing.tickets.meta_post_retrieve(...) +
client.hris.teams.retrieve(...)
@@ -28145,7 +31855,7 @@ client.ticketing.tickets.meta_patch_retrieve(
-Returns metadata for `Ticket` POSTs. +Returns a `Team` object with the given `id`.
@@ -28166,7 +31876,9 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.tickets.meta_post_retrieve() +client.hris.teams.retrieve( + id="id", +) ``` @@ -28182,7 +31894,7 @@ client.ticketing.tickets.meta_post_retrieve()
-**collection_id:** `typing.Optional[str]` — If provided, will only return tickets for this collection. +**id:** `str`
@@ -28190,7 +31902,23 @@ client.ticketing.tickets.meta_post_retrieve()
-**ticket_type:** `typing.Optional[str]` — If provided, will only return tickets for this ticket type. +**expand:** `typing.Optional[typing.Literal["parent_team"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**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).
@@ -28210,7 +31938,8 @@ client.ticketing.tickets.meta_post_retrieve()
-
client.ticketing.tickets.remote_field_classes_list(...) +## Hris TimeOff +
client.hris.time_off.list(...)
@@ -28222,7 +31951,7 @@ client.ticketing.tickets.meta_post_retrieve()
-Returns a list of `RemoteFieldClass` objects. +Returns a list of `TimeOff` objects.
@@ -28243,7 +31972,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.tickets.remote_field_classes_list( +client.hris.time_off.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -28261,15 +31990,7 @@ client.ticketing.tickets.remote_field_classes_list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. - -
-
- -
-
- -**ids:** `typing.Optional[str]` — If provided, will only return remote field classes with the `ids` in this list +**approver_id:** `typing.Optional[str]` — If provided, will only return time off for this approver.
@@ -28277,7 +31998,7 @@ client.ticketing.tickets.remote_field_classes_list(
-**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/). +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
@@ -28285,7 +32006,7 @@ client.ticketing.tickets.remote_field_classes_list(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime.
@@ -28293,7 +32014,7 @@ client.ticketing.tickets.remote_field_classes_list(
-**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). +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -28301,7 +32022,7 @@ client.ticketing.tickets.remote_field_classes_list(
-**is_common_model_field:** `typing.Optional[bool]` — If provided, will only return remote field classes with this is_common_model_field value +**employee_id:** `typing.Optional[str]` — If provided, will only return time off for this employee.
@@ -28309,7 +32030,7 @@ client.ticketing.tickets.remote_field_classes_list(
-**is_custom:** `typing.Optional[bool]` — If provided, will only return remote fields classes with this is_custom value +**ended_after:** `typing.Optional[dt.datetime]` — If provided, will only return employees that ended after this datetime.
@@ -28317,7 +32038,7 @@ client.ticketing.tickets.remote_field_classes_list(
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +**ended_before:** `typing.Optional[dt.datetime]` — If provided, will only return time-offs that ended before this datetime.
@@ -28325,71 +32046,15 @@ client.ticketing.tickets.remote_field_classes_list(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**expand:** `typing.Optional[TimeOffListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. -
-
- -
- - - - -
- -## Ticketing Users -
client.ticketing.users.list(...) -
-
- -#### 📝 Description - -
-
- -
-
- -Returns a list of `User` objects. -
-
-
-
- -#### 🔌 Usage - -
-
- -
-
- -```python -from merge import Merge - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.ticketing.users.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", -) - -``` -
-
-#### ⚙️ Parameters - -
-
-
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. +**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/).
@@ -28397,7 +32062,7 @@ client.ticketing.users.list(
-**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -28405,7 +32070,7 @@ client.ticketing.users.list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**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).
@@ -28413,7 +32078,7 @@ client.ticketing.users.list(
-**email_address:** `typing.Optional[str]` — If provided, will only return users with emails equal to this value (case insensitive). +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned.
@@ -28421,7 +32086,7 @@ client.ticketing.users.list(
-**expand:** `typing.Optional[UsersListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned.
@@ -28429,7 +32094,7 @@ client.ticketing.users.list(
-**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/). +**page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -28437,7 +32102,7 @@ client.ticketing.users.list(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**remote_fields:** `typing.Optional[TimeOffListRequestRemoteFields]` — Deprecated. Use show_enum_origins.
@@ -28445,7 +32110,7 @@ client.ticketing.users.list(
-**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). +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -28453,7 +32118,16 @@ client.ticketing.users.list(
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +**request_type:** `typing.Optional[TimeOffListRequestRequestType]` + +If provided, will only return TimeOff with this request type. Options: ('VACATION', 'SICK', 'PERSONAL', 'JURY_DUTY', 'VOLUNTEER', 'BEREAVEMENT') + +* `VACATION` - VACATION +* `SICK` - SICK +* `PERSONAL` - PERSONAL +* `JURY_DUTY` - JURY_DUTY +* `VOLUNTEER` - VOLUNTEER +* `BEREAVEMENT` - BEREAVEMENT
@@ -28461,7 +32135,7 @@ client.ticketing.users.list(
-**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. +**show_enum_origins:** `typing.Optional[TimeOffListRequestShowEnumOrigins]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter)
@@ -28469,7 +32143,7 @@ client.ticketing.users.list(
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +**started_after:** `typing.Optional[dt.datetime]` — If provided, will only return time-offs that started after this datetime.
@@ -28477,7 +32151,7 @@ client.ticketing.users.list(
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. +**started_before:** `typing.Optional[dt.datetime]` — If provided, will only return time-offs that started before this datetime.
@@ -28485,7 +32159,15 @@ client.ticketing.users.list(
-**team:** `typing.Optional[str]` — If provided, will only return users matching in this team. +**status:** `typing.Optional[TimeOffListRequestStatus]` + +If provided, will only return TimeOff with this status. Options: ('REQUESTED', 'APPROVED', 'DECLINED', 'CANCELLED', 'DELETED') + +* `REQUESTED` - REQUESTED +* `APPROVED` - APPROVED +* `DECLINED` - DECLINED +* `CANCELLED` - CANCELLED +* `DELETED` - DELETED
@@ -28505,7 +32187,7 @@ client.ticketing.users.list(
-
client.ticketing.users.retrieve(...) +
client.hris.time_off.create(...)
@@ -28517,7 +32199,7 @@ client.ticketing.users.list(
-Returns a `User` object with the given `id`. +Creates a `TimeOff` object with the given values.
@@ -28533,13 +32215,14 @@ Returns a `User` object with the given `id`. ```python from merge import Merge +from merge.resources.hris import TimeOffRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.users.retrieve( - id="id", +client.hris.time_off.create( + model=TimeOffRequest(), ) ``` @@ -28556,15 +32239,7 @@ client.ticketing.users.retrieve(
-**id:** `str` - -
-
- -
-
- -**expand:** `typing.Optional[UsersRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**model:** `TimeOffRequest`
@@ -28572,7 +32247,7 @@ client.ticketing.users.retrieve(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response.
@@ -28580,7 +32255,7 @@ client.ticketing.users.retrieve(
-**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). +**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously.
@@ -28600,8 +32275,7 @@ client.ticketing.users.retrieve(
-## Ticketing WebhookReceivers -
client.ticketing.webhook_receivers.list() +
client.hris.time_off.retrieve(...)
@@ -28613,7 +32287,7 @@ client.ticketing.users.retrieve(
-Returns a list of `WebhookReceiver` objects. +Returns a `TimeOff` object with the given `id`.
@@ -28634,7 +32308,9 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.ticketing.webhook_receivers.list() +client.hris.time_off.retrieve( + id="id", +) ``` @@ -28650,71 +32326,31 @@ client.ticketing.webhook_receivers.list()
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**id:** `str`
- -
- - - - -
- -
client.ticketing.webhook_receivers.create(...) -
-
- -#### 📝 Description - -
-
-Creates a `WebhookReceiver` object with the given values. -
-
+**expand:** `typing.Optional[TimeOffRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +
-#### 🔌 Usage - -
-
-
-```python -from merge import Merge - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.ticketing.webhook_receivers.create( - event="event", - is_active=True, -) - -``` -
-
+**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +
-#### ⚙️ Parameters - -
-
-
-**event:** `str` +**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).
@@ -28722,7 +32358,7 @@ client.ticketing.webhook_receivers.create(
-**is_active:** `bool` +**remote_fields:** `typing.Optional[TimeOffRetrieveRequestRemoteFields]` — Deprecated. Use show_enum_origins.
@@ -28730,7 +32366,7 @@ client.ticketing.webhook_receivers.create(
-**key:** `typing.Optional[str]` +**show_enum_origins:** `typing.Optional[TimeOffRetrieveRequestShowEnumOrigins]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter)
@@ -28750,8 +32386,7 @@ client.ticketing.webhook_receivers.create(
-## Hris AccountDetails -
client.hris.account_details.retrieve() +
client.hris.time_off.meta_post_retrieve()
@@ -28763,7 +32398,7 @@ client.ticketing.webhook_receivers.create(
-Get details for a linked account. +Returns metadata for `TimeOff` POSTs.
@@ -28784,7 +32419,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.account_details.retrieve() +client.hris.time_off.meta_post_retrieve() ``` @@ -28812,8 +32447,8 @@ client.hris.account_details.retrieve()
-## Hris AccountToken -
client.hris.account_token.retrieve(...) +## Hris TimeOffBalances +
client.hris.time_off_balances.list(...)
@@ -28825,7 +32460,7 @@ client.hris.account_details.retrieve()
-Returns the account token for the end user with the provided public token. +Returns a list of `TimeOffBalance` objects.
@@ -28846,8 +32481,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.account_token.retrieve( - public_token="public_token", +client.hris.time_off_balances.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) ``` @@ -28864,7 +32499,7 @@ client.hris.account_token.retrieve(
-**public_token:** `str` +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
@@ -28872,75 +32507,47 @@ client.hris.account_token.retrieve(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime.
- -
+
+
+**cursor:** `typing.Optional[str]` — The pagination cursor value. +
-
-## Hris AsyncPassthrough -
client.hris.async_passthrough.create(...)
-#### 📝 Description - -
-
+**employee_id:** `typing.Optional[str]` — If provided, will only return time off balances for this employee. + +
+
-Asynchronously pull data from an endpoint not currently supported by Merge. -
-
+**expand:** `typing.Optional[typing.Literal["employee"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +
-#### 🔌 Usage - -
-
-
-```python -from merge import Merge -from merge.resources.hris import DataPassthroughRequest, MethodEnum - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.hris.async_passthrough.create( - request=DataPassthroughRequest( - method=MethodEnum.GET, - path="/scooters", - ), -) - -``` -
-
+**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/). +
-#### ⚙️ Parameters - -
-
-
-**request:** `DataPassthroughRequest` +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -28948,70 +32555,72 @@ client.hris.async_passthrough.create(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**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).
-
-
+
+
+**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +
-
-
client.hris.async_passthrough.retrieve(...)
-#### 📝 Description - -
-
+**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. + +
+
-Retrieves data from earlier async-passthrough POST request -
-
+**page_size:** `typing.Optional[int]` — Number of results to return per page. +
-#### 🔌 Usage -
-
-
- -```python -from merge import Merge +**policy_type:** `typing.Optional[TimeOffBalancesListRequestPolicyType]` -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.hris.async_passthrough.retrieve( - async_passthrough_receipt_id="async_passthrough_receipt_id", -) +If provided, will only return TimeOffBalance with this policy type. Options: ('VACATION', 'SICK', 'PERSONAL', 'JURY_DUTY', 'VOLUNTEER', 'BEREAVEMENT') -``` +* `VACATION` - VACATION +* `SICK` - SICK +* `PERSONAL` - PERSONAL +* `JURY_DUTY` - JURY_DUTY +* `VOLUNTEER` - VOLUNTEER +* `BEREAVEMENT` - BEREAVEMENT +
+ +
+
+ +**remote_fields:** `typing.Optional[typing.Literal["policy_type"]]` — Deprecated. Use show_enum_origins. +
-#### ⚙️ Parameters -
+**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. + +
+
+
-**async_passthrough_receipt_id:** `str` +**show_enum_origins:** `typing.Optional[typing.Literal["policy_type"]]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter)
@@ -29031,8 +32640,7 @@ client.hris.async_passthrough.retrieve(
-## Hris AuditTrail -
client.hris.audit_trail.list(...) +
client.hris.time_off_balances.retrieve(...)
@@ -29044,7 +32652,7 @@ client.hris.async_passthrough.retrieve(
-Gets a list of audit trail events. +Returns a `TimeOffBalance` object with the given `id`.
@@ -29065,8 +32673,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.audit_trail.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +client.hris.time_off_balances.retrieve( + id="id", ) ``` @@ -29083,15 +32691,7 @@ client.hris.audit_trail.list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. - -
-
- -
-
- -**end_date:** `typing.Optional[str]` — If included, will only include audit trail events that occurred before this time +**id:** `str`
@@ -29099,7 +32699,7 @@ client.hris.audit_trail.list(
-**event_type:** `typing.Optional[str]` — If included, will only include events with the given event type. Possible values include: `CREATED_REMOTE_PRODUCTION_API_KEY`, `DELETED_REMOTE_PRODUCTION_API_KEY`, `CREATED_TEST_API_KEY`, `DELETED_TEST_API_KEY`, `REGENERATED_PRODUCTION_API_KEY`, `REGENERATED_WEBHOOK_SIGNATURE`, `INVITED_USER`, `TWO_FACTOR_AUTH_ENABLED`, `TWO_FACTOR_AUTH_DISABLED`, `DELETED_LINKED_ACCOUNT`, `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT`, `CREATED_DESTINATION`, `DELETED_DESTINATION`, `CHANGED_DESTINATION`, `CHANGED_SCOPES`, `CHANGED_PERSONAL_INFORMATION`, `CHANGED_ORGANIZATION_SETTINGS`, `ENABLED_INTEGRATION`, `DISABLED_INTEGRATION`, `ENABLED_CATEGORY`, `DISABLED_CATEGORY`, `CHANGED_PASSWORD`, `RESET_PASSWORD`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `CREATED_INTEGRATION_WIDE_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_FIELD_MAPPING`, `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING`, `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING`, `DELETED_INTEGRATION_WIDE_FIELD_MAPPING`, `DELETED_LINKED_ACCOUNT_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `FORCED_LINKED_ACCOUNT_RESYNC`, `MUTED_ISSUE`, `GENERATED_MAGIC_LINK`, `ENABLED_MERGE_WEBHOOK`, `DISABLED_MERGE_WEBHOOK`, `MERGE_WEBHOOK_TARGET_CHANGED`, `END_USER_CREDENTIALS_ACCESSED` +**expand:** `typing.Optional[typing.Literal["employee"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -29107,7 +32707,7 @@ client.hris.audit_trail.list(
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -29115,7 +32715,7 @@ client.hris.audit_trail.list(
-**start_date:** `typing.Optional[str]` — If included, will only include audit trail events that occurred after this time +**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).
@@ -29123,7 +32723,7 @@ client.hris.audit_trail.list(
-**user_email:** `typing.Optional[str]` — If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email. +**remote_fields:** `typing.Optional[typing.Literal["policy_type"]]` — Deprecated. Use show_enum_origins.
@@ -29131,65 +32731,11 @@ client.hris.audit_trail.list(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**show_enum_origins:** `typing.Optional[typing.Literal["policy_type"]]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) -
-
- -
- - - - -
- -## Hris AvailableActions -
client.hris.available_actions.retrieve() -
-
- -#### 📝 Description - -
-
- -
-
- -Returns a list of models and actions available for an account. -
-
-#### 🔌 Usage - -
-
- -
-
- -```python -from merge import Merge - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.hris.available_actions.retrieve() - -``` -
-
-
-
- -#### ⚙️ Parameters - -
-
-
@@ -29205,8 +32751,8 @@ client.hris.available_actions.retrieve()
-## Hris BankInfo -
client.hris.bank_info.list(...) +## Hris TimesheetEntries +
client.hris.timesheet_entries.list(...)
@@ -29218,7 +32764,7 @@ client.hris.available_actions.retrieve()
-Returns a list of `BankInfo` objects. +Returns a list of `TimesheetEntry` objects.
@@ -29239,7 +32785,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.bank_info.list( +client.hris.timesheet_entries.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -29257,12 +32803,7 @@ client.hris.bank_info.list(
-**account_type:** `typing.Optional[BankInfoListRequestAccountType]` - -If provided, will only return BankInfo's with this account type. Options: ('SAVINGS', 'CHECKING') - -* `SAVINGS` - SAVINGS -* `CHECKING` - CHECKING +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
@@ -29270,7 +32811,7 @@ If provided, will only return BankInfo's with this account type. Options: ('SAVI
-**bank_name:** `typing.Optional[str]` — If provided, will only return BankInfo's with this bank name. +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime.
@@ -29278,7 +32819,7 @@ If provided, will only return BankInfo's with this account type. Options: ('SAVI
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -29286,7 +32827,7 @@ If provided, will only return BankInfo's with this account type. Options: ('SAVI
-**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +**employee_id:** `typing.Optional[str]` — If provided, will only return timesheet entries for this employee.
@@ -29294,7 +32835,7 @@ If provided, will only return BankInfo's with this account type. Options: ('SAVI
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**ended_after:** `typing.Optional[dt.datetime]` — If provided, will only return timesheet entries ended after this datetime.
@@ -29302,7 +32843,7 @@ If provided, will only return BankInfo's with this account type. Options: ('SAVI
-**employee_id:** `typing.Optional[str]` — If provided, will only return bank accounts for this employee. +**ended_before:** `typing.Optional[dt.datetime]` — If provided, will only return timesheet entries ended before this datetime.
@@ -29358,7 +32899,7 @@ If provided, will only return BankInfo's with this account type. Options: ('SAVI
-**order_by:** `typing.Optional[BankInfoListRequestOrderBy]` — Overrides the default ordering for this endpoint. Possible values include: remote_created_at, -remote_created_at. +**order_by:** `typing.Optional[TimesheetEntriesListRequestOrderBy]` — Overrides the default ordering for this endpoint. Possible values include: start_time, -start_time.
@@ -29374,7 +32915,7 @@ If provided, will only return BankInfo's with this account type. Options: ('SAVI
-**remote_fields:** `typing.Optional[typing.Literal["account_type"]]` — Deprecated. Use show_enum_origins. +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -29382,7 +32923,7 @@ If provided, will only return BankInfo's with this account type. Options: ('SAVI
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. +**started_after:** `typing.Optional[dt.datetime]` — If provided, will only return timesheet entries started after this datetime.
@@ -29390,7 +32931,7 @@ If provided, will only return BankInfo's with this account type. Options: ('SAVI
-**show_enum_origins:** `typing.Optional[typing.Literal["account_type"]]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) +**started_before:** `typing.Optional[dt.datetime]` — If provided, will only return timesheet entries started before this datetime.
@@ -29410,7 +32951,7 @@ If provided, will only return BankInfo's with this account type. Options: ('SAVI
-
client.hris.bank_info.retrieve(...) +
client.hris.timesheet_entries.create(...)
@@ -29422,7 +32963,7 @@ If provided, will only return BankInfo's with this account type. Options: ('SAVI
-Returns a `BankInfo` object with the given `id`. +Creates a `TimesheetEntry` object with the given values.
@@ -29438,13 +32979,14 @@ Returns a `BankInfo` object with the given `id`. ```python from merge import Merge +from merge.resources.hris import TimesheetEntryRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.bank_info.retrieve( - id="id", +client.hris.timesheet_entries.create( + model=TimesheetEntryRequest(), ) ``` @@ -29461,31 +33003,7 @@ client.hris.bank_info.retrieve(
-**id:** `str` - -
-
- -
-
- -**expand:** `typing.Optional[typing.Literal["employee"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - -
-
- -
-
- -**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). +**model:** `TimesheetEntryRequest`
@@ -29493,7 +33011,7 @@ client.hris.bank_info.retrieve(
-**remote_fields:** `typing.Optional[typing.Literal["account_type"]]` — Deprecated. Use show_enum_origins. +**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response.
@@ -29501,7 +33019,7 @@ client.hris.bank_info.retrieve(
-**show_enum_origins:** `typing.Optional[typing.Literal["account_type"]]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) +**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously.
@@ -29521,8 +33039,7 @@ client.hris.bank_info.retrieve(
-## Hris Benefits -
client.hris.benefits.list(...) +
client.hris.timesheet_entries.retrieve(...)
@@ -29534,7 +33051,7 @@ client.hris.bank_info.retrieve(
-Returns a list of `Benefit` objects. +Returns a `TimesheetEntry` object with the given `id`.
@@ -29555,8 +33072,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.benefits.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +client.hris.timesheet_entries.retrieve( + id="id", ) ``` @@ -29573,7 +33090,7 @@ client.hris.benefits.list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. +**id:** `str`
@@ -29581,7 +33098,7 @@ client.hris.benefits.list(
-**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +**expand:** `typing.Optional[typing.Literal["employee"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -29589,7 +33106,7 @@ client.hris.benefits.list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -29597,7 +33114,7 @@ client.hris.benefits.list(
-**employee_id:** `typing.Optional[str]` — If provided, will return the benefits associated with the employee. +**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).
@@ -29605,67 +33122,126 @@ client.hris.benefits.list(
-**expand:** `typing.Optional[typing.Literal["employee"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**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/). -
+
+
client.hris.timesheet_entries.meta_post_retrieve()
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. - +#### 📝 Description + +
+
+ +
+
+ +Returns metadata for `TimesheetEntry` POSTs. +
+
+#### 🔌 Usage +
-**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). - +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.hris.timesheet_entries.meta_post_retrieve() + +``` +
+
+#### ⚙️ Parameters +
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +
+
+ +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
+ +
+
+
+ +## Hris WebhookReceivers +
client.hris.webhook_receivers.list()
-**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. - +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `WebhookReceiver` objects. +
+
+#### 🔌 Usage + +
+
+
-**page_size:** `typing.Optional[int]` — Number of results to return per page. - +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.hris.webhook_receivers.list() + +``` +
+
+#### ⚙️ Parameters +
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. - -
-
-
@@ -29681,7 +33257,7 @@ client.hris.benefits.list(
-
client.hris.benefits.retrieve(...) +
client.hris.webhook_receivers.create(...)
@@ -29693,7 +33269,7 @@ client.hris.benefits.list(
-Returns a `Benefit` object with the given `id`. +Creates a `WebhookReceiver` object with the given values.
@@ -29714,8 +33290,9 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.benefits.retrieve( - id="id", +client.hris.webhook_receivers.create( + event="event", + is_active=True, ) ``` @@ -29732,15 +33309,7 @@ client.hris.benefits.retrieve(
-**id:** `str` - -
-
- -
-
- -**expand:** `typing.Optional[typing.Literal["employee"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**event:** `str`
@@ -29748,7 +33317,7 @@ client.hris.benefits.retrieve(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**is_active:** `bool`
@@ -29756,7 +33325,7 @@ client.hris.benefits.retrieve(
-**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). +**key:** `typing.Optional[str]`
@@ -29776,8 +33345,8 @@ client.hris.benefits.retrieve(
-## Hris Companies -
client.hris.companies.list(...) +## Ticketing AccountDetails +
client.ticketing.account_details.retrieve()
@@ -29789,7 +33358,7 @@ client.hris.benefits.retrieve(
-Returns a list of `Company` objects. +Get details for a linked account.
@@ -29810,9 +33379,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.companies.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", -) +client.ticketing.account_details.retrieve() ``` @@ -29828,79 +33395,71 @@ client.hris.companies.list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
- -
-
- -**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. -
-
-
-**cursor:** `typing.Optional[str]` — The pagination cursor value. -
+
+## Ticketing AccountToken +
client.ticketing.account_token.retrieve(...)
-**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/). - -
-
+#### 📝 Description
-**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). - +Returns the account token for the end user with the provided public token. +
+
+#### 🔌 Usage +
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. - -
-
-
-**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. - +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.ticketing.account_token.retrieve( + public_token="public_token", +) + +``` +
+
+#### ⚙️ Parameters +
-**page_size:** `typing.Optional[int]` — Number of results to return per page. - -
-
-
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. +**public_token:** `str`
@@ -29920,7 +33479,8 @@ client.hris.companies.list(
-
client.hris.companies.retrieve(...) +## Ticketing Accounts +
client.ticketing.accounts.list(...)
@@ -29932,7 +33492,7 @@ client.hris.companies.list(
-Returns a `Company` object with the given `id`. +Returns a list of `Account` objects.
@@ -29953,8 +33513,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.companies.retrieve( - id="id", +client.ticketing.accounts.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) ``` @@ -29971,7 +33531,7 @@ client.hris.companies.retrieve(
-**id:** `str` +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
@@ -29979,7 +33539,7 @@ client.hris.companies.retrieve(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime.
@@ -29987,7 +33547,7 @@ client.hris.companies.retrieve(
-**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). +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -29995,65 +33555,59 @@ client.hris.companies.retrieve(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**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. +
-
-## Hris Scopes -
client.hris.scopes.default_scopes_retrieve()
-#### 📝 Description - -
-
+**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). + +
+
-Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). -
-
+**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +
-#### 🔌 Usage -
+**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+
-```python -from merge import Merge - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.hris.scopes.default_scopes_retrieve() - -``` -
-
+**page_size:** `typing.Optional[int]` — Number of results to return per page. + -#### ⚙️ Parameters -
+**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. + +
+
+
@@ -30069,7 +33623,7 @@ client.hris.scopes.default_scopes_retrieve()
-
client.hris.scopes.linked_account_scopes_retrieve() +
client.ticketing.accounts.retrieve(...)
@@ -30081,7 +33635,7 @@ client.hris.scopes.default_scopes_retrieve()
-Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). +Returns an `Account` object with the given `id`.
@@ -30102,7 +33656,9 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.scopes.linked_account_scopes_retrieve() +client.ticketing.accounts.retrieve( + id="id", +) ``` @@ -30118,6 +33674,30 @@ client.hris.scopes.linked_account_scopes_retrieve()
+**id:** `str` + +
+
+ +
+
+ +**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). + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -30130,7 +33710,8 @@ client.hris.scopes.linked_account_scopes_retrieve()
-
client.hris.scopes.linked_account_scopes_create(...) +## Ticketing AsyncPassthrough +
client.ticketing.async_passthrough.create(...)
@@ -30142,7 +33723,7 @@ client.hris.scopes.linked_account_scopes_retrieve()
-Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes) +Asynchronously pull data from an endpoint not currently supported by Merge.
@@ -30158,42 +33739,17 @@ Update permissions for any Common Model or field for a single Linked Account. An ```python from merge import Merge -from merge.resources.hris import ( - FieldPermissionDeserializerRequest, - IndividualCommonModelScopeDeserializerRequest, - ModelPermissionDeserializerRequest, -) +from merge.resources.ticketing import DataPassthroughRequest, MethodEnum client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.scopes.linked_account_scopes_create( - common_models=[ - IndividualCommonModelScopeDeserializerRequest( - model_name="Employee", - model_permissions={ - "READ": ModelPermissionDeserializerRequest( - is_enabled=True, - ), - "WRITE": ModelPermissionDeserializerRequest( - is_enabled=False, - ), - }, - field_permissions=FieldPermissionDeserializerRequest( - enabled_fields=["avatar", "home_location"], - disabled_fields=["work_location"], - ), - ), - IndividualCommonModelScopeDeserializerRequest( - model_name="Benefit", - model_permissions={ - "WRITE": ModelPermissionDeserializerRequest( - is_enabled=False, - ) - }, - ), - ], +client.ticketing.async_passthrough.create( + request=DataPassthroughRequest( + method=MethodEnum.GET, + path="/scooters", + ), ) ``` @@ -30210,7 +33766,7 @@ client.hris.scopes.linked_account_scopes_create(
-**common_models:** `typing.Sequence[IndividualCommonModelScopeDeserializerRequest]` — The common models you want to update the scopes for +**request:** `DataPassthroughRequest`
@@ -30230,8 +33786,7 @@ client.hris.scopes.linked_account_scopes_create(
-## Hris DeleteAccount -
client.hris.delete_account.delete() +
client.ticketing.async_passthrough.retrieve(...)
@@ -30243,7 +33798,7 @@ client.hris.scopes.linked_account_scopes_create(
-Delete a linked account. +Retrieves data from earlier async-passthrough POST request
@@ -30264,7 +33819,9 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.delete_account.delete() +client.ticketing.async_passthrough.retrieve( + async_passthrough_receipt_id="async_passthrough_receipt_id", +) ``` @@ -30280,6 +33837,14 @@ client.hris.delete_account.delete()
+**async_passthrough_receipt_id:** `str` + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -30292,8 +33857,8 @@ client.hris.delete_account.delete()
-## Hris Dependents -
client.hris.dependents.list(...) +## Ticketing Attachments +
client.ticketing.attachments.list(...)
@@ -30305,7 +33870,7 @@ client.hris.delete_account.delete()
-Returns a list of `Dependent` objects. +Returns a list of `Attachment` objects.
@@ -30326,7 +33891,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.dependents.list( +client.ticketing.attachments.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -30368,7 +33933,7 @@ client.hris.dependents.list(
-**employee_id:** `typing.Optional[str]` — If provided, will only return dependents for this employee. +**expand:** `typing.Optional[typing.Literal["ticket"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -30392,7 +33957,7 @@ client.hris.dependents.list(
-**include_sensitive_fields:** `typing.Optional[bool]` — Whether to include sensitive fields (such as social security numbers) in the response. +**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).
@@ -30400,7 +33965,7 @@ client.hris.dependents.list(
-**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). +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned.
@@ -30408,7 +33973,7 @@ client.hris.dependents.list(
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned.
@@ -30416,7 +33981,7 @@ client.hris.dependents.list(
-**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. +**page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -30424,7 +33989,7 @@ client.hris.dependents.list(
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +**remote_created_after:** `typing.Optional[dt.datetime]` — If provided, will only return attachments created in the third party platform after this datetime.
@@ -30440,6 +34005,14 @@ client.hris.dependents.list(
+**ticket_id:** `typing.Optional[str]` — If provided, will only return comments for this ticket. + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -30452,7 +34025,7 @@ client.hris.dependents.list(
-
client.hris.dependents.retrieve(...) +
client.ticketing.attachments.create(...)
@@ -30464,7 +34037,7 @@ client.hris.dependents.list(
-Returns a `Dependent` object with the given `id`. +Creates an `Attachment` object with the given values.
@@ -30480,13 +34053,14 @@ Returns a `Dependent` object with the given `id`. ```python from merge import Merge +from merge.resources.ticketing import AttachmentRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.dependents.retrieve( - id="id", +client.ticketing.attachments.create( + model=AttachmentRequest(), ) ``` @@ -30503,15 +34077,7 @@ client.hris.dependents.retrieve(
-**id:** `str` - -
-
- -
-
- -**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**model:** `AttachmentRequest`
@@ -30519,7 +34085,7 @@ client.hris.dependents.retrieve(
-**include_sensitive_fields:** `typing.Optional[bool]` — Whether to include sensitive fields (such as social security numbers) in the response. +**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response.
@@ -30527,7 +34093,7 @@ client.hris.dependents.retrieve(
-**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). +**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously.
@@ -30547,8 +34113,7 @@ client.hris.dependents.retrieve(
-## Hris EmployeePayrollRuns -
client.hris.employee_payroll_runs.list(...) +
client.ticketing.attachments.retrieve(...)
@@ -30560,7 +34125,7 @@ client.hris.dependents.retrieve(
-Returns a list of `EmployeePayrollRun` objects. +Returns an `Attachment` object with the given `id`.
@@ -30581,8 +34146,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.employee_payroll_runs.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +client.ticketing.attachments.retrieve( + id="id", ) ``` @@ -30599,7 +34164,7 @@ client.hris.employee_payroll_runs.list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. +**id:** `str`
@@ -30607,7 +34172,7 @@ client.hris.employee_payroll_runs.list(
-**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +**expand:** `typing.Optional[typing.Literal["ticket"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -30615,7 +34180,7 @@ client.hris.employee_payroll_runs.list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -30623,7 +34188,7 @@ client.hris.employee_payroll_runs.list(
-**employee_id:** `typing.Optional[str]` — If provided, will only return employee payroll runs for this employee. +**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).
@@ -30631,107 +34196,64 @@ client.hris.employee_payroll_runs.list(
-**ended_after:** `typing.Optional[dt.datetime]` — If provided, will only return employee payroll runs ended after this datetime. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
- -
-
- -**ended_before:** `typing.Optional[dt.datetime]` — If provided, will only return employee payroll runs ended before this datetime. -
-
-
-**expand:** `typing.Optional[EmployeePayrollRunsListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. -
+
+
client.ticketing.attachments.meta_post_retrieve()
-**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/). - -
-
+#### 📝 Description
-**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). - +Returns metadata for `TicketingAttachment` POSTs.
- -
-
- -**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. -
-
-
- -**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. - -
-
+#### 🔌 Usage
-**page_size:** `typing.Optional[int]` — Number of results to return per page. - -
-
-
-**payroll_run_id:** `typing.Optional[str]` — If provided, will only return employee payroll runs for this employee. - -
-
+```python +from merge import Merge -
-
+client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.ticketing.attachments.meta_post_retrieve() -**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. - +```
- -
-
- -**started_after:** `typing.Optional[dt.datetime]` — If provided, will only return employee payroll runs started after this datetime. -
+#### ⚙️ Parameters +
-**started_before:** `typing.Optional[dt.datetime]` — If provided, will only return employee payroll runs started before this datetime. - -
-
-
@@ -30747,7 +34269,8 @@ client.hris.employee_payroll_runs.list(
-
client.hris.employee_payroll_runs.retrieve(...) +## Ticketing AuditTrail +
client.ticketing.audit_trail.list(...)
@@ -30759,7 +34282,7 @@ client.hris.employee_payroll_runs.list(
-Returns an `EmployeePayrollRun` object with the given `id`. +Gets a list of audit trail events.
@@ -30780,8 +34303,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.employee_payroll_runs.retrieve( - id="id", +client.ticketing.audit_trail.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) ``` @@ -30798,7 +34321,7 @@ client.hris.employee_payroll_runs.retrieve(
-**id:** `str` +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -30806,7 +34329,7 @@ client.hris.employee_payroll_runs.retrieve(
-**expand:** `typing.Optional[EmployeePayrollRunsRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**end_date:** `typing.Optional[str]` — If included, will only include audit trail events that occurred before this time
@@ -30814,7 +34337,7 @@ client.hris.employee_payroll_runs.retrieve(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**event_type:** `typing.Optional[str]` — If included, will only include events with the given event type. Possible values include: `CREATED_REMOTE_PRODUCTION_API_KEY`, `DELETED_REMOTE_PRODUCTION_API_KEY`, `CREATED_TEST_API_KEY`, `DELETED_TEST_API_KEY`, `REGENERATED_PRODUCTION_API_KEY`, `REGENERATED_WEBHOOK_SIGNATURE`, `INVITED_USER`, `TWO_FACTOR_AUTH_ENABLED`, `TWO_FACTOR_AUTH_DISABLED`, `DELETED_LINKED_ACCOUNT`, `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT`, `CREATED_DESTINATION`, `DELETED_DESTINATION`, `CHANGED_DESTINATION`, `CHANGED_SCOPES`, `CHANGED_PERSONAL_INFORMATION`, `CHANGED_ORGANIZATION_SETTINGS`, `ENABLED_INTEGRATION`, `DISABLED_INTEGRATION`, `ENABLED_CATEGORY`, `DISABLED_CATEGORY`, `CHANGED_PASSWORD`, `RESET_PASSWORD`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `CREATED_INTEGRATION_WIDE_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_FIELD_MAPPING`, `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING`, `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING`, `DELETED_INTEGRATION_WIDE_FIELD_MAPPING`, `DELETED_LINKED_ACCOUNT_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `FORCED_LINKED_ACCOUNT_RESYNC`, `MUTED_ISSUE`, `GENERATED_MAGIC_LINK`, `ENABLED_MERGE_WEBHOOK`, `DISABLED_MERGE_WEBHOOK`, `MERGE_WEBHOOK_TARGET_CHANGED`, `END_USER_CREDENTIALS_ACCESSED`
@@ -30822,7 +34345,23 @@ client.hris.employee_payroll_runs.retrieve(
-**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. + +
+
+ +
+
+ +**start_date:** `typing.Optional[str]` — If included, will only include audit trail events that occurred after this time + +
+
+ +
+
+ +**user_email:** `typing.Optional[str]` — If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email.
@@ -30842,8 +34381,8 @@ client.hris.employee_payroll_runs.retrieve(
-## Hris Employees -
client.hris.employees.list(...) +## Ticketing AvailableActions +
client.ticketing.available_actions.retrieve()
@@ -30855,7 +34394,7 @@ client.hris.employee_payroll_runs.retrieve(
-Returns a list of `Employee` objects. +Returns a list of models and actions available for an account.
@@ -30876,9 +34415,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.employees.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", -) +client.ticketing.available_actions.retrieve() ``` @@ -30894,69 +34431,71 @@ client.hris.employees.list(
-**company_id:** `typing.Optional[str]` — If provided, will only return employees for this company. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
- -
-
- -**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. -
-
-
-**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. -
+
+## Ticketing Collections +
client.ticketing.collections.list(...)
-**cursor:** `typing.Optional[str]` — The pagination cursor value. - -
-
+#### 📝 Description
-**display_full_name:** `typing.Optional[str]` — If provided, will only return employees with this display name. - -
-
-
-**employee_number:** `typing.Optional[str]` — If provided, will only return employees with this employee number. - +Returns a list of `Collection` objects. +
+
+#### 🔌 Usage +
-**employment_status:** `typing.Optional[EmployeesListRequestEmploymentStatus]` +
+
-If provided, will only return employees with this employment status. +```python +from merge import Merge -* `ACTIVE` - ACTIVE -* `PENDING` - PENDING -* `INACTIVE` - INACTIVE - +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.ticketing.collections.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +) + +``` +
+
+#### ⚙️ Parameters +
-**employment_type:** `typing.Optional[str]` — If provided, will only return employees that have an employment of the specified employment_type. +
+
+ +**collection_type:** `typing.Optional[str]` — If provided, will only return collections of the given type.
@@ -30964,7 +34503,7 @@ If provided, will only return employees with this employment status.
-**expand:** `typing.Optional[EmployeesListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
@@ -30972,7 +34511,7 @@ If provided, will only return employees with this employment status.
-**first_name:** `typing.Optional[str]` — If provided, will only return employees with this first name. +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime.
@@ -30980,7 +34519,7 @@ If provided, will only return employees with this employment status.
-**groups:** `typing.Optional[str]` — If provided, will only return employees matching the group ids; multiple groups can be separated by commas. +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -30988,7 +34527,7 @@ If provided, will only return employees with this employment status.
-**home_location_id:** `typing.Optional[str]` — If provided, will only return employees for this home location. +**expand:** `typing.Optional[typing.Literal["parent_collection"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -31012,7 +34551,7 @@ If provided, will only return employees with this employment status.
-**include_sensitive_fields:** `typing.Optional[bool]` — Whether to include sensitive fields (such as social security numbers) in the response. +**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).
@@ -31020,7 +34559,7 @@ If provided, will only return employees with this employment status.
-**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). +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned.
@@ -31028,7 +34567,7 @@ If provided, will only return employees with this employment status.
-**job_title:** `typing.Optional[str]` — If provided, will only return employees that have an employment of the specified job_title. +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned.
@@ -31036,7 +34575,7 @@ If provided, will only return employees with this employment status.
-**last_name:** `typing.Optional[str]` — If provided, will only return employees with this last name. +**name:** `typing.Optional[str]` — If provided, will only return collections with this name.
@@ -31044,7 +34583,7 @@ If provided, will only return employees with this employment status.
-**manager_id:** `typing.Optional[str]` — If provided, will only return employees for this manager. +**page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -31052,7 +34591,7 @@ If provided, will only return employees with this employment status.
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +**parent_collection_id:** `typing.Optional[str]` — If provided, will only return collections whose parent collection matches the given id.
@@ -31060,7 +34599,7 @@ If provided, will only return employees with this employment status.
-**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. +**remote_fields:** `typing.Optional[typing.Literal["collection_type"]]` — Deprecated. Use show_enum_origins.
@@ -31068,7 +34607,7 @@ If provided, will only return employees with this employment status.
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -31076,7 +34615,7 @@ If provided, will only return employees with this employment status.
-**pay_group_id:** `typing.Optional[str]` — If provided, will only return employees for this pay group +**show_enum_origins:** `typing.Optional[typing.Literal["collection_type"]]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter)
@@ -31084,39 +34623,71 @@ If provided, will only return employees with this employment status.
-**personal_email:** `typing.Optional[str]` — If provided, will only return Employees with this personal email +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
-
-
-**remote_fields:** `typing.Optional[EmployeesListRequestRemoteFields]` — Deprecated. Use show_enum_origins. -
+
+
client.ticketing.collections.viewers_list(...)
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. - +#### 📝 Description + +
+
+ +
+
+ +Returns a list of `Viewer` objects that point to a User id or Team id that is either an assignee or viewer on a `Collection` with the given id. [Learn more.](https://help.merge.dev/en/articles/10333658-ticketing-access-control-list-acls) +
+
+#### 🔌 Usage +
-**show_enum_origins:** `typing.Optional[EmployeesListRequestShowEnumOrigins]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) - +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.ticketing.collections.viewers_list( + collection_id="collection_id", + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +) + +```
+
+
+ +#### ⚙️ Parameters
-**started_after:** `typing.Optional[dt.datetime]` — If provided, will only return employees that started after this datetime. +
+
+ +**collection_id:** `str`
@@ -31124,7 +34695,7 @@ If provided, will only return employees with this employment status.
-**started_before:** `typing.Optional[dt.datetime]` — If provided, will only return employees that started before this datetime. +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -31132,7 +34703,7 @@ If provided, will only return employees with this employment status.
-**team_id:** `typing.Optional[str]` — If provided, will only return employees for this team. +**expand:** `typing.Optional[CollectionsViewersListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -31140,7 +34711,7 @@ If provided, will only return employees with this employment status.
-**terminated_after:** `typing.Optional[dt.datetime]` — If provided, will only return employees that were terminated after this datetime. +**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/).
@@ -31148,7 +34719,7 @@ If provided, will only return employees with this employment status.
-**terminated_before:** `typing.Optional[dt.datetime]` — If provided, will only return employees that were terminated before this datetime. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -31156,7 +34727,7 @@ If provided, will only return employees with this employment status.
-**work_email:** `typing.Optional[str]` — If provided, will only return Employees with this work email +**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).
@@ -31164,7 +34735,7 @@ If provided, will only return employees with this employment status.
-**work_location_id:** `typing.Optional[str]` — If provided, will only return employees for this location. +**page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -31184,7 +34755,7 @@ If provided, will only return employees with this employment status.
-
client.hris.employees.create(...) +
client.ticketing.collections.retrieve(...)
@@ -31196,7 +34767,7 @@ If provided, will only return employees with this employment status.
-Creates an `Employee` object with the given values. +Returns a `Collection` object with the given `id`.
@@ -31212,14 +34783,13 @@ Creates an `Employee` object with the given values. ```python from merge import Merge -from merge.resources.hris import EmployeeRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.employees.create( - model=EmployeeRequest(), +client.ticketing.collections.retrieve( + id="id", ) ``` @@ -31236,7 +34806,7 @@ client.hris.employees.create(
-**model:** `EmployeeRequest` +**id:** `str`
@@ -31244,7 +34814,7 @@ client.hris.employees.create(
-**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. +**expand:** `typing.Optional[typing.Literal["parent_collection"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -31252,7 +34822,31 @@ client.hris.employees.create(
-**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. +**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). + +
+
+ +
+
+ +**remote_fields:** `typing.Optional[typing.Literal["collection_type"]]` — Deprecated. Use show_enum_origins. + +
+
+ +
+
+ +**show_enum_origins:** `typing.Optional[typing.Literal["collection_type"]]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter)
@@ -31272,7 +34866,8 @@ client.hris.employees.create(
-
client.hris.employees.retrieve(...) +## Ticketing Comments +
client.ticketing.comments.list(...)
@@ -31284,7 +34879,7 @@ client.hris.employees.create(
-Returns an `Employee` object with the given `id`. +Returns a list of `Comment` objects.
@@ -31305,8 +34900,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.employees.retrieve( - id="id", +client.ticketing.comments.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) ``` @@ -31323,7 +34918,7 @@ client.hris.employees.retrieve(
-**id:** `str` +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
@@ -31331,7 +34926,7 @@ client.hris.employees.retrieve(
-**expand:** `typing.Optional[EmployeesRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime.
@@ -31339,7 +34934,7 @@ client.hris.employees.retrieve(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -31347,7 +34942,7 @@ client.hris.employees.retrieve(
-**include_sensitive_fields:** `typing.Optional[bool]` — Whether to include sensitive fields (such as social security numbers) in the response. +**expand:** `typing.Optional[CommentsListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -31355,7 +34950,7 @@ client.hris.employees.retrieve(
-**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). +**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/).
@@ -31363,7 +34958,7 @@ client.hris.employees.retrieve(
-**remote_fields:** `typing.Optional[EmployeesRetrieveRequestRemoteFields]` — Deprecated. Use show_enum_origins. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -31371,7 +34966,7 @@ client.hris.employees.retrieve(
-**show_enum_origins:** `typing.Optional[EmployeesRetrieveRequestShowEnumOrigins]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) +**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).
@@ -31379,72 +34974,31 @@ client.hris.employees.retrieve(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned.
- -
- - - - -
- -
client.hris.employees.ignore_create(...) -
-
- -#### 📝 Description - -
-
-Ignores a specific row based on the `model_id` in the url. These records will have their properties set to null, and will not be updated in future syncs. The "reason" and "message" fields in the request body will be stored for audit purposes. -
-
+**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. +
-#### 🔌 Usage -
-
-
- -```python -from merge import Merge -from merge.resources.hris import ReasonEnum - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.hris.employees.ignore_create( - model_id="model_id", - reason=ReasonEnum.GENERAL_CUSTOMER_REQUEST, -) - -``` -
-
+**page_size:** `typing.Optional[int]` — Number of results to return per page. +
-#### ⚙️ Parameters - -
-
-
-**model_id:** `str` +**remote_created_after:** `typing.Optional[dt.datetime]` — If provided, will only return Comments created in the third party platform after this datetime.
@@ -31452,7 +35006,7 @@ client.hris.employees.ignore_create(
-**reason:** `IgnoreCommonModelRequestReason` +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -31460,7 +35014,7 @@ client.hris.employees.ignore_create(
-**message:** `typing.Optional[str]` +**ticket_id:** `typing.Optional[str]` — If provided, will only return comments for this ticket.
@@ -31480,7 +35034,7 @@ client.hris.employees.ignore_create(
-
client.hris.employees.meta_post_retrieve() +
client.ticketing.comments.create(...)
@@ -31492,7 +35046,7 @@ client.hris.employees.ignore_create(
-Returns metadata for `Employee` POSTs. +Creates a `Comment` object with the given values.
@@ -31508,12 +35062,15 @@ Returns metadata for `Employee` POSTs. ```python from merge import Merge +from merge.resources.ticketing import CommentRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.employees.meta_post_retrieve() +client.ticketing.comments.create( + model=CommentRequest(), +) ``` @@ -31529,6 +35086,30 @@ client.hris.employees.meta_post_retrieve()
+**model:** `CommentRequest` + +
+
+ +
+
+ +**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -31540,9 +35121,8 @@ client.hris.employees.meta_post_retrieve()
- -## Hris EmployerBenefits -
client.hris.employer_benefits.list(...) + +
client.ticketing.comments.retrieve(...)
@@ -31554,7 +35134,7 @@ client.hris.employees.meta_post_retrieve()
-Returns a list of `EmployerBenefit` objects. +Returns a `Comment` object with the given `id`.
@@ -31575,8 +35155,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.employer_benefits.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +client.ticketing.comments.retrieve( + id="id", ) ``` @@ -31593,23 +35173,7 @@ client.hris.employer_benefits.list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. - -
-
- -
-
- -**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The pagination cursor value. +**id:** `str`
@@ -31617,7 +35181,7 @@ client.hris.employer_benefits.list(
-**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/). +**expand:** `typing.Optional[CommentsRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -31641,38 +35205,6 @@ client.hris.employer_benefits.list(
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. - -
-
- -
-
- -**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. - -
-
- -
-
- -**page_size:** `typing.Optional[int]` — Number of results to return per page. - -
-
- -
-
- -**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -31685,7 +35217,7 @@ client.hris.employer_benefits.list(
-
client.hris.employer_benefits.retrieve(...) +
client.ticketing.comments.meta_post_retrieve()
@@ -31697,7 +35229,7 @@ client.hris.employer_benefits.list(
-Returns an `EmployerBenefit` object with the given `id`. +Returns metadata for `Comment` POSTs.
@@ -31718,9 +35250,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.employer_benefits.retrieve( - id="id", -) +client.ticketing.comments.meta_post_retrieve() ``` @@ -31736,30 +35266,6 @@ client.hris.employer_benefits.retrieve(
-**id:** `str` - -
-
- -
-
- -**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). - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -31772,8 +35278,8 @@ client.hris.employer_benefits.retrieve(
-## Hris Employments -
client.hris.employments.list(...) +## Ticketing Contacts +
client.ticketing.contacts.list(...)
@@ -31785,7 +35291,7 @@ client.hris.employer_benefits.retrieve(
-Returns a list of `Employment` objects. +Returns a list of `Contact` objects.
@@ -31806,7 +35312,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.employments.list( +client.ticketing.contacts.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -31848,7 +35354,7 @@ client.hris.employments.list(
-**employee_id:** `typing.Optional[str]` — If provided, will only return employments for this employee. +**email_address:** `typing.Optional[str]` — If provided, will only return Contacts that match this email.
@@ -31856,7 +35362,7 @@ client.hris.employments.list(
-**expand:** `typing.Optional[EmploymentsListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**expand:** `typing.Optional[typing.Literal["account"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -31904,14 +35410,6 @@ client.hris.employments.list(
-**order_by:** `typing.Optional[EmploymentsListRequestOrderBy]` — Overrides the default ordering for this endpoint. Possible values include: effective_date, -effective_date. - -
-
- -
-
- **page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -31920,14 +35418,6 @@ client.hris.employments.list(
-**remote_fields:** `typing.Optional[EmploymentsListRequestRemoteFields]` — Deprecated. Use show_enum_origins. - -
-
- -
-
- **remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -31936,14 +35426,6 @@ client.hris.employments.list(
-**show_enum_origins:** `typing.Optional[EmploymentsListRequestShowEnumOrigins]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -31956,7 +35438,7 @@ client.hris.employments.list(
-
client.hris.employments.retrieve(...) +
client.ticketing.contacts.create(...)
@@ -31968,7 +35450,7 @@ client.hris.employments.list(
-Returns an `Employment` object with the given `id`. +Creates a `Contact` object with the given values.
@@ -31984,13 +35466,14 @@ Returns an `Employment` object with the given `id`. ```python from merge import Merge +from merge.resources.ticketing import ContactRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.employments.retrieve( - id="id", +client.ticketing.contacts.create( + model=ContactRequest(), ) ``` @@ -32007,31 +35490,7 @@ client.hris.employments.retrieve(
-**id:** `str` - -
-
- -
-
- -**expand:** `typing.Optional[EmploymentsRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - -
-
- -
-
- -**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). +**model:** `ContactRequest`
@@ -32039,7 +35498,7 @@ client.hris.employments.retrieve(
-**remote_fields:** `typing.Optional[EmploymentsRetrieveRequestRemoteFields]` — Deprecated. Use show_enum_origins. +**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response.
@@ -32047,7 +35506,7 @@ client.hris.employments.retrieve(
-**show_enum_origins:** `typing.Optional[EmploymentsRetrieveRequestShowEnumOrigins]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) +**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously.
@@ -32067,8 +35526,7 @@ client.hris.employments.retrieve(
-## Hris FieldMapping -
client.hris.field_mapping.field_mappings_retrieve(...) +
client.ticketing.contacts.retrieve(...)
@@ -32080,7 +35538,7 @@ client.hris.employments.retrieve(
-Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +Returns a `Contact` object with the given `id`.
@@ -32101,7 +35559,9 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.field_mapping.field_mappings_retrieve() +client.ticketing.contacts.retrieve( + id="id", +) ``` @@ -32117,7 +35577,31 @@ client.hris.field_mapping.field_mappings_retrieve()
-**exclude_remote_field_metadata:** `typing.Optional[bool]` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. +**id:** `str` + +
+
+ +
+
+ +**expand:** `typing.Optional[typing.Literal["account"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**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).
@@ -32137,7 +35621,7 @@ client.hris.field_mapping.field_mappings_retrieve()
-
client.hris.field_mapping.field_mappings_create(...) +
client.ticketing.contacts.meta_post_retrieve()
@@ -32149,7 +35633,7 @@ client.hris.field_mapping.field_mappings_retrieve()
-Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +Returns metadata for `TicketingContact` POSTs.
@@ -32170,14 +35654,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.field_mapping.field_mappings_create( - target_field_name="example_target_field_name", - target_field_description="this is a example description of the target field", - remote_field_traversal_path=["example_remote_field"], - remote_method="GET", - remote_url_path="/example-url-path", - common_model_name="ExampleCommonModel", -) +client.ticketing.contacts.meta_post_retrieve() ``` @@ -32193,59 +35670,65 @@ client.hris.field_mapping.field_mappings_create(
-**target_field_name:** `str` — The name of the target field you want this remote field to map to. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**target_field_description:** `str` — The description of the target field you want this remote field to map to. -
+
+## Ticketing Scopes +
client.ticketing.scopes.default_scopes_retrieve()
-**remote_field_traversal_path:** `typing.Sequence[typing.Optional[typing.Any]]` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. - -
-
+#### 📝 Description
-**remote_method:** `str` — The method of the remote endpoint where the remote field is coming from. - +
+
+ +Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). +
+
+#### 🔌 Usage +
-**remote_url_path:** `str` — The path of the remote endpoint where the remote field is coming from. - +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.ticketing.scopes.default_scopes_retrieve() + +```
- -
-
- -**common_model_name:** `str` — The name of the Common Model that the remote field corresponds to in a given category. -
+#### ⚙️ Parameters +
-**exclude_remote_field_metadata:** `typing.Optional[bool]` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. - -
-
-
@@ -32261,7 +35744,7 @@ client.hris.field_mapping.field_mappings_create(
-
client.hris.field_mapping.field_mappings_destroy(...) +
client.ticketing.scopes.linked_account_scopes_retrieve()
@@ -32273,7 +35756,7 @@ client.hris.field_mapping.field_mappings_create(
-Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes).
@@ -32294,9 +35777,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.field_mapping.field_mappings_destroy( - field_mapping_id="field_mapping_id", -) +client.ticketing.scopes.linked_account_scopes_retrieve() ``` @@ -32312,14 +35793,6 @@ client.hris.field_mapping.field_mappings_destroy(
-**field_mapping_id:** `str` - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -32332,7 +35805,7 @@ client.hris.field_mapping.field_mappings_destroy(
-
client.hris.field_mapping.field_mappings_partial_update(...) +
client.ticketing.scopes.linked_account_scopes_create(...)
@@ -32344,7 +35817,7 @@ client.hris.field_mapping.field_mappings_destroy(
-Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes)
@@ -32360,13 +35833,42 @@ Create or update existing Field Mappings for a Linked Account. Changes will be r ```python from merge import Merge +from merge.resources.ticketing import ( + FieldPermissionDeserializerRequest, + IndividualCommonModelScopeDeserializerRequest, + ModelPermissionDeserializerRequest, +) client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.field_mapping.field_mappings_partial_update( - field_mapping_id="field_mapping_id", +client.ticketing.scopes.linked_account_scopes_create( + common_models=[ + IndividualCommonModelScopeDeserializerRequest( + model_name="Employee", + model_permissions={ + "READ": ModelPermissionDeserializerRequest( + is_enabled=True, + ), + "WRITE": ModelPermissionDeserializerRequest( + is_enabled=False, + ), + }, + field_permissions=FieldPermissionDeserializerRequest( + enabled_fields=["avatar", "home_location"], + disabled_fields=["work_location"], + ), + ), + IndividualCommonModelScopeDeserializerRequest( + model_name="Benefit", + model_permissions={ + "WRITE": ModelPermissionDeserializerRequest( + is_enabled=False, + ) + }, + ), + ], ) ``` @@ -32383,31 +35885,7 @@ client.hris.field_mapping.field_mappings_partial_update(
-**field_mapping_id:** `str` - -
-
- -
-
- -**remote_field_traversal_path:** `typing.Optional[typing.Sequence[typing.Optional[typing.Any]]]` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. - -
-
- -
-
- -**remote_method:** `typing.Optional[str]` — The method of the remote endpoint where the remote field is coming from. - -
-
- -
-
- -**remote_url_path:** `typing.Optional[str]` — The path of the remote endpoint where the remote field is coming from. +**common_models:** `typing.Sequence[IndividualCommonModelScopeDeserializerRequest]` — The common models you want to update the scopes for
@@ -32427,7 +35905,8 @@ client.hris.field_mapping.field_mappings_partial_update(
-
client.hris.field_mapping.remote_fields_retrieve(...) +## Ticketing DeleteAccount +
client.ticketing.delete_account.delete()
@@ -32439,7 +35918,7 @@ client.hris.field_mapping.field_mappings_partial_update(
-Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +Delete a linked account.
@@ -32460,7 +35939,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.field_mapping.remote_fields_retrieve() +client.ticketing.delete_account.delete() ``` @@ -32476,22 +35955,6 @@ client.hris.field_mapping.remote_fields_retrieve()
-**common_models:** `typing.Optional[str]` — A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. - -
-
- -
-
- -**include_example_values:** `typing.Optional[str]` — If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -32504,7 +35967,8 @@ client.hris.field_mapping.remote_fields_retrieve()
-
client.hris.field_mapping.target_fields_retrieve() +## Ticketing FieldMapping +
client.ticketing.field_mapping.field_mappings_retrieve(...)
@@ -32516,7 +35980,7 @@ client.hris.field_mapping.remote_fields_retrieve()
-Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). +Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/).
@@ -32537,7 +36001,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.field_mapping.target_fields_retrieve() +client.ticketing.field_mapping.field_mappings_retrieve() ``` @@ -32553,6 +36017,14 @@ client.hris.field_mapping.target_fields_retrieve()
+**exclude_remote_field_metadata:** `typing.Optional[bool]` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -32565,8 +36037,7 @@ client.hris.field_mapping.target_fields_retrieve()
-## Hris GenerateKey -
client.hris.generate_key.create(...) +
client.ticketing.field_mapping.field_mappings_create(...)
@@ -32578,7 +36049,7 @@ client.hris.field_mapping.target_fields_retrieve()
-Create a remote key. +Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start.
@@ -32599,8 +36070,13 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.generate_key.create( - name="Remote Deployment Key 1", +client.ticketing.field_mapping.field_mappings_create( + target_field_name="example_target_field_name", + target_field_description="this is a example description of the target field", + remote_field_traversal_path=["example_remote_field"], + remote_method="GET", + remote_url_path="/example-url-path", + common_model_name="ExampleCommonModel", ) ``` @@ -32617,7 +36093,55 @@ client.hris.generate_key.create(
-**name:** `str` — The name of the remote key +**target_field_name:** `str` — The name of the target field you want this remote field to map to. + +
+
+ +
+
+ +**target_field_description:** `str` — The description of the target field you want this remote field to map to. + +
+
+ +
+
+ +**remote_field_traversal_path:** `typing.Sequence[typing.Optional[typing.Any]]` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + +
+
+ +
+
+ +**remote_method:** `str` — The method of the remote endpoint where the remote field is coming from. + +
+
+ +
+
+ +**remote_url_path:** `str` — The path of the remote endpoint where the remote field is coming from. + +
+
+ +
+
+ +**common_model_name:** `str` — The name of the Common Model that the remote field corresponds to in a given category. + +
+
+ +
+
+ +**exclude_remote_field_metadata:** `typing.Optional[bool]` — If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations.
@@ -32637,8 +36161,7 @@ client.hris.generate_key.create(
-## Hris Groups -
client.hris.groups.list(...) +
client.ticketing.field_mapping.field_mappings_destroy(...)
@@ -32650,7 +36173,7 @@ client.hris.generate_key.create(
-Returns a list of `Group` objects. +Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start.
@@ -32671,8 +36194,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.groups.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +client.ticketing.field_mapping.field_mappings_destroy( + field_mapping_id="field_mapping_id", ) ``` @@ -32689,7 +36212,7 @@ client.hris.groups.list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. +**field_mapping_id:** `str`
@@ -32697,31 +36220,70 @@ client.hris.groups.list(
-**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
+ + + + +
+
client.ticketing.field_mapping.field_mappings_partial_update(...)
-**cursor:** `typing.Optional[str]` — The pagination cursor value. - +#### 📝 Description + +
+
+ +
+
+ +Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. +
+
+#### 🔌 Usage +
-**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/). - +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.ticketing.field_mapping.field_mappings_partial_update( + field_mapping_id="field_mapping_id", +) + +``` +
+
+#### ⚙️ Parameters +
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +
+
+ +**field_mapping_id:** `str`
@@ -32729,7 +36291,7 @@ client.hris.groups.list(
-**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). +**remote_field_traversal_path:** `typing.Optional[typing.Sequence[typing.Optional[typing.Any]]]` — The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint.
@@ -32737,7 +36299,7 @@ client.hris.groups.list(
-**is_commonly_used_as_team:** `typing.Optional[str]` — If provided, specifies whether to return only Group objects which refer to a team in the third party platform. Note that this is an opinionated view based on how a team may be represented in the third party platform. +**remote_method:** `typing.Optional[str]` — The method of the remote endpoint where the remote field is coming from.
@@ -32745,7 +36307,7 @@ client.hris.groups.list(
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +**remote_url_path:** `typing.Optional[str]` — The path of the remote endpoint where the remote field is coming from.
@@ -32753,47 +36315,68 @@ client.hris.groups.list(
-**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+
+
-
-
-**names:** `typing.Optional[str]` — If provided, will only return groups with these names. Multiple values can be separated by commas. -
+
+
client.ticketing.field_mapping.remote_fields_retrieve(...)
-**page_size:** `typing.Optional[int]` — Number of results to return per page. - -
-
+#### 📝 Description
-**remote_fields:** `typing.Optional[typing.Literal["type"]]` — Deprecated. Use show_enum_origins. - +
+
+ +Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). +
+
+#### 🔌 Usage +
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. - +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.ticketing.field_mapping.remote_fields_retrieve() + +``` +
+
+#### ⚙️ Parameters +
-**show_enum_origins:** `typing.Optional[typing.Literal["type"]]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) +
+
+ +**common_models:** `typing.Optional[str]` — A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models.
@@ -32801,7 +36384,7 @@ client.hris.groups.list(
-**types:** `typing.Optional[str]` — If provided, will only return groups of these types. Multiple values can be separated by commas. +**include_example_values:** `typing.Optional[str]` — If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers.
@@ -32821,7 +36404,7 @@ client.hris.groups.list(
-
client.hris.groups.retrieve(...) +
client.ticketing.field_mapping.target_fields_retrieve()
@@ -32833,7 +36416,7 @@ client.hris.groups.list(
-Returns a `Group` object with the given `id`. +Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/).
@@ -32854,9 +36437,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.groups.retrieve( - id="id", -) +client.ticketing.field_mapping.target_fields_retrieve() ``` @@ -32872,39 +36453,71 @@ client.hris.groups.retrieve(
-**id:** `str` +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. -
+
+## Ticketing GenerateKey +
client.ticketing.generate_key.create(...)
-**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). - +#### 📝 Description + +
+
+ +
+
+ +Create a remote key. +
+
+#### 🔌 Usage +
-**remote_fields:** `typing.Optional[typing.Literal["type"]]` — Deprecated. Use show_enum_origins. - +
+
+ +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.ticketing.generate_key.create( + name="Remote Deployment Key 1", +) + +```
+
+
+ +#### ⚙️ Parameters
-**show_enum_origins:** `typing.Optional[typing.Literal["type"]]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) +
+
+ +**name:** `str` — The name of the remote key
@@ -32924,8 +36537,8 @@ client.hris.groups.retrieve(
-## Hris Issues -
client.hris.issues.list(...) +## Ticketing Issues +
client.ticketing.issues.list(...)
@@ -32958,7 +36571,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.issues.list( +client.ticketing.issues.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -33105,7 +36718,7 @@ Status of the issue. Options: ('ONGOING', 'RESOLVED')
-
client.hris.issues.retrieve(...) +
client.ticketing.issues.retrieve(...)
@@ -33138,7 +36751,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.issues.retrieve( +client.ticketing.issues.retrieve( id="id", ) @@ -33176,8 +36789,8 @@ client.hris.issues.retrieve(
-## Hris LinkToken -
client.hris.link_token.create(...) +## Ticketing LinkToken +
client.ticketing.link_token.create(...)
@@ -33205,13 +36818,13 @@ Creates a link token to be used when linking a new end user. ```python from merge import Merge -from merge.resources.hris import CategoriesEnum +from merge.resources.ticketing import CategoriesEnum client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.link_token.create( +client.ticketing.link_token.create( end_user_email_address="example@gmail.com", end_user_organization_name="Test Organization", end_user_origin_id="12345", @@ -33360,8 +36973,8 @@ The following subset of IETF language tags can be used to configure localization
-## Hris LinkedAccounts -
client.hris.linked_accounts.list(...) +## Ticketing LinkedAccounts +
client.ticketing.linked_accounts.list(...)
@@ -33394,7 +37007,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.linked_accounts.list( +client.ticketing.linked_accounts.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -33538,8 +37151,8 @@ Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing`
-## Hris Locations -
client.hris.locations.list(...) +## Ticketing Passthrough +
client.ticketing.passthrough.create(...)
@@ -33551,7 +37164,7 @@ Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `mktg`, `ticketing`
-Returns a list of `Location` objects. +Pull data from an endpoint not currently supported by Merge.
@@ -33567,13 +37180,17 @@ Returns a list of `Location` objects. ```python from merge import Merge +from merge.resources.ticketing import DataPassthroughRequest, MethodEnum client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.locations.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +client.ticketing.passthrough.create( + request=DataPassthroughRequest( + method=MethodEnum.GET, + path="/scooters", + ), ) ``` @@ -33590,108 +37207,7 @@ client.hris.locations.list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. - -
-
- -
-
- -**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. - -
-
- -
-
- -**cursor:** `typing.Optional[str]` — The pagination cursor value. - -
-
- -
-
- -**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). - -
-
- -
-
- -**location_type:** `typing.Optional[LocationsListRequestLocationType]` - -If provided, will only return locations with this location_type - -* `HOME` - HOME -* `WORK` - WORK - -
-
- -
-
- -**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. - -
-
- -
-
- -**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. - -
-
- -
-
- -**page_size:** `typing.Optional[int]` — Number of results to return per page. - -
-
- -
-
- -**remote_fields:** `typing.Optional[LocationsListRequestRemoteFields]` — Deprecated. Use show_enum_origins. - -
-
- -
-
- -**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. - -
-
- -
-
- -**show_enum_origins:** `typing.Optional[LocationsListRequestShowEnumOrigins]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) +**request:** `DataPassthroughRequest`
@@ -33711,7 +37227,8 @@ If provided, will only return locations with this location_type
-
client.hris.locations.retrieve(...) +## Ticketing Projects +
client.ticketing.projects.list(...)
@@ -33723,7 +37240,7 @@ If provided, will only return locations with this location_type
-Returns a `Location` object with the given `id`. +Returns a list of `Project` objects.
@@ -33744,8 +37261,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.locations.retrieve( - id="id", +client.ticketing.projects.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) ``` @@ -33762,7 +37279,31 @@ client.hris.locations.retrieve(
-**id:** `str` +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ +**cursor:** `typing.Optional[str]` — The pagination cursor value. + +
+
+ +
+
+ +**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/).
@@ -33786,7 +37327,7 @@ client.hris.locations.retrieve(
-**remote_fields:** `typing.Optional[LocationsRetrieveRequestRemoteFields]` — Deprecated. Use show_enum_origins. +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned.
@@ -33794,7 +37335,23 @@ client.hris.locations.retrieve(
-**show_enum_origins:** `typing.Optional[LocationsRetrieveRequestShowEnumOrigins]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ +**page_size:** `typing.Optional[int]` — Number of results to return per page. + +
+
+ +
+
+ +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -33814,8 +37371,7 @@ client.hris.locations.retrieve(
-## Hris Passthrough -
client.hris.passthrough.create(...) +
client.ticketing.projects.retrieve(...)
@@ -33827,7 +37383,7 @@ client.hris.locations.retrieve(
-Pull data from an endpoint not currently supported by Merge. +Returns a `Project` object with the given `id`.
@@ -33843,17 +37399,13 @@ Pull data from an endpoint not currently supported by Merge. ```python from merge import Merge -from merge.resources.hris import DataPassthroughRequest, MethodEnum client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.passthrough.create( - request=DataPassthroughRequest( - method=MethodEnum.GET, - path="/scooters", - ), +client.ticketing.projects.retrieve( + id="id", ) ``` @@ -33870,7 +37422,23 @@ client.hris.passthrough.create(
-**request:** `DataPassthroughRequest` +**id:** `str` + +
+
+ +
+
+ +**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).
@@ -33890,8 +37458,7 @@ client.hris.passthrough.create(
-## Hris PayGroups -
client.hris.pay_groups.list(...) +
client.ticketing.projects.users_list(...)
@@ -33903,7 +37470,7 @@ client.hris.passthrough.create(
-Returns a list of `PayGroup` objects. +Returns a list of `User` objects.
@@ -33924,7 +37491,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.pay_groups.list( +client.ticketing.projects.users_list( + parent_id="parent_id", cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -33942,7 +37510,7 @@ client.hris.pay_groups.list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. +**parent_id:** `str`
@@ -33950,7 +37518,7 @@ client.hris.pay_groups.list(
-**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -33958,7 +37526,7 @@ client.hris.pay_groups.list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**expand:** `typing.Optional[ProjectsUsersListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -33990,22 +37558,6 @@ client.hris.pay_groups.list(
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. - -
-
- -
-
- -**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. - -
-
- -
-
- **page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -34014,14 +37566,6 @@ client.hris.pay_groups.list(
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -34034,7 +37578,8 @@ client.hris.pay_groups.list(
-
client.hris.pay_groups.retrieve(...) +## Ticketing RegenerateKey +
client.ticketing.regenerate_key.create(...)
@@ -34046,7 +37591,7 @@ client.hris.pay_groups.list(
-Returns a `PayGroup` object with the given `id`. +Exchange remote keys.
@@ -34067,8 +37612,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.pay_groups.retrieve( - id="id", +client.ticketing.regenerate_key.create( + name="Remote Deployment Key 1", ) ``` @@ -34085,23 +37630,7 @@ client.hris.pay_groups.retrieve(
-**id:** `str` - -
-
- -
-
- -**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). +**name:** `str` — The name of the remote key
@@ -34121,8 +37650,8 @@ client.hris.pay_groups.retrieve(
-## Hris PayrollRuns -
client.hris.payroll_runs.list(...) +## Ticketing Roles +
client.ticketing.roles.list(...)
@@ -34134,7 +37663,7 @@ client.hris.pay_groups.retrieve(
-Returns a list of `PayrollRun` objects. +Returns a list of `Role` objects.
@@ -34155,7 +37684,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.payroll_runs.list( +client.ticketing.roles.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -34197,7 +37726,7 @@ client.hris.payroll_runs.list(
-**ended_after:** `typing.Optional[dt.datetime]` — If provided, will only return payroll runs ended after this datetime. +**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/).
@@ -34205,7 +37734,7 @@ client.hris.payroll_runs.list(
-**ended_before:** `typing.Optional[dt.datetime]` — If provided, will only return payroll runs ended before this datetime. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -34213,7 +37742,7 @@ client.hris.payroll_runs.list(
-**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_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).
@@ -34221,7 +37750,7 @@ client.hris.payroll_runs.list(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned.
@@ -34229,7 +37758,7 @@ client.hris.payroll_runs.list(
-**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). +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned.
@@ -34237,7 +37766,7 @@ client.hris.payroll_runs.list(
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +**page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -34245,7 +37774,7 @@ client.hris.payroll_runs.list(
-**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -34253,47 +37782,70 @@ client.hris.payroll_runs.list(
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**remote_fields:** `typing.Optional[PayrollRunsListRequestRemoteFields]` — Deprecated. Use show_enum_origins. -
+
+
client.ticketing.roles.retrieve(...)
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. - +#### 📝 Description + +
+
+ +
+
+ +Returns a `Role` object with the given `id`.
+
+
+ +#### 🔌 Usage
-**run_type:** `typing.Optional[PayrollRunsListRequestRunType]` +
+
-If provided, will only return PayrollRun's with this status. Options: ('REGULAR', 'OFF_CYCLE', 'CORRECTION', 'TERMINATION', 'SIGN_ON_BONUS') +```python +from merge import Merge -* `REGULAR` - REGULAR -* `OFF_CYCLE` - OFF_CYCLE -* `CORRECTION` - CORRECTION -* `TERMINATION` - TERMINATION -* `SIGN_ON_BONUS` - SIGN_ON_BONUS - +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.ticketing.roles.retrieve( + id="id", +) + +``` +
+
+#### ⚙️ Parameters +
-**show_enum_origins:** `typing.Optional[PayrollRunsListRequestShowEnumOrigins]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) +
+
+ +**id:** `str`
@@ -34301,7 +37853,7 @@ If provided, will only return PayrollRun's with this status. Options: ('REGULAR'
-**started_after:** `typing.Optional[dt.datetime]` — If provided, will only return payroll runs started after this datetime. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -34309,7 +37861,7 @@ If provided, will only return PayrollRun's with this status. Options: ('REGULAR'
-**started_before:** `typing.Optional[dt.datetime]` — If provided, will only return payroll runs started before this datetime. +**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).
@@ -34329,7 +37881,8 @@ If provided, will only return PayrollRun's with this status. Options: ('REGULAR'
-
client.hris.payroll_runs.retrieve(...) +## Ticketing SyncStatus +
client.ticketing.sync_status.list(...)
@@ -34341,7 +37894,7 @@ If provided, will only return PayrollRun's with this status. Options: ('REGULAR'
-Returns a `PayrollRun` object with the given `id`. +Get sync status for the current sync and the most recently finished sync. `last_sync_start` represents the most recent time any sync began. `last_sync_finished` represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the `last_sync_finished` timestamp where `last_sync_result` is `DONE`. Possible values for `status` and `last_sync_result` are `DISABLED`, `DONE`, `FAILED`, `PARTIALLY_SYNCED`, `PAUSED`, `SYNCING`. Learn more about sync status in our [Help Center](https://help.merge.dev/en/articles/8184193-merge-sync-statuses).
@@ -34362,49 +37915,25 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.payroll_runs.retrieve( - id="id", -) - -``` - -
- - - -#### ⚙️ Parameters - -
-
- -
-
+client.ticketing.sync_status.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +) -**id:** `str` - +```
- -
-
- -**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. -
+#### ⚙️ Parameters +
-**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). - -
-
-
-**remote_fields:** `typing.Optional[PayrollRunsRetrieveRequestRemoteFields]` — Deprecated. Use show_enum_origins. +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -34412,7 +37941,7 @@ client.hris.payroll_runs.retrieve(
-**show_enum_origins:** `typing.Optional[PayrollRunsRetrieveRequestShowEnumOrigins]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) +**page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -34432,8 +37961,8 @@ client.hris.payroll_runs.retrieve(
-## Hris RegenerateKey -
client.hris.regenerate_key.create(...) +## Ticketing ForceResync +
client.ticketing.force_resync.sync_status_resync_create()
@@ -34445,7 +37974,7 @@ client.hris.payroll_runs.retrieve(
-Exchange remote keys. +Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers.
@@ -34466,9 +37995,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.regenerate_key.create( - name="Remote Deployment Key 1", -) +client.ticketing.force_resync.sync_status_resync_create() ``` @@ -34484,14 +38011,6 @@ client.hris.regenerate_key.create(
-**name:** `str` — The name of the remote key - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -34504,8 +38023,8 @@ client.hris.regenerate_key.create(
-## Hris SyncStatus -
client.hris.sync_status.list(...) +## Ticketing Tags +
client.ticketing.tags.list(...)
@@ -34517,7 +38036,7 @@ client.hris.regenerate_key.create(
-Get sync status for the current sync and the most recently finished sync. `last_sync_start` represents the most recent time any sync began. `last_sync_finished` represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the `last_sync_finished` timestamp where `last_sync_result` is `DONE`. Possible values for `status` and `last_sync_result` are `DISABLED`, `DONE`, `FAILED`, `PARTIALLY_SYNCED`, `PAUSED`, `SYNCING`. Learn more about sync status in our [Help Center](https://help.merge.dev/en/articles/8184193-merge-sync-statuses). +Returns a list of `Tag` objects.
@@ -34538,7 +38057,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.sync_status.list( +client.ticketing.tags.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -34556,6 +38075,22 @@ client.hris.sync_status.list(
+**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. + +
+
+ +
+
+ **cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -34564,6 +38099,46 @@ client.hris.sync_status.list(
+**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). + +
+
+ +
+
+ +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+ +
+
+ +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. + +
+
+ +
+
+ **page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -34572,6 +38147,14 @@ client.hris.sync_status.list(
+**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -34584,8 +38167,7 @@ client.hris.sync_status.list(
-## Hris ForceResync -
client.hris.force_resync.sync_status_resync_create() +
client.ticketing.tags.retrieve(...)
@@ -34597,7 +38179,7 @@ client.hris.sync_status.list(
-Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. +Returns a `Tag` object with the given `id`.
@@ -34618,7 +38200,9 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.force_resync.sync_status_resync_create() +client.ticketing.tags.retrieve( + id="id", +) ``` @@ -34634,6 +38218,30 @@ client.hris.force_resync.sync_status_resync_create()
+**id:** `str` + +
+
+ +
+
+ +**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). + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -34646,8 +38254,8 @@ client.hris.force_resync.sync_status_resync_create()
-## Hris Teams -
client.hris.teams.list(...) +## Ticketing Teams +
client.ticketing.teams.list(...)
@@ -34680,7 +38288,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.teams.list( +client.ticketing.teams.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -34722,14 +38330,6 @@ client.hris.teams.list(
-**expand:** `typing.Optional[typing.Literal["parent_team"]]` — 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/).
@@ -34778,14 +38378,6 @@ client.hris.teams.list(
-**parent_team_id:** `typing.Optional[str]` — If provided, will only return teams with this parent team. - -
-
- -
-
- **remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -34806,7 +38398,7 @@ client.hris.teams.list(
-
client.hris.teams.retrieve(...) +
client.ticketing.teams.retrieve(...)
@@ -34839,7 +38431,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.teams.retrieve( +client.ticketing.teams.retrieve( id="id", ) @@ -34865,14 +38457,6 @@ client.hris.teams.retrieve(
-**expand:** `typing.Optional[typing.Literal["parent_team"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - -
-
- -
-
- **include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -34901,8 +38485,8 @@ client.hris.teams.retrieve(
-## Hris TimeOff -
client.hris.time_off.list(...) +## Ticketing Tickets +
client.ticketing.tickets.list(...)
@@ -34914,7 +38498,7 @@ client.hris.teams.retrieve(
-Returns a list of `TimeOff` objects. +Returns a list of `Ticket` objects.
@@ -34935,25 +38519,113 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.time_off.list( +client.ticketing.tickets.list( cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) -``` +``` + +
+ + + +#### ⚙️ Parameters + +
+
+ +
+
+ +**account_id:** `typing.Optional[str]` — If provided, will only return tickets for this account. + +
+
+ +
+
+ +**assignee_ids:** `typing.Optional[str]` — If provided, will only return tickets assigned to the assignee_ids; multiple assignee_ids can be separated by commas. + +
+
+ +
+
+ +**collection_ids:** `typing.Optional[str]` — If provided, will only return tickets assigned to the collection_ids; multiple collection_ids can be separated by commas. + +
+
+ +
+
+ +**completed_after:** `typing.Optional[dt.datetime]` — If provided, will only return tickets completed after this datetime. + +
+
+ +
+
+ +**completed_before:** `typing.Optional[dt.datetime]` — If provided, will only return tickets completed before this datetime. + +
+
+ +
+
+ +**contact_id:** `typing.Optional[str]` — If provided, will only return tickets for this contact. + +
+
+ +
+
+ +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. + +
+
+ +
+
+ +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +
+ +
+
+ +**creator_id:** `typing.Optional[str]` — If provided, will only return tickets created by this creator_id. +
-#### ⚙️ Parameters +
+
+ +**cursor:** `typing.Optional[str]` — The pagination cursor value. + +
+
+**due_after:** `typing.Optional[dt.datetime]` — If provided, will only return tickets due after this datetime. + +
+
+
-**approver_id:** `typing.Optional[str]` — If provided, will only return time off for this approver. +**due_before:** `typing.Optional[dt.datetime]` — If provided, will only return tickets due before this datetime.
@@ -34961,7 +38633,7 @@ client.hris.time_off.list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. +**expand:** `typing.Optional[TicketsListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -34969,7 +38641,7 @@ client.hris.time_off.list(
-**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +**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/).
@@ -34977,7 +38649,7 @@ client.hris.time_off.list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -34985,7 +38657,7 @@ client.hris.time_off.list(
-**employee_id:** `typing.Optional[str]` — If provided, will only return time off for this employee. +**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format.
@@ -34993,7 +38665,7 @@ client.hris.time_off.list(
-**ended_after:** `typing.Optional[dt.datetime]` — If provided, will only return employees that ended after this datetime. +**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).
@@ -35001,7 +38673,7 @@ client.hris.time_off.list(
-**ended_before:** `typing.Optional[dt.datetime]` — If provided, will only return time-offs that ended before this datetime. +**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned.
@@ -35009,7 +38681,7 @@ client.hris.time_off.list(
-**expand:** `typing.Optional[TimeOffListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned.
@@ -35017,7 +38689,7 @@ client.hris.time_off.list(
-**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/). +**name:** `typing.Optional[str]` — If provided, will only return tickets with this name.
@@ -35025,7 +38697,7 @@ client.hris.time_off.list(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -35033,7 +38705,7 @@ client.hris.time_off.list(
-**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). +**parent_ticket_id:** `typing.Optional[str]` — If provided, will only return sub tickets of the parent_ticket_id.
@@ -35041,7 +38713,14 @@ client.hris.time_off.list(
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +**priority:** `typing.Optional[TicketsListRequestPriority]` + +If provided, will only return tickets of this priority. + +* `URGENT` - URGENT +* `HIGH` - HIGH +* `NORMAL` - NORMAL +* `LOW` - LOW
@@ -35049,7 +38728,7 @@ client.hris.time_off.list(
-**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. +**remote_created_after:** `typing.Optional[dt.datetime]` — If provided, will only return tickets created in the third party platform after this datetime.
@@ -35057,7 +38736,7 @@ client.hris.time_off.list(
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +**remote_created_before:** `typing.Optional[dt.datetime]` — If provided, will only return tickets created in the third party platform before this datetime.
@@ -35065,7 +38744,7 @@ client.hris.time_off.list(
-**remote_fields:** `typing.Optional[TimeOffListRequestRemoteFields]` — Deprecated. Use show_enum_origins. +**remote_fields:** `typing.Optional[TicketsListRequestRemoteFields]` — Deprecated. Use show_enum_origins.
@@ -35081,16 +38760,15 @@ client.hris.time_off.list(
-**request_type:** `typing.Optional[TimeOffListRequestRequestType]` +**remote_updated_after:** `typing.Optional[dt.datetime]` — If provided, will only return tickets updated in the third party platform after this datetime. + +
+
-If provided, will only return TimeOff with this request type. Options: ('VACATION', 'SICK', 'PERSONAL', 'JURY_DUTY', 'VOLUNTEER', 'BEREAVEMENT') +
+
-* `VACATION` - VACATION -* `SICK` - SICK -* `PERSONAL` - PERSONAL -* `JURY_DUTY` - JURY_DUTY -* `VOLUNTEER` - VOLUNTEER -* `BEREAVEMENT` - BEREAVEMENT +**remote_updated_before:** `typing.Optional[dt.datetime]` — If provided, will only return tickets updated in the third party platform before this datetime.
@@ -35098,7 +38776,7 @@ If provided, will only return TimeOff with this request type. Options: ('VACATIO
-**show_enum_origins:** `typing.Optional[TimeOffListRequestShowEnumOrigins]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) +**show_enum_origins:** `typing.Optional[TicketsListRequestShowEnumOrigins]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter)
@@ -35106,7 +38784,7 @@ If provided, will only return TimeOff with this request type. Options: ('VACATIO
-**started_after:** `typing.Optional[dt.datetime]` — If provided, will only return time-offs that started after this datetime. +**status:** `typing.Optional[str]` — If provided, will only return tickets of this status.
@@ -35114,7 +38792,7 @@ If provided, will only return TimeOff with this request type. Options: ('VACATIO
-**started_before:** `typing.Optional[dt.datetime]` — If provided, will only return time-offs that started before this datetime. +**tags:** `typing.Optional[str]` — If provided, will only return tickets matching the tags; multiple tags can be separated by commas.
@@ -35122,15 +38800,15 @@ If provided, will only return TimeOff with this request type. Options: ('VACATIO
-**status:** `typing.Optional[TimeOffListRequestStatus]` +**ticket_type:** `typing.Optional[str]` — If provided, will only return tickets of this type. + +
+
-If provided, will only return TimeOff with this status. Options: ('REQUESTED', 'APPROVED', 'DECLINED', 'CANCELLED', 'DELETED') +
+
-* `REQUESTED` - REQUESTED -* `APPROVED` - APPROVED -* `DECLINED` - DECLINED -* `CANCELLED` - CANCELLED -* `DELETED` - DELETED +**ticket_url:** `typing.Optional[str]` — If provided, will only return tickets where the URL matches or contains the substring
@@ -35150,7 +38828,7 @@ If provided, will only return TimeOff with this status. Options: ('REQUESTED', '
-
client.hris.time_off.create(...) +
client.ticketing.tickets.create(...)
@@ -35162,7 +38840,7 @@ If provided, will only return TimeOff with this status. Options: ('REQUESTED', '
-Creates a `TimeOff` object with the given values. +Creates a `Ticket` object with the given values.
@@ -35178,14 +38856,14 @@ Creates a `TimeOff` object with the given values. ```python from merge import Merge -from merge.resources.hris import TimeOffRequest +from merge.resources.ticketing import TicketRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.time_off.create( - model=TimeOffRequest(), +client.ticketing.tickets.create( + model=TicketRequest(), ) ``` @@ -35202,7 +38880,7 @@ client.hris.time_off.create(
-**model:** `TimeOffRequest` +**model:** `TicketRequest`
@@ -35238,7 +38916,7 @@ client.hris.time_off.create(
-
client.hris.time_off.retrieve(...) +
client.ticketing.tickets.retrieve(...)
@@ -35250,7 +38928,7 @@ client.hris.time_off.create(
-Returns a `TimeOff` object with the given `id`. +Returns a `Ticket` object with the given `id`.
@@ -35271,7 +38949,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.time_off.retrieve( +client.ticketing.tickets.retrieve( id="id", ) @@ -35297,7 +38975,7 @@ client.hris.time_off.retrieve(
-**expand:** `typing.Optional[TimeOffRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**expand:** `typing.Optional[TicketsRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -35313,6 +38991,14 @@ client.hris.time_off.retrieve(
+**include_remote_fields:** `typing.Optional[bool]` — Whether to include all remote fields, including fields that Merge did not map to common models, in a normalized format. + +
+
+ +
+
+ **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).
@@ -35321,7 +39007,7 @@ client.hris.time_off.retrieve(
-**remote_fields:** `typing.Optional[TimeOffRetrieveRequestRemoteFields]` — Deprecated. Use show_enum_origins. +**remote_fields:** `typing.Optional[TicketsRetrieveRequestRemoteFields]` — Deprecated. Use show_enum_origins.
@@ -35329,7 +39015,7 @@ client.hris.time_off.retrieve(
-**show_enum_origins:** `typing.Optional[TimeOffRetrieveRequestShowEnumOrigins]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) +**show_enum_origins:** `typing.Optional[TicketsRetrieveRequestShowEnumOrigins]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter)
@@ -35349,7 +39035,7 @@ client.hris.time_off.retrieve(
-
client.hris.time_off.meta_post_retrieve() +
client.ticketing.tickets.partial_update(...)
@@ -35361,7 +39047,7 @@ client.hris.time_off.retrieve(
-Returns metadata for `TimeOff` POSTs. +Updates a `Ticket` object with the given `id`.
@@ -35377,12 +39063,16 @@ Returns metadata for `TimeOff` POSTs. ```python from merge import Merge +from merge.resources.ticketing import PatchedTicketRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.time_off.meta_post_retrieve() +client.ticketing.tickets.partial_update( + id="id", + model=PatchedTicketRequest(), +) ``` @@ -35398,6 +39088,38 @@ client.hris.time_off.meta_post_retrieve()
+**id:** `str` + +
+
+ +
+
+ +**model:** `PatchedTicketRequest` + +
+
+ +
+
+ +**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. + +
+
+ +
+
+ +**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -35410,8 +39132,7 @@ client.hris.time_off.meta_post_retrieve()
-## Hris TimeOffBalances -
client.hris.time_off_balances.list(...) +
client.ticketing.tickets.viewers_list(...)
@@ -35423,7 +39144,7 @@ client.hris.time_off.meta_post_retrieve()
-Returns a list of `TimeOffBalance` objects. +Returns a list of `Viewer` objects that point to a User id or Team id that is either an assignee or viewer on a `Ticket` with the given id. [Learn more.](https://help.merge.dev/en/articles/10333658-ticketing-access-control-list-acls)
@@ -35444,7 +39165,8 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.time_off_balances.list( +client.ticketing.tickets.viewers_list( + ticket_id="ticket_id", cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) @@ -35462,15 +39184,7 @@ client.hris.time_off_balances.list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. - -
-
- -
-
- -**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +**ticket_id:** `str`
@@ -35486,15 +39200,7 @@ client.hris.time_off_balances.list(
-**employee_id:** `typing.Optional[str]` — If provided, will only return time off balances for this employee. - -
-
- -
-
- -**expand:** `typing.Optional[typing.Literal["employee"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**expand:** `typing.Optional[TicketsViewersListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces.
@@ -35518,64 +39224,7 @@ client.hris.time_off_balances.list(
-**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). - -
-
- -
-
- -**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. - -
-
- -
-
- -**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. - -
-
- -
-
- -**page_size:** `typing.Optional[int]` — Number of results to return per page. - -
-
- -
-
- -**policy_type:** `typing.Optional[TimeOffBalancesListRequestPolicyType]` - -If provided, will only return TimeOffBalance with this policy type. Options: ('VACATION', 'SICK', 'PERSONAL', 'JURY_DUTY', 'VOLUNTEER', 'BEREAVEMENT') - -* `VACATION` - VACATION -* `SICK` - SICK -* `PERSONAL` - PERSONAL -* `JURY_DUTY` - JURY_DUTY -* `VOLUNTEER` - VOLUNTEER -* `BEREAVEMENT` - BEREAVEMENT - -
-
- -
-
- -**remote_fields:** `typing.Optional[typing.Literal["policy_type"]]` — Deprecated. Use show_enum_origins. - -
-
- -
-
- -**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. +**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).
@@ -35583,7 +39232,7 @@ If provided, will only return TimeOffBalance with this policy type. Options: ('V
-**show_enum_origins:** `typing.Optional[typing.Literal["policy_type"]]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) +**page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -35603,7 +39252,7 @@ If provided, will only return TimeOffBalance with this policy type. Options: ('V
-
client.hris.time_off_balances.retrieve(...) +
client.ticketing.tickets.meta_patch_retrieve(...)
@@ -35615,7 +39264,7 @@ If provided, will only return TimeOffBalance with this policy type. Options: ('V
-Returns a `TimeOffBalance` object with the given `id`. +Returns metadata for `Ticket` PATCHs.
@@ -35636,7 +39285,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.time_off_balances.retrieve( +client.ticketing.tickets.meta_patch_retrieve( id="id", ) @@ -35662,46 +39311,6 @@ client.hris.time_off_balances.retrieve(
-**expand:** `typing.Optional[typing.Literal["employee"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - -
-
- -
-
- -**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). - -
-
- -
-
- -**remote_fields:** `typing.Optional[typing.Literal["policy_type"]]` — Deprecated. Use show_enum_origins. - -
-
- -
-
- -**show_enum_origins:** `typing.Optional[typing.Literal["policy_type"]]` — A comma separated list of enum field names for which you'd like the original values to be returned, instead of Merge's normalized enum values. [Learn more](https://help.merge.dev/en/articles/8950958-show_enum_origins-query-parameter) - -
-
- -
-
- **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -35714,8 +39323,7 @@ client.hris.time_off_balances.retrieve(
-## Hris TimesheetEntries -
client.hris.timesheet_entries.list(...) +
client.ticketing.tickets.meta_post_retrieve(...)
@@ -35727,7 +39335,7 @@ client.hris.time_off_balances.retrieve(
-Returns a list of `TimesheetEntry` objects. +Returns metadata for `Ticket` POSTs.
@@ -35748,9 +39356,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.timesheet_entries.list( - cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", -) +client.ticketing.tickets.meta_post_retrieve() ``` @@ -35766,7 +39372,7 @@ client.hris.timesheet_entries.list(
-**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime. +**collection_id:** `typing.Optional[str]` — If provided, will only return tickets for this collection.
@@ -35774,7 +39380,7 @@ client.hris.timesheet_entries.list(
-**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime. +**ticket_type:** `typing.Optional[str]` — If provided, will only return tickets for this ticket type.
@@ -35782,63 +39388,70 @@ client.hris.timesheet_entries.list(
-**cursor:** `typing.Optional[str]` — The pagination cursor value. +**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
+ +
-
-
-**employee_id:** `typing.Optional[str]` — If provided, will only return timesheet entries for this employee. -
+
+
client.ticketing.tickets.remote_field_classes_list(...)
-**ended_after:** `typing.Optional[dt.datetime]` — If provided, will only return timesheet entries ended after this datetime. - -
-
+#### 📝 Description
-**ended_before:** `typing.Optional[dt.datetime]` — If provided, will only return timesheet entries ended before this datetime. - -
-
-
-**expand:** `typing.Optional[typing.Literal["employee"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. - +Returns a list of `RemoteFieldClass` objects. +
+
+#### 🔌 Usage +
-**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. - +```python +from merge import Merge + +client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", +) +client.ticketing.tickets.remote_field_classes_list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", +) + +```
+ + + +#### ⚙️ Parameters
-**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). +
+
+ +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -35846,7 +39459,7 @@ client.hris.timesheet_entries.list(
-**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. +**ids:** `typing.Optional[str]` — If provided, will only return remote field classes with the `ids` in this list
@@ -35854,7 +39467,7 @@ client.hris.timesheet_entries.list(
-**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned. +**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/).
@@ -35862,7 +39475,7 @@ client.hris.timesheet_entries.list(
-**order_by:** `typing.Optional[TimesheetEntriesListRequestOrderBy]` — Overrides the default ordering for this endpoint. Possible values include: start_time, -start_time. +**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models.
@@ -35870,7 +39483,7 @@ client.hris.timesheet_entries.list(
-**page_size:** `typing.Optional[int]` — Number of results to return per page. +**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).
@@ -35878,7 +39491,7 @@ client.hris.timesheet_entries.list(
-**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object. +**is_common_model_field:** `typing.Optional[bool]` — If provided, will only return remote field classes with this is_common_model_field value
@@ -35886,7 +39499,7 @@ client.hris.timesheet_entries.list(
-**started_after:** `typing.Optional[dt.datetime]` — If provided, will only return timesheet entries started after this datetime. +**is_custom:** `typing.Optional[bool]` — If provided, will only return remote fields classes with this is_custom value
@@ -35894,7 +39507,7 @@ client.hris.timesheet_entries.list(
-**started_before:** `typing.Optional[dt.datetime]` — If provided, will only return timesheet entries started before this datetime. +**page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -35914,7 +39527,8 @@ client.hris.timesheet_entries.list(
-
client.hris.timesheet_entries.create(...) +## Ticketing Users +
client.ticketing.users.list(...)
@@ -35926,7 +39540,7 @@ client.hris.timesheet_entries.list(
-Creates a `TimesheetEntry` object with the given values. +Returns a list of `User` objects.
@@ -35942,14 +39556,13 @@ Creates a `TimesheetEntry` object with the given values. ```python from merge import Merge -from merge.resources.hris import TimesheetEntryRequest client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.timesheet_entries.create( - model=TimesheetEntryRequest(), +client.ticketing.users.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", ) ``` @@ -35966,7 +39579,7 @@ client.hris.timesheet_entries.create(
-**model:** `TimesheetEntryRequest` +**created_after:** `typing.Optional[dt.datetime]` — If provided, will only return objects created after this datetime.
@@ -35974,7 +39587,7 @@ client.hris.timesheet_entries.create(
-**is_debug_mode:** `typing.Optional[bool]` — Whether to include debug fields (such as log file links) in the response. +**created_before:** `typing.Optional[dt.datetime]` — If provided, will only return objects created before this datetime.
@@ -35982,7 +39595,7 @@ client.hris.timesheet_entries.create(
-**run_async:** `typing.Optional[bool]` — Whether or not third-party updates should be run asynchronously. +**cursor:** `typing.Optional[str]` — The pagination cursor value.
@@ -35990,70 +39603,55 @@ client.hris.timesheet_entries.create(
-**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration. +**email_address:** `typing.Optional[str]` — If provided, will only return users with emails equal to this value (case insensitive).
- -
+
+
+**expand:** `typing.Optional[UsersListRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +
-
-
client.hris.timesheet_entries.retrieve(...)
-#### 📝 Description - -
-
+**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/). + +
+
-Returns a `TimesheetEntry` object with the given `id`. -
-
+**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +
-#### 🔌 Usage -
-
-
- -```python -from merge import Merge - -client = Merge( - account_token="YOUR_ACCOUNT_TOKEN", - api_key="YOUR_API_KEY", -) -client.hris.timesheet_entries.retrieve( - id="id", -) - -``` -
-
+**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). +
-#### ⚙️ Parameters -
+**modified_after:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge after this date time will be returned. + +
+
+
-**id:** `str` +**modified_before:** `typing.Optional[dt.datetime]` — If provided, only objects synced by Merge before this date time will be returned.
@@ -36061,7 +39659,7 @@ client.hris.timesheet_entries.retrieve(
-**expand:** `typing.Optional[typing.Literal["employee"]]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. +**page_size:** `typing.Optional[int]` — Number of results to return per page.
@@ -36069,7 +39667,7 @@ client.hris.timesheet_entries.retrieve(
-**include_remote_data:** `typing.Optional[bool]` — Whether to include the original data Merge fetched from the third-party to produce these models. +**remote_id:** `typing.Optional[str]` — The API provider's ID for the given object.
@@ -36077,7 +39675,7 @@ client.hris.timesheet_entries.retrieve(
-**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). +**team:** `typing.Optional[str]` — If provided, will only return users matching in this team.
@@ -36097,7 +39695,7 @@ client.hris.timesheet_entries.retrieve(
-
client.hris.timesheet_entries.meta_post_retrieve() +
client.ticketing.users.retrieve(...)
@@ -36109,7 +39707,7 @@ client.hris.timesheet_entries.retrieve(
-Returns metadata for `TimesheetEntry` POSTs. +Returns a `User` object with the given `id`.
@@ -36130,7 +39728,9 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.timesheet_entries.meta_post_retrieve() +client.ticketing.users.retrieve( + id="id", +) ``` @@ -36146,6 +39746,38 @@ client.hris.timesheet_entries.meta_post_retrieve()
+**id:** `str` + +
+
+ +
+
+ +**expand:** `typing.Optional[UsersRetrieveRequestExpand]` — Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + +
+
+ +
+
+ +**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). + +
+
+ +
+
+ **request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
@@ -36158,8 +39790,8 @@ client.hris.timesheet_entries.meta_post_retrieve()
-## Hris WebhookReceivers -
client.hris.webhook_receivers.list() +## Ticketing WebhookReceivers +
client.ticketing.webhook_receivers.list()
@@ -36192,7 +39824,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.webhook_receivers.list() +client.ticketing.webhook_receivers.list() ```
@@ -36220,7 +39852,7 @@ client.hris.webhook_receivers.list()
-
client.hris.webhook_receivers.create(...) +
client.ticketing.webhook_receivers.create(...)
@@ -36253,7 +39885,7 @@ client = Merge( account_token="YOUR_ACCOUNT_TOKEN", api_key="YOUR_API_KEY", ) -client.hris.webhook_receivers.create( +client.ticketing.webhook_receivers.create( event="event", is_active=True, ) diff --git a/src/merge/__init__.py b/src/merge/__init__.py index 3a9ef08f..f9da1787 100644 --- a/src/merge/__init__.py +++ b/src/merge/__init__.py @@ -6,7 +6,7 @@ from importlib import import_module if typing.TYPE_CHECKING: - from .resources import accounting, ats, crm, filestorage, hris, ticketing + from .resources import accounting, ats, crm, filestorage, hris, knowledgebase, ticketing from .client import AsyncMerge, Merge from .environment import MergeEnvironment from .version import __version__ @@ -20,6 +20,7 @@ "crm": ".resources", "filestorage": ".resources", "hris": ".resources", + "knowledgebase": ".resources", "ticketing": ".resources", } @@ -53,5 +54,6 @@ def __dir__(): "crm", "filestorage", "hris", + "knowledgebase", "ticketing", ] diff --git a/src/merge/client.py b/src/merge/client.py index 55d2ce06..09650c56 100644 --- a/src/merge/client.py +++ b/src/merge/client.py @@ -14,6 +14,7 @@ from .resources.crm.client import AsyncCrmClient, CrmClient from .resources.filestorage.client import AsyncFilestorageClient, FilestorageClient from .resources.hris.client import AsyncHrisClient, HrisClient + from .resources.knowledgebase.client import AsyncKnowledgebaseClient, KnowledgebaseClient from .resources.ticketing.client import AsyncTicketingClient, TicketingClient @@ -87,10 +88,11 @@ def __init__( timeout=_defaulted_timeout, ) self._ats: typing.Optional[AtsClient] = None - self._crm: typing.Optional[CrmClient] = None self._filestorage: typing.Optional[FilestorageClient] = None - self._ticketing: typing.Optional[TicketingClient] = None + self._crm: typing.Optional[CrmClient] = None + self._knowledgebase: typing.Optional[KnowledgebaseClient] = None self._hris: typing.Optional[HrisClient] = None + self._ticketing: typing.Optional[TicketingClient] = None self._accounting: typing.Optional[AccountingClient] = None @property @@ -101,14 +103,6 @@ def ats(self): self._ats = AtsClient(client_wrapper=self._client_wrapper) return self._ats - @property - def crm(self): - if self._crm is None: - from .resources.crm.client import CrmClient # noqa: E402 - - self._crm = CrmClient(client_wrapper=self._client_wrapper) - return self._crm - @property def filestorage(self): if self._filestorage is None: @@ -118,12 +112,20 @@ def filestorage(self): return self._filestorage @property - def ticketing(self): - if self._ticketing is None: - from .resources.ticketing.client import TicketingClient # noqa: E402 + def crm(self): + if self._crm is None: + from .resources.crm.client import CrmClient # noqa: E402 - self._ticketing = TicketingClient(client_wrapper=self._client_wrapper) - return self._ticketing + self._crm = CrmClient(client_wrapper=self._client_wrapper) + return self._crm + + @property + def knowledgebase(self): + if self._knowledgebase is None: + from .resources.knowledgebase.client import KnowledgebaseClient # noqa: E402 + + self._knowledgebase = KnowledgebaseClient(client_wrapper=self._client_wrapper) + return self._knowledgebase @property def hris(self): @@ -133,6 +135,14 @@ def hris(self): self._hris = HrisClient(client_wrapper=self._client_wrapper) return self._hris + @property + def ticketing(self): + if self._ticketing is None: + from .resources.ticketing.client import TicketingClient # noqa: E402 + + self._ticketing = TicketingClient(client_wrapper=self._client_wrapper) + return self._ticketing + @property def accounting(self): if self._accounting is None: @@ -212,10 +222,11 @@ def __init__( timeout=_defaulted_timeout, ) self._ats: typing.Optional[AsyncAtsClient] = None - self._crm: typing.Optional[AsyncCrmClient] = None self._filestorage: typing.Optional[AsyncFilestorageClient] = None - self._ticketing: typing.Optional[AsyncTicketingClient] = None + self._crm: typing.Optional[AsyncCrmClient] = None + self._knowledgebase: typing.Optional[AsyncKnowledgebaseClient] = None self._hris: typing.Optional[AsyncHrisClient] = None + self._ticketing: typing.Optional[AsyncTicketingClient] = None self._accounting: typing.Optional[AsyncAccountingClient] = None @property @@ -226,14 +237,6 @@ def ats(self): self._ats = AsyncAtsClient(client_wrapper=self._client_wrapper) return self._ats - @property - def crm(self): - if self._crm is None: - from .resources.crm.client import AsyncCrmClient # noqa: E402 - - self._crm = AsyncCrmClient(client_wrapper=self._client_wrapper) - return self._crm - @property def filestorage(self): if self._filestorage is None: @@ -243,12 +246,20 @@ def filestorage(self): return self._filestorage @property - def ticketing(self): - if self._ticketing is None: - from .resources.ticketing.client import AsyncTicketingClient # noqa: E402 + def crm(self): + if self._crm is None: + from .resources.crm.client import AsyncCrmClient # noqa: E402 - self._ticketing = AsyncTicketingClient(client_wrapper=self._client_wrapper) - return self._ticketing + self._crm = AsyncCrmClient(client_wrapper=self._client_wrapper) + return self._crm + + @property + def knowledgebase(self): + if self._knowledgebase is None: + from .resources.knowledgebase.client import AsyncKnowledgebaseClient # noqa: E402 + + self._knowledgebase = AsyncKnowledgebaseClient(client_wrapper=self._client_wrapper) + return self._knowledgebase @property def hris(self): @@ -258,6 +269,14 @@ def hris(self): self._hris = AsyncHrisClient(client_wrapper=self._client_wrapper) return self._hris + @property + def ticketing(self): + if self._ticketing is None: + from .resources.ticketing.client import AsyncTicketingClient # noqa: E402 + + self._ticketing = AsyncTicketingClient(client_wrapper=self._client_wrapper) + return self._ticketing + @property def accounting(self): if self._accounting is None: diff --git a/src/merge/core/client_wrapper.py b/src/merge/core/client_wrapper.py index 79daf204..0bec11f2 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/2.3.2", + "User-Agent": "MergePythonClient/2.4.0", "X-Fern-Language": "Python", "X-Fern-SDK-Name": "MergePythonClient", - "X-Fern-SDK-Version": "2.3.2", + "X-Fern-SDK-Version": "2.4.0", **(self.get_custom_headers() or {}), } if self._account_token is not None: diff --git a/src/merge/resources/__init__.py b/src/merge/resources/__init__.py index b431f719..19bb76ff 100644 --- a/src/merge/resources/__init__.py +++ b/src/merge/resources/__init__.py @@ -6,13 +6,14 @@ from importlib import import_module if typing.TYPE_CHECKING: - from . import accounting, ats, crm, filestorage, hris, ticketing + from . import accounting, ats, crm, filestorage, hris, knowledgebase, ticketing _dynamic_imports: typing.Dict[str, str] = { "accounting": ".", "ats": ".", "crm": ".", "filestorage": ".", "hris": ".", + "knowledgebase": ".", "ticketing": ".", } @@ -36,4 +37,4 @@ def __dir__(): return sorted(lazy_attrs) -__all__ = ["accounting", "ats", "crm", "filestorage", "hris", "ticketing"] +__all__ = ["accounting", "ats", "crm", "filestorage", "hris", "knowledgebase", "ticketing"] diff --git a/src/merge/resources/knowledgebase/__init__.py b/src/merge/resources/knowledgebase/__init__.py new file mode 100644 index 00000000..70e1a1d8 --- /dev/null +++ b/src/merge/resources/knowledgebase/__init__.py @@ -0,0 +1,472 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ( + AccountDetails, + AccountDetailsAndActions, + AccountDetailsAndActionsCategory, + AccountDetailsAndActionsIntegration, + AccountDetailsAndActionsStatus, + AccountDetailsAndActionsStatusEnum, + AccountDetailsCategory, + AccountIntegration, + AccountToken, + AdvancedMetadata, + Article, + ArticleAttachmentsItem, + ArticleAuthor, + ArticleLastEditedBy, + ArticleParentArticle, + ArticleParentContainer, + ArticlePermissionsItem, + ArticleRootContainer, + ArticleStatus, + ArticleType, + ArticleTypeEnum, + ArticleVisibility, + AsyncPassthroughReciept, + Attachment, + AuditLogEvent, + AuditLogEventEventType, + AuditLogEventRole, + AvailableActions, + CategoriesEnum, + CategoryEnum, + CommonModelScopeApi, + CommonModelScopesBodyRequest, + CompletedAccountInitialScreenEnum, + Container, + ContainerPermissionsItem, + ContainerStatus, + ContainerType, + ContainerTypeEnum, + ContainerVisibility, + DataPassthroughRequest, + DataPassthroughRequestMethod, + DataPassthroughRequestRequestFormat, + DebugModeLog, + DebugModelLogSummary, + EnabledActionsEnum, + EncodingEnum, + ErrorValidationProblem, + EventTypeEnum, + ExternalTargetFieldApi, + ExternalTargetFieldApiResponse, + FieldMappingApiInstance, + FieldMappingApiInstanceRemoteField, + FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo, + FieldMappingApiInstanceResponse, + FieldMappingApiInstanceTargetField, + FieldMappingInstanceResponse, + FieldPermissionDeserializer, + FieldPermissionDeserializerRequest, + Group, + GroupParentGroup, + GroupUsersItem, + IndividualCommonModelScopeDeserializer, + IndividualCommonModelScopeDeserializerRequest, + Issue, + IssueStatus, + IssueStatusEnum, + LanguageEnum, + LastSyncResultEnum, + LinkToken, + MethodEnum, + ModelOperation, + ModelPermissionDeserializer, + ModelPermissionDeserializerRequest, + MultipartFormFieldRequest, + MultipartFormFieldRequestEncoding, + PaginatedAccountDetailsAndActionsList, + PaginatedArticleList, + PaginatedAttachmentList, + PaginatedAuditLogEventList, + PaginatedContainerList, + PaginatedGroupList, + PaginatedIssueList, + PaginatedSyncStatusList, + PaginatedUserList, + Permission, + PermissionGroup, + PermissionType, + PermissionTypeEnum, + PermissionUser, + RemoteData, + RemoteEndpointInfo, + RemoteFieldApi, + RemoteFieldApiAdvancedMetadata, + RemoteFieldApiCoverage, + RemoteFieldApiResponse, + RemoteKey, + RemoteResponse, + RemoteResponseResponseType, + RequestFormatEnum, + ResponseTypeEnum, + RoleEnum, + RolesEnum, + SelectiveSyncConfigurationsUsageEnum, + Status3C6Enum, + StatusFd5Enum, + SyncStatus, + SyncStatusLastSyncResult, + SyncStatusStatus, + User, + ValidationProblemSource, + VisibilityEnum, + WarningValidationProblem, + WebhookReceiver, + ) + from .resources import ( + ArticlesListRequestExpand, + ArticlesRetrieveRequestExpand, + AsyncPassthroughRetrieveResponse, + ContainersListRequestExpand, + ContainersRetrieveRequestExpand, + EndUserDetailsRequestLanguage, + GroupsListRequestExpand, + GroupsRetrieveRequestExpand, + IssuesListRequestStatus, + LinkedAccountsListRequestCategory, + account_details, + account_token, + articles, + async_passthrough, + attachments, + audit_trail, + available_actions, + containers, + delete_account, + field_mapping, + force_resync, + generate_key, + groups, + issues, + link_token, + linked_accounts, + passthrough, + regenerate_key, + scopes, + sync_status, + users, + webhook_receivers, + ) +_dynamic_imports: typing.Dict[str, str] = { + "AccountDetails": ".types", + "AccountDetailsAndActions": ".types", + "AccountDetailsAndActionsCategory": ".types", + "AccountDetailsAndActionsIntegration": ".types", + "AccountDetailsAndActionsStatus": ".types", + "AccountDetailsAndActionsStatusEnum": ".types", + "AccountDetailsCategory": ".types", + "AccountIntegration": ".types", + "AccountToken": ".types", + "AdvancedMetadata": ".types", + "Article": ".types", + "ArticleAttachmentsItem": ".types", + "ArticleAuthor": ".types", + "ArticleLastEditedBy": ".types", + "ArticleParentArticle": ".types", + "ArticleParentContainer": ".types", + "ArticlePermissionsItem": ".types", + "ArticleRootContainer": ".types", + "ArticleStatus": ".types", + "ArticleType": ".types", + "ArticleTypeEnum": ".types", + "ArticleVisibility": ".types", + "ArticlesListRequestExpand": ".resources", + "ArticlesRetrieveRequestExpand": ".resources", + "AsyncPassthroughReciept": ".types", + "AsyncPassthroughRetrieveResponse": ".resources", + "Attachment": ".types", + "AuditLogEvent": ".types", + "AuditLogEventEventType": ".types", + "AuditLogEventRole": ".types", + "AvailableActions": ".types", + "CategoriesEnum": ".types", + "CategoryEnum": ".types", + "CommonModelScopeApi": ".types", + "CommonModelScopesBodyRequest": ".types", + "CompletedAccountInitialScreenEnum": ".types", + "Container": ".types", + "ContainerPermissionsItem": ".types", + "ContainerStatus": ".types", + "ContainerType": ".types", + "ContainerTypeEnum": ".types", + "ContainerVisibility": ".types", + "ContainersListRequestExpand": ".resources", + "ContainersRetrieveRequestExpand": ".resources", + "DataPassthroughRequest": ".types", + "DataPassthroughRequestMethod": ".types", + "DataPassthroughRequestRequestFormat": ".types", + "DebugModeLog": ".types", + "DebugModelLogSummary": ".types", + "EnabledActionsEnum": ".types", + "EncodingEnum": ".types", + "EndUserDetailsRequestLanguage": ".resources", + "ErrorValidationProblem": ".types", + "EventTypeEnum": ".types", + "ExternalTargetFieldApi": ".types", + "ExternalTargetFieldApiResponse": ".types", + "FieldMappingApiInstance": ".types", + "FieldMappingApiInstanceRemoteField": ".types", + "FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo": ".types", + "FieldMappingApiInstanceResponse": ".types", + "FieldMappingApiInstanceTargetField": ".types", + "FieldMappingInstanceResponse": ".types", + "FieldPermissionDeserializer": ".types", + "FieldPermissionDeserializerRequest": ".types", + "Group": ".types", + "GroupParentGroup": ".types", + "GroupUsersItem": ".types", + "GroupsListRequestExpand": ".resources", + "GroupsRetrieveRequestExpand": ".resources", + "IndividualCommonModelScopeDeserializer": ".types", + "IndividualCommonModelScopeDeserializerRequest": ".types", + "Issue": ".types", + "IssueStatus": ".types", + "IssueStatusEnum": ".types", + "IssuesListRequestStatus": ".resources", + "LanguageEnum": ".types", + "LastSyncResultEnum": ".types", + "LinkToken": ".types", + "LinkedAccountsListRequestCategory": ".resources", + "MethodEnum": ".types", + "ModelOperation": ".types", + "ModelPermissionDeserializer": ".types", + "ModelPermissionDeserializerRequest": ".types", + "MultipartFormFieldRequest": ".types", + "MultipartFormFieldRequestEncoding": ".types", + "PaginatedAccountDetailsAndActionsList": ".types", + "PaginatedArticleList": ".types", + "PaginatedAttachmentList": ".types", + "PaginatedAuditLogEventList": ".types", + "PaginatedContainerList": ".types", + "PaginatedGroupList": ".types", + "PaginatedIssueList": ".types", + "PaginatedSyncStatusList": ".types", + "PaginatedUserList": ".types", + "Permission": ".types", + "PermissionGroup": ".types", + "PermissionType": ".types", + "PermissionTypeEnum": ".types", + "PermissionUser": ".types", + "RemoteData": ".types", + "RemoteEndpointInfo": ".types", + "RemoteFieldApi": ".types", + "RemoteFieldApiAdvancedMetadata": ".types", + "RemoteFieldApiCoverage": ".types", + "RemoteFieldApiResponse": ".types", + "RemoteKey": ".types", + "RemoteResponse": ".types", + "RemoteResponseResponseType": ".types", + "RequestFormatEnum": ".types", + "ResponseTypeEnum": ".types", + "RoleEnum": ".types", + "RolesEnum": ".types", + "SelectiveSyncConfigurationsUsageEnum": ".types", + "Status3C6Enum": ".types", + "StatusFd5Enum": ".types", + "SyncStatus": ".types", + "SyncStatusLastSyncResult": ".types", + "SyncStatusStatus": ".types", + "User": ".types", + "ValidationProblemSource": ".types", + "VisibilityEnum": ".types", + "WarningValidationProblem": ".types", + "WebhookReceiver": ".types", + "account_details": ".resources", + "account_token": ".resources", + "articles": ".resources", + "async_passthrough": ".resources", + "attachments": ".resources", + "audit_trail": ".resources", + "available_actions": ".resources", + "containers": ".resources", + "delete_account": ".resources", + "field_mapping": ".resources", + "force_resync": ".resources", + "generate_key": ".resources", + "groups": ".resources", + "issues": ".resources", + "link_token": ".resources", + "linked_accounts": ".resources", + "passthrough": ".resources", + "regenerate_key": ".resources", + "scopes": ".resources", + "sync_status": ".resources", + "users": ".resources", + "webhook_receivers": ".resources", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "AccountDetails", + "AccountDetailsAndActions", + "AccountDetailsAndActionsCategory", + "AccountDetailsAndActionsIntegration", + "AccountDetailsAndActionsStatus", + "AccountDetailsAndActionsStatusEnum", + "AccountDetailsCategory", + "AccountIntegration", + "AccountToken", + "AdvancedMetadata", + "Article", + "ArticleAttachmentsItem", + "ArticleAuthor", + "ArticleLastEditedBy", + "ArticleParentArticle", + "ArticleParentContainer", + "ArticlePermissionsItem", + "ArticleRootContainer", + "ArticleStatus", + "ArticleType", + "ArticleTypeEnum", + "ArticleVisibility", + "ArticlesListRequestExpand", + "ArticlesRetrieveRequestExpand", + "AsyncPassthroughReciept", + "AsyncPassthroughRetrieveResponse", + "Attachment", + "AuditLogEvent", + "AuditLogEventEventType", + "AuditLogEventRole", + "AvailableActions", + "CategoriesEnum", + "CategoryEnum", + "CommonModelScopeApi", + "CommonModelScopesBodyRequest", + "CompletedAccountInitialScreenEnum", + "Container", + "ContainerPermissionsItem", + "ContainerStatus", + "ContainerType", + "ContainerTypeEnum", + "ContainerVisibility", + "ContainersListRequestExpand", + "ContainersRetrieveRequestExpand", + "DataPassthroughRequest", + "DataPassthroughRequestMethod", + "DataPassthroughRequestRequestFormat", + "DebugModeLog", + "DebugModelLogSummary", + "EnabledActionsEnum", + "EncodingEnum", + "EndUserDetailsRequestLanguage", + "ErrorValidationProblem", + "EventTypeEnum", + "ExternalTargetFieldApi", + "ExternalTargetFieldApiResponse", + "FieldMappingApiInstance", + "FieldMappingApiInstanceRemoteField", + "FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo", + "FieldMappingApiInstanceResponse", + "FieldMappingApiInstanceTargetField", + "FieldMappingInstanceResponse", + "FieldPermissionDeserializer", + "FieldPermissionDeserializerRequest", + "Group", + "GroupParentGroup", + "GroupUsersItem", + "GroupsListRequestExpand", + "GroupsRetrieveRequestExpand", + "IndividualCommonModelScopeDeserializer", + "IndividualCommonModelScopeDeserializerRequest", + "Issue", + "IssueStatus", + "IssueStatusEnum", + "IssuesListRequestStatus", + "LanguageEnum", + "LastSyncResultEnum", + "LinkToken", + "LinkedAccountsListRequestCategory", + "MethodEnum", + "ModelOperation", + "ModelPermissionDeserializer", + "ModelPermissionDeserializerRequest", + "MultipartFormFieldRequest", + "MultipartFormFieldRequestEncoding", + "PaginatedAccountDetailsAndActionsList", + "PaginatedArticleList", + "PaginatedAttachmentList", + "PaginatedAuditLogEventList", + "PaginatedContainerList", + "PaginatedGroupList", + "PaginatedIssueList", + "PaginatedSyncStatusList", + "PaginatedUserList", + "Permission", + "PermissionGroup", + "PermissionType", + "PermissionTypeEnum", + "PermissionUser", + "RemoteData", + "RemoteEndpointInfo", + "RemoteFieldApi", + "RemoteFieldApiAdvancedMetadata", + "RemoteFieldApiCoverage", + "RemoteFieldApiResponse", + "RemoteKey", + "RemoteResponse", + "RemoteResponseResponseType", + "RequestFormatEnum", + "ResponseTypeEnum", + "RoleEnum", + "RolesEnum", + "SelectiveSyncConfigurationsUsageEnum", + "Status3C6Enum", + "StatusFd5Enum", + "SyncStatus", + "SyncStatusLastSyncResult", + "SyncStatusStatus", + "User", + "ValidationProblemSource", + "VisibilityEnum", + "WarningValidationProblem", + "WebhookReceiver", + "account_details", + "account_token", + "articles", + "async_passthrough", + "attachments", + "audit_trail", + "available_actions", + "containers", + "delete_account", + "field_mapping", + "force_resync", + "generate_key", + "groups", + "issues", + "link_token", + "linked_accounts", + "passthrough", + "regenerate_key", + "scopes", + "sync_status", + "users", + "webhook_receivers", +] diff --git a/src/merge/resources/knowledgebase/client.py b/src/merge/resources/knowledgebase/client.py new file mode 100644 index 00000000..7b2ce565 --- /dev/null +++ b/src/merge/resources/knowledgebase/client.py @@ -0,0 +1,480 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .raw_client import AsyncRawKnowledgebaseClient, RawKnowledgebaseClient + +if typing.TYPE_CHECKING: + from .resources.account_details.client import AccountDetailsClient, AsyncAccountDetailsClient + from .resources.account_token.client import AccountTokenClient, AsyncAccountTokenClient + from .resources.articles.client import ArticlesClient, AsyncArticlesClient + from .resources.async_passthrough.client import AsyncAsyncPassthroughClient + from .resources.async_passthrough.client import ( + AsyncPassthroughClient as resources_knowledgebase_resources_async_passthrough_client_AsyncPassthroughClient, + ) + from .resources.attachments.client import AsyncAttachmentsClient, AttachmentsClient + from .resources.audit_trail.client import AsyncAuditTrailClient, AuditTrailClient + from .resources.available_actions.client import AsyncAvailableActionsClient, AvailableActionsClient + from .resources.containers.client import AsyncContainersClient, ContainersClient + from .resources.delete_account.client import AsyncDeleteAccountClient, DeleteAccountClient + from .resources.field_mapping.client import AsyncFieldMappingClient, FieldMappingClient + from .resources.force_resync.client import AsyncForceResyncClient, ForceResyncClient + from .resources.generate_key.client import AsyncGenerateKeyClient, GenerateKeyClient + from .resources.groups.client import AsyncGroupsClient, GroupsClient + from .resources.issues.client import AsyncIssuesClient, IssuesClient + from .resources.link_token.client import AsyncLinkTokenClient, LinkTokenClient + from .resources.linked_accounts.client import AsyncLinkedAccountsClient, LinkedAccountsClient + from .resources.passthrough.client import ( + AsyncPassthroughClient as resources_knowledgebase_resources_passthrough_client_AsyncPassthroughClient, + ) + from .resources.passthrough.client import PassthroughClient + from .resources.regenerate_key.client import AsyncRegenerateKeyClient, RegenerateKeyClient + from .resources.scopes.client import AsyncScopesClient, ScopesClient + from .resources.sync_status.client import AsyncSyncStatusClient, SyncStatusClient + from .resources.users.client import AsyncUsersClient, UsersClient + from .resources.webhook_receivers.client import AsyncWebhookReceiversClient, WebhookReceiversClient + + +class KnowledgebaseClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawKnowledgebaseClient(client_wrapper=client_wrapper) + self._client_wrapper = client_wrapper + self._account_details: typing.Optional[AccountDetailsClient] = None + self._account_token: typing.Optional[AccountTokenClient] = None + self._articles: typing.Optional[ArticlesClient] = None + self._async_passthrough: typing.Optional[ + resources_knowledgebase_resources_async_passthrough_client_AsyncPassthroughClient + ] = None + self._attachments: typing.Optional[AttachmentsClient] = None + self._audit_trail: typing.Optional[AuditTrailClient] = None + self._available_actions: typing.Optional[AvailableActionsClient] = None + self._containers: typing.Optional[ContainersClient] = None + self._scopes: typing.Optional[ScopesClient] = None + self._delete_account: typing.Optional[DeleteAccountClient] = None + self._field_mapping: typing.Optional[FieldMappingClient] = None + self._generate_key: typing.Optional[GenerateKeyClient] = None + self._groups: typing.Optional[GroupsClient] = None + self._issues: typing.Optional[IssuesClient] = None + self._link_token: typing.Optional[LinkTokenClient] = None + self._linked_accounts: typing.Optional[LinkedAccountsClient] = None + self._passthrough: typing.Optional[PassthroughClient] = None + self._regenerate_key: typing.Optional[RegenerateKeyClient] = None + self._sync_status: typing.Optional[SyncStatusClient] = None + self._force_resync: typing.Optional[ForceResyncClient] = None + self._users: typing.Optional[UsersClient] = None + self._webhook_receivers: typing.Optional[WebhookReceiversClient] = None + + @property + def with_raw_response(self) -> RawKnowledgebaseClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawKnowledgebaseClient + """ + return self._raw_client + + @property + def account_details(self): + if self._account_details is None: + from .resources.account_details.client import AccountDetailsClient # noqa: E402 + + self._account_details = AccountDetailsClient(client_wrapper=self._client_wrapper) + return self._account_details + + @property + def account_token(self): + if self._account_token is None: + from .resources.account_token.client import AccountTokenClient # noqa: E402 + + self._account_token = AccountTokenClient(client_wrapper=self._client_wrapper) + return self._account_token + + @property + def articles(self): + if self._articles is None: + from .resources.articles.client import ArticlesClient # noqa: E402 + + self._articles = ArticlesClient(client_wrapper=self._client_wrapper) + return self._articles + + @property + def async_passthrough(self): + if self._async_passthrough is None: + from .resources.async_passthrough.client import ( + AsyncPassthroughClient as resources_knowledgebase_resources_async_passthrough_client_AsyncPassthroughClient, # noqa: E402 + ) + + self._async_passthrough = resources_knowledgebase_resources_async_passthrough_client_AsyncPassthroughClient( + client_wrapper=self._client_wrapper + ) + return self._async_passthrough + + @property + def attachments(self): + if self._attachments is None: + from .resources.attachments.client import AttachmentsClient # noqa: E402 + + self._attachments = AttachmentsClient(client_wrapper=self._client_wrapper) + return self._attachments + + @property + def audit_trail(self): + if self._audit_trail is None: + from .resources.audit_trail.client import AuditTrailClient # noqa: E402 + + self._audit_trail = AuditTrailClient(client_wrapper=self._client_wrapper) + return self._audit_trail + + @property + def available_actions(self): + if self._available_actions is None: + from .resources.available_actions.client import AvailableActionsClient # noqa: E402 + + self._available_actions = AvailableActionsClient(client_wrapper=self._client_wrapper) + return self._available_actions + + @property + def containers(self): + if self._containers is None: + from .resources.containers.client import ContainersClient # noqa: E402 + + self._containers = ContainersClient(client_wrapper=self._client_wrapper) + return self._containers + + @property + def scopes(self): + if self._scopes is None: + from .resources.scopes.client import ScopesClient # noqa: E402 + + self._scopes = ScopesClient(client_wrapper=self._client_wrapper) + return self._scopes + + @property + def delete_account(self): + if self._delete_account is None: + from .resources.delete_account.client import DeleteAccountClient # noqa: E402 + + self._delete_account = DeleteAccountClient(client_wrapper=self._client_wrapper) + return self._delete_account + + @property + def field_mapping(self): + if self._field_mapping is None: + from .resources.field_mapping.client import FieldMappingClient # noqa: E402 + + self._field_mapping = FieldMappingClient(client_wrapper=self._client_wrapper) + return self._field_mapping + + @property + def generate_key(self): + if self._generate_key is None: + from .resources.generate_key.client import GenerateKeyClient # noqa: E402 + + self._generate_key = GenerateKeyClient(client_wrapper=self._client_wrapper) + return self._generate_key + + @property + def groups(self): + if self._groups is None: + from .resources.groups.client import GroupsClient # noqa: E402 + + self._groups = GroupsClient(client_wrapper=self._client_wrapper) + return self._groups + + @property + def issues(self): + if self._issues is None: + from .resources.issues.client import IssuesClient # noqa: E402 + + self._issues = IssuesClient(client_wrapper=self._client_wrapper) + return self._issues + + @property + def link_token(self): + if self._link_token is None: + from .resources.link_token.client import LinkTokenClient # noqa: E402 + + self._link_token = LinkTokenClient(client_wrapper=self._client_wrapper) + return self._link_token + + @property + def linked_accounts(self): + if self._linked_accounts is None: + from .resources.linked_accounts.client import LinkedAccountsClient # noqa: E402 + + self._linked_accounts = LinkedAccountsClient(client_wrapper=self._client_wrapper) + return self._linked_accounts + + @property + def passthrough(self): + if self._passthrough is None: + from .resources.passthrough.client import PassthroughClient # noqa: E402 + + self._passthrough = PassthroughClient(client_wrapper=self._client_wrapper) + return self._passthrough + + @property + def regenerate_key(self): + if self._regenerate_key is None: + from .resources.regenerate_key.client import RegenerateKeyClient # noqa: E402 + + self._regenerate_key = RegenerateKeyClient(client_wrapper=self._client_wrapper) + return self._regenerate_key + + @property + def sync_status(self): + if self._sync_status is None: + from .resources.sync_status.client import SyncStatusClient # noqa: E402 + + self._sync_status = SyncStatusClient(client_wrapper=self._client_wrapper) + return self._sync_status + + @property + def force_resync(self): + if self._force_resync is None: + from .resources.force_resync.client import ForceResyncClient # noqa: E402 + + self._force_resync = ForceResyncClient(client_wrapper=self._client_wrapper) + return self._force_resync + + @property + def users(self): + if self._users is None: + from .resources.users.client import UsersClient # noqa: E402 + + self._users = UsersClient(client_wrapper=self._client_wrapper) + return self._users + + @property + def webhook_receivers(self): + if self._webhook_receivers is None: + from .resources.webhook_receivers.client import WebhookReceiversClient # noqa: E402 + + self._webhook_receivers = WebhookReceiversClient(client_wrapper=self._client_wrapper) + return self._webhook_receivers + + +class AsyncKnowledgebaseClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawKnowledgebaseClient(client_wrapper=client_wrapper) + self._client_wrapper = client_wrapper + self._account_details: typing.Optional[AsyncAccountDetailsClient] = None + self._account_token: typing.Optional[AsyncAccountTokenClient] = None + self._articles: typing.Optional[AsyncArticlesClient] = None + self._async_passthrough: typing.Optional[AsyncAsyncPassthroughClient] = None + self._attachments: typing.Optional[AsyncAttachmentsClient] = None + self._audit_trail: typing.Optional[AsyncAuditTrailClient] = None + self._available_actions: typing.Optional[AsyncAvailableActionsClient] = None + self._containers: typing.Optional[AsyncContainersClient] = None + self._scopes: typing.Optional[AsyncScopesClient] = None + self._delete_account: typing.Optional[AsyncDeleteAccountClient] = None + self._field_mapping: typing.Optional[AsyncFieldMappingClient] = None + self._generate_key: typing.Optional[AsyncGenerateKeyClient] = None + self._groups: typing.Optional[AsyncGroupsClient] = None + self._issues: typing.Optional[AsyncIssuesClient] = None + self._link_token: typing.Optional[AsyncLinkTokenClient] = None + self._linked_accounts: typing.Optional[AsyncLinkedAccountsClient] = None + self._passthrough: typing.Optional[ + resources_knowledgebase_resources_passthrough_client_AsyncPassthroughClient + ] = None + self._regenerate_key: typing.Optional[AsyncRegenerateKeyClient] = None + self._sync_status: typing.Optional[AsyncSyncStatusClient] = None + self._force_resync: typing.Optional[AsyncForceResyncClient] = None + self._users: typing.Optional[AsyncUsersClient] = None + self._webhook_receivers: typing.Optional[AsyncWebhookReceiversClient] = None + + @property + def with_raw_response(self) -> AsyncRawKnowledgebaseClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawKnowledgebaseClient + """ + return self._raw_client + + @property + def account_details(self): + if self._account_details is None: + from .resources.account_details.client import AsyncAccountDetailsClient # noqa: E402 + + self._account_details = AsyncAccountDetailsClient(client_wrapper=self._client_wrapper) + return self._account_details + + @property + def account_token(self): + if self._account_token is None: + from .resources.account_token.client import AsyncAccountTokenClient # noqa: E402 + + self._account_token = AsyncAccountTokenClient(client_wrapper=self._client_wrapper) + return self._account_token + + @property + def articles(self): + if self._articles is None: + from .resources.articles.client import AsyncArticlesClient # noqa: E402 + + self._articles = AsyncArticlesClient(client_wrapper=self._client_wrapper) + return self._articles + + @property + def async_passthrough(self): + if self._async_passthrough is None: + from .resources.async_passthrough.client import AsyncAsyncPassthroughClient # noqa: E402 + + self._async_passthrough = AsyncAsyncPassthroughClient(client_wrapper=self._client_wrapper) + return self._async_passthrough + + @property + def attachments(self): + if self._attachments is None: + from .resources.attachments.client import AsyncAttachmentsClient # noqa: E402 + + self._attachments = AsyncAttachmentsClient(client_wrapper=self._client_wrapper) + return self._attachments + + @property + def audit_trail(self): + if self._audit_trail is None: + from .resources.audit_trail.client import AsyncAuditTrailClient # noqa: E402 + + self._audit_trail = AsyncAuditTrailClient(client_wrapper=self._client_wrapper) + return self._audit_trail + + @property + def available_actions(self): + if self._available_actions is None: + from .resources.available_actions.client import AsyncAvailableActionsClient # noqa: E402 + + self._available_actions = AsyncAvailableActionsClient(client_wrapper=self._client_wrapper) + return self._available_actions + + @property + def containers(self): + if self._containers is None: + from .resources.containers.client import AsyncContainersClient # noqa: E402 + + self._containers = AsyncContainersClient(client_wrapper=self._client_wrapper) + return self._containers + + @property + def scopes(self): + if self._scopes is None: + from .resources.scopes.client import AsyncScopesClient # noqa: E402 + + self._scopes = AsyncScopesClient(client_wrapper=self._client_wrapper) + return self._scopes + + @property + def delete_account(self): + if self._delete_account is None: + from .resources.delete_account.client import AsyncDeleteAccountClient # noqa: E402 + + self._delete_account = AsyncDeleteAccountClient(client_wrapper=self._client_wrapper) + return self._delete_account + + @property + def field_mapping(self): + if self._field_mapping is None: + from .resources.field_mapping.client import AsyncFieldMappingClient # noqa: E402 + + self._field_mapping = AsyncFieldMappingClient(client_wrapper=self._client_wrapper) + return self._field_mapping + + @property + def generate_key(self): + if self._generate_key is None: + from .resources.generate_key.client import AsyncGenerateKeyClient # noqa: E402 + + self._generate_key = AsyncGenerateKeyClient(client_wrapper=self._client_wrapper) + return self._generate_key + + @property + def groups(self): + if self._groups is None: + from .resources.groups.client import AsyncGroupsClient # noqa: E402 + + self._groups = AsyncGroupsClient(client_wrapper=self._client_wrapper) + return self._groups + + @property + def issues(self): + if self._issues is None: + from .resources.issues.client import AsyncIssuesClient # noqa: E402 + + self._issues = AsyncIssuesClient(client_wrapper=self._client_wrapper) + return self._issues + + @property + def link_token(self): + if self._link_token is None: + from .resources.link_token.client import AsyncLinkTokenClient # noqa: E402 + + self._link_token = AsyncLinkTokenClient(client_wrapper=self._client_wrapper) + return self._link_token + + @property + def linked_accounts(self): + if self._linked_accounts is None: + from .resources.linked_accounts.client import AsyncLinkedAccountsClient # noqa: E402 + + self._linked_accounts = AsyncLinkedAccountsClient(client_wrapper=self._client_wrapper) + return self._linked_accounts + + @property + def passthrough(self): + if self._passthrough is None: + from .resources.passthrough.client import ( + AsyncPassthroughClient as resources_knowledgebase_resources_passthrough_client_AsyncPassthroughClient, # noqa: E402 + ) + + self._passthrough = resources_knowledgebase_resources_passthrough_client_AsyncPassthroughClient( + client_wrapper=self._client_wrapper + ) + return self._passthrough + + @property + def regenerate_key(self): + if self._regenerate_key is None: + from .resources.regenerate_key.client import AsyncRegenerateKeyClient # noqa: E402 + + self._regenerate_key = AsyncRegenerateKeyClient(client_wrapper=self._client_wrapper) + return self._regenerate_key + + @property + def sync_status(self): + if self._sync_status is None: + from .resources.sync_status.client import AsyncSyncStatusClient # noqa: E402 + + self._sync_status = AsyncSyncStatusClient(client_wrapper=self._client_wrapper) + return self._sync_status + + @property + def force_resync(self): + if self._force_resync is None: + from .resources.force_resync.client import AsyncForceResyncClient # noqa: E402 + + self._force_resync = AsyncForceResyncClient(client_wrapper=self._client_wrapper) + return self._force_resync + + @property + def users(self): + if self._users is None: + from .resources.users.client import AsyncUsersClient # noqa: E402 + + self._users = AsyncUsersClient(client_wrapper=self._client_wrapper) + return self._users + + @property + def webhook_receivers(self): + if self._webhook_receivers is None: + from .resources.webhook_receivers.client import AsyncWebhookReceiversClient # noqa: E402 + + self._webhook_receivers = AsyncWebhookReceiversClient(client_wrapper=self._client_wrapper) + return self._webhook_receivers diff --git a/src/merge/resources/knowledgebase/raw_client.py b/src/merge/resources/knowledgebase/raw_client.py new file mode 100644 index 00000000..482f5fd8 --- /dev/null +++ b/src/merge/resources/knowledgebase/raw_client.py @@ -0,0 +1,13 @@ +# This file was auto-generated by Fern from our API Definition. + +from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper + + +class RawKnowledgebaseClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + +class AsyncRawKnowledgebaseClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper diff --git a/src/merge/resources/knowledgebase/resources/__init__.py b/src/merge/resources/knowledgebase/resources/__init__.py new file mode 100644 index 00000000..d9322f75 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/__init__.py @@ -0,0 +1,128 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from . import ( + account_details, + account_token, + articles, + async_passthrough, + attachments, + audit_trail, + available_actions, + containers, + delete_account, + field_mapping, + force_resync, + generate_key, + groups, + issues, + link_token, + linked_accounts, + passthrough, + regenerate_key, + scopes, + sync_status, + users, + webhook_receivers, + ) + from .articles import ArticlesListRequestExpand, ArticlesRetrieveRequestExpand + from .async_passthrough import AsyncPassthroughRetrieveResponse + from .containers import ContainersListRequestExpand, ContainersRetrieveRequestExpand + from .groups import GroupsListRequestExpand, GroupsRetrieveRequestExpand + from .issues import IssuesListRequestStatus + from .link_token import EndUserDetailsRequestLanguage + from .linked_accounts import LinkedAccountsListRequestCategory +_dynamic_imports: typing.Dict[str, str] = { + "ArticlesListRequestExpand": ".articles", + "ArticlesRetrieveRequestExpand": ".articles", + "AsyncPassthroughRetrieveResponse": ".async_passthrough", + "ContainersListRequestExpand": ".containers", + "ContainersRetrieveRequestExpand": ".containers", + "EndUserDetailsRequestLanguage": ".link_token", + "GroupsListRequestExpand": ".groups", + "GroupsRetrieveRequestExpand": ".groups", + "IssuesListRequestStatus": ".issues", + "LinkedAccountsListRequestCategory": ".linked_accounts", + "account_details": ".", + "account_token": ".", + "articles": ".", + "async_passthrough": ".", + "attachments": ".", + "audit_trail": ".", + "available_actions": ".", + "containers": ".", + "delete_account": ".", + "field_mapping": ".", + "force_resync": ".", + "generate_key": ".", + "groups": ".", + "issues": ".", + "link_token": ".", + "linked_accounts": ".", + "passthrough": ".", + "regenerate_key": ".", + "scopes": ".", + "sync_status": ".", + "users": ".", + "webhook_receivers": ".", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "ArticlesListRequestExpand", + "ArticlesRetrieveRequestExpand", + "AsyncPassthroughRetrieveResponse", + "ContainersListRequestExpand", + "ContainersRetrieveRequestExpand", + "EndUserDetailsRequestLanguage", + "GroupsListRequestExpand", + "GroupsRetrieveRequestExpand", + "IssuesListRequestStatus", + "LinkedAccountsListRequestCategory", + "account_details", + "account_token", + "articles", + "async_passthrough", + "attachments", + "audit_trail", + "available_actions", + "containers", + "delete_account", + "field_mapping", + "force_resync", + "generate_key", + "groups", + "issues", + "link_token", + "linked_accounts", + "passthrough", + "regenerate_key", + "scopes", + "sync_status", + "users", + "webhook_receivers", +] diff --git a/src/merge/resources/knowledgebase/resources/account_details/__init__.py b/src/merge/resources/knowledgebase/resources/account_details/__init__.py new file mode 100644 index 00000000..5cde0202 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/account_details/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/merge/resources/knowledgebase/resources/account_details/client.py b/src/merge/resources/knowledgebase/resources/account_details/client.py new file mode 100644 index 00000000..94d11855 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/account_details/client.py @@ -0,0 +1,102 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from ...types.account_details import AccountDetails +from .raw_client import AsyncRawAccountDetailsClient, RawAccountDetailsClient + + +class AccountDetailsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawAccountDetailsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawAccountDetailsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawAccountDetailsClient + """ + return self._raw_client + + def retrieve(self, *, request_options: typing.Optional[RequestOptions] = None) -> AccountDetails: + """ + Get details for a linked account. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AccountDetails + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.account_details.retrieve() + """ + _response = self._raw_client.retrieve(request_options=request_options) + return _response.data + + +class AsyncAccountDetailsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawAccountDetailsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawAccountDetailsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawAccountDetailsClient + """ + return self._raw_client + + async def retrieve(self, *, request_options: typing.Optional[RequestOptions] = None) -> AccountDetails: + """ + Get details for a linked account. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AccountDetails + + + 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.knowledgebase.account_details.retrieve() + + + asyncio.run(main()) + """ + _response = await self._raw_client.retrieve(request_options=request_options) + return _response.data diff --git a/src/merge/resources/knowledgebase/resources/account_details/raw_client.py b/src/merge/resources/knowledgebase/resources/account_details/raw_client.py new file mode 100644 index 00000000..836e029d --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/account_details/raw_client.py @@ -0,0 +1,91 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.request_options import RequestOptions +from .....core.unchecked_base_model import construct_type +from ...types.account_details import AccountDetails + + +class RawAccountDetailsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def retrieve(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[AccountDetails]: + """ + Get details for a linked account. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[AccountDetails] + + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/account-details", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + AccountDetails, + construct_type( + type_=AccountDetails, # 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) + + +class AsyncRawAccountDetailsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def retrieve( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[AccountDetails]: + """ + Get details for a linked account. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[AccountDetails] + + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/account-details", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + AccountDetails, + construct_type( + type_=AccountDetails, # 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) diff --git a/src/merge/resources/knowledgebase/resources/account_token/__init__.py b/src/merge/resources/knowledgebase/resources/account_token/__init__.py new file mode 100644 index 00000000..5cde0202 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/account_token/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/merge/resources/knowledgebase/resources/account_token/client.py b/src/merge/resources/knowledgebase/resources/account_token/client.py new file mode 100644 index 00000000..60aa41d9 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/account_token/client.py @@ -0,0 +1,112 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from ...types.account_token import AccountToken +from .raw_client import AsyncRawAccountTokenClient, RawAccountTokenClient + + +class AccountTokenClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawAccountTokenClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawAccountTokenClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawAccountTokenClient + """ + return self._raw_client + + def retrieve(self, public_token: str, *, request_options: typing.Optional[RequestOptions] = None) -> AccountToken: + """ + Returns the account token for the end user with the provided public token. + + Parameters + ---------- + public_token : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AccountToken + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.account_token.retrieve( + public_token="public_token", + ) + """ + _response = self._raw_client.retrieve(public_token, request_options=request_options) + return _response.data + + +class AsyncAccountTokenClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawAccountTokenClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawAccountTokenClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawAccountTokenClient + """ + return self._raw_client + + async def retrieve( + self, public_token: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AccountToken: + """ + Returns the account token for the end user with the provided public token. + + Parameters + ---------- + public_token : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AccountToken + + + 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.knowledgebase.account_token.retrieve( + public_token="public_token", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.retrieve(public_token, request_options=request_options) + return _response.data diff --git a/src/merge/resources/knowledgebase/resources/account_token/raw_client.py b/src/merge/resources/knowledgebase/resources/account_token/raw_client.py new file mode 100644 index 00000000..7ae9b614 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/account_token/raw_client.py @@ -0,0 +1,98 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.jsonable_encoder import jsonable_encoder +from .....core.request_options import RequestOptions +from .....core.unchecked_base_model import construct_type +from ...types.account_token import AccountToken + + +class RawAccountTokenClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def retrieve( + self, public_token: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[AccountToken]: + """ + Returns the account token for the end user with the provided public token. + + Parameters + ---------- + public_token : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[AccountToken] + + """ + _response = self._client_wrapper.httpx_client.request( + f"knowledgebase/v1/account-token/{jsonable_encoder(public_token)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + AccountToken, + construct_type( + type_=AccountToken, # 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) + + +class AsyncRawAccountTokenClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def retrieve( + self, public_token: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[AccountToken]: + """ + Returns the account token for the end user with the provided public token. + + Parameters + ---------- + public_token : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[AccountToken] + + """ + _response = await self._client_wrapper.httpx_client.request( + f"knowledgebase/v1/account-token/{jsonable_encoder(public_token)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + AccountToken, + construct_type( + type_=AccountToken, # 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) diff --git a/src/merge/resources/knowledgebase/resources/articles/__init__.py b/src/merge/resources/knowledgebase/resources/articles/__init__.py new file mode 100644 index 00000000..9e487c23 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/articles/__init__.py @@ -0,0 +1,35 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ArticlesListRequestExpand, ArticlesRetrieveRequestExpand +_dynamic_imports: typing.Dict[str, str] = { + "ArticlesListRequestExpand": ".types", + "ArticlesRetrieveRequestExpand": ".types", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["ArticlesListRequestExpand", "ArticlesRetrieveRequestExpand"] diff --git a/src/merge/resources/knowledgebase/resources/articles/client.py b/src/merge/resources/knowledgebase/resources/articles/client.py new file mode 100644 index 00000000..5c14b7b2 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/articles/client.py @@ -0,0 +1,378 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from ...types.article import Article +from ...types.paginated_article_list import PaginatedArticleList +from .raw_client import AsyncRawArticlesClient, RawArticlesClient +from .types.articles_list_request_expand import ArticlesListRequestExpand +from .types.articles_retrieve_request_expand import ArticlesRetrieveRequestExpand + + +class ArticlesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawArticlesClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawArticlesClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawArticlesClient + """ + return self._raw_client + + def list( + self, + *, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, + cursor: typing.Optional[str] = None, + expand: typing.Optional[ArticlesListRequestExpand] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, + page_size: typing.Optional[int] = None, + parent_article_id: typing.Optional[str] = None, + parent_container_id: typing.Optional[str] = None, + remote_id: typing.Optional[str] = None, + type: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedArticleList: + """ + Returns a list of `Article` objects. + + Parameters + ---------- + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[ArticlesListRequestExpand] + 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). + + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + + page_size : typing.Optional[int] + Number of results to return per page. + + parent_article_id : typing.Optional[str] + If provided, will only return sub articles of the parent_article_id. + + parent_container_id : typing.Optional[str] + If provided, will only return sub articles of the parent_container_id. + + remote_id : typing.Optional[str] + The API provider's ID for the given object. + + type : typing.Optional[str] + If provided, will only return articles of the given type. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedArticleList + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.articles.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ) + """ + _response = self._raw_client.list( + created_after=created_after, + created_before=created_before, + cursor=cursor, + expand=expand, + include_deleted_data=include_deleted_data, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + modified_after=modified_after, + modified_before=modified_before, + page_size=page_size, + parent_article_id=parent_article_id, + parent_container_id=parent_container_id, + remote_id=remote_id, + type=type, + request_options=request_options, + ) + return _response.data + + def retrieve( + self, + id: str, + *, + expand: typing.Optional[ArticlesRetrieveRequestExpand] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> Article: + """ + Returns an `Article` object with the given `id`. + + Parameters + ---------- + id : str + + expand : typing.Optional[ArticlesRetrieveRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + 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). + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Article + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.articles.retrieve( + id="id", + ) + """ + _response = self._raw_client.retrieve( + id, + expand=expand, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + request_options=request_options, + ) + return _response.data + + +class AsyncArticlesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawArticlesClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawArticlesClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawArticlesClient + """ + return self._raw_client + + async def list( + self, + *, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, + cursor: typing.Optional[str] = None, + expand: typing.Optional[ArticlesListRequestExpand] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, + page_size: typing.Optional[int] = None, + parent_article_id: typing.Optional[str] = None, + parent_container_id: typing.Optional[str] = None, + remote_id: typing.Optional[str] = None, + type: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedArticleList: + """ + Returns a list of `Article` objects. + + Parameters + ---------- + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[ArticlesListRequestExpand] + 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). + + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + + page_size : typing.Optional[int] + Number of results to return per page. + + parent_article_id : typing.Optional[str] + If provided, will only return sub articles of the parent_article_id. + + parent_container_id : typing.Optional[str] + If provided, will only return sub articles of the parent_container_id. + + remote_id : typing.Optional[str] + The API provider's ID for the given object. + + type : typing.Optional[str] + If provided, will only return articles of the given type. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedArticleList + + + 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.knowledgebase.articles.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.list( + created_after=created_after, + created_before=created_before, + cursor=cursor, + expand=expand, + include_deleted_data=include_deleted_data, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + modified_after=modified_after, + modified_before=modified_before, + page_size=page_size, + parent_article_id=parent_article_id, + parent_container_id=parent_container_id, + remote_id=remote_id, + type=type, + request_options=request_options, + ) + return _response.data + + async def retrieve( + self, + id: str, + *, + expand: typing.Optional[ArticlesRetrieveRequestExpand] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> Article: + """ + Returns an `Article` object with the given `id`. + + Parameters + ---------- + id : str + + expand : typing.Optional[ArticlesRetrieveRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + 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). + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Article + + + 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.knowledgebase.articles.retrieve( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.retrieve( + id, + expand=expand, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + request_options=request_options, + ) + return _response.data diff --git a/src/merge/resources/knowledgebase/resources/articles/raw_client.py b/src/merge/resources/knowledgebase/resources/articles/raw_client.py new file mode 100644 index 00000000..0e4474ef --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/articles/raw_client.py @@ -0,0 +1,363 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.datetime_utils import serialize_datetime +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.jsonable_encoder import jsonable_encoder +from .....core.request_options import RequestOptions +from .....core.unchecked_base_model import construct_type +from ...types.article import Article +from ...types.paginated_article_list import PaginatedArticleList +from .types.articles_list_request_expand import ArticlesListRequestExpand +from .types.articles_retrieve_request_expand import ArticlesRetrieveRequestExpand + + +class RawArticlesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + *, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, + cursor: typing.Optional[str] = None, + expand: typing.Optional[ArticlesListRequestExpand] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, + page_size: typing.Optional[int] = None, + parent_article_id: typing.Optional[str] = None, + parent_container_id: typing.Optional[str] = None, + remote_id: typing.Optional[str] = None, + type: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[PaginatedArticleList]: + """ + Returns a list of `Article` objects. + + Parameters + ---------- + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[ArticlesListRequestExpand] + 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). + + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + + page_size : typing.Optional[int] + Number of results to return per page. + + parent_article_id : typing.Optional[str] + If provided, will only return sub articles of the parent_article_id. + + parent_container_id : typing.Optional[str] + If provided, will only return sub articles of the parent_container_id. + + remote_id : typing.Optional[str] + The API provider's ID for the given object. + + type : typing.Optional[str] + If provided, will only return articles of the given type. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[PaginatedArticleList] + + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/articles", + method="GET", + params={ + "created_after": serialize_datetime(created_after) if created_after is not None else None, + "created_before": serialize_datetime(created_before) if created_before is not None else None, + "cursor": cursor, + "expand": expand, + "include_deleted_data": include_deleted_data, + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + "modified_after": serialize_datetime(modified_after) if modified_after is not None else None, + "modified_before": serialize_datetime(modified_before) if modified_before is not None else None, + "page_size": page_size, + "parent_article_id": parent_article_id, + "parent_container_id": parent_container_id, + "remote_id": remote_id, + "type": type, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedArticleList, + construct_type( + type_=PaginatedArticleList, # 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, + *, + expand: typing.Optional[ArticlesRetrieveRequestExpand] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[Article]: + """ + Returns an `Article` object with the given `id`. + + Parameters + ---------- + id : str + + expand : typing.Optional[ArticlesRetrieveRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + 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). + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[Article] + + """ + _response = self._client_wrapper.httpx_client.request( + f"knowledgebase/v1/articles/{jsonable_encoder(id)}", + method="GET", + params={ + "expand": expand, + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + Article, + construct_type( + type_=Article, # 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) + + +class AsyncRawArticlesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + *, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, + cursor: typing.Optional[str] = None, + expand: typing.Optional[ArticlesListRequestExpand] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, + page_size: typing.Optional[int] = None, + parent_article_id: typing.Optional[str] = None, + parent_container_id: typing.Optional[str] = None, + remote_id: typing.Optional[str] = None, + type: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[PaginatedArticleList]: + """ + Returns a list of `Article` objects. + + Parameters + ---------- + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[ArticlesListRequestExpand] + 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). + + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + + page_size : typing.Optional[int] + Number of results to return per page. + + parent_article_id : typing.Optional[str] + If provided, will only return sub articles of the parent_article_id. + + parent_container_id : typing.Optional[str] + If provided, will only return sub articles of the parent_container_id. + + remote_id : typing.Optional[str] + The API provider's ID for the given object. + + type : typing.Optional[str] + If provided, will only return articles of the given type. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[PaginatedArticleList] + + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/articles", + method="GET", + params={ + "created_after": serialize_datetime(created_after) if created_after is not None else None, + "created_before": serialize_datetime(created_before) if created_before is not None else None, + "cursor": cursor, + "expand": expand, + "include_deleted_data": include_deleted_data, + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + "modified_after": serialize_datetime(modified_after) if modified_after is not None else None, + "modified_before": serialize_datetime(modified_before) if modified_before is not None else None, + "page_size": page_size, + "parent_article_id": parent_article_id, + "parent_container_id": parent_container_id, + "remote_id": remote_id, + "type": type, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedArticleList, + construct_type( + type_=PaginatedArticleList, # 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, + *, + expand: typing.Optional[ArticlesRetrieveRequestExpand] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[Article]: + """ + Returns an `Article` object with the given `id`. + + Parameters + ---------- + id : str + + expand : typing.Optional[ArticlesRetrieveRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + 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). + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[Article] + + """ + _response = await self._client_wrapper.httpx_client.request( + f"knowledgebase/v1/articles/{jsonable_encoder(id)}", + method="GET", + params={ + "expand": expand, + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + Article, + construct_type( + type_=Article, # 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) diff --git a/src/merge/resources/knowledgebase/resources/articles/types/__init__.py b/src/merge/resources/knowledgebase/resources/articles/types/__init__.py new file mode 100644 index 00000000..0201e80e --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/articles/types/__init__.py @@ -0,0 +1,36 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .articles_list_request_expand import ArticlesListRequestExpand + from .articles_retrieve_request_expand import ArticlesRetrieveRequestExpand +_dynamic_imports: typing.Dict[str, str] = { + "ArticlesListRequestExpand": ".articles_list_request_expand", + "ArticlesRetrieveRequestExpand": ".articles_retrieve_request_expand", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["ArticlesListRequestExpand", "ArticlesRetrieveRequestExpand"] diff --git a/src/merge/resources/knowledgebase/resources/articles/types/articles_list_request_expand.py b/src/merge/resources/knowledgebase/resources/articles/types/articles_list_request_expand.py new file mode 100644 index 00000000..e8ab09ea --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/articles/types/articles_list_request_expand.py @@ -0,0 +1,625 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class ArticlesListRequestExpand(str, enum.Enum): + ATTACHMENTS = "attachments" + ATTACHMENTS_AUTHOR = "attachments,author" + ATTACHMENTS_AUTHOR_LAST_EDITED_BY = "attachments,author,last_edited_by" + ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE = "attachments,author,last_edited_by,parent_article" + ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER = ( + "attachments,author,last_edited_by,parent_article,parent_container" + ) + ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "attachments,author,last_edited_by,parent_article,parent_container,root_container" + ) + ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER = ( + "attachments,author,last_edited_by,parent_article,root_container" + ) + ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER = "attachments,author,last_edited_by,parent_container" + ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER = ( + "attachments,author,last_edited_by,parent_container,root_container" + ) + ATTACHMENTS_AUTHOR_LAST_EDITED_BY_ROOT_CONTAINER = "attachments,author,last_edited_by,root_container" + ATTACHMENTS_AUTHOR_PARENT_ARTICLE = "attachments,author,parent_article" + ATTACHMENTS_AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER = "attachments,author,parent_article,parent_container" + ATTACHMENTS_AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "attachments,author,parent_article,parent_container,root_container" + ) + ATTACHMENTS_AUTHOR_PARENT_ARTICLE_ROOT_CONTAINER = "attachments,author,parent_article,root_container" + ATTACHMENTS_AUTHOR_PARENT_CONTAINER = "attachments,author,parent_container" + ATTACHMENTS_AUTHOR_PARENT_CONTAINER_ROOT_CONTAINER = "attachments,author,parent_container,root_container" + ATTACHMENTS_AUTHOR_ROOT_CONTAINER = "attachments,author,root_container" + ATTACHMENTS_LAST_EDITED_BY = "attachments,last_edited_by" + ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE = "attachments,last_edited_by,parent_article" + ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER = ( + "attachments,last_edited_by,parent_article,parent_container" + ) + ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "attachments,last_edited_by,parent_article,parent_container,root_container" + ) + ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER = ( + "attachments,last_edited_by,parent_article,root_container" + ) + ATTACHMENTS_LAST_EDITED_BY_PARENT_CONTAINER = "attachments,last_edited_by,parent_container" + ATTACHMENTS_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER = ( + "attachments,last_edited_by,parent_container,root_container" + ) + ATTACHMENTS_LAST_EDITED_BY_ROOT_CONTAINER = "attachments,last_edited_by,root_container" + ATTACHMENTS_PARENT_ARTICLE = "attachments,parent_article" + ATTACHMENTS_PARENT_ARTICLE_PARENT_CONTAINER = "attachments,parent_article,parent_container" + ATTACHMENTS_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "attachments,parent_article,parent_container,root_container" + ) + ATTACHMENTS_PARENT_ARTICLE_ROOT_CONTAINER = "attachments,parent_article,root_container" + ATTACHMENTS_PARENT_CONTAINER = "attachments,parent_container" + ATTACHMENTS_PARENT_CONTAINER_ROOT_CONTAINER = "attachments,parent_container,root_container" + ATTACHMENTS_ROOT_CONTAINER = "attachments,root_container" + AUTHOR = "author" + AUTHOR_LAST_EDITED_BY = "author,last_edited_by" + AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE = "author,last_edited_by,parent_article" + AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER = "author,last_edited_by,parent_article,parent_container" + AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "author,last_edited_by,parent_article,parent_container,root_container" + ) + AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER = "author,last_edited_by,parent_article,root_container" + AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER = "author,last_edited_by,parent_container" + AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER = "author,last_edited_by,parent_container,root_container" + AUTHOR_LAST_EDITED_BY_ROOT_CONTAINER = "author,last_edited_by,root_container" + AUTHOR_PARENT_ARTICLE = "author,parent_article" + AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER = "author,parent_article,parent_container" + AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = "author,parent_article,parent_container,root_container" + AUTHOR_PARENT_ARTICLE_ROOT_CONTAINER = "author,parent_article,root_container" + AUTHOR_PARENT_CONTAINER = "author,parent_container" + AUTHOR_PARENT_CONTAINER_ROOT_CONTAINER = "author,parent_container,root_container" + AUTHOR_ROOT_CONTAINER = "author,root_container" + LAST_EDITED_BY = "last_edited_by" + LAST_EDITED_BY_PARENT_ARTICLE = "last_edited_by,parent_article" + LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER = "last_edited_by,parent_article,parent_container" + LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "last_edited_by,parent_article,parent_container,root_container" + ) + LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER = "last_edited_by,parent_article,root_container" + LAST_EDITED_BY_PARENT_CONTAINER = "last_edited_by,parent_container" + LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER = "last_edited_by,parent_container,root_container" + LAST_EDITED_BY_ROOT_CONTAINER = "last_edited_by,root_container" + PARENT_ARTICLE = "parent_article" + PARENT_ARTICLE_PARENT_CONTAINER = "parent_article,parent_container" + PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = "parent_article,parent_container,root_container" + PARENT_ARTICLE_ROOT_CONTAINER = "parent_article,root_container" + PARENT_CONTAINER = "parent_container" + PARENT_CONTAINER_ROOT_CONTAINER = "parent_container,root_container" + PERMISSIONS = "permissions" + PERMISSIONS_ATTACHMENTS = "permissions,attachments" + PERMISSIONS_ATTACHMENTS_AUTHOR = "permissions,attachments,author" + PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY = "permissions,attachments,author,last_edited_by" + PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE = ( + "permissions,attachments,author,last_edited_by,parent_article" + ) + PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER = ( + "permissions,attachments,author,last_edited_by,parent_article,parent_container" + ) + PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "permissions,attachments,author,last_edited_by,parent_article,parent_container,root_container" + ) + PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER = ( + "permissions,attachments,author,last_edited_by,parent_article,root_container" + ) + PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER = ( + "permissions,attachments,author,last_edited_by,parent_container" + ) + PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER = ( + "permissions,attachments,author,last_edited_by,parent_container,root_container" + ) + PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_ROOT_CONTAINER = ( + "permissions,attachments,author,last_edited_by,root_container" + ) + PERMISSIONS_ATTACHMENTS_AUTHOR_PARENT_ARTICLE = "permissions,attachments,author,parent_article" + PERMISSIONS_ATTACHMENTS_AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER = ( + "permissions,attachments,author,parent_article,parent_container" + ) + PERMISSIONS_ATTACHMENTS_AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "permissions,attachments,author,parent_article,parent_container,root_container" + ) + PERMISSIONS_ATTACHMENTS_AUTHOR_PARENT_ARTICLE_ROOT_CONTAINER = ( + "permissions,attachments,author,parent_article,root_container" + ) + PERMISSIONS_ATTACHMENTS_AUTHOR_PARENT_CONTAINER = "permissions,attachments,author,parent_container" + PERMISSIONS_ATTACHMENTS_AUTHOR_PARENT_CONTAINER_ROOT_CONTAINER = ( + "permissions,attachments,author,parent_container,root_container" + ) + PERMISSIONS_ATTACHMENTS_AUTHOR_ROOT_CONTAINER = "permissions,attachments,author,root_container" + PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY = "permissions,attachments,last_edited_by" + PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE = "permissions,attachments,last_edited_by,parent_article" + PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER = ( + "permissions,attachments,last_edited_by,parent_article,parent_container" + ) + PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "permissions,attachments,last_edited_by,parent_article,parent_container,root_container" + ) + PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER = ( + "permissions,attachments,last_edited_by,parent_article,root_container" + ) + PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_PARENT_CONTAINER = "permissions,attachments,last_edited_by,parent_container" + PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER = ( + "permissions,attachments,last_edited_by,parent_container,root_container" + ) + PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_ROOT_CONTAINER = "permissions,attachments,last_edited_by,root_container" + PERMISSIONS_ATTACHMENTS_PARENT_ARTICLE = "permissions,attachments,parent_article" + PERMISSIONS_ATTACHMENTS_PARENT_ARTICLE_PARENT_CONTAINER = "permissions,attachments,parent_article,parent_container" + PERMISSIONS_ATTACHMENTS_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "permissions,attachments,parent_article,parent_container,root_container" + ) + PERMISSIONS_ATTACHMENTS_PARENT_ARTICLE_ROOT_CONTAINER = "permissions,attachments,parent_article,root_container" + PERMISSIONS_ATTACHMENTS_PARENT_CONTAINER = "permissions,attachments,parent_container" + PERMISSIONS_ATTACHMENTS_PARENT_CONTAINER_ROOT_CONTAINER = "permissions,attachments,parent_container,root_container" + PERMISSIONS_ATTACHMENTS_ROOT_CONTAINER = "permissions,attachments,root_container" + PERMISSIONS_AUTHOR = "permissions,author" + PERMISSIONS_AUTHOR_LAST_EDITED_BY = "permissions,author,last_edited_by" + PERMISSIONS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE = "permissions,author,last_edited_by,parent_article" + PERMISSIONS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER = ( + "permissions,author,last_edited_by,parent_article,parent_container" + ) + PERMISSIONS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "permissions,author,last_edited_by,parent_article,parent_container,root_container" + ) + PERMISSIONS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER = ( + "permissions,author,last_edited_by,parent_article,root_container" + ) + PERMISSIONS_AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER = "permissions,author,last_edited_by,parent_container" + PERMISSIONS_AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER = ( + "permissions,author,last_edited_by,parent_container,root_container" + ) + PERMISSIONS_AUTHOR_LAST_EDITED_BY_ROOT_CONTAINER = "permissions,author,last_edited_by,root_container" + PERMISSIONS_AUTHOR_PARENT_ARTICLE = "permissions,author,parent_article" + PERMISSIONS_AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER = "permissions,author,parent_article,parent_container" + PERMISSIONS_AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "permissions,author,parent_article,parent_container,root_container" + ) + PERMISSIONS_AUTHOR_PARENT_ARTICLE_ROOT_CONTAINER = "permissions,author,parent_article,root_container" + PERMISSIONS_AUTHOR_PARENT_CONTAINER = "permissions,author,parent_container" + PERMISSIONS_AUTHOR_PARENT_CONTAINER_ROOT_CONTAINER = "permissions,author,parent_container,root_container" + PERMISSIONS_AUTHOR_ROOT_CONTAINER = "permissions,author,root_container" + PERMISSIONS_LAST_EDITED_BY = "permissions,last_edited_by" + PERMISSIONS_LAST_EDITED_BY_PARENT_ARTICLE = "permissions,last_edited_by,parent_article" + PERMISSIONS_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER = ( + "permissions,last_edited_by,parent_article,parent_container" + ) + PERMISSIONS_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "permissions,last_edited_by,parent_article,parent_container,root_container" + ) + PERMISSIONS_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER = ( + "permissions,last_edited_by,parent_article,root_container" + ) + PERMISSIONS_LAST_EDITED_BY_PARENT_CONTAINER = "permissions,last_edited_by,parent_container" + PERMISSIONS_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER = ( + "permissions,last_edited_by,parent_container,root_container" + ) + PERMISSIONS_LAST_EDITED_BY_ROOT_CONTAINER = "permissions,last_edited_by,root_container" + PERMISSIONS_PARENT_ARTICLE = "permissions,parent_article" + PERMISSIONS_PARENT_ARTICLE_PARENT_CONTAINER = "permissions,parent_article,parent_container" + PERMISSIONS_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "permissions,parent_article,parent_container,root_container" + ) + PERMISSIONS_PARENT_ARTICLE_ROOT_CONTAINER = "permissions,parent_article,root_container" + PERMISSIONS_PARENT_CONTAINER = "permissions,parent_container" + PERMISSIONS_PARENT_CONTAINER_ROOT_CONTAINER = "permissions,parent_container,root_container" + PERMISSIONS_ROOT_CONTAINER = "permissions,root_container" + ROOT_CONTAINER = "root_container" + + def visit( + self, + attachments: typing.Callable[[], T_Result], + attachments_author: typing.Callable[[], T_Result], + attachments_author_last_edited_by: typing.Callable[[], T_Result], + attachments_author_last_edited_by_parent_article: typing.Callable[[], T_Result], + attachments_author_last_edited_by_parent_article_parent_container: typing.Callable[[], T_Result], + attachments_author_last_edited_by_parent_article_parent_container_root_container: typing.Callable[[], T_Result], + attachments_author_last_edited_by_parent_article_root_container: typing.Callable[[], T_Result], + attachments_author_last_edited_by_parent_container: typing.Callable[[], T_Result], + attachments_author_last_edited_by_parent_container_root_container: typing.Callable[[], T_Result], + attachments_author_last_edited_by_root_container: typing.Callable[[], T_Result], + attachments_author_parent_article: typing.Callable[[], T_Result], + attachments_author_parent_article_parent_container: typing.Callable[[], T_Result], + attachments_author_parent_article_parent_container_root_container: typing.Callable[[], T_Result], + attachments_author_parent_article_root_container: typing.Callable[[], T_Result], + attachments_author_parent_container: typing.Callable[[], T_Result], + attachments_author_parent_container_root_container: typing.Callable[[], T_Result], + attachments_author_root_container: typing.Callable[[], T_Result], + attachments_last_edited_by: typing.Callable[[], T_Result], + attachments_last_edited_by_parent_article: typing.Callable[[], T_Result], + attachments_last_edited_by_parent_article_parent_container: typing.Callable[[], T_Result], + attachments_last_edited_by_parent_article_parent_container_root_container: typing.Callable[[], T_Result], + attachments_last_edited_by_parent_article_root_container: typing.Callable[[], T_Result], + attachments_last_edited_by_parent_container: typing.Callable[[], T_Result], + attachments_last_edited_by_parent_container_root_container: typing.Callable[[], T_Result], + attachments_last_edited_by_root_container: typing.Callable[[], T_Result], + attachments_parent_article: typing.Callable[[], T_Result], + attachments_parent_article_parent_container: typing.Callable[[], T_Result], + attachments_parent_article_parent_container_root_container: typing.Callable[[], T_Result], + attachments_parent_article_root_container: typing.Callable[[], T_Result], + attachments_parent_container: typing.Callable[[], T_Result], + attachments_parent_container_root_container: typing.Callable[[], T_Result], + attachments_root_container: typing.Callable[[], T_Result], + author: typing.Callable[[], T_Result], + author_last_edited_by: typing.Callable[[], T_Result], + author_last_edited_by_parent_article: typing.Callable[[], T_Result], + author_last_edited_by_parent_article_parent_container: typing.Callable[[], T_Result], + author_last_edited_by_parent_article_parent_container_root_container: typing.Callable[[], T_Result], + author_last_edited_by_parent_article_root_container: typing.Callable[[], T_Result], + author_last_edited_by_parent_container: typing.Callable[[], T_Result], + author_last_edited_by_parent_container_root_container: typing.Callable[[], T_Result], + author_last_edited_by_root_container: typing.Callable[[], T_Result], + author_parent_article: typing.Callable[[], T_Result], + author_parent_article_parent_container: typing.Callable[[], T_Result], + author_parent_article_parent_container_root_container: typing.Callable[[], T_Result], + author_parent_article_root_container: typing.Callable[[], T_Result], + author_parent_container: typing.Callable[[], T_Result], + author_parent_container_root_container: typing.Callable[[], T_Result], + author_root_container: typing.Callable[[], T_Result], + last_edited_by: typing.Callable[[], T_Result], + last_edited_by_parent_article: typing.Callable[[], T_Result], + last_edited_by_parent_article_parent_container: typing.Callable[[], T_Result], + last_edited_by_parent_article_parent_container_root_container: typing.Callable[[], T_Result], + last_edited_by_parent_article_root_container: typing.Callable[[], T_Result], + last_edited_by_parent_container: typing.Callable[[], T_Result], + last_edited_by_parent_container_root_container: typing.Callable[[], T_Result], + last_edited_by_root_container: typing.Callable[[], T_Result], + parent_article: typing.Callable[[], T_Result], + parent_article_parent_container: typing.Callable[[], T_Result], + parent_article_parent_container_root_container: typing.Callable[[], T_Result], + parent_article_root_container: typing.Callable[[], T_Result], + parent_container: typing.Callable[[], T_Result], + parent_container_root_container: typing.Callable[[], T_Result], + permissions: typing.Callable[[], T_Result], + permissions_attachments: typing.Callable[[], T_Result], + permissions_attachments_author: typing.Callable[[], T_Result], + permissions_attachments_author_last_edited_by: typing.Callable[[], T_Result], + permissions_attachments_author_last_edited_by_parent_article: typing.Callable[[], T_Result], + permissions_attachments_author_last_edited_by_parent_article_parent_container: typing.Callable[[], T_Result], + permissions_attachments_author_last_edited_by_parent_article_parent_container_root_container: typing.Callable[ + [], T_Result + ], + permissions_attachments_author_last_edited_by_parent_article_root_container: typing.Callable[[], T_Result], + permissions_attachments_author_last_edited_by_parent_container: typing.Callable[[], T_Result], + permissions_attachments_author_last_edited_by_parent_container_root_container: typing.Callable[[], T_Result], + permissions_attachments_author_last_edited_by_root_container: typing.Callable[[], T_Result], + permissions_attachments_author_parent_article: typing.Callable[[], T_Result], + permissions_attachments_author_parent_article_parent_container: typing.Callable[[], T_Result], + permissions_attachments_author_parent_article_parent_container_root_container: typing.Callable[[], T_Result], + permissions_attachments_author_parent_article_root_container: typing.Callable[[], T_Result], + permissions_attachments_author_parent_container: typing.Callable[[], T_Result], + permissions_attachments_author_parent_container_root_container: typing.Callable[[], T_Result], + permissions_attachments_author_root_container: typing.Callable[[], T_Result], + permissions_attachments_last_edited_by: typing.Callable[[], T_Result], + permissions_attachments_last_edited_by_parent_article: typing.Callable[[], T_Result], + permissions_attachments_last_edited_by_parent_article_parent_container: typing.Callable[[], T_Result], + permissions_attachments_last_edited_by_parent_article_parent_container_root_container: typing.Callable[ + [], T_Result + ], + permissions_attachments_last_edited_by_parent_article_root_container: typing.Callable[[], T_Result], + permissions_attachments_last_edited_by_parent_container: typing.Callable[[], T_Result], + permissions_attachments_last_edited_by_parent_container_root_container: typing.Callable[[], T_Result], + permissions_attachments_last_edited_by_root_container: typing.Callable[[], T_Result], + permissions_attachments_parent_article: typing.Callable[[], T_Result], + permissions_attachments_parent_article_parent_container: typing.Callable[[], T_Result], + permissions_attachments_parent_article_parent_container_root_container: typing.Callable[[], T_Result], + permissions_attachments_parent_article_root_container: typing.Callable[[], T_Result], + permissions_attachments_parent_container: typing.Callable[[], T_Result], + permissions_attachments_parent_container_root_container: typing.Callable[[], T_Result], + permissions_attachments_root_container: typing.Callable[[], T_Result], + permissions_author: typing.Callable[[], T_Result], + permissions_author_last_edited_by: typing.Callable[[], T_Result], + permissions_author_last_edited_by_parent_article: typing.Callable[[], T_Result], + permissions_author_last_edited_by_parent_article_parent_container: typing.Callable[[], T_Result], + permissions_author_last_edited_by_parent_article_parent_container_root_container: typing.Callable[[], T_Result], + permissions_author_last_edited_by_parent_article_root_container: typing.Callable[[], T_Result], + permissions_author_last_edited_by_parent_container: typing.Callable[[], T_Result], + permissions_author_last_edited_by_parent_container_root_container: typing.Callable[[], T_Result], + permissions_author_last_edited_by_root_container: typing.Callable[[], T_Result], + permissions_author_parent_article: typing.Callable[[], T_Result], + permissions_author_parent_article_parent_container: typing.Callable[[], T_Result], + permissions_author_parent_article_parent_container_root_container: typing.Callable[[], T_Result], + permissions_author_parent_article_root_container: typing.Callable[[], T_Result], + permissions_author_parent_container: typing.Callable[[], T_Result], + permissions_author_parent_container_root_container: typing.Callable[[], T_Result], + permissions_author_root_container: typing.Callable[[], T_Result], + permissions_last_edited_by: typing.Callable[[], T_Result], + permissions_last_edited_by_parent_article: typing.Callable[[], T_Result], + permissions_last_edited_by_parent_article_parent_container: typing.Callable[[], T_Result], + permissions_last_edited_by_parent_article_parent_container_root_container: typing.Callable[[], T_Result], + permissions_last_edited_by_parent_article_root_container: typing.Callable[[], T_Result], + permissions_last_edited_by_parent_container: typing.Callable[[], T_Result], + permissions_last_edited_by_parent_container_root_container: typing.Callable[[], T_Result], + permissions_last_edited_by_root_container: typing.Callable[[], T_Result], + permissions_parent_article: typing.Callable[[], T_Result], + permissions_parent_article_parent_container: typing.Callable[[], T_Result], + permissions_parent_article_parent_container_root_container: typing.Callable[[], T_Result], + permissions_parent_article_root_container: typing.Callable[[], T_Result], + permissions_parent_container: typing.Callable[[], T_Result], + permissions_parent_container_root_container: typing.Callable[[], T_Result], + permissions_root_container: typing.Callable[[], T_Result], + root_container: typing.Callable[[], T_Result], + ) -> T_Result: + if self is ArticlesListRequestExpand.ATTACHMENTS: + return attachments() + if self is ArticlesListRequestExpand.ATTACHMENTS_AUTHOR: + return attachments_author() + if self is ArticlesListRequestExpand.ATTACHMENTS_AUTHOR_LAST_EDITED_BY: + return attachments_author_last_edited_by() + if self is ArticlesListRequestExpand.ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE: + return attachments_author_last_edited_by_parent_article() + if self is ArticlesListRequestExpand.ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER: + return attachments_author_last_edited_by_parent_article_parent_container() + if ( + self + is ArticlesListRequestExpand.ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER + ): + return attachments_author_last_edited_by_parent_article_parent_container_root_container() + if self is ArticlesListRequestExpand.ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER: + return attachments_author_last_edited_by_parent_article_root_container() + if self is ArticlesListRequestExpand.ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER: + return attachments_author_last_edited_by_parent_container() + if self is ArticlesListRequestExpand.ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER: + return attachments_author_last_edited_by_parent_container_root_container() + if self is ArticlesListRequestExpand.ATTACHMENTS_AUTHOR_LAST_EDITED_BY_ROOT_CONTAINER: + return attachments_author_last_edited_by_root_container() + if self is ArticlesListRequestExpand.ATTACHMENTS_AUTHOR_PARENT_ARTICLE: + return attachments_author_parent_article() + if self is ArticlesListRequestExpand.ATTACHMENTS_AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER: + return attachments_author_parent_article_parent_container() + if self is ArticlesListRequestExpand.ATTACHMENTS_AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER: + return attachments_author_parent_article_parent_container_root_container() + if self is ArticlesListRequestExpand.ATTACHMENTS_AUTHOR_PARENT_ARTICLE_ROOT_CONTAINER: + return attachments_author_parent_article_root_container() + if self is ArticlesListRequestExpand.ATTACHMENTS_AUTHOR_PARENT_CONTAINER: + return attachments_author_parent_container() + if self is ArticlesListRequestExpand.ATTACHMENTS_AUTHOR_PARENT_CONTAINER_ROOT_CONTAINER: + return attachments_author_parent_container_root_container() + if self is ArticlesListRequestExpand.ATTACHMENTS_AUTHOR_ROOT_CONTAINER: + return attachments_author_root_container() + if self is ArticlesListRequestExpand.ATTACHMENTS_LAST_EDITED_BY: + return attachments_last_edited_by() + if self is ArticlesListRequestExpand.ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE: + return attachments_last_edited_by_parent_article() + if self is ArticlesListRequestExpand.ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER: + return attachments_last_edited_by_parent_article_parent_container() + if self is ArticlesListRequestExpand.ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER: + return attachments_last_edited_by_parent_article_parent_container_root_container() + if self is ArticlesListRequestExpand.ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER: + return attachments_last_edited_by_parent_article_root_container() + if self is ArticlesListRequestExpand.ATTACHMENTS_LAST_EDITED_BY_PARENT_CONTAINER: + return attachments_last_edited_by_parent_container() + if self is ArticlesListRequestExpand.ATTACHMENTS_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER: + return attachments_last_edited_by_parent_container_root_container() + if self is ArticlesListRequestExpand.ATTACHMENTS_LAST_EDITED_BY_ROOT_CONTAINER: + return attachments_last_edited_by_root_container() + if self is ArticlesListRequestExpand.ATTACHMENTS_PARENT_ARTICLE: + return attachments_parent_article() + if self is ArticlesListRequestExpand.ATTACHMENTS_PARENT_ARTICLE_PARENT_CONTAINER: + return attachments_parent_article_parent_container() + if self is ArticlesListRequestExpand.ATTACHMENTS_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER: + return attachments_parent_article_parent_container_root_container() + if self is ArticlesListRequestExpand.ATTACHMENTS_PARENT_ARTICLE_ROOT_CONTAINER: + return attachments_parent_article_root_container() + if self is ArticlesListRequestExpand.ATTACHMENTS_PARENT_CONTAINER: + return attachments_parent_container() + if self is ArticlesListRequestExpand.ATTACHMENTS_PARENT_CONTAINER_ROOT_CONTAINER: + return attachments_parent_container_root_container() + if self is ArticlesListRequestExpand.ATTACHMENTS_ROOT_CONTAINER: + return attachments_root_container() + if self is ArticlesListRequestExpand.AUTHOR: + return author() + if self is ArticlesListRequestExpand.AUTHOR_LAST_EDITED_BY: + return author_last_edited_by() + if self is ArticlesListRequestExpand.AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE: + return author_last_edited_by_parent_article() + if self is ArticlesListRequestExpand.AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER: + return author_last_edited_by_parent_article_parent_container() + if self is ArticlesListRequestExpand.AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER: + return author_last_edited_by_parent_article_parent_container_root_container() + if self is ArticlesListRequestExpand.AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER: + return author_last_edited_by_parent_article_root_container() + if self is ArticlesListRequestExpand.AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER: + return author_last_edited_by_parent_container() + if self is ArticlesListRequestExpand.AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER: + return author_last_edited_by_parent_container_root_container() + if self is ArticlesListRequestExpand.AUTHOR_LAST_EDITED_BY_ROOT_CONTAINER: + return author_last_edited_by_root_container() + if self is ArticlesListRequestExpand.AUTHOR_PARENT_ARTICLE: + return author_parent_article() + if self is ArticlesListRequestExpand.AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER: + return author_parent_article_parent_container() + if self is ArticlesListRequestExpand.AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER: + return author_parent_article_parent_container_root_container() + if self is ArticlesListRequestExpand.AUTHOR_PARENT_ARTICLE_ROOT_CONTAINER: + return author_parent_article_root_container() + if self is ArticlesListRequestExpand.AUTHOR_PARENT_CONTAINER: + return author_parent_container() + if self is ArticlesListRequestExpand.AUTHOR_PARENT_CONTAINER_ROOT_CONTAINER: + return author_parent_container_root_container() + if self is ArticlesListRequestExpand.AUTHOR_ROOT_CONTAINER: + return author_root_container() + if self is ArticlesListRequestExpand.LAST_EDITED_BY: + return last_edited_by() + if self is ArticlesListRequestExpand.LAST_EDITED_BY_PARENT_ARTICLE: + return last_edited_by_parent_article() + if self is ArticlesListRequestExpand.LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER: + return last_edited_by_parent_article_parent_container() + if self is ArticlesListRequestExpand.LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER: + return last_edited_by_parent_article_parent_container_root_container() + if self is ArticlesListRequestExpand.LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER: + return last_edited_by_parent_article_root_container() + if self is ArticlesListRequestExpand.LAST_EDITED_BY_PARENT_CONTAINER: + return last_edited_by_parent_container() + if self is ArticlesListRequestExpand.LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER: + return last_edited_by_parent_container_root_container() + if self is ArticlesListRequestExpand.LAST_EDITED_BY_ROOT_CONTAINER: + return last_edited_by_root_container() + if self is ArticlesListRequestExpand.PARENT_ARTICLE: + return parent_article() + if self is ArticlesListRequestExpand.PARENT_ARTICLE_PARENT_CONTAINER: + return parent_article_parent_container() + if self is ArticlesListRequestExpand.PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER: + return parent_article_parent_container_root_container() + if self is ArticlesListRequestExpand.PARENT_ARTICLE_ROOT_CONTAINER: + return parent_article_root_container() + if self is ArticlesListRequestExpand.PARENT_CONTAINER: + return parent_container() + if self is ArticlesListRequestExpand.PARENT_CONTAINER_ROOT_CONTAINER: + return parent_container_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS: + return permissions() + if self is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS: + return permissions_attachments() + if self is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR: + return permissions_attachments_author() + if self is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY: + return permissions_attachments_author_last_edited_by() + if self is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE: + return permissions_attachments_author_last_edited_by_parent_article() + if ( + self + is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER + ): + return permissions_attachments_author_last_edited_by_parent_article_parent_container() + if ( + self + is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER + ): + return permissions_attachments_author_last_edited_by_parent_article_parent_container_root_container() + if ( + self + is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER + ): + return permissions_attachments_author_last_edited_by_parent_article_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER: + return permissions_attachments_author_last_edited_by_parent_container() + if ( + self + is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER + ): + return permissions_attachments_author_last_edited_by_parent_container_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_ROOT_CONTAINER: + return permissions_attachments_author_last_edited_by_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_PARENT_ARTICLE: + return permissions_attachments_author_parent_article() + if self is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER: + return permissions_attachments_author_parent_article_parent_container() + if ( + self + is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER + ): + return permissions_attachments_author_parent_article_parent_container_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_PARENT_ARTICLE_ROOT_CONTAINER: + return permissions_attachments_author_parent_article_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_PARENT_CONTAINER: + return permissions_attachments_author_parent_container() + if self is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_PARENT_CONTAINER_ROOT_CONTAINER: + return permissions_attachments_author_parent_container_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_ROOT_CONTAINER: + return permissions_attachments_author_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY: + return permissions_attachments_last_edited_by() + if self is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE: + return permissions_attachments_last_edited_by_parent_article() + if self is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER: + return permissions_attachments_last_edited_by_parent_article_parent_container() + if ( + self + is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER + ): + return permissions_attachments_last_edited_by_parent_article_parent_container_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER: + return permissions_attachments_last_edited_by_parent_article_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_PARENT_CONTAINER: + return permissions_attachments_last_edited_by_parent_container() + if self is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER: + return permissions_attachments_last_edited_by_parent_container_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_ROOT_CONTAINER: + return permissions_attachments_last_edited_by_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_PARENT_ARTICLE: + return permissions_attachments_parent_article() + if self is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_PARENT_ARTICLE_PARENT_CONTAINER: + return permissions_attachments_parent_article_parent_container() + if self is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER: + return permissions_attachments_parent_article_parent_container_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_PARENT_ARTICLE_ROOT_CONTAINER: + return permissions_attachments_parent_article_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_PARENT_CONTAINER: + return permissions_attachments_parent_container() + if self is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_PARENT_CONTAINER_ROOT_CONTAINER: + return permissions_attachments_parent_container_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_ATTACHMENTS_ROOT_CONTAINER: + return permissions_attachments_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_AUTHOR: + return permissions_author() + if self is ArticlesListRequestExpand.PERMISSIONS_AUTHOR_LAST_EDITED_BY: + return permissions_author_last_edited_by() + if self is ArticlesListRequestExpand.PERMISSIONS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE: + return permissions_author_last_edited_by_parent_article() + if self is ArticlesListRequestExpand.PERMISSIONS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER: + return permissions_author_last_edited_by_parent_article_parent_container() + if ( + self + is ArticlesListRequestExpand.PERMISSIONS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER + ): + return permissions_author_last_edited_by_parent_article_parent_container_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER: + return permissions_author_last_edited_by_parent_article_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER: + return permissions_author_last_edited_by_parent_container() + if self is ArticlesListRequestExpand.PERMISSIONS_AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER: + return permissions_author_last_edited_by_parent_container_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_AUTHOR_LAST_EDITED_BY_ROOT_CONTAINER: + return permissions_author_last_edited_by_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_AUTHOR_PARENT_ARTICLE: + return permissions_author_parent_article() + if self is ArticlesListRequestExpand.PERMISSIONS_AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER: + return permissions_author_parent_article_parent_container() + if self is ArticlesListRequestExpand.PERMISSIONS_AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER: + return permissions_author_parent_article_parent_container_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_AUTHOR_PARENT_ARTICLE_ROOT_CONTAINER: + return permissions_author_parent_article_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_AUTHOR_PARENT_CONTAINER: + return permissions_author_parent_container() + if self is ArticlesListRequestExpand.PERMISSIONS_AUTHOR_PARENT_CONTAINER_ROOT_CONTAINER: + return permissions_author_parent_container_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_AUTHOR_ROOT_CONTAINER: + return permissions_author_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_LAST_EDITED_BY: + return permissions_last_edited_by() + if self is ArticlesListRequestExpand.PERMISSIONS_LAST_EDITED_BY_PARENT_ARTICLE: + return permissions_last_edited_by_parent_article() + if self is ArticlesListRequestExpand.PERMISSIONS_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER: + return permissions_last_edited_by_parent_article_parent_container() + if self is ArticlesListRequestExpand.PERMISSIONS_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER: + return permissions_last_edited_by_parent_article_parent_container_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER: + return permissions_last_edited_by_parent_article_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_LAST_EDITED_BY_PARENT_CONTAINER: + return permissions_last_edited_by_parent_container() + if self is ArticlesListRequestExpand.PERMISSIONS_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER: + return permissions_last_edited_by_parent_container_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_LAST_EDITED_BY_ROOT_CONTAINER: + return permissions_last_edited_by_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_PARENT_ARTICLE: + return permissions_parent_article() + if self is ArticlesListRequestExpand.PERMISSIONS_PARENT_ARTICLE_PARENT_CONTAINER: + return permissions_parent_article_parent_container() + if self is ArticlesListRequestExpand.PERMISSIONS_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER: + return permissions_parent_article_parent_container_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_PARENT_ARTICLE_ROOT_CONTAINER: + return permissions_parent_article_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_PARENT_CONTAINER: + return permissions_parent_container() + if self is ArticlesListRequestExpand.PERMISSIONS_PARENT_CONTAINER_ROOT_CONTAINER: + return permissions_parent_container_root_container() + if self is ArticlesListRequestExpand.PERMISSIONS_ROOT_CONTAINER: + return permissions_root_container() + if self is ArticlesListRequestExpand.ROOT_CONTAINER: + return root_container() diff --git a/src/merge/resources/knowledgebase/resources/articles/types/articles_retrieve_request_expand.py b/src/merge/resources/knowledgebase/resources/articles/types/articles_retrieve_request_expand.py new file mode 100644 index 00000000..e64863e6 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/articles/types/articles_retrieve_request_expand.py @@ -0,0 +1,631 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class ArticlesRetrieveRequestExpand(str, enum.Enum): + ATTACHMENTS = "attachments" + ATTACHMENTS_AUTHOR = "attachments,author" + ATTACHMENTS_AUTHOR_LAST_EDITED_BY = "attachments,author,last_edited_by" + ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE = "attachments,author,last_edited_by,parent_article" + ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER = ( + "attachments,author,last_edited_by,parent_article,parent_container" + ) + ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "attachments,author,last_edited_by,parent_article,parent_container,root_container" + ) + ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER = ( + "attachments,author,last_edited_by,parent_article,root_container" + ) + ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER = "attachments,author,last_edited_by,parent_container" + ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER = ( + "attachments,author,last_edited_by,parent_container,root_container" + ) + ATTACHMENTS_AUTHOR_LAST_EDITED_BY_ROOT_CONTAINER = "attachments,author,last_edited_by,root_container" + ATTACHMENTS_AUTHOR_PARENT_ARTICLE = "attachments,author,parent_article" + ATTACHMENTS_AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER = "attachments,author,parent_article,parent_container" + ATTACHMENTS_AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "attachments,author,parent_article,parent_container,root_container" + ) + ATTACHMENTS_AUTHOR_PARENT_ARTICLE_ROOT_CONTAINER = "attachments,author,parent_article,root_container" + ATTACHMENTS_AUTHOR_PARENT_CONTAINER = "attachments,author,parent_container" + ATTACHMENTS_AUTHOR_PARENT_CONTAINER_ROOT_CONTAINER = "attachments,author,parent_container,root_container" + ATTACHMENTS_AUTHOR_ROOT_CONTAINER = "attachments,author,root_container" + ATTACHMENTS_LAST_EDITED_BY = "attachments,last_edited_by" + ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE = "attachments,last_edited_by,parent_article" + ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER = ( + "attachments,last_edited_by,parent_article,parent_container" + ) + ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "attachments,last_edited_by,parent_article,parent_container,root_container" + ) + ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER = ( + "attachments,last_edited_by,parent_article,root_container" + ) + ATTACHMENTS_LAST_EDITED_BY_PARENT_CONTAINER = "attachments,last_edited_by,parent_container" + ATTACHMENTS_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER = ( + "attachments,last_edited_by,parent_container,root_container" + ) + ATTACHMENTS_LAST_EDITED_BY_ROOT_CONTAINER = "attachments,last_edited_by,root_container" + ATTACHMENTS_PARENT_ARTICLE = "attachments,parent_article" + ATTACHMENTS_PARENT_ARTICLE_PARENT_CONTAINER = "attachments,parent_article,parent_container" + ATTACHMENTS_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "attachments,parent_article,parent_container,root_container" + ) + ATTACHMENTS_PARENT_ARTICLE_ROOT_CONTAINER = "attachments,parent_article,root_container" + ATTACHMENTS_PARENT_CONTAINER = "attachments,parent_container" + ATTACHMENTS_PARENT_CONTAINER_ROOT_CONTAINER = "attachments,parent_container,root_container" + ATTACHMENTS_ROOT_CONTAINER = "attachments,root_container" + AUTHOR = "author" + AUTHOR_LAST_EDITED_BY = "author,last_edited_by" + AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE = "author,last_edited_by,parent_article" + AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER = "author,last_edited_by,parent_article,parent_container" + AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "author,last_edited_by,parent_article,parent_container,root_container" + ) + AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER = "author,last_edited_by,parent_article,root_container" + AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER = "author,last_edited_by,parent_container" + AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER = "author,last_edited_by,parent_container,root_container" + AUTHOR_LAST_EDITED_BY_ROOT_CONTAINER = "author,last_edited_by,root_container" + AUTHOR_PARENT_ARTICLE = "author,parent_article" + AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER = "author,parent_article,parent_container" + AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = "author,parent_article,parent_container,root_container" + AUTHOR_PARENT_ARTICLE_ROOT_CONTAINER = "author,parent_article,root_container" + AUTHOR_PARENT_CONTAINER = "author,parent_container" + AUTHOR_PARENT_CONTAINER_ROOT_CONTAINER = "author,parent_container,root_container" + AUTHOR_ROOT_CONTAINER = "author,root_container" + LAST_EDITED_BY = "last_edited_by" + LAST_EDITED_BY_PARENT_ARTICLE = "last_edited_by,parent_article" + LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER = "last_edited_by,parent_article,parent_container" + LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "last_edited_by,parent_article,parent_container,root_container" + ) + LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER = "last_edited_by,parent_article,root_container" + LAST_EDITED_BY_PARENT_CONTAINER = "last_edited_by,parent_container" + LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER = "last_edited_by,parent_container,root_container" + LAST_EDITED_BY_ROOT_CONTAINER = "last_edited_by,root_container" + PARENT_ARTICLE = "parent_article" + PARENT_ARTICLE_PARENT_CONTAINER = "parent_article,parent_container" + PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = "parent_article,parent_container,root_container" + PARENT_ARTICLE_ROOT_CONTAINER = "parent_article,root_container" + PARENT_CONTAINER = "parent_container" + PARENT_CONTAINER_ROOT_CONTAINER = "parent_container,root_container" + PERMISSIONS = "permissions" + PERMISSIONS_ATTACHMENTS = "permissions,attachments" + PERMISSIONS_ATTACHMENTS_AUTHOR = "permissions,attachments,author" + PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY = "permissions,attachments,author,last_edited_by" + PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE = ( + "permissions,attachments,author,last_edited_by,parent_article" + ) + PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER = ( + "permissions,attachments,author,last_edited_by,parent_article,parent_container" + ) + PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "permissions,attachments,author,last_edited_by,parent_article,parent_container,root_container" + ) + PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER = ( + "permissions,attachments,author,last_edited_by,parent_article,root_container" + ) + PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER = ( + "permissions,attachments,author,last_edited_by,parent_container" + ) + PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER = ( + "permissions,attachments,author,last_edited_by,parent_container,root_container" + ) + PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_ROOT_CONTAINER = ( + "permissions,attachments,author,last_edited_by,root_container" + ) + PERMISSIONS_ATTACHMENTS_AUTHOR_PARENT_ARTICLE = "permissions,attachments,author,parent_article" + PERMISSIONS_ATTACHMENTS_AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER = ( + "permissions,attachments,author,parent_article,parent_container" + ) + PERMISSIONS_ATTACHMENTS_AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "permissions,attachments,author,parent_article,parent_container,root_container" + ) + PERMISSIONS_ATTACHMENTS_AUTHOR_PARENT_ARTICLE_ROOT_CONTAINER = ( + "permissions,attachments,author,parent_article,root_container" + ) + PERMISSIONS_ATTACHMENTS_AUTHOR_PARENT_CONTAINER = "permissions,attachments,author,parent_container" + PERMISSIONS_ATTACHMENTS_AUTHOR_PARENT_CONTAINER_ROOT_CONTAINER = ( + "permissions,attachments,author,parent_container,root_container" + ) + PERMISSIONS_ATTACHMENTS_AUTHOR_ROOT_CONTAINER = "permissions,attachments,author,root_container" + PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY = "permissions,attachments,last_edited_by" + PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE = "permissions,attachments,last_edited_by,parent_article" + PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER = ( + "permissions,attachments,last_edited_by,parent_article,parent_container" + ) + PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "permissions,attachments,last_edited_by,parent_article,parent_container,root_container" + ) + PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER = ( + "permissions,attachments,last_edited_by,parent_article,root_container" + ) + PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_PARENT_CONTAINER = "permissions,attachments,last_edited_by,parent_container" + PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER = ( + "permissions,attachments,last_edited_by,parent_container,root_container" + ) + PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_ROOT_CONTAINER = "permissions,attachments,last_edited_by,root_container" + PERMISSIONS_ATTACHMENTS_PARENT_ARTICLE = "permissions,attachments,parent_article" + PERMISSIONS_ATTACHMENTS_PARENT_ARTICLE_PARENT_CONTAINER = "permissions,attachments,parent_article,parent_container" + PERMISSIONS_ATTACHMENTS_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "permissions,attachments,parent_article,parent_container,root_container" + ) + PERMISSIONS_ATTACHMENTS_PARENT_ARTICLE_ROOT_CONTAINER = "permissions,attachments,parent_article,root_container" + PERMISSIONS_ATTACHMENTS_PARENT_CONTAINER = "permissions,attachments,parent_container" + PERMISSIONS_ATTACHMENTS_PARENT_CONTAINER_ROOT_CONTAINER = "permissions,attachments,parent_container,root_container" + PERMISSIONS_ATTACHMENTS_ROOT_CONTAINER = "permissions,attachments,root_container" + PERMISSIONS_AUTHOR = "permissions,author" + PERMISSIONS_AUTHOR_LAST_EDITED_BY = "permissions,author,last_edited_by" + PERMISSIONS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE = "permissions,author,last_edited_by,parent_article" + PERMISSIONS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER = ( + "permissions,author,last_edited_by,parent_article,parent_container" + ) + PERMISSIONS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "permissions,author,last_edited_by,parent_article,parent_container,root_container" + ) + PERMISSIONS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER = ( + "permissions,author,last_edited_by,parent_article,root_container" + ) + PERMISSIONS_AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER = "permissions,author,last_edited_by,parent_container" + PERMISSIONS_AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER = ( + "permissions,author,last_edited_by,parent_container,root_container" + ) + PERMISSIONS_AUTHOR_LAST_EDITED_BY_ROOT_CONTAINER = "permissions,author,last_edited_by,root_container" + PERMISSIONS_AUTHOR_PARENT_ARTICLE = "permissions,author,parent_article" + PERMISSIONS_AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER = "permissions,author,parent_article,parent_container" + PERMISSIONS_AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "permissions,author,parent_article,parent_container,root_container" + ) + PERMISSIONS_AUTHOR_PARENT_ARTICLE_ROOT_CONTAINER = "permissions,author,parent_article,root_container" + PERMISSIONS_AUTHOR_PARENT_CONTAINER = "permissions,author,parent_container" + PERMISSIONS_AUTHOR_PARENT_CONTAINER_ROOT_CONTAINER = "permissions,author,parent_container,root_container" + PERMISSIONS_AUTHOR_ROOT_CONTAINER = "permissions,author,root_container" + PERMISSIONS_LAST_EDITED_BY = "permissions,last_edited_by" + PERMISSIONS_LAST_EDITED_BY_PARENT_ARTICLE = "permissions,last_edited_by,parent_article" + PERMISSIONS_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER = ( + "permissions,last_edited_by,parent_article,parent_container" + ) + PERMISSIONS_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "permissions,last_edited_by,parent_article,parent_container,root_container" + ) + PERMISSIONS_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER = ( + "permissions,last_edited_by,parent_article,root_container" + ) + PERMISSIONS_LAST_EDITED_BY_PARENT_CONTAINER = "permissions,last_edited_by,parent_container" + PERMISSIONS_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER = ( + "permissions,last_edited_by,parent_container,root_container" + ) + PERMISSIONS_LAST_EDITED_BY_ROOT_CONTAINER = "permissions,last_edited_by,root_container" + PERMISSIONS_PARENT_ARTICLE = "permissions,parent_article" + PERMISSIONS_PARENT_ARTICLE_PARENT_CONTAINER = "permissions,parent_article,parent_container" + PERMISSIONS_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER = ( + "permissions,parent_article,parent_container,root_container" + ) + PERMISSIONS_PARENT_ARTICLE_ROOT_CONTAINER = "permissions,parent_article,root_container" + PERMISSIONS_PARENT_CONTAINER = "permissions,parent_container" + PERMISSIONS_PARENT_CONTAINER_ROOT_CONTAINER = "permissions,parent_container,root_container" + PERMISSIONS_ROOT_CONTAINER = "permissions,root_container" + ROOT_CONTAINER = "root_container" + + def visit( + self, + attachments: typing.Callable[[], T_Result], + attachments_author: typing.Callable[[], T_Result], + attachments_author_last_edited_by: typing.Callable[[], T_Result], + attachments_author_last_edited_by_parent_article: typing.Callable[[], T_Result], + attachments_author_last_edited_by_parent_article_parent_container: typing.Callable[[], T_Result], + attachments_author_last_edited_by_parent_article_parent_container_root_container: typing.Callable[[], T_Result], + attachments_author_last_edited_by_parent_article_root_container: typing.Callable[[], T_Result], + attachments_author_last_edited_by_parent_container: typing.Callable[[], T_Result], + attachments_author_last_edited_by_parent_container_root_container: typing.Callable[[], T_Result], + attachments_author_last_edited_by_root_container: typing.Callable[[], T_Result], + attachments_author_parent_article: typing.Callable[[], T_Result], + attachments_author_parent_article_parent_container: typing.Callable[[], T_Result], + attachments_author_parent_article_parent_container_root_container: typing.Callable[[], T_Result], + attachments_author_parent_article_root_container: typing.Callable[[], T_Result], + attachments_author_parent_container: typing.Callable[[], T_Result], + attachments_author_parent_container_root_container: typing.Callable[[], T_Result], + attachments_author_root_container: typing.Callable[[], T_Result], + attachments_last_edited_by: typing.Callable[[], T_Result], + attachments_last_edited_by_parent_article: typing.Callable[[], T_Result], + attachments_last_edited_by_parent_article_parent_container: typing.Callable[[], T_Result], + attachments_last_edited_by_parent_article_parent_container_root_container: typing.Callable[[], T_Result], + attachments_last_edited_by_parent_article_root_container: typing.Callable[[], T_Result], + attachments_last_edited_by_parent_container: typing.Callable[[], T_Result], + attachments_last_edited_by_parent_container_root_container: typing.Callable[[], T_Result], + attachments_last_edited_by_root_container: typing.Callable[[], T_Result], + attachments_parent_article: typing.Callable[[], T_Result], + attachments_parent_article_parent_container: typing.Callable[[], T_Result], + attachments_parent_article_parent_container_root_container: typing.Callable[[], T_Result], + attachments_parent_article_root_container: typing.Callable[[], T_Result], + attachments_parent_container: typing.Callable[[], T_Result], + attachments_parent_container_root_container: typing.Callable[[], T_Result], + attachments_root_container: typing.Callable[[], T_Result], + author: typing.Callable[[], T_Result], + author_last_edited_by: typing.Callable[[], T_Result], + author_last_edited_by_parent_article: typing.Callable[[], T_Result], + author_last_edited_by_parent_article_parent_container: typing.Callable[[], T_Result], + author_last_edited_by_parent_article_parent_container_root_container: typing.Callable[[], T_Result], + author_last_edited_by_parent_article_root_container: typing.Callable[[], T_Result], + author_last_edited_by_parent_container: typing.Callable[[], T_Result], + author_last_edited_by_parent_container_root_container: typing.Callable[[], T_Result], + author_last_edited_by_root_container: typing.Callable[[], T_Result], + author_parent_article: typing.Callable[[], T_Result], + author_parent_article_parent_container: typing.Callable[[], T_Result], + author_parent_article_parent_container_root_container: typing.Callable[[], T_Result], + author_parent_article_root_container: typing.Callable[[], T_Result], + author_parent_container: typing.Callable[[], T_Result], + author_parent_container_root_container: typing.Callable[[], T_Result], + author_root_container: typing.Callable[[], T_Result], + last_edited_by: typing.Callable[[], T_Result], + last_edited_by_parent_article: typing.Callable[[], T_Result], + last_edited_by_parent_article_parent_container: typing.Callable[[], T_Result], + last_edited_by_parent_article_parent_container_root_container: typing.Callable[[], T_Result], + last_edited_by_parent_article_root_container: typing.Callable[[], T_Result], + last_edited_by_parent_container: typing.Callable[[], T_Result], + last_edited_by_parent_container_root_container: typing.Callable[[], T_Result], + last_edited_by_root_container: typing.Callable[[], T_Result], + parent_article: typing.Callable[[], T_Result], + parent_article_parent_container: typing.Callable[[], T_Result], + parent_article_parent_container_root_container: typing.Callable[[], T_Result], + parent_article_root_container: typing.Callable[[], T_Result], + parent_container: typing.Callable[[], T_Result], + parent_container_root_container: typing.Callable[[], T_Result], + permissions: typing.Callable[[], T_Result], + permissions_attachments: typing.Callable[[], T_Result], + permissions_attachments_author: typing.Callable[[], T_Result], + permissions_attachments_author_last_edited_by: typing.Callable[[], T_Result], + permissions_attachments_author_last_edited_by_parent_article: typing.Callable[[], T_Result], + permissions_attachments_author_last_edited_by_parent_article_parent_container: typing.Callable[[], T_Result], + permissions_attachments_author_last_edited_by_parent_article_parent_container_root_container: typing.Callable[ + [], T_Result + ], + permissions_attachments_author_last_edited_by_parent_article_root_container: typing.Callable[[], T_Result], + permissions_attachments_author_last_edited_by_parent_container: typing.Callable[[], T_Result], + permissions_attachments_author_last_edited_by_parent_container_root_container: typing.Callable[[], T_Result], + permissions_attachments_author_last_edited_by_root_container: typing.Callable[[], T_Result], + permissions_attachments_author_parent_article: typing.Callable[[], T_Result], + permissions_attachments_author_parent_article_parent_container: typing.Callable[[], T_Result], + permissions_attachments_author_parent_article_parent_container_root_container: typing.Callable[[], T_Result], + permissions_attachments_author_parent_article_root_container: typing.Callable[[], T_Result], + permissions_attachments_author_parent_container: typing.Callable[[], T_Result], + permissions_attachments_author_parent_container_root_container: typing.Callable[[], T_Result], + permissions_attachments_author_root_container: typing.Callable[[], T_Result], + permissions_attachments_last_edited_by: typing.Callable[[], T_Result], + permissions_attachments_last_edited_by_parent_article: typing.Callable[[], T_Result], + permissions_attachments_last_edited_by_parent_article_parent_container: typing.Callable[[], T_Result], + permissions_attachments_last_edited_by_parent_article_parent_container_root_container: typing.Callable[ + [], T_Result + ], + permissions_attachments_last_edited_by_parent_article_root_container: typing.Callable[[], T_Result], + permissions_attachments_last_edited_by_parent_container: typing.Callable[[], T_Result], + permissions_attachments_last_edited_by_parent_container_root_container: typing.Callable[[], T_Result], + permissions_attachments_last_edited_by_root_container: typing.Callable[[], T_Result], + permissions_attachments_parent_article: typing.Callable[[], T_Result], + permissions_attachments_parent_article_parent_container: typing.Callable[[], T_Result], + permissions_attachments_parent_article_parent_container_root_container: typing.Callable[[], T_Result], + permissions_attachments_parent_article_root_container: typing.Callable[[], T_Result], + permissions_attachments_parent_container: typing.Callable[[], T_Result], + permissions_attachments_parent_container_root_container: typing.Callable[[], T_Result], + permissions_attachments_root_container: typing.Callable[[], T_Result], + permissions_author: typing.Callable[[], T_Result], + permissions_author_last_edited_by: typing.Callable[[], T_Result], + permissions_author_last_edited_by_parent_article: typing.Callable[[], T_Result], + permissions_author_last_edited_by_parent_article_parent_container: typing.Callable[[], T_Result], + permissions_author_last_edited_by_parent_article_parent_container_root_container: typing.Callable[[], T_Result], + permissions_author_last_edited_by_parent_article_root_container: typing.Callable[[], T_Result], + permissions_author_last_edited_by_parent_container: typing.Callable[[], T_Result], + permissions_author_last_edited_by_parent_container_root_container: typing.Callable[[], T_Result], + permissions_author_last_edited_by_root_container: typing.Callable[[], T_Result], + permissions_author_parent_article: typing.Callable[[], T_Result], + permissions_author_parent_article_parent_container: typing.Callable[[], T_Result], + permissions_author_parent_article_parent_container_root_container: typing.Callable[[], T_Result], + permissions_author_parent_article_root_container: typing.Callable[[], T_Result], + permissions_author_parent_container: typing.Callable[[], T_Result], + permissions_author_parent_container_root_container: typing.Callable[[], T_Result], + permissions_author_root_container: typing.Callable[[], T_Result], + permissions_last_edited_by: typing.Callable[[], T_Result], + permissions_last_edited_by_parent_article: typing.Callable[[], T_Result], + permissions_last_edited_by_parent_article_parent_container: typing.Callable[[], T_Result], + permissions_last_edited_by_parent_article_parent_container_root_container: typing.Callable[[], T_Result], + permissions_last_edited_by_parent_article_root_container: typing.Callable[[], T_Result], + permissions_last_edited_by_parent_container: typing.Callable[[], T_Result], + permissions_last_edited_by_parent_container_root_container: typing.Callable[[], T_Result], + permissions_last_edited_by_root_container: typing.Callable[[], T_Result], + permissions_parent_article: typing.Callable[[], T_Result], + permissions_parent_article_parent_container: typing.Callable[[], T_Result], + permissions_parent_article_parent_container_root_container: typing.Callable[[], T_Result], + permissions_parent_article_root_container: typing.Callable[[], T_Result], + permissions_parent_container: typing.Callable[[], T_Result], + permissions_parent_container_root_container: typing.Callable[[], T_Result], + permissions_root_container: typing.Callable[[], T_Result], + root_container: typing.Callable[[], T_Result], + ) -> T_Result: + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS: + return attachments() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_AUTHOR: + return attachments_author() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_AUTHOR_LAST_EDITED_BY: + return attachments_author_last_edited_by() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE: + return attachments_author_last_edited_by_parent_article() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER: + return attachments_author_last_edited_by_parent_article_parent_container() + if ( + self + is ArticlesRetrieveRequestExpand.ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER + ): + return attachments_author_last_edited_by_parent_article_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER: + return attachments_author_last_edited_by_parent_article_root_container() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER: + return attachments_author_last_edited_by_parent_container() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER: + return attachments_author_last_edited_by_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_AUTHOR_LAST_EDITED_BY_ROOT_CONTAINER: + return attachments_author_last_edited_by_root_container() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_AUTHOR_PARENT_ARTICLE: + return attachments_author_parent_article() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER: + return attachments_author_parent_article_parent_container() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER: + return attachments_author_parent_article_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_AUTHOR_PARENT_ARTICLE_ROOT_CONTAINER: + return attachments_author_parent_article_root_container() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_AUTHOR_PARENT_CONTAINER: + return attachments_author_parent_container() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_AUTHOR_PARENT_CONTAINER_ROOT_CONTAINER: + return attachments_author_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_AUTHOR_ROOT_CONTAINER: + return attachments_author_root_container() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_LAST_EDITED_BY: + return attachments_last_edited_by() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE: + return attachments_last_edited_by_parent_article() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER: + return attachments_last_edited_by_parent_article_parent_container() + if ( + self + is ArticlesRetrieveRequestExpand.ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER + ): + return attachments_last_edited_by_parent_article_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER: + return attachments_last_edited_by_parent_article_root_container() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_LAST_EDITED_BY_PARENT_CONTAINER: + return attachments_last_edited_by_parent_container() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER: + return attachments_last_edited_by_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_LAST_EDITED_BY_ROOT_CONTAINER: + return attachments_last_edited_by_root_container() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_PARENT_ARTICLE: + return attachments_parent_article() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_PARENT_ARTICLE_PARENT_CONTAINER: + return attachments_parent_article_parent_container() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER: + return attachments_parent_article_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_PARENT_ARTICLE_ROOT_CONTAINER: + return attachments_parent_article_root_container() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_PARENT_CONTAINER: + return attachments_parent_container() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_PARENT_CONTAINER_ROOT_CONTAINER: + return attachments_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.ATTACHMENTS_ROOT_CONTAINER: + return attachments_root_container() + if self is ArticlesRetrieveRequestExpand.AUTHOR: + return author() + if self is ArticlesRetrieveRequestExpand.AUTHOR_LAST_EDITED_BY: + return author_last_edited_by() + if self is ArticlesRetrieveRequestExpand.AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE: + return author_last_edited_by_parent_article() + if self is ArticlesRetrieveRequestExpand.AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER: + return author_last_edited_by_parent_article_parent_container() + if self is ArticlesRetrieveRequestExpand.AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER: + return author_last_edited_by_parent_article_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER: + return author_last_edited_by_parent_article_root_container() + if self is ArticlesRetrieveRequestExpand.AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER: + return author_last_edited_by_parent_container() + if self is ArticlesRetrieveRequestExpand.AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER: + return author_last_edited_by_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.AUTHOR_LAST_EDITED_BY_ROOT_CONTAINER: + return author_last_edited_by_root_container() + if self is ArticlesRetrieveRequestExpand.AUTHOR_PARENT_ARTICLE: + return author_parent_article() + if self is ArticlesRetrieveRequestExpand.AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER: + return author_parent_article_parent_container() + if self is ArticlesRetrieveRequestExpand.AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER: + return author_parent_article_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.AUTHOR_PARENT_ARTICLE_ROOT_CONTAINER: + return author_parent_article_root_container() + if self is ArticlesRetrieveRequestExpand.AUTHOR_PARENT_CONTAINER: + return author_parent_container() + if self is ArticlesRetrieveRequestExpand.AUTHOR_PARENT_CONTAINER_ROOT_CONTAINER: + return author_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.AUTHOR_ROOT_CONTAINER: + return author_root_container() + if self is ArticlesRetrieveRequestExpand.LAST_EDITED_BY: + return last_edited_by() + if self is ArticlesRetrieveRequestExpand.LAST_EDITED_BY_PARENT_ARTICLE: + return last_edited_by_parent_article() + if self is ArticlesRetrieveRequestExpand.LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER: + return last_edited_by_parent_article_parent_container() + if self is ArticlesRetrieveRequestExpand.LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER: + return last_edited_by_parent_article_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER: + return last_edited_by_parent_article_root_container() + if self is ArticlesRetrieveRequestExpand.LAST_EDITED_BY_PARENT_CONTAINER: + return last_edited_by_parent_container() + if self is ArticlesRetrieveRequestExpand.LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER: + return last_edited_by_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.LAST_EDITED_BY_ROOT_CONTAINER: + return last_edited_by_root_container() + if self is ArticlesRetrieveRequestExpand.PARENT_ARTICLE: + return parent_article() + if self is ArticlesRetrieveRequestExpand.PARENT_ARTICLE_PARENT_CONTAINER: + return parent_article_parent_container() + if self is ArticlesRetrieveRequestExpand.PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER: + return parent_article_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.PARENT_ARTICLE_ROOT_CONTAINER: + return parent_article_root_container() + if self is ArticlesRetrieveRequestExpand.PARENT_CONTAINER: + return parent_container() + if self is ArticlesRetrieveRequestExpand.PARENT_CONTAINER_ROOT_CONTAINER: + return parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS: + return permissions() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS: + return permissions_attachments() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR: + return permissions_attachments_author() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY: + return permissions_attachments_author_last_edited_by() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE: + return permissions_attachments_author_last_edited_by_parent_article() + if ( + self + is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER + ): + return permissions_attachments_author_last_edited_by_parent_article_parent_container() + if ( + self + is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER + ): + return permissions_attachments_author_last_edited_by_parent_article_parent_container_root_container() + if ( + self + is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER + ): + return permissions_attachments_author_last_edited_by_parent_article_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER: + return permissions_attachments_author_last_edited_by_parent_container() + if ( + self + is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER + ): + return permissions_attachments_author_last_edited_by_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_LAST_EDITED_BY_ROOT_CONTAINER: + return permissions_attachments_author_last_edited_by_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_PARENT_ARTICLE: + return permissions_attachments_author_parent_article() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER: + return permissions_attachments_author_parent_article_parent_container() + if ( + self + is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER + ): + return permissions_attachments_author_parent_article_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_PARENT_ARTICLE_ROOT_CONTAINER: + return permissions_attachments_author_parent_article_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_PARENT_CONTAINER: + return permissions_attachments_author_parent_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_PARENT_CONTAINER_ROOT_CONTAINER: + return permissions_attachments_author_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_AUTHOR_ROOT_CONTAINER: + return permissions_attachments_author_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY: + return permissions_attachments_last_edited_by() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE: + return permissions_attachments_last_edited_by_parent_article() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER: + return permissions_attachments_last_edited_by_parent_article_parent_container() + if ( + self + is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER + ): + return permissions_attachments_last_edited_by_parent_article_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER: + return permissions_attachments_last_edited_by_parent_article_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_PARENT_CONTAINER: + return permissions_attachments_last_edited_by_parent_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER: + return permissions_attachments_last_edited_by_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_LAST_EDITED_BY_ROOT_CONTAINER: + return permissions_attachments_last_edited_by_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_PARENT_ARTICLE: + return permissions_attachments_parent_article() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_PARENT_ARTICLE_PARENT_CONTAINER: + return permissions_attachments_parent_article_parent_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER: + return permissions_attachments_parent_article_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_PARENT_ARTICLE_ROOT_CONTAINER: + return permissions_attachments_parent_article_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_PARENT_CONTAINER: + return permissions_attachments_parent_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_PARENT_CONTAINER_ROOT_CONTAINER: + return permissions_attachments_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ATTACHMENTS_ROOT_CONTAINER: + return permissions_attachments_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_AUTHOR: + return permissions_author() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_AUTHOR_LAST_EDITED_BY: + return permissions_author_last_edited_by() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE: + return permissions_author_last_edited_by_parent_article() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER: + return permissions_author_last_edited_by_parent_article_parent_container() + if ( + self + is ArticlesRetrieveRequestExpand.PERMISSIONS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER + ): + return permissions_author_last_edited_by_parent_article_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_AUTHOR_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER: + return permissions_author_last_edited_by_parent_article_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER: + return permissions_author_last_edited_by_parent_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_AUTHOR_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER: + return permissions_author_last_edited_by_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_AUTHOR_LAST_EDITED_BY_ROOT_CONTAINER: + return permissions_author_last_edited_by_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_AUTHOR_PARENT_ARTICLE: + return permissions_author_parent_article() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER: + return permissions_author_parent_article_parent_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_AUTHOR_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER: + return permissions_author_parent_article_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_AUTHOR_PARENT_ARTICLE_ROOT_CONTAINER: + return permissions_author_parent_article_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_AUTHOR_PARENT_CONTAINER: + return permissions_author_parent_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_AUTHOR_PARENT_CONTAINER_ROOT_CONTAINER: + return permissions_author_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_AUTHOR_ROOT_CONTAINER: + return permissions_author_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_LAST_EDITED_BY: + return permissions_last_edited_by() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_LAST_EDITED_BY_PARENT_ARTICLE: + return permissions_last_edited_by_parent_article() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER: + return permissions_last_edited_by_parent_article_parent_container() + if ( + self + is ArticlesRetrieveRequestExpand.PERMISSIONS_LAST_EDITED_BY_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER + ): + return permissions_last_edited_by_parent_article_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_LAST_EDITED_BY_PARENT_ARTICLE_ROOT_CONTAINER: + return permissions_last_edited_by_parent_article_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_LAST_EDITED_BY_PARENT_CONTAINER: + return permissions_last_edited_by_parent_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_LAST_EDITED_BY_PARENT_CONTAINER_ROOT_CONTAINER: + return permissions_last_edited_by_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_LAST_EDITED_BY_ROOT_CONTAINER: + return permissions_last_edited_by_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_PARENT_ARTICLE: + return permissions_parent_article() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_PARENT_ARTICLE_PARENT_CONTAINER: + return permissions_parent_article_parent_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_PARENT_ARTICLE_PARENT_CONTAINER_ROOT_CONTAINER: + return permissions_parent_article_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_PARENT_ARTICLE_ROOT_CONTAINER: + return permissions_parent_article_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_PARENT_CONTAINER: + return permissions_parent_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_PARENT_CONTAINER_ROOT_CONTAINER: + return permissions_parent_container_root_container() + if self is ArticlesRetrieveRequestExpand.PERMISSIONS_ROOT_CONTAINER: + return permissions_root_container() + if self is ArticlesRetrieveRequestExpand.ROOT_CONTAINER: + return root_container() diff --git a/src/merge/resources/knowledgebase/resources/async_passthrough/__init__.py b/src/merge/resources/knowledgebase/resources/async_passthrough/__init__.py new file mode 100644 index 00000000..375c7953 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/async_passthrough/__init__.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import AsyncPassthroughRetrieveResponse +_dynamic_imports: typing.Dict[str, str] = {"AsyncPassthroughRetrieveResponse": ".types"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["AsyncPassthroughRetrieveResponse"] diff --git a/src/merge/resources/knowledgebase/resources/async_passthrough/client.py b/src/merge/resources/knowledgebase/resources/async_passthrough/client.py new file mode 100644 index 00000000..72373917 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/async_passthrough/client.py @@ -0,0 +1,201 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from ...types.async_passthrough_reciept import AsyncPassthroughReciept +from ...types.data_passthrough_request import DataPassthroughRequest +from .raw_client import AsyncRawAsyncPassthroughClient, RawAsyncPassthroughClient +from .types.async_passthrough_retrieve_response import AsyncPassthroughRetrieveResponse + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class AsyncPassthroughClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawAsyncPassthroughClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawAsyncPassthroughClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawAsyncPassthroughClient + """ + return self._raw_client + + def create( + self, *, request: DataPassthroughRequest, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncPassthroughReciept: + """ + Asynchronously pull data from an endpoint not currently supported by Merge. + + Parameters + ---------- + request : DataPassthroughRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPassthroughReciept + + + Examples + -------- + from merge import Merge + from merge.resources.knowledgebase import DataPassthroughRequest, MethodEnum + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.async_passthrough.create( + request=DataPassthroughRequest( + method=MethodEnum.GET, + path="/scooters", + ), + ) + """ + _response = self._raw_client.create(request=request, request_options=request_options) + return _response.data + + def retrieve( + self, async_passthrough_receipt_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncPassthroughRetrieveResponse: + """ + Retrieves data from earlier async-passthrough POST request + + Parameters + ---------- + async_passthrough_receipt_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPassthroughRetrieveResponse + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.async_passthrough.retrieve( + async_passthrough_receipt_id="async_passthrough_receipt_id", + ) + """ + _response = self._raw_client.retrieve(async_passthrough_receipt_id, request_options=request_options) + return _response.data + + +class AsyncAsyncPassthroughClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawAsyncPassthroughClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawAsyncPassthroughClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawAsyncPassthroughClient + """ + return self._raw_client + + async def create( + self, *, request: DataPassthroughRequest, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncPassthroughReciept: + """ + Asynchronously pull data from an endpoint not currently supported by Merge. + + Parameters + ---------- + request : DataPassthroughRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPassthroughReciept + + + Examples + -------- + import asyncio + + from merge import AsyncMerge + from merge.resources.knowledgebase import DataPassthroughRequest, MethodEnum + + client = AsyncMerge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.knowledgebase.async_passthrough.create( + request=DataPassthroughRequest( + method=MethodEnum.GET, + path="/scooters", + ), + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.create(request=request, request_options=request_options) + return _response.data + + async def retrieve( + self, async_passthrough_receipt_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncPassthroughRetrieveResponse: + """ + Retrieves data from earlier async-passthrough POST request + + Parameters + ---------- + async_passthrough_receipt_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncPassthroughRetrieveResponse + + + 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.knowledgebase.async_passthrough.retrieve( + async_passthrough_receipt_id="async_passthrough_receipt_id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.retrieve(async_passthrough_receipt_id, request_options=request_options) + return _response.data diff --git a/src/merge/resources/knowledgebase/resources/async_passthrough/raw_client.py b/src/merge/resources/knowledgebase/resources/async_passthrough/raw_client.py new file mode 100644 index 00000000..1edf795f --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/async_passthrough/raw_client.py @@ -0,0 +1,189 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.jsonable_encoder import jsonable_encoder +from .....core.request_options import RequestOptions +from .....core.unchecked_base_model import construct_type +from ...types.async_passthrough_reciept import AsyncPassthroughReciept +from ...types.data_passthrough_request import DataPassthroughRequest +from .types.async_passthrough_retrieve_response import AsyncPassthroughRetrieveResponse + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RawAsyncPassthroughClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def create( + self, *, request: DataPassthroughRequest, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[AsyncPassthroughReciept]: + """ + Asynchronously pull data from an endpoint not currently supported by Merge. + + Parameters + ---------- + request : DataPassthroughRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[AsyncPassthroughReciept] + + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/async-passthrough", + method="POST", + json=request, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + AsyncPassthroughReciept, + construct_type( + type_=AsyncPassthroughReciept, # 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, async_passthrough_receipt_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[AsyncPassthroughRetrieveResponse]: + """ + Retrieves data from earlier async-passthrough POST request + + Parameters + ---------- + async_passthrough_receipt_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[AsyncPassthroughRetrieveResponse] + + """ + _response = self._client_wrapper.httpx_client.request( + f"knowledgebase/v1/async-passthrough/{jsonable_encoder(async_passthrough_receipt_id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + AsyncPassthroughRetrieveResponse, + construct_type( + type_=AsyncPassthroughRetrieveResponse, # 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) + + +class AsyncRawAsyncPassthroughClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def create( + self, *, request: DataPassthroughRequest, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[AsyncPassthroughReciept]: + """ + Asynchronously pull data from an endpoint not currently supported by Merge. + + Parameters + ---------- + request : DataPassthroughRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[AsyncPassthroughReciept] + + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/async-passthrough", + method="POST", + json=request, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + AsyncPassthroughReciept, + construct_type( + type_=AsyncPassthroughReciept, # 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, async_passthrough_receipt_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[AsyncPassthroughRetrieveResponse]: + """ + Retrieves data from earlier async-passthrough POST request + + Parameters + ---------- + async_passthrough_receipt_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[AsyncPassthroughRetrieveResponse] + + """ + _response = await self._client_wrapper.httpx_client.request( + f"knowledgebase/v1/async-passthrough/{jsonable_encoder(async_passthrough_receipt_id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + AsyncPassthroughRetrieveResponse, + construct_type( + type_=AsyncPassthroughRetrieveResponse, # 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) diff --git a/src/merge/resources/knowledgebase/resources/async_passthrough/types/__init__.py b/src/merge/resources/knowledgebase/resources/async_passthrough/types/__init__.py new file mode 100644 index 00000000..f6e9bec9 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/async_passthrough/types/__init__.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .async_passthrough_retrieve_response import AsyncPassthroughRetrieveResponse +_dynamic_imports: typing.Dict[str, str] = {"AsyncPassthroughRetrieveResponse": ".async_passthrough_retrieve_response"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["AsyncPassthroughRetrieveResponse"] diff --git a/src/merge/resources/knowledgebase/resources/async_passthrough/types/async_passthrough_retrieve_response.py b/src/merge/resources/knowledgebase/resources/async_passthrough/types/async_passthrough_retrieve_response.py new file mode 100644 index 00000000..f8f87c18 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/async_passthrough/types/async_passthrough_retrieve_response.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ....types.remote_response import RemoteResponse + +AsyncPassthroughRetrieveResponse = typing.Union[RemoteResponse, str] diff --git a/src/merge/resources/knowledgebase/resources/attachments/__init__.py b/src/merge/resources/knowledgebase/resources/attachments/__init__.py new file mode 100644 index 00000000..5cde0202 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/attachments/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/merge/resources/knowledgebase/resources/attachments/client.py b/src/merge/resources/knowledgebase/resources/attachments/client.py new file mode 100644 index 00000000..6d0da962 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/attachments/client.py @@ -0,0 +1,326 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from ...types.attachment import Attachment +from ...types.paginated_attachment_list import PaginatedAttachmentList +from .raw_client import AsyncRawAttachmentsClient, RawAttachmentsClient + + +class AttachmentsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawAttachmentsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawAttachmentsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawAttachmentsClient + """ + return self._raw_client + + def list( + self, + *, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, + cursor: typing.Optional[str] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, + page_size: typing.Optional[int] = None, + remote_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedAttachmentList: + """ + Returns a list of `Attachment` objects. + + Parameters + ---------- + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + + cursor : typing.Optional[str] + The pagination cursor value. + + 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). + + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + + page_size : typing.Optional[int] + Number of results to return per page. + + remote_id : typing.Optional[str] + The API provider's ID for the given object. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedAttachmentList + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.attachments.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ) + """ + _response = self._raw_client.list( + created_after=created_after, + created_before=created_before, + cursor=cursor, + include_deleted_data=include_deleted_data, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + modified_after=modified_after, + modified_before=modified_before, + page_size=page_size, + remote_id=remote_id, + request_options=request_options, + ) + return _response.data + + def retrieve( + self, + id: str, + *, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> Attachment: + """ + Returns an `Attachment` object with the given `id`. + + Parameters + ---------- + id : str + + 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). + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Attachment + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.attachments.retrieve( + id="id", + ) + """ + _response = self._raw_client.retrieve( + id, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + request_options=request_options, + ) + return _response.data + + +class AsyncAttachmentsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawAttachmentsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawAttachmentsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawAttachmentsClient + """ + return self._raw_client + + async def list( + self, + *, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, + cursor: typing.Optional[str] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, + page_size: typing.Optional[int] = None, + remote_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedAttachmentList: + """ + Returns a list of `Attachment` objects. + + Parameters + ---------- + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + + cursor : typing.Optional[str] + The pagination cursor value. + + 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). + + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + + page_size : typing.Optional[int] + Number of results to return per page. + + remote_id : typing.Optional[str] + The API provider's ID for the given object. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedAttachmentList + + + 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.knowledgebase.attachments.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.list( + created_after=created_after, + created_before=created_before, + cursor=cursor, + include_deleted_data=include_deleted_data, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + modified_after=modified_after, + modified_before=modified_before, + page_size=page_size, + remote_id=remote_id, + request_options=request_options, + ) + return _response.data + + async def retrieve( + self, + id: str, + *, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> Attachment: + """ + Returns an `Attachment` object with the given `id`. + + Parameters + ---------- + id : str + + 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). + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Attachment + + + 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.knowledgebase.attachments.retrieve( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.retrieve( + id, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + request_options=request_options, + ) + return _response.data diff --git a/src/merge/resources/knowledgebase/resources/attachments/raw_client.py b/src/merge/resources/knowledgebase/resources/attachments/raw_client.py new file mode 100644 index 00000000..1b64b0c7 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/attachments/raw_client.py @@ -0,0 +1,311 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.datetime_utils import serialize_datetime +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.jsonable_encoder import jsonable_encoder +from .....core.request_options import RequestOptions +from .....core.unchecked_base_model import construct_type +from ...types.attachment import Attachment +from ...types.paginated_attachment_list import PaginatedAttachmentList + + +class RawAttachmentsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + *, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, + cursor: typing.Optional[str] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, + page_size: typing.Optional[int] = None, + remote_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[PaginatedAttachmentList]: + """ + Returns a list of `Attachment` objects. + + Parameters + ---------- + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + + cursor : typing.Optional[str] + The pagination cursor value. + + 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). + + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + + page_size : typing.Optional[int] + Number of results to return per page. + + remote_id : typing.Optional[str] + The API provider's ID for the given object. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[PaginatedAttachmentList] + + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/attachments", + method="GET", + params={ + "created_after": serialize_datetime(created_after) if created_after is not None else None, + "created_before": serialize_datetime(created_before) if created_before is not None else None, + "cursor": cursor, + "include_deleted_data": include_deleted_data, + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + "modified_after": serialize_datetime(modified_after) if modified_after is not None else None, + "modified_before": serialize_datetime(modified_before) if modified_before is not None else None, + "page_size": page_size, + "remote_id": remote_id, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedAttachmentList, + construct_type( + type_=PaginatedAttachmentList, # 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, + *, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[Attachment]: + """ + Returns an `Attachment` object with the given `id`. + + Parameters + ---------- + id : str + + 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). + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[Attachment] + + """ + _response = self._client_wrapper.httpx_client.request( + f"knowledgebase/v1/attachments/{jsonable_encoder(id)}", + method="GET", + params={ + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + Attachment, + construct_type( + type_=Attachment, # 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) + + +class AsyncRawAttachmentsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + *, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, + cursor: typing.Optional[str] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, + page_size: typing.Optional[int] = None, + remote_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[PaginatedAttachmentList]: + """ + Returns a list of `Attachment` objects. + + Parameters + ---------- + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + + cursor : typing.Optional[str] + The pagination cursor value. + + 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). + + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + + page_size : typing.Optional[int] + Number of results to return per page. + + remote_id : typing.Optional[str] + The API provider's ID for the given object. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[PaginatedAttachmentList] + + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/attachments", + method="GET", + params={ + "created_after": serialize_datetime(created_after) if created_after is not None else None, + "created_before": serialize_datetime(created_before) if created_before is not None else None, + "cursor": cursor, + "include_deleted_data": include_deleted_data, + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + "modified_after": serialize_datetime(modified_after) if modified_after is not None else None, + "modified_before": serialize_datetime(modified_before) if modified_before is not None else None, + "page_size": page_size, + "remote_id": remote_id, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedAttachmentList, + construct_type( + type_=PaginatedAttachmentList, # 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, + *, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[Attachment]: + """ + Returns an `Attachment` object with the given `id`. + + Parameters + ---------- + id : str + + 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). + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[Attachment] + + """ + _response = await self._client_wrapper.httpx_client.request( + f"knowledgebase/v1/attachments/{jsonable_encoder(id)}", + method="GET", + params={ + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + Attachment, + construct_type( + type_=Attachment, # 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) diff --git a/src/merge/resources/knowledgebase/resources/audit_trail/__init__.py b/src/merge/resources/knowledgebase/resources/audit_trail/__init__.py new file mode 100644 index 00000000..5cde0202 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/audit_trail/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/merge/resources/knowledgebase/resources/audit_trail/client.py b/src/merge/resources/knowledgebase/resources/audit_trail/client.py new file mode 100644 index 00000000..aeba70bb --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/audit_trail/client.py @@ -0,0 +1,178 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from ...types.paginated_audit_log_event_list import PaginatedAuditLogEventList +from .raw_client import AsyncRawAuditTrailClient, RawAuditTrailClient + + +class AuditTrailClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawAuditTrailClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawAuditTrailClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawAuditTrailClient + """ + return self._raw_client + + def list( + self, + *, + cursor: typing.Optional[str] = None, + end_date: typing.Optional[str] = None, + event_type: typing.Optional[str] = None, + page_size: typing.Optional[int] = None, + start_date: typing.Optional[str] = None, + user_email: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedAuditLogEventList: + """ + Gets a list of audit trail events. + + Parameters + ---------- + cursor : typing.Optional[str] + The pagination cursor value. + + end_date : typing.Optional[str] + If included, will only include audit trail events that occurred before this time + + event_type : typing.Optional[str] + If included, will only include events with the given event type. Possible values include: `CREATED_REMOTE_PRODUCTION_API_KEY`, `DELETED_REMOTE_PRODUCTION_API_KEY`, `CREATED_TEST_API_KEY`, `DELETED_TEST_API_KEY`, `REGENERATED_PRODUCTION_API_KEY`, `REGENERATED_WEBHOOK_SIGNATURE`, `INVITED_USER`, `TWO_FACTOR_AUTH_ENABLED`, `TWO_FACTOR_AUTH_DISABLED`, `DELETED_LINKED_ACCOUNT`, `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT`, `CREATED_DESTINATION`, `DELETED_DESTINATION`, `CHANGED_DESTINATION`, `CHANGED_SCOPES`, `CHANGED_PERSONAL_INFORMATION`, `CHANGED_ORGANIZATION_SETTINGS`, `ENABLED_INTEGRATION`, `DISABLED_INTEGRATION`, `ENABLED_CATEGORY`, `DISABLED_CATEGORY`, `CHANGED_PASSWORD`, `RESET_PASSWORD`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `CREATED_INTEGRATION_WIDE_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_FIELD_MAPPING`, `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING`, `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING`, `DELETED_INTEGRATION_WIDE_FIELD_MAPPING`, `DELETED_LINKED_ACCOUNT_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `FORCED_LINKED_ACCOUNT_RESYNC`, `MUTED_ISSUE`, `GENERATED_MAGIC_LINK`, `ENABLED_MERGE_WEBHOOK`, `DISABLED_MERGE_WEBHOOK`, `MERGE_WEBHOOK_TARGET_CHANGED`, `END_USER_CREDENTIALS_ACCESSED` + + page_size : typing.Optional[int] + Number of results to return per page. + + start_date : typing.Optional[str] + If included, will only include audit trail events that occurred after this time + + user_email : typing.Optional[str] + If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedAuditLogEventList + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.audit_trail.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ) + """ + _response = self._raw_client.list( + cursor=cursor, + end_date=end_date, + event_type=event_type, + page_size=page_size, + start_date=start_date, + user_email=user_email, + request_options=request_options, + ) + return _response.data + + +class AsyncAuditTrailClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawAuditTrailClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawAuditTrailClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawAuditTrailClient + """ + return self._raw_client + + async def list( + self, + *, + cursor: typing.Optional[str] = None, + end_date: typing.Optional[str] = None, + event_type: typing.Optional[str] = None, + page_size: typing.Optional[int] = None, + start_date: typing.Optional[str] = None, + user_email: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedAuditLogEventList: + """ + Gets a list of audit trail events. + + Parameters + ---------- + cursor : typing.Optional[str] + The pagination cursor value. + + end_date : typing.Optional[str] + If included, will only include audit trail events that occurred before this time + + event_type : typing.Optional[str] + If included, will only include events with the given event type. Possible values include: `CREATED_REMOTE_PRODUCTION_API_KEY`, `DELETED_REMOTE_PRODUCTION_API_KEY`, `CREATED_TEST_API_KEY`, `DELETED_TEST_API_KEY`, `REGENERATED_PRODUCTION_API_KEY`, `REGENERATED_WEBHOOK_SIGNATURE`, `INVITED_USER`, `TWO_FACTOR_AUTH_ENABLED`, `TWO_FACTOR_AUTH_DISABLED`, `DELETED_LINKED_ACCOUNT`, `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT`, `CREATED_DESTINATION`, `DELETED_DESTINATION`, `CHANGED_DESTINATION`, `CHANGED_SCOPES`, `CHANGED_PERSONAL_INFORMATION`, `CHANGED_ORGANIZATION_SETTINGS`, `ENABLED_INTEGRATION`, `DISABLED_INTEGRATION`, `ENABLED_CATEGORY`, `DISABLED_CATEGORY`, `CHANGED_PASSWORD`, `RESET_PASSWORD`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `CREATED_INTEGRATION_WIDE_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_FIELD_MAPPING`, `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING`, `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING`, `DELETED_INTEGRATION_WIDE_FIELD_MAPPING`, `DELETED_LINKED_ACCOUNT_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `FORCED_LINKED_ACCOUNT_RESYNC`, `MUTED_ISSUE`, `GENERATED_MAGIC_LINK`, `ENABLED_MERGE_WEBHOOK`, `DISABLED_MERGE_WEBHOOK`, `MERGE_WEBHOOK_TARGET_CHANGED`, `END_USER_CREDENTIALS_ACCESSED` + + page_size : typing.Optional[int] + Number of results to return per page. + + start_date : typing.Optional[str] + If included, will only include audit trail events that occurred after this time + + user_email : typing.Optional[str] + If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedAuditLogEventList + + + 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.knowledgebase.audit_trail.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.list( + cursor=cursor, + end_date=end_date, + event_type=event_type, + page_size=page_size, + start_date=start_date, + user_email=user_email, + request_options=request_options, + ) + return _response.data diff --git a/src/merge/resources/knowledgebase/resources/audit_trail/raw_client.py b/src/merge/resources/knowledgebase/resources/audit_trail/raw_client.py new file mode 100644 index 00000000..d130a2a1 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/audit_trail/raw_client.py @@ -0,0 +1,161 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.request_options import RequestOptions +from .....core.unchecked_base_model import construct_type +from ...types.paginated_audit_log_event_list import PaginatedAuditLogEventList + + +class RawAuditTrailClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + *, + cursor: typing.Optional[str] = None, + end_date: typing.Optional[str] = None, + event_type: typing.Optional[str] = None, + page_size: typing.Optional[int] = None, + start_date: typing.Optional[str] = None, + user_email: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[PaginatedAuditLogEventList]: + """ + Gets a list of audit trail events. + + Parameters + ---------- + cursor : typing.Optional[str] + The pagination cursor value. + + end_date : typing.Optional[str] + If included, will only include audit trail events that occurred before this time + + event_type : typing.Optional[str] + If included, will only include events with the given event type. Possible values include: `CREATED_REMOTE_PRODUCTION_API_KEY`, `DELETED_REMOTE_PRODUCTION_API_KEY`, `CREATED_TEST_API_KEY`, `DELETED_TEST_API_KEY`, `REGENERATED_PRODUCTION_API_KEY`, `REGENERATED_WEBHOOK_SIGNATURE`, `INVITED_USER`, `TWO_FACTOR_AUTH_ENABLED`, `TWO_FACTOR_AUTH_DISABLED`, `DELETED_LINKED_ACCOUNT`, `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT`, `CREATED_DESTINATION`, `DELETED_DESTINATION`, `CHANGED_DESTINATION`, `CHANGED_SCOPES`, `CHANGED_PERSONAL_INFORMATION`, `CHANGED_ORGANIZATION_SETTINGS`, `ENABLED_INTEGRATION`, `DISABLED_INTEGRATION`, `ENABLED_CATEGORY`, `DISABLED_CATEGORY`, `CHANGED_PASSWORD`, `RESET_PASSWORD`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `CREATED_INTEGRATION_WIDE_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_FIELD_MAPPING`, `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING`, `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING`, `DELETED_INTEGRATION_WIDE_FIELD_MAPPING`, `DELETED_LINKED_ACCOUNT_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `FORCED_LINKED_ACCOUNT_RESYNC`, `MUTED_ISSUE`, `GENERATED_MAGIC_LINK`, `ENABLED_MERGE_WEBHOOK`, `DISABLED_MERGE_WEBHOOK`, `MERGE_WEBHOOK_TARGET_CHANGED`, `END_USER_CREDENTIALS_ACCESSED` + + page_size : typing.Optional[int] + Number of results to return per page. + + start_date : typing.Optional[str] + If included, will only include audit trail events that occurred after this time + + user_email : typing.Optional[str] + If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[PaginatedAuditLogEventList] + + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/audit-trail", + method="GET", + params={ + "cursor": cursor, + "end_date": end_date, + "event_type": event_type, + "page_size": page_size, + "start_date": start_date, + "user_email": user_email, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedAuditLogEventList, + construct_type( + type_=PaginatedAuditLogEventList, # 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) + + +class AsyncRawAuditTrailClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + *, + cursor: typing.Optional[str] = None, + end_date: typing.Optional[str] = None, + event_type: typing.Optional[str] = None, + page_size: typing.Optional[int] = None, + start_date: typing.Optional[str] = None, + user_email: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[PaginatedAuditLogEventList]: + """ + Gets a list of audit trail events. + + Parameters + ---------- + cursor : typing.Optional[str] + The pagination cursor value. + + end_date : typing.Optional[str] + If included, will only include audit trail events that occurred before this time + + event_type : typing.Optional[str] + If included, will only include events with the given event type. Possible values include: `CREATED_REMOTE_PRODUCTION_API_KEY`, `DELETED_REMOTE_PRODUCTION_API_KEY`, `CREATED_TEST_API_KEY`, `DELETED_TEST_API_KEY`, `REGENERATED_PRODUCTION_API_KEY`, `REGENERATED_WEBHOOK_SIGNATURE`, `INVITED_USER`, `TWO_FACTOR_AUTH_ENABLED`, `TWO_FACTOR_AUTH_DISABLED`, `DELETED_LINKED_ACCOUNT`, `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT`, `CREATED_DESTINATION`, `DELETED_DESTINATION`, `CHANGED_DESTINATION`, `CHANGED_SCOPES`, `CHANGED_PERSONAL_INFORMATION`, `CHANGED_ORGANIZATION_SETTINGS`, `ENABLED_INTEGRATION`, `DISABLED_INTEGRATION`, `ENABLED_CATEGORY`, `DISABLED_CATEGORY`, `CHANGED_PASSWORD`, `RESET_PASSWORD`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION`, `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT`, `CREATED_INTEGRATION_WIDE_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_FIELD_MAPPING`, `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING`, `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING`, `DELETED_INTEGRATION_WIDE_FIELD_MAPPING`, `DELETED_LINKED_ACCOUNT_FIELD_MAPPING`, `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE`, `FORCED_LINKED_ACCOUNT_RESYNC`, `MUTED_ISSUE`, `GENERATED_MAGIC_LINK`, `ENABLED_MERGE_WEBHOOK`, `DISABLED_MERGE_WEBHOOK`, `MERGE_WEBHOOK_TARGET_CHANGED`, `END_USER_CREDENTIALS_ACCESSED` + + page_size : typing.Optional[int] + Number of results to return per page. + + start_date : typing.Optional[str] + If included, will only include audit trail events that occurred after this time + + user_email : typing.Optional[str] + If provided, this will return events associated with the specified user email. Please note that the email address reflects the user's email at the time of the event, and may not be their current email. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[PaginatedAuditLogEventList] + + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/audit-trail", + method="GET", + params={ + "cursor": cursor, + "end_date": end_date, + "event_type": event_type, + "page_size": page_size, + "start_date": start_date, + "user_email": user_email, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedAuditLogEventList, + construct_type( + type_=PaginatedAuditLogEventList, # 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) diff --git a/src/merge/resources/knowledgebase/resources/available_actions/__init__.py b/src/merge/resources/knowledgebase/resources/available_actions/__init__.py new file mode 100644 index 00000000..5cde0202 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/available_actions/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/merge/resources/knowledgebase/resources/available_actions/client.py b/src/merge/resources/knowledgebase/resources/available_actions/client.py new file mode 100644 index 00000000..3f5a7a95 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/available_actions/client.py @@ -0,0 +1,102 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from ...types.available_actions import AvailableActions +from .raw_client import AsyncRawAvailableActionsClient, RawAvailableActionsClient + + +class AvailableActionsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawAvailableActionsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawAvailableActionsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawAvailableActionsClient + """ + return self._raw_client + + def retrieve(self, *, request_options: typing.Optional[RequestOptions] = None) -> AvailableActions: + """ + Returns a list of models and actions available for an account. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AvailableActions + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.available_actions.retrieve() + """ + _response = self._raw_client.retrieve(request_options=request_options) + return _response.data + + +class AsyncAvailableActionsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawAvailableActionsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawAvailableActionsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawAvailableActionsClient + """ + return self._raw_client + + async def retrieve(self, *, request_options: typing.Optional[RequestOptions] = None) -> AvailableActions: + """ + Returns a list of models and actions available for an account. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AvailableActions + + + 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.knowledgebase.available_actions.retrieve() + + + asyncio.run(main()) + """ + _response = await self._raw_client.retrieve(request_options=request_options) + return _response.data diff --git a/src/merge/resources/knowledgebase/resources/available_actions/raw_client.py b/src/merge/resources/knowledgebase/resources/available_actions/raw_client.py new file mode 100644 index 00000000..9ea7770d --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/available_actions/raw_client.py @@ -0,0 +1,91 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.request_options import RequestOptions +from .....core.unchecked_base_model import construct_type +from ...types.available_actions import AvailableActions + + +class RawAvailableActionsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def retrieve(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[AvailableActions]: + """ + Returns a list of models and actions available for an account. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[AvailableActions] + + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/available-actions", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + AvailableActions, + construct_type( + type_=AvailableActions, # 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) + + +class AsyncRawAvailableActionsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def retrieve( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[AvailableActions]: + """ + Returns a list of models and actions available for an account. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[AvailableActions] + + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/available-actions", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + AvailableActions, + construct_type( + type_=AvailableActions, # 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) diff --git a/src/merge/resources/knowledgebase/resources/containers/__init__.py b/src/merge/resources/knowledgebase/resources/containers/__init__.py new file mode 100644 index 00000000..b66d2970 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/containers/__init__.py @@ -0,0 +1,35 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import ContainersListRequestExpand, ContainersRetrieveRequestExpand +_dynamic_imports: typing.Dict[str, str] = { + "ContainersListRequestExpand": ".types", + "ContainersRetrieveRequestExpand": ".types", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["ContainersListRequestExpand", "ContainersRetrieveRequestExpand"] diff --git a/src/merge/resources/knowledgebase/resources/containers/client.py b/src/merge/resources/knowledgebase/resources/containers/client.py new file mode 100644 index 00000000..3438434d --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/containers/client.py @@ -0,0 +1,378 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from ...types.container import Container +from ...types.paginated_container_list import PaginatedContainerList +from .raw_client import AsyncRawContainersClient, RawContainersClient +from .types.containers_list_request_expand import ContainersListRequestExpand +from .types.containers_retrieve_request_expand import ContainersRetrieveRequestExpand + + +class ContainersClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawContainersClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawContainersClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawContainersClient + """ + return self._raw_client + + def list( + self, + *, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, + cursor: typing.Optional[str] = None, + expand: typing.Optional[ContainersListRequestExpand] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, + page_size: typing.Optional[int] = None, + parent_article_id: typing.Optional[str] = None, + parent_container_id: typing.Optional[str] = None, + remote_id: typing.Optional[str] = None, + type: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedContainerList: + """ + Returns a list of `Container` objects. + + Parameters + ---------- + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[ContainersListRequestExpand] + 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). + + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + + page_size : typing.Optional[int] + Number of results to return per page. + + parent_article_id : typing.Optional[str] + If provided, will only return sub containers of the parent_article_id. + + parent_container_id : typing.Optional[str] + If provided, will only return sub containers of the parent_container_id. + + remote_id : typing.Optional[str] + The API provider's ID for the given object. + + type : typing.Optional[str] + If provided, will only return containers of the given type. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedContainerList + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.containers.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ) + """ + _response = self._raw_client.list( + created_after=created_after, + created_before=created_before, + cursor=cursor, + expand=expand, + include_deleted_data=include_deleted_data, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + modified_after=modified_after, + modified_before=modified_before, + page_size=page_size, + parent_article_id=parent_article_id, + parent_container_id=parent_container_id, + remote_id=remote_id, + type=type, + request_options=request_options, + ) + return _response.data + + def retrieve( + self, + id: str, + *, + expand: typing.Optional[ContainersRetrieveRequestExpand] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> Container: + """ + Returns a `Container` object with the given `id`. + + Parameters + ---------- + id : str + + expand : typing.Optional[ContainersRetrieveRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + 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). + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Container + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.containers.retrieve( + id="id", + ) + """ + _response = self._raw_client.retrieve( + id, + expand=expand, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + request_options=request_options, + ) + return _response.data + + +class AsyncContainersClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawContainersClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawContainersClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawContainersClient + """ + return self._raw_client + + async def list( + self, + *, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, + cursor: typing.Optional[str] = None, + expand: typing.Optional[ContainersListRequestExpand] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, + page_size: typing.Optional[int] = None, + parent_article_id: typing.Optional[str] = None, + parent_container_id: typing.Optional[str] = None, + remote_id: typing.Optional[str] = None, + type: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedContainerList: + """ + Returns a list of `Container` objects. + + Parameters + ---------- + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[ContainersListRequestExpand] + 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). + + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + + page_size : typing.Optional[int] + Number of results to return per page. + + parent_article_id : typing.Optional[str] + If provided, will only return sub containers of the parent_article_id. + + parent_container_id : typing.Optional[str] + If provided, will only return sub containers of the parent_container_id. + + remote_id : typing.Optional[str] + The API provider's ID for the given object. + + type : typing.Optional[str] + If provided, will only return containers of the given type. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedContainerList + + + 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.knowledgebase.containers.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.list( + created_after=created_after, + created_before=created_before, + cursor=cursor, + expand=expand, + include_deleted_data=include_deleted_data, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + modified_after=modified_after, + modified_before=modified_before, + page_size=page_size, + parent_article_id=parent_article_id, + parent_container_id=parent_container_id, + remote_id=remote_id, + type=type, + request_options=request_options, + ) + return _response.data + + async def retrieve( + self, + id: str, + *, + expand: typing.Optional[ContainersRetrieveRequestExpand] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> Container: + """ + Returns a `Container` object with the given `id`. + + Parameters + ---------- + id : str + + expand : typing.Optional[ContainersRetrieveRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + 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). + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Container + + + 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.knowledgebase.containers.retrieve( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.retrieve( + id, + expand=expand, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + request_options=request_options, + ) + return _response.data diff --git a/src/merge/resources/knowledgebase/resources/containers/raw_client.py b/src/merge/resources/knowledgebase/resources/containers/raw_client.py new file mode 100644 index 00000000..ff1d134e --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/containers/raw_client.py @@ -0,0 +1,363 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.datetime_utils import serialize_datetime +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.jsonable_encoder import jsonable_encoder +from .....core.request_options import RequestOptions +from .....core.unchecked_base_model import construct_type +from ...types.container import Container +from ...types.paginated_container_list import PaginatedContainerList +from .types.containers_list_request_expand import ContainersListRequestExpand +from .types.containers_retrieve_request_expand import ContainersRetrieveRequestExpand + + +class RawContainersClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + *, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, + cursor: typing.Optional[str] = None, + expand: typing.Optional[ContainersListRequestExpand] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, + page_size: typing.Optional[int] = None, + parent_article_id: typing.Optional[str] = None, + parent_container_id: typing.Optional[str] = None, + remote_id: typing.Optional[str] = None, + type: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[PaginatedContainerList]: + """ + Returns a list of `Container` objects. + + Parameters + ---------- + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[ContainersListRequestExpand] + 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). + + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + + page_size : typing.Optional[int] + Number of results to return per page. + + parent_article_id : typing.Optional[str] + If provided, will only return sub containers of the parent_article_id. + + parent_container_id : typing.Optional[str] + If provided, will only return sub containers of the parent_container_id. + + remote_id : typing.Optional[str] + The API provider's ID for the given object. + + type : typing.Optional[str] + If provided, will only return containers of the given type. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[PaginatedContainerList] + + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/containers", + method="GET", + params={ + "created_after": serialize_datetime(created_after) if created_after is not None else None, + "created_before": serialize_datetime(created_before) if created_before is not None else None, + "cursor": cursor, + "expand": expand, + "include_deleted_data": include_deleted_data, + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + "modified_after": serialize_datetime(modified_after) if modified_after is not None else None, + "modified_before": serialize_datetime(modified_before) if modified_before is not None else None, + "page_size": page_size, + "parent_article_id": parent_article_id, + "parent_container_id": parent_container_id, + "remote_id": remote_id, + "type": type, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedContainerList, + construct_type( + type_=PaginatedContainerList, # 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, + *, + expand: typing.Optional[ContainersRetrieveRequestExpand] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[Container]: + """ + Returns a `Container` object with the given `id`. + + Parameters + ---------- + id : str + + expand : typing.Optional[ContainersRetrieveRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + 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). + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[Container] + + """ + _response = self._client_wrapper.httpx_client.request( + f"knowledgebase/v1/containers/{jsonable_encoder(id)}", + method="GET", + params={ + "expand": expand, + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + Container, + construct_type( + type_=Container, # 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) + + +class AsyncRawContainersClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + *, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, + cursor: typing.Optional[str] = None, + expand: typing.Optional[ContainersListRequestExpand] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, + page_size: typing.Optional[int] = None, + parent_article_id: typing.Optional[str] = None, + parent_container_id: typing.Optional[str] = None, + remote_id: typing.Optional[str] = None, + type: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[PaginatedContainerList]: + """ + Returns a list of `Container` objects. + + Parameters + ---------- + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[ContainersListRequestExpand] + 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). + + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + + page_size : typing.Optional[int] + Number of results to return per page. + + parent_article_id : typing.Optional[str] + If provided, will only return sub containers of the parent_article_id. + + parent_container_id : typing.Optional[str] + If provided, will only return sub containers of the parent_container_id. + + remote_id : typing.Optional[str] + The API provider's ID for the given object. + + type : typing.Optional[str] + If provided, will only return containers of the given type. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[PaginatedContainerList] + + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/containers", + method="GET", + params={ + "created_after": serialize_datetime(created_after) if created_after is not None else None, + "created_before": serialize_datetime(created_before) if created_before is not None else None, + "cursor": cursor, + "expand": expand, + "include_deleted_data": include_deleted_data, + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + "modified_after": serialize_datetime(modified_after) if modified_after is not None else None, + "modified_before": serialize_datetime(modified_before) if modified_before is not None else None, + "page_size": page_size, + "parent_article_id": parent_article_id, + "parent_container_id": parent_container_id, + "remote_id": remote_id, + "type": type, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedContainerList, + construct_type( + type_=PaginatedContainerList, # 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, + *, + expand: typing.Optional[ContainersRetrieveRequestExpand] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[Container]: + """ + Returns a `Container` object with the given `id`. + + Parameters + ---------- + id : str + + expand : typing.Optional[ContainersRetrieveRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + 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). + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[Container] + + """ + _response = await self._client_wrapper.httpx_client.request( + f"knowledgebase/v1/containers/{jsonable_encoder(id)}", + method="GET", + params={ + "expand": expand, + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + Container, + construct_type( + type_=Container, # 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) diff --git a/src/merge/resources/knowledgebase/resources/containers/types/__init__.py b/src/merge/resources/knowledgebase/resources/containers/types/__init__.py new file mode 100644 index 00000000..352ce242 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/containers/types/__init__.py @@ -0,0 +1,36 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .containers_list_request_expand import ContainersListRequestExpand + from .containers_retrieve_request_expand import ContainersRetrieveRequestExpand +_dynamic_imports: typing.Dict[str, str] = { + "ContainersListRequestExpand": ".containers_list_request_expand", + "ContainersRetrieveRequestExpand": ".containers_retrieve_request_expand", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["ContainersListRequestExpand", "ContainersRetrieveRequestExpand"] diff --git a/src/merge/resources/knowledgebase/resources/containers/types/containers_list_request_expand.py b/src/merge/resources/knowledgebase/resources/containers/types/containers_list_request_expand.py new file mode 100644 index 00000000..49c7be3a --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/containers/types/containers_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 ContainersListRequestExpand(str, enum.Enum): + PARENT_ARTICLE = "parent_article" + PARENT_ARTICLE_PARENT_CONTAINER = "parent_article,parent_container" + PARENT_CONTAINER = "parent_container" + PERMISSIONS = "permissions" + PERMISSIONS_PARENT_ARTICLE = "permissions,parent_article" + PERMISSIONS_PARENT_ARTICLE_PARENT_CONTAINER = "permissions,parent_article,parent_container" + PERMISSIONS_PARENT_CONTAINER = "permissions,parent_container" + + def visit( + self, + parent_article: typing.Callable[[], T_Result], + parent_article_parent_container: typing.Callable[[], T_Result], + parent_container: typing.Callable[[], T_Result], + permissions: typing.Callable[[], T_Result], + permissions_parent_article: typing.Callable[[], T_Result], + permissions_parent_article_parent_container: typing.Callable[[], T_Result], + permissions_parent_container: typing.Callable[[], T_Result], + ) -> T_Result: + if self is ContainersListRequestExpand.PARENT_ARTICLE: + return parent_article() + if self is ContainersListRequestExpand.PARENT_ARTICLE_PARENT_CONTAINER: + return parent_article_parent_container() + if self is ContainersListRequestExpand.PARENT_CONTAINER: + return parent_container() + if self is ContainersListRequestExpand.PERMISSIONS: + return permissions() + if self is ContainersListRequestExpand.PERMISSIONS_PARENT_ARTICLE: + return permissions_parent_article() + if self is ContainersListRequestExpand.PERMISSIONS_PARENT_ARTICLE_PARENT_CONTAINER: + return permissions_parent_article_parent_container() + if self is ContainersListRequestExpand.PERMISSIONS_PARENT_CONTAINER: + return permissions_parent_container() diff --git a/src/merge/resources/knowledgebase/resources/containers/types/containers_retrieve_request_expand.py b/src/merge/resources/knowledgebase/resources/containers/types/containers_retrieve_request_expand.py new file mode 100644 index 00000000..7b10f318 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/containers/types/containers_retrieve_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 ContainersRetrieveRequestExpand(str, enum.Enum): + PARENT_ARTICLE = "parent_article" + PARENT_ARTICLE_PARENT_CONTAINER = "parent_article,parent_container" + PARENT_CONTAINER = "parent_container" + PERMISSIONS = "permissions" + PERMISSIONS_PARENT_ARTICLE = "permissions,parent_article" + PERMISSIONS_PARENT_ARTICLE_PARENT_CONTAINER = "permissions,parent_article,parent_container" + PERMISSIONS_PARENT_CONTAINER = "permissions,parent_container" + + def visit( + self, + parent_article: typing.Callable[[], T_Result], + parent_article_parent_container: typing.Callable[[], T_Result], + parent_container: typing.Callable[[], T_Result], + permissions: typing.Callable[[], T_Result], + permissions_parent_article: typing.Callable[[], T_Result], + permissions_parent_article_parent_container: typing.Callable[[], T_Result], + permissions_parent_container: typing.Callable[[], T_Result], + ) -> T_Result: + if self is ContainersRetrieveRequestExpand.PARENT_ARTICLE: + return parent_article() + if self is ContainersRetrieveRequestExpand.PARENT_ARTICLE_PARENT_CONTAINER: + return parent_article_parent_container() + if self is ContainersRetrieveRequestExpand.PARENT_CONTAINER: + return parent_container() + if self is ContainersRetrieveRequestExpand.PERMISSIONS: + return permissions() + if self is ContainersRetrieveRequestExpand.PERMISSIONS_PARENT_ARTICLE: + return permissions_parent_article() + if self is ContainersRetrieveRequestExpand.PERMISSIONS_PARENT_ARTICLE_PARENT_CONTAINER: + return permissions_parent_article_parent_container() + if self is ContainersRetrieveRequestExpand.PERMISSIONS_PARENT_CONTAINER: + return permissions_parent_container() diff --git a/src/merge/resources/knowledgebase/resources/delete_account/__init__.py b/src/merge/resources/knowledgebase/resources/delete_account/__init__.py new file mode 100644 index 00000000..5cde0202 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/delete_account/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/merge/resources/knowledgebase/resources/delete_account/client.py b/src/merge/resources/knowledgebase/resources/delete_account/client.py new file mode 100644 index 00000000..71794eed --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/delete_account/client.py @@ -0,0 +1,99 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from .raw_client import AsyncRawDeleteAccountClient, RawDeleteAccountClient + + +class DeleteAccountClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawDeleteAccountClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawDeleteAccountClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawDeleteAccountClient + """ + return self._raw_client + + def delete(self, *, request_options: typing.Optional[RequestOptions] = None) -> None: + """ + Delete a linked account. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.delete_account.delete() + """ + _response = self._raw_client.delete(request_options=request_options) + return _response.data + + +class AsyncDeleteAccountClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawDeleteAccountClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawDeleteAccountClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawDeleteAccountClient + """ + return self._raw_client + + async def delete(self, *, request_options: typing.Optional[RequestOptions] = None) -> None: + """ + Delete a linked account. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + None + + 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.knowledgebase.delete_account.delete() + + + asyncio.run(main()) + """ + _response = await self._raw_client.delete(request_options=request_options) + return _response.data diff --git a/src/merge/resources/knowledgebase/resources/delete_account/raw_client.py b/src/merge/resources/knowledgebase/resources/delete_account/raw_client.py new file mode 100644 index 00000000..69762675 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/delete_account/raw_client.py @@ -0,0 +1,71 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.request_options import RequestOptions + + +class RawDeleteAccountClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def delete(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[None]: + """ + Delete a linked account. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[None] + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/delete-account", + method="POST", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return HttpResponse(response=_response, data=None) + _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) + + +class AsyncRawDeleteAccountClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def delete(self, *, request_options: typing.Optional[RequestOptions] = None) -> AsyncHttpResponse[None]: + """ + Delete a linked account. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[None] + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/delete-account", + method="POST", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + return AsyncHttpResponse(response=_response, data=None) + _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) diff --git a/src/merge/resources/knowledgebase/resources/field_mapping/__init__.py b/src/merge/resources/knowledgebase/resources/field_mapping/__init__.py new file mode 100644 index 00000000..5cde0202 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/field_mapping/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/merge/resources/knowledgebase/resources/field_mapping/client.py b/src/merge/resources/knowledgebase/resources/field_mapping/client.py new file mode 100644 index 00000000..4c25ae11 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/field_mapping/client.py @@ -0,0 +1,652 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from ...types.external_target_field_api_response import ExternalTargetFieldApiResponse +from ...types.field_mapping_api_instance_response import FieldMappingApiInstanceResponse +from ...types.field_mapping_instance_response import FieldMappingInstanceResponse +from ...types.remote_field_api_response import RemoteFieldApiResponse +from .raw_client import AsyncRawFieldMappingClient, RawFieldMappingClient + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class FieldMappingClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawFieldMappingClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawFieldMappingClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawFieldMappingClient + """ + return self._raw_client + + def field_mappings_retrieve( + self, + *, + exclude_remote_field_metadata: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> FieldMappingApiInstanceResponse: + """ + Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). + + Parameters + ---------- + exclude_remote_field_metadata : typing.Optional[bool] + If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + FieldMappingApiInstanceResponse + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.field_mapping.field_mappings_retrieve() + """ + _response = self._raw_client.field_mappings_retrieve( + exclude_remote_field_metadata=exclude_remote_field_metadata, request_options=request_options + ) + return _response.data + + def field_mappings_create( + self, + *, + target_field_name: str, + target_field_description: str, + remote_field_traversal_path: typing.Sequence[typing.Optional[typing.Any]], + remote_method: str, + remote_url_path: str, + common_model_name: str, + exclude_remote_field_metadata: typing.Optional[bool] = None, + jmes_path: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> FieldMappingInstanceResponse: + """ + Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. + + Parameters + ---------- + target_field_name : str + The name of the target field you want this remote field to map to. + + target_field_description : str + The description of the target field you want this remote field to map to. + + remote_field_traversal_path : typing.Sequence[typing.Optional[typing.Any]] + The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + + remote_method : str + The method of the remote endpoint where the remote field is coming from. + + remote_url_path : str + The path of the remote endpoint where the remote field is coming from. + + common_model_name : str + The name of the Common Model that the remote field corresponds to in a given category. + + exclude_remote_field_metadata : typing.Optional[bool] + If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. + + jmes_path : typing.Optional[str] + JMES path to specify json query expression to be used on field mapping. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + FieldMappingInstanceResponse + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.field_mapping.field_mappings_create( + target_field_name="example_target_field_name", + target_field_description="this is a example description of the target field", + remote_field_traversal_path=["example_remote_field"], + remote_method="GET", + remote_url_path="/example-url-path", + common_model_name="ExampleCommonModel", + ) + """ + _response = self._raw_client.field_mappings_create( + target_field_name=target_field_name, + target_field_description=target_field_description, + remote_field_traversal_path=remote_field_traversal_path, + remote_method=remote_method, + remote_url_path=remote_url_path, + common_model_name=common_model_name, + exclude_remote_field_metadata=exclude_remote_field_metadata, + jmes_path=jmes_path, + request_options=request_options, + ) + return _response.data + + def field_mappings_destroy( + self, field_mapping_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> FieldMappingInstanceResponse: + """ + Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. + + Parameters + ---------- + field_mapping_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + FieldMappingInstanceResponse + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.field_mapping.field_mappings_destroy( + field_mapping_id="field_mapping_id", + ) + """ + _response = self._raw_client.field_mappings_destroy(field_mapping_id, request_options=request_options) + return _response.data + + def field_mappings_partial_update( + self, + field_mapping_id: str, + *, + remote_field_traversal_path: typing.Optional[typing.Sequence[typing.Optional[typing.Any]]] = OMIT, + remote_method: typing.Optional[str] = OMIT, + remote_url_path: typing.Optional[str] = OMIT, + jmes_path: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> FieldMappingInstanceResponse: + """ + Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. + + Parameters + ---------- + field_mapping_id : str + + remote_field_traversal_path : typing.Optional[typing.Sequence[typing.Optional[typing.Any]]] + The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + + remote_method : typing.Optional[str] + The method of the remote endpoint where the remote field is coming from. + + remote_url_path : typing.Optional[str] + The path of the remote endpoint where the remote field is coming from. + + jmes_path : typing.Optional[str] + JMES path to specify json query expression to be used on field mapping. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + FieldMappingInstanceResponse + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.field_mapping.field_mappings_partial_update( + field_mapping_id="field_mapping_id", + ) + """ + _response = self._raw_client.field_mappings_partial_update( + field_mapping_id, + remote_field_traversal_path=remote_field_traversal_path, + remote_method=remote_method, + remote_url_path=remote_url_path, + jmes_path=jmes_path, + request_options=request_options, + ) + return _response.data + + def remote_fields_retrieve( + self, + *, + common_models: typing.Optional[str] = None, + include_example_values: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> RemoteFieldApiResponse: + """ + Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). + + Parameters + ---------- + common_models : typing.Optional[str] + A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. + + include_example_values : typing.Optional[str] + If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + RemoteFieldApiResponse + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.field_mapping.remote_fields_retrieve() + """ + _response = self._raw_client.remote_fields_retrieve( + common_models=common_models, include_example_values=include_example_values, request_options=request_options + ) + return _response.data + + def target_fields_retrieve( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> ExternalTargetFieldApiResponse: + """ + Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ExternalTargetFieldApiResponse + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.field_mapping.target_fields_retrieve() + """ + _response = self._raw_client.target_fields_retrieve(request_options=request_options) + return _response.data + + +class AsyncFieldMappingClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawFieldMappingClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawFieldMappingClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawFieldMappingClient + """ + return self._raw_client + + async def field_mappings_retrieve( + self, + *, + exclude_remote_field_metadata: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> FieldMappingApiInstanceResponse: + """ + Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). + + Parameters + ---------- + exclude_remote_field_metadata : typing.Optional[bool] + If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + FieldMappingApiInstanceResponse + + + 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.knowledgebase.field_mapping.field_mappings_retrieve() + + + asyncio.run(main()) + """ + _response = await self._raw_client.field_mappings_retrieve( + exclude_remote_field_metadata=exclude_remote_field_metadata, request_options=request_options + ) + return _response.data + + async def field_mappings_create( + self, + *, + target_field_name: str, + target_field_description: str, + remote_field_traversal_path: typing.Sequence[typing.Optional[typing.Any]], + remote_method: str, + remote_url_path: str, + common_model_name: str, + exclude_remote_field_metadata: typing.Optional[bool] = None, + jmes_path: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> FieldMappingInstanceResponse: + """ + Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. + + Parameters + ---------- + target_field_name : str + The name of the target field you want this remote field to map to. + + target_field_description : str + The description of the target field you want this remote field to map to. + + remote_field_traversal_path : typing.Sequence[typing.Optional[typing.Any]] + The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + + remote_method : str + The method of the remote endpoint where the remote field is coming from. + + remote_url_path : str + The path of the remote endpoint where the remote field is coming from. + + common_model_name : str + The name of the Common Model that the remote field corresponds to in a given category. + + exclude_remote_field_metadata : typing.Optional[bool] + If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. + + jmes_path : typing.Optional[str] + JMES path to specify json query expression to be used on field mapping. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + FieldMappingInstanceResponse + + + 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.knowledgebase.field_mapping.field_mappings_create( + target_field_name="example_target_field_name", + target_field_description="this is a example description of the target field", + remote_field_traversal_path=["example_remote_field"], + remote_method="GET", + remote_url_path="/example-url-path", + common_model_name="ExampleCommonModel", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.field_mappings_create( + target_field_name=target_field_name, + target_field_description=target_field_description, + remote_field_traversal_path=remote_field_traversal_path, + remote_method=remote_method, + remote_url_path=remote_url_path, + common_model_name=common_model_name, + exclude_remote_field_metadata=exclude_remote_field_metadata, + jmes_path=jmes_path, + request_options=request_options, + ) + return _response.data + + async def field_mappings_destroy( + self, field_mapping_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> FieldMappingInstanceResponse: + """ + Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. + + Parameters + ---------- + field_mapping_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + FieldMappingInstanceResponse + + + 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.knowledgebase.field_mapping.field_mappings_destroy( + field_mapping_id="field_mapping_id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.field_mappings_destroy(field_mapping_id, request_options=request_options) + return _response.data + + async def field_mappings_partial_update( + self, + field_mapping_id: str, + *, + remote_field_traversal_path: typing.Optional[typing.Sequence[typing.Optional[typing.Any]]] = OMIT, + remote_method: typing.Optional[str] = OMIT, + remote_url_path: typing.Optional[str] = OMIT, + jmes_path: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> FieldMappingInstanceResponse: + """ + Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. + + Parameters + ---------- + field_mapping_id : str + + remote_field_traversal_path : typing.Optional[typing.Sequence[typing.Optional[typing.Any]]] + The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + + remote_method : typing.Optional[str] + The method of the remote endpoint where the remote field is coming from. + + remote_url_path : typing.Optional[str] + The path of the remote endpoint where the remote field is coming from. + + jmes_path : typing.Optional[str] + JMES path to specify json query expression to be used on field mapping. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + FieldMappingInstanceResponse + + + 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.knowledgebase.field_mapping.field_mappings_partial_update( + field_mapping_id="field_mapping_id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.field_mappings_partial_update( + field_mapping_id, + remote_field_traversal_path=remote_field_traversal_path, + remote_method=remote_method, + remote_url_path=remote_url_path, + jmes_path=jmes_path, + request_options=request_options, + ) + return _response.data + + async def remote_fields_retrieve( + self, + *, + common_models: typing.Optional[str] = None, + include_example_values: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> RemoteFieldApiResponse: + """ + Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). + + Parameters + ---------- + common_models : typing.Optional[str] + A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. + + include_example_values : typing.Optional[str] + If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + RemoteFieldApiResponse + + + 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.knowledgebase.field_mapping.remote_fields_retrieve() + + + asyncio.run(main()) + """ + _response = await self._raw_client.remote_fields_retrieve( + common_models=common_models, include_example_values=include_example_values, request_options=request_options + ) + return _response.data + + async def target_fields_retrieve( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> ExternalTargetFieldApiResponse: + """ + Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + ExternalTargetFieldApiResponse + + + 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.knowledgebase.field_mapping.target_fields_retrieve() + + + asyncio.run(main()) + """ + _response = await self._raw_client.target_fields_retrieve(request_options=request_options) + return _response.data diff --git a/src/merge/resources/knowledgebase/resources/field_mapping/raw_client.py b/src/merge/resources/knowledgebase/resources/field_mapping/raw_client.py new file mode 100644 index 00000000..0767247f --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/field_mapping/raw_client.py @@ -0,0 +1,672 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.jsonable_encoder import jsonable_encoder +from .....core.request_options import RequestOptions +from .....core.unchecked_base_model import construct_type +from ...types.external_target_field_api_response import ExternalTargetFieldApiResponse +from ...types.field_mapping_api_instance_response import FieldMappingApiInstanceResponse +from ...types.field_mapping_instance_response import FieldMappingInstanceResponse +from ...types.remote_field_api_response import RemoteFieldApiResponse + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RawFieldMappingClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def field_mappings_retrieve( + self, + *, + exclude_remote_field_metadata: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[FieldMappingApiInstanceResponse]: + """ + Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). + + Parameters + ---------- + exclude_remote_field_metadata : typing.Optional[bool] + If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[FieldMappingApiInstanceResponse] + + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/field-mappings", + method="GET", + params={ + "exclude_remote_field_metadata": exclude_remote_field_metadata, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + FieldMappingApiInstanceResponse, + construct_type( + type_=FieldMappingApiInstanceResponse, # 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 field_mappings_create( + self, + *, + target_field_name: str, + target_field_description: str, + remote_field_traversal_path: typing.Sequence[typing.Optional[typing.Any]], + remote_method: str, + remote_url_path: str, + common_model_name: str, + exclude_remote_field_metadata: typing.Optional[bool] = None, + jmes_path: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[FieldMappingInstanceResponse]: + """ + Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. + + Parameters + ---------- + target_field_name : str + The name of the target field you want this remote field to map to. + + target_field_description : str + The description of the target field you want this remote field to map to. + + remote_field_traversal_path : typing.Sequence[typing.Optional[typing.Any]] + The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + + remote_method : str + The method of the remote endpoint where the remote field is coming from. + + remote_url_path : str + The path of the remote endpoint where the remote field is coming from. + + common_model_name : str + The name of the Common Model that the remote field corresponds to in a given category. + + exclude_remote_field_metadata : typing.Optional[bool] + If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. + + jmes_path : typing.Optional[str] + JMES path to specify json query expression to be used on field mapping. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[FieldMappingInstanceResponse] + + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/field-mappings", + method="POST", + params={ + "exclude_remote_field_metadata": exclude_remote_field_metadata, + }, + json={ + "target_field_name": target_field_name, + "target_field_description": target_field_description, + "remote_field_traversal_path": remote_field_traversal_path, + "remote_method": remote_method, + "remote_url_path": remote_url_path, + "common_model_name": common_model_name, + "jmes_path": jmes_path, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + FieldMappingInstanceResponse, + construct_type( + type_=FieldMappingInstanceResponse, # 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 field_mappings_destroy( + self, field_mapping_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[FieldMappingInstanceResponse]: + """ + Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. + + Parameters + ---------- + field_mapping_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[FieldMappingInstanceResponse] + + """ + _response = self._client_wrapper.httpx_client.request( + f"knowledgebase/v1/field-mappings/{jsonable_encoder(field_mapping_id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + FieldMappingInstanceResponse, + construct_type( + type_=FieldMappingInstanceResponse, # 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 field_mappings_partial_update( + self, + field_mapping_id: str, + *, + remote_field_traversal_path: typing.Optional[typing.Sequence[typing.Optional[typing.Any]]] = OMIT, + remote_method: typing.Optional[str] = OMIT, + remote_url_path: typing.Optional[str] = OMIT, + jmes_path: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[FieldMappingInstanceResponse]: + """ + Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. + + Parameters + ---------- + field_mapping_id : str + + remote_field_traversal_path : typing.Optional[typing.Sequence[typing.Optional[typing.Any]]] + The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + + remote_method : typing.Optional[str] + The method of the remote endpoint where the remote field is coming from. + + remote_url_path : typing.Optional[str] + The path of the remote endpoint where the remote field is coming from. + + jmes_path : typing.Optional[str] + JMES path to specify json query expression to be used on field mapping. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[FieldMappingInstanceResponse] + + """ + _response = self._client_wrapper.httpx_client.request( + f"knowledgebase/v1/field-mappings/{jsonable_encoder(field_mapping_id)}", + method="PATCH", + json={ + "remote_field_traversal_path": remote_field_traversal_path, + "remote_method": remote_method, + "remote_url_path": remote_url_path, + "jmes_path": jmes_path, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + FieldMappingInstanceResponse, + construct_type( + type_=FieldMappingInstanceResponse, # 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 remote_fields_retrieve( + self, + *, + common_models: typing.Optional[str] = None, + include_example_values: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[RemoteFieldApiResponse]: + """ + Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). + + Parameters + ---------- + common_models : typing.Optional[str] + A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. + + include_example_values : typing.Optional[str] + If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[RemoteFieldApiResponse] + + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/remote-fields", + method="GET", + params={ + "common_models": common_models, + "include_example_values": include_example_values, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + RemoteFieldApiResponse, + construct_type( + type_=RemoteFieldApiResponse, # 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 target_fields_retrieve( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[ExternalTargetFieldApiResponse]: + """ + Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[ExternalTargetFieldApiResponse] + + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/target-fields", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ExternalTargetFieldApiResponse, + construct_type( + type_=ExternalTargetFieldApiResponse, # 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) + + +class AsyncRawFieldMappingClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def field_mappings_retrieve( + self, + *, + exclude_remote_field_metadata: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[FieldMappingApiInstanceResponse]: + """ + Get all Field Mappings for this Linked Account. Field Mappings are mappings between third-party Remote Fields and user defined Merge fields. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). + + Parameters + ---------- + exclude_remote_field_metadata : typing.Optional[bool] + If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[FieldMappingApiInstanceResponse] + + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/field-mappings", + method="GET", + params={ + "exclude_remote_field_metadata": exclude_remote_field_metadata, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + FieldMappingApiInstanceResponse, + construct_type( + type_=FieldMappingApiInstanceResponse, # 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 field_mappings_create( + self, + *, + target_field_name: str, + target_field_description: str, + remote_field_traversal_path: typing.Sequence[typing.Optional[typing.Any]], + remote_method: str, + remote_url_path: str, + common_model_name: str, + exclude_remote_field_metadata: typing.Optional[bool] = None, + jmes_path: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[FieldMappingInstanceResponse]: + """ + Create new Field Mappings that will be available after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. + + Parameters + ---------- + target_field_name : str + The name of the target field you want this remote field to map to. + + target_field_description : str + The description of the target field you want this remote field to map to. + + remote_field_traversal_path : typing.Sequence[typing.Optional[typing.Any]] + The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + + remote_method : str + The method of the remote endpoint where the remote field is coming from. + + remote_url_path : str + The path of the remote endpoint where the remote field is coming from. + + common_model_name : str + The name of the Common Model that the remote field corresponds to in a given category. + + exclude_remote_field_metadata : typing.Optional[bool] + If `true`, remote fields metadata is excluded from each field mapping instance (i.e. `remote_fields.remote_key_name` and `remote_fields.schema` will be null). This will increase the speed of the request since these fields require some calculations. + + jmes_path : typing.Optional[str] + JMES path to specify json query expression to be used on field mapping. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[FieldMappingInstanceResponse] + + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/field-mappings", + method="POST", + params={ + "exclude_remote_field_metadata": exclude_remote_field_metadata, + }, + json={ + "target_field_name": target_field_name, + "target_field_description": target_field_description, + "remote_field_traversal_path": remote_field_traversal_path, + "remote_method": remote_method, + "remote_url_path": remote_url_path, + "common_model_name": common_model_name, + "jmes_path": jmes_path, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + FieldMappingInstanceResponse, + construct_type( + type_=FieldMappingInstanceResponse, # 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 field_mappings_destroy( + self, field_mapping_id: str, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[FieldMappingInstanceResponse]: + """ + Deletes Field Mappings for a Linked Account. All data related to this Field Mapping will be deleted and these changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. + + Parameters + ---------- + field_mapping_id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[FieldMappingInstanceResponse] + + """ + _response = await self._client_wrapper.httpx_client.request( + f"knowledgebase/v1/field-mappings/{jsonable_encoder(field_mapping_id)}", + method="DELETE", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + FieldMappingInstanceResponse, + construct_type( + type_=FieldMappingInstanceResponse, # 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 field_mappings_partial_update( + self, + field_mapping_id: str, + *, + remote_field_traversal_path: typing.Optional[typing.Sequence[typing.Optional[typing.Any]]] = OMIT, + remote_method: typing.Optional[str] = OMIT, + remote_url_path: typing.Optional[str] = OMIT, + jmes_path: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[FieldMappingInstanceResponse]: + """ + Create or update existing Field Mappings for a Linked Account. Changes will be reflected after the next scheduled sync. This will cause the next sync for this Linked Account to sync **ALL** data from start. + + Parameters + ---------- + field_mapping_id : str + + remote_field_traversal_path : typing.Optional[typing.Sequence[typing.Optional[typing.Any]]] + The field traversal path of the remote field listed when you hit the GET /remote-fields endpoint. + + remote_method : typing.Optional[str] + The method of the remote endpoint where the remote field is coming from. + + remote_url_path : typing.Optional[str] + The path of the remote endpoint where the remote field is coming from. + + jmes_path : typing.Optional[str] + JMES path to specify json query expression to be used on field mapping. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[FieldMappingInstanceResponse] + + """ + _response = await self._client_wrapper.httpx_client.request( + f"knowledgebase/v1/field-mappings/{jsonable_encoder(field_mapping_id)}", + method="PATCH", + json={ + "remote_field_traversal_path": remote_field_traversal_path, + "remote_method": remote_method, + "remote_url_path": remote_url_path, + "jmes_path": jmes_path, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + FieldMappingInstanceResponse, + construct_type( + type_=FieldMappingInstanceResponse, # 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 remote_fields_retrieve( + self, + *, + common_models: typing.Optional[str] = None, + include_example_values: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[RemoteFieldApiResponse]: + """ + Get all remote fields for a Linked Account. Remote fields are third-party fields that are accessible after initial sync if remote_data is enabled. You can use remote fields to override existing Merge fields or map a new Merge field. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/overview/). + + Parameters + ---------- + common_models : typing.Optional[str] + A comma seperated list of Common Model names. If included, will only return Remote Fields for those Common Models. + + include_example_values : typing.Optional[str] + If true, will include example values, where available, for remote fields in the 3rd party platform. These examples come from active data from your customers. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[RemoteFieldApiResponse] + + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/remote-fields", + method="GET", + params={ + "common_models": common_models, + "include_example_values": include_example_values, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + RemoteFieldApiResponse, + construct_type( + type_=RemoteFieldApiResponse, # 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 target_fields_retrieve( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[ExternalTargetFieldApiResponse]: + """ + Get all organization-wide Target Fields, this will not include any Linked Account specific Target Fields. Organization-wide Target Fields are additional fields appended to the Merge Common Model for all Linked Accounts in a category. [Learn more](https://docs.merge.dev/supplemental-data/field-mappings/target-fields/). + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[ExternalTargetFieldApiResponse] + + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/target-fields", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + ExternalTargetFieldApiResponse, + construct_type( + type_=ExternalTargetFieldApiResponse, # 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) diff --git a/src/merge/resources/knowledgebase/resources/force_resync/__init__.py b/src/merge/resources/knowledgebase/resources/force_resync/__init__.py new file mode 100644 index 00000000..5cde0202 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/force_resync/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/merge/resources/knowledgebase/resources/force_resync/client.py b/src/merge/resources/knowledgebase/resources/force_resync/client.py new file mode 100644 index 00000000..af416400 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/force_resync/client.py @@ -0,0 +1,106 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from ...types.sync_status import SyncStatus +from .raw_client import AsyncRawForceResyncClient, RawForceResyncClient + + +class ForceResyncClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawForceResyncClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawForceResyncClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawForceResyncClient + """ + return self._raw_client + + def sync_status_resync_create( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> typing.List[SyncStatus]: + """ + Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[SyncStatus] + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.force_resync.sync_status_resync_create() + """ + _response = self._raw_client.sync_status_resync_create(request_options=request_options) + return _response.data + + +class AsyncForceResyncClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawForceResyncClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawForceResyncClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawForceResyncClient + """ + return self._raw_client + + async def sync_status_resync_create( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> typing.List[SyncStatus]: + """ + Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[SyncStatus] + + + 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.knowledgebase.force_resync.sync_status_resync_create() + + + asyncio.run(main()) + """ + _response = await self._raw_client.sync_status_resync_create(request_options=request_options) + return _response.data diff --git a/src/merge/resources/knowledgebase/resources/force_resync/raw_client.py b/src/merge/resources/knowledgebase/resources/force_resync/raw_client.py new file mode 100644 index 00000000..afda654c --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/force_resync/raw_client.py @@ -0,0 +1,93 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.request_options import RequestOptions +from .....core.unchecked_base_model import construct_type +from ...types.sync_status import SyncStatus + + +class RawForceResyncClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def sync_status_resync_create( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[typing.List[SyncStatus]]: + """ + Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[typing.List[SyncStatus]] + + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/sync-status/resync", + method="POST", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + typing.List[SyncStatus], + construct_type( + type_=typing.List[SyncStatus], # 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) + + +class AsyncRawForceResyncClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def sync_status_resync_create( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[typing.List[SyncStatus]]: + """ + Force re-sync of all models. This endpoint is available for monthly, quarterly, and highest sync frequency customers on the Professional or Enterprise plans. Doing so will consume a sync credit for the relevant linked account. Force re-syncs can also be triggered manually in the Merge Dashboard and is available for all customers. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[typing.List[SyncStatus]] + + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/sync-status/resync", + method="POST", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + typing.List[SyncStatus], + construct_type( + type_=typing.List[SyncStatus], # 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) diff --git a/src/merge/resources/knowledgebase/resources/generate_key/__init__.py b/src/merge/resources/knowledgebase/resources/generate_key/__init__.py new file mode 100644 index 00000000..5cde0202 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/generate_key/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/merge/resources/knowledgebase/resources/generate_key/client.py b/src/merge/resources/knowledgebase/resources/generate_key/client.py new file mode 100644 index 00000000..4a21b90c --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/generate_key/client.py @@ -0,0 +1,115 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from ...types.remote_key import RemoteKey +from .raw_client import AsyncRawGenerateKeyClient, RawGenerateKeyClient + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class GenerateKeyClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawGenerateKeyClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawGenerateKeyClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawGenerateKeyClient + """ + return self._raw_client + + def create(self, *, name: str, request_options: typing.Optional[RequestOptions] = None) -> RemoteKey: + """ + Create a remote key. + + Parameters + ---------- + name : str + The name of the remote key + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + RemoteKey + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.generate_key.create( + name="Remote Deployment Key 1", + ) + """ + _response = self._raw_client.create(name=name, request_options=request_options) + return _response.data + + +class AsyncGenerateKeyClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawGenerateKeyClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawGenerateKeyClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawGenerateKeyClient + """ + return self._raw_client + + async def create(self, *, name: str, request_options: typing.Optional[RequestOptions] = None) -> RemoteKey: + """ + Create a remote key. + + Parameters + ---------- + name : str + The name of the remote key + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + RemoteKey + + + 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.knowledgebase.generate_key.create( + name="Remote Deployment Key 1", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.create(name=name, request_options=request_options) + return _response.data diff --git a/src/merge/resources/knowledgebase/resources/generate_key/raw_client.py b/src/merge/resources/knowledgebase/resources/generate_key/raw_client.py new file mode 100644 index 00000000..a528f2c7 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/generate_key/raw_client.py @@ -0,0 +1,114 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.request_options import RequestOptions +from .....core.unchecked_base_model import construct_type +from ...types.remote_key import RemoteKey + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RawGenerateKeyClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def create(self, *, name: str, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[RemoteKey]: + """ + Create a remote key. + + Parameters + ---------- + name : str + The name of the remote key + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[RemoteKey] + + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/generate-key", + method="POST", + json={ + "name": name, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + RemoteKey, + construct_type( + type_=RemoteKey, # 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) + + +class AsyncRawGenerateKeyClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def create( + self, *, name: str, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[RemoteKey]: + """ + Create a remote key. + + Parameters + ---------- + name : str + The name of the remote key + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[RemoteKey] + + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/generate-key", + method="POST", + json={ + "name": name, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + RemoteKey, + construct_type( + type_=RemoteKey, # 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) diff --git a/src/merge/resources/knowledgebase/resources/groups/__init__.py b/src/merge/resources/knowledgebase/resources/groups/__init__.py new file mode 100644 index 00000000..d4647a1c --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/groups/__init__.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import GroupsListRequestExpand, GroupsRetrieveRequestExpand +_dynamic_imports: typing.Dict[str, str] = {"GroupsListRequestExpand": ".types", "GroupsRetrieveRequestExpand": ".types"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["GroupsListRequestExpand", "GroupsRetrieveRequestExpand"] diff --git a/src/merge/resources/knowledgebase/resources/groups/client.py b/src/merge/resources/knowledgebase/resources/groups/client.py new file mode 100644 index 00000000..acca352d --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/groups/client.py @@ -0,0 +1,348 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from ...types.group import Group +from ...types.paginated_group_list import PaginatedGroupList +from .raw_client import AsyncRawGroupsClient, RawGroupsClient +from .types.groups_list_request_expand import GroupsListRequestExpand +from .types.groups_retrieve_request_expand import GroupsRetrieveRequestExpand + + +class GroupsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawGroupsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawGroupsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawGroupsClient + """ + return self._raw_client + + def list( + self, + *, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, + cursor: typing.Optional[str] = None, + expand: typing.Optional[GroupsListRequestExpand] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, + page_size: typing.Optional[int] = None, + remote_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedGroupList: + """ + Returns a list of `Group` objects. + + Parameters + ---------- + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[GroupsListRequestExpand] + 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). + + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + + page_size : typing.Optional[int] + Number of results to return per page. + + remote_id : typing.Optional[str] + The API provider's ID for the given object. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedGroupList + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.groups.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ) + """ + _response = self._raw_client.list( + created_after=created_after, + created_before=created_before, + cursor=cursor, + expand=expand, + include_deleted_data=include_deleted_data, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + modified_after=modified_after, + modified_before=modified_before, + page_size=page_size, + remote_id=remote_id, + request_options=request_options, + ) + return _response.data + + def retrieve( + self, + id: str, + *, + expand: typing.Optional[GroupsRetrieveRequestExpand] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> Group: + """ + Returns a `Group` object with the given `id`. + + Parameters + ---------- + id : str + + expand : typing.Optional[GroupsRetrieveRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + 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). + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Group + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.groups.retrieve( + id="id", + ) + """ + _response = self._raw_client.retrieve( + id, + expand=expand, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + request_options=request_options, + ) + return _response.data + + +class AsyncGroupsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawGroupsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawGroupsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawGroupsClient + """ + return self._raw_client + + async def list( + self, + *, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, + cursor: typing.Optional[str] = None, + expand: typing.Optional[GroupsListRequestExpand] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, + page_size: typing.Optional[int] = None, + remote_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedGroupList: + """ + Returns a list of `Group` objects. + + Parameters + ---------- + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[GroupsListRequestExpand] + 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). + + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + + page_size : typing.Optional[int] + Number of results to return per page. + + remote_id : typing.Optional[str] + The API provider's ID for the given object. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedGroupList + + + 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.knowledgebase.groups.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.list( + created_after=created_after, + created_before=created_before, + cursor=cursor, + expand=expand, + include_deleted_data=include_deleted_data, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + modified_after=modified_after, + modified_before=modified_before, + page_size=page_size, + remote_id=remote_id, + request_options=request_options, + ) + return _response.data + + async def retrieve( + self, + id: str, + *, + expand: typing.Optional[GroupsRetrieveRequestExpand] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> Group: + """ + Returns a `Group` object with the given `id`. + + Parameters + ---------- + id : str + + expand : typing.Optional[GroupsRetrieveRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + 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). + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Group + + + 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.knowledgebase.groups.retrieve( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.retrieve( + id, + expand=expand, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + request_options=request_options, + ) + return _response.data diff --git a/src/merge/resources/knowledgebase/resources/groups/raw_client.py b/src/merge/resources/knowledgebase/resources/groups/raw_client.py new file mode 100644 index 00000000..ee98e9eb --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/groups/raw_client.py @@ -0,0 +1,333 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.datetime_utils import serialize_datetime +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.jsonable_encoder import jsonable_encoder +from .....core.request_options import RequestOptions +from .....core.unchecked_base_model import construct_type +from ...types.group import Group +from ...types.paginated_group_list import PaginatedGroupList +from .types.groups_list_request_expand import GroupsListRequestExpand +from .types.groups_retrieve_request_expand import GroupsRetrieveRequestExpand + + +class RawGroupsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + *, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, + cursor: typing.Optional[str] = None, + expand: typing.Optional[GroupsListRequestExpand] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, + page_size: typing.Optional[int] = None, + remote_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[PaginatedGroupList]: + """ + Returns a list of `Group` objects. + + Parameters + ---------- + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[GroupsListRequestExpand] + 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). + + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + + page_size : typing.Optional[int] + Number of results to return per page. + + remote_id : typing.Optional[str] + The API provider's ID for the given object. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[PaginatedGroupList] + + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/groups", + method="GET", + params={ + "created_after": serialize_datetime(created_after) if created_after is not None else None, + "created_before": serialize_datetime(created_before) if created_before is not None else None, + "cursor": cursor, + "expand": expand, + "include_deleted_data": include_deleted_data, + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + "modified_after": serialize_datetime(modified_after) if modified_after is not None else None, + "modified_before": serialize_datetime(modified_before) if modified_before is not None else None, + "page_size": page_size, + "remote_id": remote_id, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedGroupList, + construct_type( + type_=PaginatedGroupList, # 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, + *, + expand: typing.Optional[GroupsRetrieveRequestExpand] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[Group]: + """ + Returns a `Group` object with the given `id`. + + Parameters + ---------- + id : str + + expand : typing.Optional[GroupsRetrieveRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + 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). + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[Group] + + """ + _response = self._client_wrapper.httpx_client.request( + f"knowledgebase/v1/groups/{jsonable_encoder(id)}", + method="GET", + params={ + "expand": expand, + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + Group, + construct_type( + type_=Group, # 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) + + +class AsyncRawGroupsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + *, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, + cursor: typing.Optional[str] = None, + expand: typing.Optional[GroupsListRequestExpand] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, + page_size: typing.Optional[int] = None, + remote_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[PaginatedGroupList]: + """ + Returns a list of `Group` objects. + + Parameters + ---------- + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + + cursor : typing.Optional[str] + The pagination cursor value. + + expand : typing.Optional[GroupsListRequestExpand] + 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). + + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + + page_size : typing.Optional[int] + Number of results to return per page. + + remote_id : typing.Optional[str] + The API provider's ID for the given object. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[PaginatedGroupList] + + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/groups", + method="GET", + params={ + "created_after": serialize_datetime(created_after) if created_after is not None else None, + "created_before": serialize_datetime(created_before) if created_before is not None else None, + "cursor": cursor, + "expand": expand, + "include_deleted_data": include_deleted_data, + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + "modified_after": serialize_datetime(modified_after) if modified_after is not None else None, + "modified_before": serialize_datetime(modified_before) if modified_before is not None else None, + "page_size": page_size, + "remote_id": remote_id, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedGroupList, + construct_type( + type_=PaginatedGroupList, # 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, + *, + expand: typing.Optional[GroupsRetrieveRequestExpand] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[Group]: + """ + Returns a `Group` object with the given `id`. + + Parameters + ---------- + id : str + + expand : typing.Optional[GroupsRetrieveRequestExpand] + Which relations should be returned in expanded form. Multiple relation names should be comma separated without spaces. + + 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). + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[Group] + + """ + _response = await self._client_wrapper.httpx_client.request( + f"knowledgebase/v1/groups/{jsonable_encoder(id)}", + method="GET", + params={ + "expand": expand, + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + Group, + construct_type( + type_=Group, # 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) diff --git a/src/merge/resources/knowledgebase/resources/groups/types/__init__.py b/src/merge/resources/knowledgebase/resources/groups/types/__init__.py new file mode 100644 index 00000000..9e82f18a --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/groups/types/__init__.py @@ -0,0 +1,36 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .groups_list_request_expand import GroupsListRequestExpand + from .groups_retrieve_request_expand import GroupsRetrieveRequestExpand +_dynamic_imports: typing.Dict[str, str] = { + "GroupsListRequestExpand": ".groups_list_request_expand", + "GroupsRetrieveRequestExpand": ".groups_retrieve_request_expand", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["GroupsListRequestExpand", "GroupsRetrieveRequestExpand"] diff --git a/src/merge/resources/knowledgebase/resources/groups/types/groups_list_request_expand.py b/src/merge/resources/knowledgebase/resources/groups/types/groups_list_request_expand.py new file mode 100644 index 00000000..24df30ac --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/groups/types/groups_list_request_expand.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 GroupsListRequestExpand(str, enum.Enum): + PARENT_GROUP = "parent_group" + USERS = "users" + USERS_PARENT_GROUP = "users,parent_group" + + def visit( + self, + parent_group: typing.Callable[[], T_Result], + users: typing.Callable[[], T_Result], + users_parent_group: typing.Callable[[], T_Result], + ) -> T_Result: + if self is GroupsListRequestExpand.PARENT_GROUP: + return parent_group() + if self is GroupsListRequestExpand.USERS: + return users() + if self is GroupsListRequestExpand.USERS_PARENT_GROUP: + return users_parent_group() diff --git a/src/merge/resources/knowledgebase/resources/groups/types/groups_retrieve_request_expand.py b/src/merge/resources/knowledgebase/resources/groups/types/groups_retrieve_request_expand.py new file mode 100644 index 00000000..02f76ff0 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/groups/types/groups_retrieve_request_expand.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 GroupsRetrieveRequestExpand(str, enum.Enum): + PARENT_GROUP = "parent_group" + USERS = "users" + USERS_PARENT_GROUP = "users,parent_group" + + def visit( + self, + parent_group: typing.Callable[[], T_Result], + users: typing.Callable[[], T_Result], + users_parent_group: typing.Callable[[], T_Result], + ) -> T_Result: + if self is GroupsRetrieveRequestExpand.PARENT_GROUP: + return parent_group() + if self is GroupsRetrieveRequestExpand.USERS: + return users() + if self is GroupsRetrieveRequestExpand.USERS_PARENT_GROUP: + return users_parent_group() diff --git a/src/merge/resources/knowledgebase/resources/issues/__init__.py b/src/merge/resources/knowledgebase/resources/issues/__init__.py new file mode 100644 index 00000000..3ca1094b --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/issues/__init__.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import IssuesListRequestStatus +_dynamic_imports: typing.Dict[str, str] = {"IssuesListRequestStatus": ".types"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["IssuesListRequestStatus"] diff --git a/src/merge/resources/knowledgebase/resources/issues/client.py b/src/merge/resources/knowledgebase/resources/issues/client.py new file mode 100644 index 00000000..44ee02d0 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/issues/client.py @@ -0,0 +1,331 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from ...types.issue import Issue +from ...types.paginated_issue_list import PaginatedIssueList +from .raw_client import AsyncRawIssuesClient, RawIssuesClient +from .types.issues_list_request_status import IssuesListRequestStatus + + +class IssuesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawIssuesClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawIssuesClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawIssuesClient + """ + return self._raw_client + + def list( + self, + *, + account_token: typing.Optional[str] = None, + cursor: typing.Optional[str] = None, + end_date: typing.Optional[str] = None, + end_user_organization_name: typing.Optional[str] = None, + first_incident_time_after: typing.Optional[dt.datetime] = None, + first_incident_time_before: typing.Optional[dt.datetime] = None, + include_muted: typing.Optional[str] = None, + integration_name: typing.Optional[str] = None, + last_incident_time_after: typing.Optional[dt.datetime] = None, + last_incident_time_before: typing.Optional[dt.datetime] = None, + linked_account_id: typing.Optional[str] = None, + page_size: typing.Optional[int] = None, + start_date: typing.Optional[str] = None, + status: typing.Optional[IssuesListRequestStatus] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedIssueList: + """ + Gets all issues for Organization. + + Parameters + ---------- + account_token : typing.Optional[str] + + cursor : typing.Optional[str] + The pagination cursor value. + + end_date : typing.Optional[str] + If included, will only include issues whose most recent action occurred before this time + + end_user_organization_name : typing.Optional[str] + + first_incident_time_after : typing.Optional[dt.datetime] + If provided, will only return issues whose first incident time was after this datetime. + + first_incident_time_before : typing.Optional[dt.datetime] + If provided, will only return issues whose first incident time was before this datetime. + + include_muted : typing.Optional[str] + If true, will include muted issues + + integration_name : typing.Optional[str] + + last_incident_time_after : typing.Optional[dt.datetime] + If provided, will only return issues whose last incident time was after this datetime. + + last_incident_time_before : typing.Optional[dt.datetime] + If provided, will only return issues whose last incident time was before this datetime. + + linked_account_id : typing.Optional[str] + If provided, will only include issues pertaining to the linked account passed in. + + page_size : typing.Optional[int] + Number of results to return per page. + + start_date : typing.Optional[str] + If included, will only include issues whose most recent action occurred after this time + + status : typing.Optional[IssuesListRequestStatus] + Status of the issue. Options: ('ONGOING', 'RESOLVED') + + * `ONGOING` - ONGOING + * `RESOLVED` - RESOLVED + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedIssueList + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.issues.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ) + """ + _response = self._raw_client.list( + account_token=account_token, + cursor=cursor, + end_date=end_date, + end_user_organization_name=end_user_organization_name, + first_incident_time_after=first_incident_time_after, + first_incident_time_before=first_incident_time_before, + include_muted=include_muted, + integration_name=integration_name, + last_incident_time_after=last_incident_time_after, + last_incident_time_before=last_incident_time_before, + linked_account_id=linked_account_id, + page_size=page_size, + start_date=start_date, + status=status, + request_options=request_options, + ) + return _response.data + + def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Issue: + """ + Get a specific issue. + + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Issue + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.issues.retrieve( + id="id", + ) + """ + _response = self._raw_client.retrieve(id, request_options=request_options) + return _response.data + + +class AsyncIssuesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawIssuesClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawIssuesClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawIssuesClient + """ + return self._raw_client + + async def list( + self, + *, + account_token: typing.Optional[str] = None, + cursor: typing.Optional[str] = None, + end_date: typing.Optional[str] = None, + end_user_organization_name: typing.Optional[str] = None, + first_incident_time_after: typing.Optional[dt.datetime] = None, + first_incident_time_before: typing.Optional[dt.datetime] = None, + include_muted: typing.Optional[str] = None, + integration_name: typing.Optional[str] = None, + last_incident_time_after: typing.Optional[dt.datetime] = None, + last_incident_time_before: typing.Optional[dt.datetime] = None, + linked_account_id: typing.Optional[str] = None, + page_size: typing.Optional[int] = None, + start_date: typing.Optional[str] = None, + status: typing.Optional[IssuesListRequestStatus] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedIssueList: + """ + Gets all issues for Organization. + + Parameters + ---------- + account_token : typing.Optional[str] + + cursor : typing.Optional[str] + The pagination cursor value. + + end_date : typing.Optional[str] + If included, will only include issues whose most recent action occurred before this time + + end_user_organization_name : typing.Optional[str] + + first_incident_time_after : typing.Optional[dt.datetime] + If provided, will only return issues whose first incident time was after this datetime. + + first_incident_time_before : typing.Optional[dt.datetime] + If provided, will only return issues whose first incident time was before this datetime. + + include_muted : typing.Optional[str] + If true, will include muted issues + + integration_name : typing.Optional[str] + + last_incident_time_after : typing.Optional[dt.datetime] + If provided, will only return issues whose last incident time was after this datetime. + + last_incident_time_before : typing.Optional[dt.datetime] + If provided, will only return issues whose last incident time was before this datetime. + + linked_account_id : typing.Optional[str] + If provided, will only include issues pertaining to the linked account passed in. + + page_size : typing.Optional[int] + Number of results to return per page. + + start_date : typing.Optional[str] + If included, will only include issues whose most recent action occurred after this time + + status : typing.Optional[IssuesListRequestStatus] + Status of the issue. Options: ('ONGOING', 'RESOLVED') + + * `ONGOING` - ONGOING + * `RESOLVED` - RESOLVED + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedIssueList + + + 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.knowledgebase.issues.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.list( + account_token=account_token, + cursor=cursor, + end_date=end_date, + end_user_organization_name=end_user_organization_name, + first_incident_time_after=first_incident_time_after, + first_incident_time_before=first_incident_time_before, + include_muted=include_muted, + integration_name=integration_name, + last_incident_time_after=last_incident_time_after, + last_incident_time_before=last_incident_time_before, + linked_account_id=linked_account_id, + page_size=page_size, + start_date=start_date, + status=status, + request_options=request_options, + ) + return _response.data + + async def retrieve(self, id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Issue: + """ + Get a specific issue. + + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + Issue + + + 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.knowledgebase.issues.retrieve( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.retrieve(id, request_options=request_options) + return _response.data diff --git a/src/merge/resources/knowledgebase/resources/issues/raw_client.py b/src/merge/resources/knowledgebase/resources/issues/raw_client.py new file mode 100644 index 00000000..c568a658 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/issues/raw_client.py @@ -0,0 +1,336 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.datetime_utils import serialize_datetime +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.jsonable_encoder import jsonable_encoder +from .....core.request_options import RequestOptions +from .....core.unchecked_base_model import construct_type +from ...types.issue import Issue +from ...types.paginated_issue_list import PaginatedIssueList +from .types.issues_list_request_status import IssuesListRequestStatus + + +class RawIssuesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + *, + account_token: typing.Optional[str] = None, + cursor: typing.Optional[str] = None, + end_date: typing.Optional[str] = None, + end_user_organization_name: typing.Optional[str] = None, + first_incident_time_after: typing.Optional[dt.datetime] = None, + first_incident_time_before: typing.Optional[dt.datetime] = None, + include_muted: typing.Optional[str] = None, + integration_name: typing.Optional[str] = None, + last_incident_time_after: typing.Optional[dt.datetime] = None, + last_incident_time_before: typing.Optional[dt.datetime] = None, + linked_account_id: typing.Optional[str] = None, + page_size: typing.Optional[int] = None, + start_date: typing.Optional[str] = None, + status: typing.Optional[IssuesListRequestStatus] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[PaginatedIssueList]: + """ + Gets all issues for Organization. + + Parameters + ---------- + account_token : typing.Optional[str] + + cursor : typing.Optional[str] + The pagination cursor value. + + end_date : typing.Optional[str] + If included, will only include issues whose most recent action occurred before this time + + end_user_organization_name : typing.Optional[str] + + first_incident_time_after : typing.Optional[dt.datetime] + If provided, will only return issues whose first incident time was after this datetime. + + first_incident_time_before : typing.Optional[dt.datetime] + If provided, will only return issues whose first incident time was before this datetime. + + include_muted : typing.Optional[str] + If true, will include muted issues + + integration_name : typing.Optional[str] + + last_incident_time_after : typing.Optional[dt.datetime] + If provided, will only return issues whose last incident time was after this datetime. + + last_incident_time_before : typing.Optional[dt.datetime] + If provided, will only return issues whose last incident time was before this datetime. + + linked_account_id : typing.Optional[str] + If provided, will only include issues pertaining to the linked account passed in. + + page_size : typing.Optional[int] + Number of results to return per page. + + start_date : typing.Optional[str] + If included, will only include issues whose most recent action occurred after this time + + status : typing.Optional[IssuesListRequestStatus] + Status of the issue. Options: ('ONGOING', 'RESOLVED') + + * `ONGOING` - ONGOING + * `RESOLVED` - RESOLVED + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[PaginatedIssueList] + + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/issues", + method="GET", + params={ + "account_token": account_token, + "cursor": cursor, + "end_date": end_date, + "end_user_organization_name": end_user_organization_name, + "first_incident_time_after": serialize_datetime(first_incident_time_after) + if first_incident_time_after is not None + else None, + "first_incident_time_before": serialize_datetime(first_incident_time_before) + if first_incident_time_before is not None + else None, + "include_muted": include_muted, + "integration_name": integration_name, + "last_incident_time_after": serialize_datetime(last_incident_time_after) + if last_incident_time_after is not None + else None, + "last_incident_time_before": serialize_datetime(last_incident_time_before) + if last_incident_time_before is not None + else None, + "linked_account_id": linked_account_id, + "page_size": page_size, + "start_date": start_date, + "status": status, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedIssueList, + construct_type( + type_=PaginatedIssueList, # 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, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[Issue]: + """ + Get a specific issue. + + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[Issue] + + """ + _response = self._client_wrapper.httpx_client.request( + f"knowledgebase/v1/issues/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + Issue, + construct_type( + type_=Issue, # 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) + + +class AsyncRawIssuesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + *, + account_token: typing.Optional[str] = None, + cursor: typing.Optional[str] = None, + end_date: typing.Optional[str] = None, + end_user_organization_name: typing.Optional[str] = None, + first_incident_time_after: typing.Optional[dt.datetime] = None, + first_incident_time_before: typing.Optional[dt.datetime] = None, + include_muted: typing.Optional[str] = None, + integration_name: typing.Optional[str] = None, + last_incident_time_after: typing.Optional[dt.datetime] = None, + last_incident_time_before: typing.Optional[dt.datetime] = None, + linked_account_id: typing.Optional[str] = None, + page_size: typing.Optional[int] = None, + start_date: typing.Optional[str] = None, + status: typing.Optional[IssuesListRequestStatus] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[PaginatedIssueList]: + """ + Gets all issues for Organization. + + Parameters + ---------- + account_token : typing.Optional[str] + + cursor : typing.Optional[str] + The pagination cursor value. + + end_date : typing.Optional[str] + If included, will only include issues whose most recent action occurred before this time + + end_user_organization_name : typing.Optional[str] + + first_incident_time_after : typing.Optional[dt.datetime] + If provided, will only return issues whose first incident time was after this datetime. + + first_incident_time_before : typing.Optional[dt.datetime] + If provided, will only return issues whose first incident time was before this datetime. + + include_muted : typing.Optional[str] + If true, will include muted issues + + integration_name : typing.Optional[str] + + last_incident_time_after : typing.Optional[dt.datetime] + If provided, will only return issues whose last incident time was after this datetime. + + last_incident_time_before : typing.Optional[dt.datetime] + If provided, will only return issues whose last incident time was before this datetime. + + linked_account_id : typing.Optional[str] + If provided, will only include issues pertaining to the linked account passed in. + + page_size : typing.Optional[int] + Number of results to return per page. + + start_date : typing.Optional[str] + If included, will only include issues whose most recent action occurred after this time + + status : typing.Optional[IssuesListRequestStatus] + Status of the issue. Options: ('ONGOING', 'RESOLVED') + + * `ONGOING` - ONGOING + * `RESOLVED` - RESOLVED + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[PaginatedIssueList] + + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/issues", + method="GET", + params={ + "account_token": account_token, + "cursor": cursor, + "end_date": end_date, + "end_user_organization_name": end_user_organization_name, + "first_incident_time_after": serialize_datetime(first_incident_time_after) + if first_incident_time_after is not None + else None, + "first_incident_time_before": serialize_datetime(first_incident_time_before) + if first_incident_time_before is not None + else None, + "include_muted": include_muted, + "integration_name": integration_name, + "last_incident_time_after": serialize_datetime(last_incident_time_after) + if last_incident_time_after is not None + else None, + "last_incident_time_before": serialize_datetime(last_incident_time_before) + if last_incident_time_before is not None + else None, + "linked_account_id": linked_account_id, + "page_size": page_size, + "start_date": start_date, + "status": status, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedIssueList, + construct_type( + type_=PaginatedIssueList, # 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, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[Issue]: + """ + Get a specific issue. + + Parameters + ---------- + id : str + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[Issue] + + """ + _response = await self._client_wrapper.httpx_client.request( + f"knowledgebase/v1/issues/{jsonable_encoder(id)}", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + Issue, + construct_type( + type_=Issue, # 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) diff --git a/src/merge/resources/knowledgebase/resources/issues/types/__init__.py b/src/merge/resources/knowledgebase/resources/issues/types/__init__.py new file mode 100644 index 00000000..88fbf977 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/issues/types/__init__.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .issues_list_request_status import IssuesListRequestStatus +_dynamic_imports: typing.Dict[str, str] = {"IssuesListRequestStatus": ".issues_list_request_status"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["IssuesListRequestStatus"] diff --git a/src/merge/resources/knowledgebase/resources/issues/types/issues_list_request_status.py b/src/merge/resources/knowledgebase/resources/issues/types/issues_list_request_status.py new file mode 100644 index 00000000..2bd3521e --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/issues/types/issues_list_request_status.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class IssuesListRequestStatus(str, enum.Enum): + ONGOING = "ONGOING" + RESOLVED = "RESOLVED" + + def visit(self, ongoing: typing.Callable[[], T_Result], resolved: typing.Callable[[], T_Result]) -> T_Result: + if self is IssuesListRequestStatus.ONGOING: + return ongoing() + if self is IssuesListRequestStatus.RESOLVED: + return resolved() diff --git a/src/merge/resources/knowledgebase/resources/link_token/__init__.py b/src/merge/resources/knowledgebase/resources/link_token/__init__.py new file mode 100644 index 00000000..3bad6adf --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/link_token/__init__.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import EndUserDetailsRequestLanguage +_dynamic_imports: typing.Dict[str, str] = {"EndUserDetailsRequestLanguage": ".types"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["EndUserDetailsRequestLanguage"] diff --git a/src/merge/resources/knowledgebase/resources/link_token/client.py b/src/merge/resources/knowledgebase/resources/link_token/client.py new file mode 100644 index 00000000..91cf9d2e --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/link_token/client.py @@ -0,0 +1,273 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from ...types.categories_enum import CategoriesEnum +from ...types.common_model_scopes_body_request import CommonModelScopesBodyRequest +from ...types.individual_common_model_scope_deserializer_request import IndividualCommonModelScopeDeserializerRequest +from ...types.link_token import LinkToken +from .raw_client import AsyncRawLinkTokenClient, RawLinkTokenClient +from .types.end_user_details_request_language import EndUserDetailsRequestLanguage + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class LinkTokenClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawLinkTokenClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawLinkTokenClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawLinkTokenClient + """ + return self._raw_client + + def create( + self, + *, + end_user_email_address: str, + end_user_organization_name: str, + end_user_origin_id: str, + categories: typing.Sequence[CategoriesEnum], + integration: typing.Optional[str] = OMIT, + link_expiry_mins: typing.Optional[int] = OMIT, + should_create_magic_link_url: typing.Optional[bool] = OMIT, + hide_admin_magic_link: typing.Optional[bool] = OMIT, + common_models: typing.Optional[typing.Sequence[CommonModelScopesBodyRequest]] = OMIT, + category_common_model_scopes: typing.Optional[ + typing.Dict[str, typing.Optional[typing.Sequence[IndividualCommonModelScopeDeserializerRequest]]] + ] = OMIT, + language: typing.Optional[EndUserDetailsRequestLanguage] = OMIT, + are_syncs_disabled: typing.Optional[bool] = OMIT, + integration_specific_config: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> LinkToken: + """ + Creates a link token to be used when linking a new end user. + + Parameters + ---------- + end_user_email_address : str + Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent. + + end_user_organization_name : str + Your end user's organization. + + end_user_origin_id : str + This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers. + + categories : typing.Sequence[CategoriesEnum] + The integration categories to show in Merge Link. + + integration : typing.Optional[str] + The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/. + + link_expiry_mins : typing.Optional[int] + An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30. + + should_create_magic_link_url : typing.Optional[bool] + Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + + hide_admin_magic_link : typing.Optional[bool] + Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + + common_models : typing.Optional[typing.Sequence[CommonModelScopesBodyRequest]] + An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. + + category_common_model_scopes : typing.Optional[typing.Dict[str, typing.Optional[typing.Sequence[IndividualCommonModelScopeDeserializerRequest]]]] + When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. + + language : typing.Optional[EndUserDetailsRequestLanguage] + The following subset of IETF language tags can be used to configure localization. + + * `en` - en + * `de` - de + + are_syncs_disabled : typing.Optional[bool] + The boolean that indicates whether initial, periodic, and force syncs will be disabled. + + integration_specific_config : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] + A JSON object containing integration-specific configuration options. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + LinkToken + + + Examples + -------- + from merge import Merge + from merge.resources.knowledgebase import CategoriesEnum + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.link_token.create( + end_user_email_address="example@gmail.com", + end_user_organization_name="Test Organization", + end_user_origin_id="12345", + categories=[CategoriesEnum.HRIS, CategoriesEnum.ATS], + ) + """ + _response = self._raw_client.create( + end_user_email_address=end_user_email_address, + end_user_organization_name=end_user_organization_name, + end_user_origin_id=end_user_origin_id, + categories=categories, + integration=integration, + link_expiry_mins=link_expiry_mins, + should_create_magic_link_url=should_create_magic_link_url, + hide_admin_magic_link=hide_admin_magic_link, + common_models=common_models, + category_common_model_scopes=category_common_model_scopes, + language=language, + are_syncs_disabled=are_syncs_disabled, + integration_specific_config=integration_specific_config, + request_options=request_options, + ) + return _response.data + + +class AsyncLinkTokenClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawLinkTokenClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawLinkTokenClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawLinkTokenClient + """ + return self._raw_client + + async def create( + self, + *, + end_user_email_address: str, + end_user_organization_name: str, + end_user_origin_id: str, + categories: typing.Sequence[CategoriesEnum], + integration: typing.Optional[str] = OMIT, + link_expiry_mins: typing.Optional[int] = OMIT, + should_create_magic_link_url: typing.Optional[bool] = OMIT, + hide_admin_magic_link: typing.Optional[bool] = OMIT, + common_models: typing.Optional[typing.Sequence[CommonModelScopesBodyRequest]] = OMIT, + category_common_model_scopes: typing.Optional[ + typing.Dict[str, typing.Optional[typing.Sequence[IndividualCommonModelScopeDeserializerRequest]]] + ] = OMIT, + language: typing.Optional[EndUserDetailsRequestLanguage] = OMIT, + are_syncs_disabled: typing.Optional[bool] = OMIT, + integration_specific_config: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> LinkToken: + """ + Creates a link token to be used when linking a new end user. + + Parameters + ---------- + end_user_email_address : str + Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent. + + end_user_organization_name : str + Your end user's organization. + + end_user_origin_id : str + This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers. + + categories : typing.Sequence[CategoriesEnum] + The integration categories to show in Merge Link. + + integration : typing.Optional[str] + The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/. + + link_expiry_mins : typing.Optional[int] + An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30. + + should_create_magic_link_url : typing.Optional[bool] + Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + + hide_admin_magic_link : typing.Optional[bool] + Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + + common_models : typing.Optional[typing.Sequence[CommonModelScopesBodyRequest]] + An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. + + category_common_model_scopes : typing.Optional[typing.Dict[str, typing.Optional[typing.Sequence[IndividualCommonModelScopeDeserializerRequest]]]] + When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. + + language : typing.Optional[EndUserDetailsRequestLanguage] + The following subset of IETF language tags can be used to configure localization. + + * `en` - en + * `de` - de + + are_syncs_disabled : typing.Optional[bool] + The boolean that indicates whether initial, periodic, and force syncs will be disabled. + + integration_specific_config : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] + A JSON object containing integration-specific configuration options. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + LinkToken + + + Examples + -------- + import asyncio + + from merge import AsyncMerge + from merge.resources.knowledgebase import CategoriesEnum + + client = AsyncMerge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.knowledgebase.link_token.create( + end_user_email_address="example@gmail.com", + end_user_organization_name="Test Organization", + end_user_origin_id="12345", + categories=[CategoriesEnum.HRIS, CategoriesEnum.ATS], + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.create( + end_user_email_address=end_user_email_address, + end_user_organization_name=end_user_organization_name, + end_user_origin_id=end_user_origin_id, + categories=categories, + integration=integration, + link_expiry_mins=link_expiry_mins, + should_create_magic_link_url=should_create_magic_link_url, + hide_admin_magic_link=hide_admin_magic_link, + common_models=common_models, + category_common_model_scopes=category_common_model_scopes, + language=language, + are_syncs_disabled=are_syncs_disabled, + integration_specific_config=integration_specific_config, + request_options=request_options, + ) + return _response.data diff --git a/src/merge/resources/knowledgebase/resources/link_token/raw_client.py b/src/merge/resources/knowledgebase/resources/link_token/raw_client.py new file mode 100644 index 00000000..95e153e2 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/link_token/raw_client.py @@ -0,0 +1,256 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.request_options import RequestOptions +from .....core.unchecked_base_model import construct_type +from ...types.categories_enum import CategoriesEnum +from ...types.common_model_scopes_body_request import CommonModelScopesBodyRequest +from ...types.individual_common_model_scope_deserializer_request import IndividualCommonModelScopeDeserializerRequest +from ...types.link_token import LinkToken +from .types.end_user_details_request_language import EndUserDetailsRequestLanguage + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RawLinkTokenClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def create( + self, + *, + end_user_email_address: str, + end_user_organization_name: str, + end_user_origin_id: str, + categories: typing.Sequence[CategoriesEnum], + integration: typing.Optional[str] = OMIT, + link_expiry_mins: typing.Optional[int] = OMIT, + should_create_magic_link_url: typing.Optional[bool] = OMIT, + hide_admin_magic_link: typing.Optional[bool] = OMIT, + common_models: typing.Optional[typing.Sequence[CommonModelScopesBodyRequest]] = OMIT, + category_common_model_scopes: typing.Optional[ + typing.Dict[str, typing.Optional[typing.Sequence[IndividualCommonModelScopeDeserializerRequest]]] + ] = OMIT, + language: typing.Optional[EndUserDetailsRequestLanguage] = OMIT, + are_syncs_disabled: typing.Optional[bool] = OMIT, + integration_specific_config: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[LinkToken]: + """ + Creates a link token to be used when linking a new end user. + + Parameters + ---------- + end_user_email_address : str + Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent. + + end_user_organization_name : str + Your end user's organization. + + end_user_origin_id : str + This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers. + + categories : typing.Sequence[CategoriesEnum] + The integration categories to show in Merge Link. + + integration : typing.Optional[str] + The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/. + + link_expiry_mins : typing.Optional[int] + An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30. + + should_create_magic_link_url : typing.Optional[bool] + Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + + hide_admin_magic_link : typing.Optional[bool] + Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + + common_models : typing.Optional[typing.Sequence[CommonModelScopesBodyRequest]] + An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. + + category_common_model_scopes : typing.Optional[typing.Dict[str, typing.Optional[typing.Sequence[IndividualCommonModelScopeDeserializerRequest]]]] + When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. + + language : typing.Optional[EndUserDetailsRequestLanguage] + The following subset of IETF language tags can be used to configure localization. + + * `en` - en + * `de` - de + + are_syncs_disabled : typing.Optional[bool] + The boolean that indicates whether initial, periodic, and force syncs will be disabled. + + integration_specific_config : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] + A JSON object containing integration-specific configuration options. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[LinkToken] + + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/link-token", + method="POST", + json={ + "end_user_email_address": end_user_email_address, + "end_user_organization_name": end_user_organization_name, + "end_user_origin_id": end_user_origin_id, + "categories": categories, + "integration": integration, + "link_expiry_mins": link_expiry_mins, + "should_create_magic_link_url": should_create_magic_link_url, + "hide_admin_magic_link": hide_admin_magic_link, + "common_models": common_models, + "category_common_model_scopes": category_common_model_scopes, + "language": language, + "are_syncs_disabled": are_syncs_disabled, + "integration_specific_config": integration_specific_config, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + LinkToken, + construct_type( + type_=LinkToken, # 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) + + +class AsyncRawLinkTokenClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def create( + self, + *, + end_user_email_address: str, + end_user_organization_name: str, + end_user_origin_id: str, + categories: typing.Sequence[CategoriesEnum], + integration: typing.Optional[str] = OMIT, + link_expiry_mins: typing.Optional[int] = OMIT, + should_create_magic_link_url: typing.Optional[bool] = OMIT, + hide_admin_magic_link: typing.Optional[bool] = OMIT, + common_models: typing.Optional[typing.Sequence[CommonModelScopesBodyRequest]] = OMIT, + category_common_model_scopes: typing.Optional[ + typing.Dict[str, typing.Optional[typing.Sequence[IndividualCommonModelScopeDeserializerRequest]]] + ] = OMIT, + language: typing.Optional[EndUserDetailsRequestLanguage] = OMIT, + are_syncs_disabled: typing.Optional[bool] = OMIT, + integration_specific_config: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[LinkToken]: + """ + Creates a link token to be used when linking a new end user. + + Parameters + ---------- + end_user_email_address : str + Your end user's email address. This is purely for identification purposes - setting this value will not cause any emails to be sent. + + end_user_organization_name : str + Your end user's organization. + + end_user_origin_id : str + This unique identifier typically represents the ID for your end user in your product's database. This value must be distinct from other Linked Accounts' unique identifiers. + + categories : typing.Sequence[CategoriesEnum] + The integration categories to show in Merge Link. + + integration : typing.Optional[str] + The slug of a specific pre-selected integration for this linking flow token. For examples of slugs, see https://docs.merge.dev/guides/merge-link/single-integration/. + + link_expiry_mins : typing.Optional[int] + An integer number of minutes between [30, 720 or 10080 if for a Magic Link URL] for how long this token is valid. Defaults to 30. + + should_create_magic_link_url : typing.Optional[bool] + Whether to generate a Magic Link URL. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + + hide_admin_magic_link : typing.Optional[bool] + Whether to generate a Magic Link URL on the Admin Needed screen during the linking flow. Defaults to false. For more information on Magic Link, see https://merge.dev/blog/integrations-fast-say-hello-to-magic-link. + + common_models : typing.Optional[typing.Sequence[CommonModelScopesBodyRequest]] + An array of objects to specify the models and fields that will be disabled for a given Linked Account. Each object uses model_id, enabled_actions, and disabled_fields to specify the model, method, and fields that are scoped for a given Linked Account. + + category_common_model_scopes : typing.Optional[typing.Dict[str, typing.Optional[typing.Sequence[IndividualCommonModelScopeDeserializerRequest]]]] + When creating a Link Token, you can set permissions for Common Models that will apply to the account that is going to be linked. Any model or field not specified in link token payload will default to existing settings. + + language : typing.Optional[EndUserDetailsRequestLanguage] + The following subset of IETF language tags can be used to configure localization. + + * `en` - en + * `de` - de + + are_syncs_disabled : typing.Optional[bool] + The boolean that indicates whether initial, periodic, and force syncs will be disabled. + + integration_specific_config : typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] + A JSON object containing integration-specific configuration options. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[LinkToken] + + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/link-token", + method="POST", + json={ + "end_user_email_address": end_user_email_address, + "end_user_organization_name": end_user_organization_name, + "end_user_origin_id": end_user_origin_id, + "categories": categories, + "integration": integration, + "link_expiry_mins": link_expiry_mins, + "should_create_magic_link_url": should_create_magic_link_url, + "hide_admin_magic_link": hide_admin_magic_link, + "common_models": common_models, + "category_common_model_scopes": category_common_model_scopes, + "language": language, + "are_syncs_disabled": are_syncs_disabled, + "integration_specific_config": integration_specific_config, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + LinkToken, + construct_type( + type_=LinkToken, # 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) diff --git a/src/merge/resources/knowledgebase/resources/link_token/types/__init__.py b/src/merge/resources/knowledgebase/resources/link_token/types/__init__.py new file mode 100644 index 00000000..e9a7d3b9 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/link_token/types/__init__.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .end_user_details_request_language import EndUserDetailsRequestLanguage +_dynamic_imports: typing.Dict[str, str] = {"EndUserDetailsRequestLanguage": ".end_user_details_request_language"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["EndUserDetailsRequestLanguage"] diff --git a/src/merge/resources/knowledgebase/resources/link_token/types/end_user_details_request_language.py b/src/merge/resources/knowledgebase/resources/link_token/types/end_user_details_request_language.py new file mode 100644 index 00000000..65c4b44a --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/link_token/types/end_user_details_request_language.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from ....types.language_enum import LanguageEnum + +EndUserDetailsRequestLanguage = typing.Union[LanguageEnum, str] diff --git a/src/merge/resources/knowledgebase/resources/linked_accounts/__init__.py b/src/merge/resources/knowledgebase/resources/linked_accounts/__init__.py new file mode 100644 index 00000000..0b9e42b4 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/linked_accounts/__init__.py @@ -0,0 +1,32 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .types import LinkedAccountsListRequestCategory +_dynamic_imports: typing.Dict[str, str] = {"LinkedAccountsListRequestCategory": ".types"} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["LinkedAccountsListRequestCategory"] diff --git a/src/merge/resources/knowledgebase/resources/linked_accounts/client.py b/src/merge/resources/knowledgebase/resources/linked_accounts/client.py new file mode 100644 index 00000000..53ef5fa2 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/linked_accounts/client.py @@ -0,0 +1,265 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from ...types.paginated_account_details_and_actions_list import PaginatedAccountDetailsAndActionsList +from .raw_client import AsyncRawLinkedAccountsClient, RawLinkedAccountsClient +from .types.linked_accounts_list_request_category import LinkedAccountsListRequestCategory + + +class LinkedAccountsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawLinkedAccountsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawLinkedAccountsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawLinkedAccountsClient + """ + return self._raw_client + + def list( + self, + *, + category: typing.Optional[LinkedAccountsListRequestCategory] = None, + cursor: typing.Optional[str] = None, + end_user_email_address: typing.Optional[str] = None, + end_user_organization_name: typing.Optional[str] = None, + end_user_origin_id: typing.Optional[str] = None, + end_user_origin_ids: typing.Optional[str] = None, + id: typing.Optional[str] = None, + ids: typing.Optional[str] = None, + include_duplicates: typing.Optional[bool] = None, + integration_name: typing.Optional[str] = None, + is_test_account: typing.Optional[str] = None, + page_size: typing.Optional[int] = None, + status: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedAccountDetailsAndActionsList: + """ + List linked accounts for your organization. + + Parameters + ---------- + category : typing.Optional[LinkedAccountsListRequestCategory] + Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `knowledgebase`, `mktg`, `ticketing` + + * `hris` - hris + * `ats` - ats + * `accounting` - accounting + * `ticketing` - ticketing + * `crm` - crm + * `mktg` - mktg + * `filestorage` - filestorage + * `knowledgebase` - knowledgebase + + cursor : typing.Optional[str] + The pagination cursor value. + + end_user_email_address : typing.Optional[str] + If provided, will only return linked accounts associated with the given email address. + + end_user_organization_name : typing.Optional[str] + If provided, will only return linked accounts associated with the given organization name. + + end_user_origin_id : typing.Optional[str] + If provided, will only return linked accounts associated with the given origin ID. + + end_user_origin_ids : typing.Optional[str] + Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. + + id : typing.Optional[str] + + ids : typing.Optional[str] + Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. + + include_duplicates : typing.Optional[bool] + If `true`, will include complete production duplicates of the account specified by the `id` query parameter in the response. `id` must be for a complete production linked account. + + integration_name : typing.Optional[str] + If provided, will only return linked accounts associated with the given integration name. + + is_test_account : typing.Optional[str] + If included, will only include test linked accounts. If not included, will only include non-test linked accounts. + + page_size : typing.Optional[int] + Number of results to return per page. + + status : typing.Optional[str] + Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, `RELINK_NEEDED` + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedAccountDetailsAndActionsList + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.linked_accounts.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ) + """ + _response = self._raw_client.list( + category=category, + cursor=cursor, + end_user_email_address=end_user_email_address, + end_user_organization_name=end_user_organization_name, + end_user_origin_id=end_user_origin_id, + end_user_origin_ids=end_user_origin_ids, + id=id, + ids=ids, + include_duplicates=include_duplicates, + integration_name=integration_name, + is_test_account=is_test_account, + page_size=page_size, + status=status, + request_options=request_options, + ) + return _response.data + + +class AsyncLinkedAccountsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawLinkedAccountsClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawLinkedAccountsClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawLinkedAccountsClient + """ + return self._raw_client + + async def list( + self, + *, + category: typing.Optional[LinkedAccountsListRequestCategory] = None, + cursor: typing.Optional[str] = None, + end_user_email_address: typing.Optional[str] = None, + end_user_organization_name: typing.Optional[str] = None, + end_user_origin_id: typing.Optional[str] = None, + end_user_origin_ids: typing.Optional[str] = None, + id: typing.Optional[str] = None, + ids: typing.Optional[str] = None, + include_duplicates: typing.Optional[bool] = None, + integration_name: typing.Optional[str] = None, + is_test_account: typing.Optional[str] = None, + page_size: typing.Optional[int] = None, + status: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedAccountDetailsAndActionsList: + """ + List linked accounts for your organization. + + Parameters + ---------- + category : typing.Optional[LinkedAccountsListRequestCategory] + Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `knowledgebase`, `mktg`, `ticketing` + + * `hris` - hris + * `ats` - ats + * `accounting` - accounting + * `ticketing` - ticketing + * `crm` - crm + * `mktg` - mktg + * `filestorage` - filestorage + * `knowledgebase` - knowledgebase + + cursor : typing.Optional[str] + The pagination cursor value. + + end_user_email_address : typing.Optional[str] + If provided, will only return linked accounts associated with the given email address. + + end_user_organization_name : typing.Optional[str] + If provided, will only return linked accounts associated with the given organization name. + + end_user_origin_id : typing.Optional[str] + If provided, will only return linked accounts associated with the given origin ID. + + end_user_origin_ids : typing.Optional[str] + Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. + + id : typing.Optional[str] + + ids : typing.Optional[str] + Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. + + include_duplicates : typing.Optional[bool] + If `true`, will include complete production duplicates of the account specified by the `id` query parameter in the response. `id` must be for a complete production linked account. + + integration_name : typing.Optional[str] + If provided, will only return linked accounts associated with the given integration name. + + is_test_account : typing.Optional[str] + If included, will only include test linked accounts. If not included, will only include non-test linked accounts. + + page_size : typing.Optional[int] + Number of results to return per page. + + status : typing.Optional[str] + Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, `RELINK_NEEDED` + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedAccountDetailsAndActionsList + + + 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.knowledgebase.linked_accounts.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.list( + category=category, + cursor=cursor, + end_user_email_address=end_user_email_address, + end_user_organization_name=end_user_organization_name, + end_user_origin_id=end_user_origin_id, + end_user_origin_ids=end_user_origin_ids, + id=id, + ids=ids, + include_duplicates=include_duplicates, + integration_name=integration_name, + is_test_account=is_test_account, + page_size=page_size, + status=status, + request_options=request_options, + ) + return _response.data diff --git a/src/merge/resources/knowledgebase/resources/linked_accounts/raw_client.py b/src/merge/resources/knowledgebase/resources/linked_accounts/raw_client.py new file mode 100644 index 00000000..85effb94 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/linked_accounts/raw_client.py @@ -0,0 +1,248 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.request_options import RequestOptions +from .....core.unchecked_base_model import construct_type +from ...types.paginated_account_details_and_actions_list import PaginatedAccountDetailsAndActionsList +from .types.linked_accounts_list_request_category import LinkedAccountsListRequestCategory + + +class RawLinkedAccountsClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + *, + category: typing.Optional[LinkedAccountsListRequestCategory] = None, + cursor: typing.Optional[str] = None, + end_user_email_address: typing.Optional[str] = None, + end_user_organization_name: typing.Optional[str] = None, + end_user_origin_id: typing.Optional[str] = None, + end_user_origin_ids: typing.Optional[str] = None, + id: typing.Optional[str] = None, + ids: typing.Optional[str] = None, + include_duplicates: typing.Optional[bool] = None, + integration_name: typing.Optional[str] = None, + is_test_account: typing.Optional[str] = None, + page_size: typing.Optional[int] = None, + status: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[PaginatedAccountDetailsAndActionsList]: + """ + List linked accounts for your organization. + + Parameters + ---------- + category : typing.Optional[LinkedAccountsListRequestCategory] + Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `knowledgebase`, `mktg`, `ticketing` + + * `hris` - hris + * `ats` - ats + * `accounting` - accounting + * `ticketing` - ticketing + * `crm` - crm + * `mktg` - mktg + * `filestorage` - filestorage + * `knowledgebase` - knowledgebase + + cursor : typing.Optional[str] + The pagination cursor value. + + end_user_email_address : typing.Optional[str] + If provided, will only return linked accounts associated with the given email address. + + end_user_organization_name : typing.Optional[str] + If provided, will only return linked accounts associated with the given organization name. + + end_user_origin_id : typing.Optional[str] + If provided, will only return linked accounts associated with the given origin ID. + + end_user_origin_ids : typing.Optional[str] + Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. + + id : typing.Optional[str] + + ids : typing.Optional[str] + Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. + + include_duplicates : typing.Optional[bool] + If `true`, will include complete production duplicates of the account specified by the `id` query parameter in the response. `id` must be for a complete production linked account. + + integration_name : typing.Optional[str] + If provided, will only return linked accounts associated with the given integration name. + + is_test_account : typing.Optional[str] + If included, will only include test linked accounts. If not included, will only include non-test linked accounts. + + page_size : typing.Optional[int] + Number of results to return per page. + + status : typing.Optional[str] + Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, `RELINK_NEEDED` + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[PaginatedAccountDetailsAndActionsList] + + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/linked-accounts", + method="GET", + params={ + "category": category, + "cursor": cursor, + "end_user_email_address": end_user_email_address, + "end_user_organization_name": end_user_organization_name, + "end_user_origin_id": end_user_origin_id, + "end_user_origin_ids": end_user_origin_ids, + "id": id, + "ids": ids, + "include_duplicates": include_duplicates, + "integration_name": integration_name, + "is_test_account": is_test_account, + "page_size": page_size, + "status": status, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedAccountDetailsAndActionsList, + construct_type( + type_=PaginatedAccountDetailsAndActionsList, # 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) + + +class AsyncRawLinkedAccountsClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + *, + category: typing.Optional[LinkedAccountsListRequestCategory] = None, + cursor: typing.Optional[str] = None, + end_user_email_address: typing.Optional[str] = None, + end_user_organization_name: typing.Optional[str] = None, + end_user_origin_id: typing.Optional[str] = None, + end_user_origin_ids: typing.Optional[str] = None, + id: typing.Optional[str] = None, + ids: typing.Optional[str] = None, + include_duplicates: typing.Optional[bool] = None, + integration_name: typing.Optional[str] = None, + is_test_account: typing.Optional[str] = None, + page_size: typing.Optional[int] = None, + status: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[PaginatedAccountDetailsAndActionsList]: + """ + List linked accounts for your organization. + + Parameters + ---------- + category : typing.Optional[LinkedAccountsListRequestCategory] + Options: `accounting`, `ats`, `crm`, `filestorage`, `hris`, `knowledgebase`, `mktg`, `ticketing` + + * `hris` - hris + * `ats` - ats + * `accounting` - accounting + * `ticketing` - ticketing + * `crm` - crm + * `mktg` - mktg + * `filestorage` - filestorage + * `knowledgebase` - knowledgebase + + cursor : typing.Optional[str] + The pagination cursor value. + + end_user_email_address : typing.Optional[str] + If provided, will only return linked accounts associated with the given email address. + + end_user_organization_name : typing.Optional[str] + If provided, will only return linked accounts associated with the given organization name. + + end_user_origin_id : typing.Optional[str] + If provided, will only return linked accounts associated with the given origin ID. + + end_user_origin_ids : typing.Optional[str] + Comma-separated list of EndUser origin IDs, making it possible to specify multiple EndUsers at once. + + id : typing.Optional[str] + + ids : typing.Optional[str] + Comma-separated list of LinkedAccount IDs, making it possible to specify multiple LinkedAccounts at once. + + include_duplicates : typing.Optional[bool] + If `true`, will include complete production duplicates of the account specified by the `id` query parameter in the response. `id` must be for a complete production linked account. + + integration_name : typing.Optional[str] + If provided, will only return linked accounts associated with the given integration name. + + is_test_account : typing.Optional[str] + If included, will only include test linked accounts. If not included, will only include non-test linked accounts. + + page_size : typing.Optional[int] + Number of results to return per page. + + status : typing.Optional[str] + Filter by status. Options: `COMPLETE`, `IDLE`, `INCOMPLETE`, `RELINK_NEEDED` + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[PaginatedAccountDetailsAndActionsList] + + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/linked-accounts", + method="GET", + params={ + "category": category, + "cursor": cursor, + "end_user_email_address": end_user_email_address, + "end_user_organization_name": end_user_organization_name, + "end_user_origin_id": end_user_origin_id, + "end_user_origin_ids": end_user_origin_ids, + "id": id, + "ids": ids, + "include_duplicates": include_duplicates, + "integration_name": integration_name, + "is_test_account": is_test_account, + "page_size": page_size, + "status": status, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedAccountDetailsAndActionsList, + construct_type( + type_=PaginatedAccountDetailsAndActionsList, # 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) diff --git a/src/merge/resources/knowledgebase/resources/linked_accounts/types/__init__.py b/src/merge/resources/knowledgebase/resources/linked_accounts/types/__init__.py new file mode 100644 index 00000000..a28f38cc --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/linked_accounts/types/__init__.py @@ -0,0 +1,34 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .linked_accounts_list_request_category import LinkedAccountsListRequestCategory +_dynamic_imports: typing.Dict[str, str] = { + "LinkedAccountsListRequestCategory": ".linked_accounts_list_request_category" +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["LinkedAccountsListRequestCategory"] diff --git a/src/merge/resources/knowledgebase/resources/linked_accounts/types/linked_accounts_list_request_category.py b/src/merge/resources/knowledgebase/resources/linked_accounts/types/linked_accounts_list_request_category.py new file mode 100644 index 00000000..681fe8ce --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/linked_accounts/types/linked_accounts_list_request_category.py @@ -0,0 +1,45 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class LinkedAccountsListRequestCategory(str, enum.Enum): + ACCOUNTING = "accounting" + ATS = "ats" + CRM = "crm" + FILESTORAGE = "filestorage" + HRIS = "hris" + KNOWLEDGEBASE = "knowledgebase" + MKTG = "mktg" + TICKETING = "ticketing" + + def visit( + self, + accounting: typing.Callable[[], T_Result], + ats: typing.Callable[[], T_Result], + crm: typing.Callable[[], T_Result], + filestorage: typing.Callable[[], T_Result], + hris: typing.Callable[[], T_Result], + knowledgebase: typing.Callable[[], T_Result], + mktg: typing.Callable[[], T_Result], + ticketing: typing.Callable[[], T_Result], + ) -> T_Result: + if self is LinkedAccountsListRequestCategory.ACCOUNTING: + return accounting() + if self is LinkedAccountsListRequestCategory.ATS: + return ats() + if self is LinkedAccountsListRequestCategory.CRM: + return crm() + if self is LinkedAccountsListRequestCategory.FILESTORAGE: + return filestorage() + if self is LinkedAccountsListRequestCategory.HRIS: + return hris() + if self is LinkedAccountsListRequestCategory.KNOWLEDGEBASE: + return knowledgebase() + if self is LinkedAccountsListRequestCategory.MKTG: + return mktg() + if self is LinkedAccountsListRequestCategory.TICKETING: + return ticketing() diff --git a/src/merge/resources/knowledgebase/resources/passthrough/__init__.py b/src/merge/resources/knowledgebase/resources/passthrough/__init__.py new file mode 100644 index 00000000..5cde0202 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/passthrough/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/merge/resources/knowledgebase/resources/passthrough/client.py b/src/merge/resources/knowledgebase/resources/passthrough/client.py new file mode 100644 index 00000000..05d560f1 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/passthrough/client.py @@ -0,0 +1,126 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from ...types.data_passthrough_request import DataPassthroughRequest +from ...types.remote_response import RemoteResponse +from .raw_client import AsyncRawPassthroughClient, RawPassthroughClient + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class PassthroughClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawPassthroughClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawPassthroughClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawPassthroughClient + """ + return self._raw_client + + def create( + self, *, request: DataPassthroughRequest, request_options: typing.Optional[RequestOptions] = None + ) -> RemoteResponse: + """ + Pull data from an endpoint not currently supported by Merge. + + Parameters + ---------- + request : DataPassthroughRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + RemoteResponse + + + Examples + -------- + from merge import Merge + from merge.resources.knowledgebase import DataPassthroughRequest, MethodEnum + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.passthrough.create( + request=DataPassthroughRequest( + method=MethodEnum.GET, + path="/scooters", + ), + ) + """ + _response = self._raw_client.create(request=request, request_options=request_options) + return _response.data + + +class AsyncPassthroughClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawPassthroughClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawPassthroughClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawPassthroughClient + """ + return self._raw_client + + async def create( + self, *, request: DataPassthroughRequest, request_options: typing.Optional[RequestOptions] = None + ) -> RemoteResponse: + """ + Pull data from an endpoint not currently supported by Merge. + + Parameters + ---------- + request : DataPassthroughRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + RemoteResponse + + + Examples + -------- + import asyncio + + from merge import AsyncMerge + from merge.resources.knowledgebase import DataPassthroughRequest, MethodEnum + + client = AsyncMerge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.knowledgebase.passthrough.create( + request=DataPassthroughRequest( + method=MethodEnum.GET, + path="/scooters", + ), + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.create(request=request, request_options=request_options) + return _response.data diff --git a/src/merge/resources/knowledgebase/resources/passthrough/raw_client.py b/src/merge/resources/knowledgebase/resources/passthrough/raw_client.py new file mode 100644 index 00000000..84c8bfdf --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/passthrough/raw_client.py @@ -0,0 +1,111 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.request_options import RequestOptions +from .....core.unchecked_base_model import construct_type +from ...types.data_passthrough_request import DataPassthroughRequest +from ...types.remote_response import RemoteResponse + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RawPassthroughClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def create( + self, *, request: DataPassthroughRequest, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[RemoteResponse]: + """ + Pull data from an endpoint not currently supported by Merge. + + Parameters + ---------- + request : DataPassthroughRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[RemoteResponse] + + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/passthrough", + method="POST", + json=request, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + RemoteResponse, + construct_type( + type_=RemoteResponse, # 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) + + +class AsyncRawPassthroughClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def create( + self, *, request: DataPassthroughRequest, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[RemoteResponse]: + """ + Pull data from an endpoint not currently supported by Merge. + + Parameters + ---------- + request : DataPassthroughRequest + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[RemoteResponse] + + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/passthrough", + method="POST", + json=request, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + RemoteResponse, + construct_type( + type_=RemoteResponse, # 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) diff --git a/src/merge/resources/knowledgebase/resources/regenerate_key/__init__.py b/src/merge/resources/knowledgebase/resources/regenerate_key/__init__.py new file mode 100644 index 00000000..5cde0202 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/regenerate_key/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/merge/resources/knowledgebase/resources/regenerate_key/client.py b/src/merge/resources/knowledgebase/resources/regenerate_key/client.py new file mode 100644 index 00000000..a9417d74 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/regenerate_key/client.py @@ -0,0 +1,115 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from ...types.remote_key import RemoteKey +from .raw_client import AsyncRawRegenerateKeyClient, RawRegenerateKeyClient + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RegenerateKeyClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawRegenerateKeyClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawRegenerateKeyClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawRegenerateKeyClient + """ + return self._raw_client + + def create(self, *, name: str, request_options: typing.Optional[RequestOptions] = None) -> RemoteKey: + """ + Exchange remote keys. + + Parameters + ---------- + name : str + The name of the remote key + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + RemoteKey + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.regenerate_key.create( + name="Remote Deployment Key 1", + ) + """ + _response = self._raw_client.create(name=name, request_options=request_options) + return _response.data + + +class AsyncRegenerateKeyClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawRegenerateKeyClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawRegenerateKeyClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawRegenerateKeyClient + """ + return self._raw_client + + async def create(self, *, name: str, request_options: typing.Optional[RequestOptions] = None) -> RemoteKey: + """ + Exchange remote keys. + + Parameters + ---------- + name : str + The name of the remote key + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + RemoteKey + + + 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.knowledgebase.regenerate_key.create( + name="Remote Deployment Key 1", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.create(name=name, request_options=request_options) + return _response.data diff --git a/src/merge/resources/knowledgebase/resources/regenerate_key/raw_client.py b/src/merge/resources/knowledgebase/resources/regenerate_key/raw_client.py new file mode 100644 index 00000000..40114afa --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/regenerate_key/raw_client.py @@ -0,0 +1,114 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.request_options import RequestOptions +from .....core.unchecked_base_model import construct_type +from ...types.remote_key import RemoteKey + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RawRegenerateKeyClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def create(self, *, name: str, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[RemoteKey]: + """ + Exchange remote keys. + + Parameters + ---------- + name : str + The name of the remote key + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[RemoteKey] + + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/regenerate-key", + method="POST", + json={ + "name": name, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + RemoteKey, + construct_type( + type_=RemoteKey, # 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) + + +class AsyncRawRegenerateKeyClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def create( + self, *, name: str, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[RemoteKey]: + """ + Exchange remote keys. + + Parameters + ---------- + name : str + The name of the remote key + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[RemoteKey] + + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/regenerate-key", + method="POST", + json={ + "name": name, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + RemoteKey, + construct_type( + type_=RemoteKey, # 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) diff --git a/src/merge/resources/knowledgebase/resources/scopes/__init__.py b/src/merge/resources/knowledgebase/resources/scopes/__init__.py new file mode 100644 index 00000000..5cde0202 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/scopes/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/merge/resources/knowledgebase/resources/scopes/client.py b/src/merge/resources/knowledgebase/resources/scopes/client.py new file mode 100644 index 00000000..9cc148ee --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/scopes/client.py @@ -0,0 +1,320 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from ...types.common_model_scope_api import CommonModelScopeApi +from ...types.individual_common_model_scope_deserializer_request import IndividualCommonModelScopeDeserializerRequest +from .raw_client import AsyncRawScopesClient, RawScopesClient + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class ScopesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawScopesClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawScopesClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawScopesClient + """ + return self._raw_client + + def default_scopes_retrieve( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> CommonModelScopeApi: + """ + Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonModelScopeApi + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.scopes.default_scopes_retrieve() + """ + _response = self._raw_client.default_scopes_retrieve(request_options=request_options) + return _response.data + + def linked_account_scopes_retrieve( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> CommonModelScopeApi: + """ + Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonModelScopeApi + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.scopes.linked_account_scopes_retrieve() + """ + _response = self._raw_client.linked_account_scopes_retrieve(request_options=request_options) + return _response.data + + def linked_account_scopes_create( + self, + *, + common_models: typing.Sequence[IndividualCommonModelScopeDeserializerRequest], + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonModelScopeApi: + """ + Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes) + + Parameters + ---------- + common_models : typing.Sequence[IndividualCommonModelScopeDeserializerRequest] + The common models you want to update the scopes for + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonModelScopeApi + + + Examples + -------- + from merge import Merge + from merge.resources.knowledgebase import ( + FieldPermissionDeserializerRequest, + IndividualCommonModelScopeDeserializerRequest, + ModelPermissionDeserializerRequest, + ) + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.scopes.linked_account_scopes_create( + common_models=[ + IndividualCommonModelScopeDeserializerRequest( + model_name="Employee", + model_permissions={ + "READ": ModelPermissionDeserializerRequest( + is_enabled=True, + ), + "WRITE": ModelPermissionDeserializerRequest( + is_enabled=False, + ), + }, + field_permissions=FieldPermissionDeserializerRequest( + enabled_fields=["avatar", "home_location"], + disabled_fields=["work_location"], + ), + ), + IndividualCommonModelScopeDeserializerRequest( + model_name="Benefit", + model_permissions={ + "WRITE": ModelPermissionDeserializerRequest( + is_enabled=False, + ) + }, + ), + ], + ) + """ + _response = self._raw_client.linked_account_scopes_create( + common_models=common_models, request_options=request_options + ) + return _response.data + + +class AsyncScopesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawScopesClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawScopesClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawScopesClient + """ + return self._raw_client + + async def default_scopes_retrieve( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> CommonModelScopeApi: + """ + Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonModelScopeApi + + + 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.knowledgebase.scopes.default_scopes_retrieve() + + + asyncio.run(main()) + """ + _response = await self._raw_client.default_scopes_retrieve(request_options=request_options) + return _response.data + + async def linked_account_scopes_retrieve( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> CommonModelScopeApi: + """ + Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonModelScopeApi + + + 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.knowledgebase.scopes.linked_account_scopes_retrieve() + + + asyncio.run(main()) + """ + _response = await self._raw_client.linked_account_scopes_retrieve(request_options=request_options) + return _response.data + + async def linked_account_scopes_create( + self, + *, + common_models: typing.Sequence[IndividualCommonModelScopeDeserializerRequest], + request_options: typing.Optional[RequestOptions] = None, + ) -> CommonModelScopeApi: + """ + Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes) + + Parameters + ---------- + common_models : typing.Sequence[IndividualCommonModelScopeDeserializerRequest] + The common models you want to update the scopes for + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + CommonModelScopeApi + + + Examples + -------- + import asyncio + + from merge import AsyncMerge + from merge.resources.knowledgebase import ( + FieldPermissionDeserializerRequest, + IndividualCommonModelScopeDeserializerRequest, + ModelPermissionDeserializerRequest, + ) + + client = AsyncMerge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + + + async def main() -> None: + await client.knowledgebase.scopes.linked_account_scopes_create( + common_models=[ + IndividualCommonModelScopeDeserializerRequest( + model_name="Employee", + model_permissions={ + "READ": ModelPermissionDeserializerRequest( + is_enabled=True, + ), + "WRITE": ModelPermissionDeserializerRequest( + is_enabled=False, + ), + }, + field_permissions=FieldPermissionDeserializerRequest( + enabled_fields=["avatar", "home_location"], + disabled_fields=["work_location"], + ), + ), + IndividualCommonModelScopeDeserializerRequest( + model_name="Benefit", + model_permissions={ + "WRITE": ModelPermissionDeserializerRequest( + is_enabled=False, + ) + }, + ), + ], + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.linked_account_scopes_create( + common_models=common_models, request_options=request_options + ) + return _response.data diff --git a/src/merge/resources/knowledgebase/resources/scopes/raw_client.py b/src/merge/resources/knowledgebase/resources/scopes/raw_client.py new file mode 100644 index 00000000..c9ae8287 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/scopes/raw_client.py @@ -0,0 +1,267 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.request_options import RequestOptions +from .....core.unchecked_base_model import construct_type +from ...types.common_model_scope_api import CommonModelScopeApi +from ...types.individual_common_model_scope_deserializer_request import IndividualCommonModelScopeDeserializerRequest + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RawScopesClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def default_scopes_retrieve( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[CommonModelScopeApi]: + """ + Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[CommonModelScopeApi] + + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/default-scopes", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + CommonModelScopeApi, + construct_type( + type_=CommonModelScopeApi, # 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 linked_account_scopes_retrieve( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[CommonModelScopeApi]: + """ + Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[CommonModelScopeApi] + + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/linked-account-scopes", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + CommonModelScopeApi, + construct_type( + type_=CommonModelScopeApi, # 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 linked_account_scopes_create( + self, + *, + common_models: typing.Sequence[IndividualCommonModelScopeDeserializerRequest], + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[CommonModelScopeApi]: + """ + Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes) + + Parameters + ---------- + common_models : typing.Sequence[IndividualCommonModelScopeDeserializerRequest] + The common models you want to update the scopes for + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[CommonModelScopeApi] + + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/linked-account-scopes", + method="POST", + json={ + "common_models": common_models, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + CommonModelScopeApi, + construct_type( + type_=CommonModelScopeApi, # 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) + + +class AsyncRawScopesClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def default_scopes_retrieve( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[CommonModelScopeApi]: + """ + Get the default permissions for Merge Common Models and fields across all Linked Accounts of a given category. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[CommonModelScopeApi] + + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/default-scopes", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + CommonModelScopeApi, + construct_type( + type_=CommonModelScopeApi, # 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 linked_account_scopes_retrieve( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[CommonModelScopeApi]: + """ + Get all available permissions for Merge Common Models and fields for a single Linked Account. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes). + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[CommonModelScopeApi] + + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/linked-account-scopes", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + CommonModelScopeApi, + construct_type( + type_=CommonModelScopeApi, # 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 linked_account_scopes_create( + self, + *, + common_models: typing.Sequence[IndividualCommonModelScopeDeserializerRequest], + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[CommonModelScopeApi]: + """ + Update permissions for any Common Model or field for a single Linked Account. Any Scopes not set in this POST request will inherit the default Scopes. [Learn more](https://help.merge.dev/en/articles/5950052-common-model-and-field-scopes) + + Parameters + ---------- + common_models : typing.Sequence[IndividualCommonModelScopeDeserializerRequest] + The common models you want to update the scopes for + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[CommonModelScopeApi] + + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/linked-account-scopes", + method="POST", + json={ + "common_models": common_models, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + CommonModelScopeApi, + construct_type( + type_=CommonModelScopeApi, # 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) diff --git a/src/merge/resources/knowledgebase/resources/sync_status/__init__.py b/src/merge/resources/knowledgebase/resources/sync_status/__init__.py new file mode 100644 index 00000000..5cde0202 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/sync_status/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/merge/resources/knowledgebase/resources/sync_status/client.py b/src/merge/resources/knowledgebase/resources/sync_status/client.py new file mode 100644 index 00000000..1d2aa5e9 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/sync_status/client.py @@ -0,0 +1,130 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from ...types.paginated_sync_status_list import PaginatedSyncStatusList +from .raw_client import AsyncRawSyncStatusClient, RawSyncStatusClient + + +class SyncStatusClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawSyncStatusClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawSyncStatusClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawSyncStatusClient + """ + return self._raw_client + + def list( + self, + *, + cursor: typing.Optional[str] = None, + page_size: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedSyncStatusList: + """ + Get sync status for the current sync and the most recently finished sync. `last_sync_start` represents the most recent time any sync began. `last_sync_finished` represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the `last_sync_finished` timestamp where `last_sync_result` is `DONE`. Possible values for `status` and `last_sync_result` are `DISABLED`, `DONE`, `FAILED`, `PARTIALLY_SYNCED`, `PAUSED`, `SYNCING`. Learn more about sync status in our [Help Center](https://help.merge.dev/en/articles/8184193-merge-sync-statuses). + + Parameters + ---------- + cursor : typing.Optional[str] + The pagination cursor value. + + page_size : typing.Optional[int] + Number of results to return per page. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedSyncStatusList + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.sync_status.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ) + """ + _response = self._raw_client.list(cursor=cursor, page_size=page_size, request_options=request_options) + return _response.data + + +class AsyncSyncStatusClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawSyncStatusClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawSyncStatusClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawSyncStatusClient + """ + return self._raw_client + + async def list( + self, + *, + cursor: typing.Optional[str] = None, + page_size: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedSyncStatusList: + """ + Get sync status for the current sync and the most recently finished sync. `last_sync_start` represents the most recent time any sync began. `last_sync_finished` represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the `last_sync_finished` timestamp where `last_sync_result` is `DONE`. Possible values for `status` and `last_sync_result` are `DISABLED`, `DONE`, `FAILED`, `PARTIALLY_SYNCED`, `PAUSED`, `SYNCING`. Learn more about sync status in our [Help Center](https://help.merge.dev/en/articles/8184193-merge-sync-statuses). + + Parameters + ---------- + cursor : typing.Optional[str] + The pagination cursor value. + + page_size : typing.Optional[int] + Number of results to return per page. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedSyncStatusList + + + 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.knowledgebase.sync_status.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.list(cursor=cursor, page_size=page_size, request_options=request_options) + return _response.data diff --git a/src/merge/resources/knowledgebase/resources/sync_status/raw_client.py b/src/merge/resources/knowledgebase/resources/sync_status/raw_client.py new file mode 100644 index 00000000..d19287b2 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/sync_status/raw_client.py @@ -0,0 +1,121 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.request_options import RequestOptions +from .....core.unchecked_base_model import construct_type +from ...types.paginated_sync_status_list import PaginatedSyncStatusList + + +class RawSyncStatusClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + *, + cursor: typing.Optional[str] = None, + page_size: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[PaginatedSyncStatusList]: + """ + Get sync status for the current sync and the most recently finished sync. `last_sync_start` represents the most recent time any sync began. `last_sync_finished` represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the `last_sync_finished` timestamp where `last_sync_result` is `DONE`. Possible values for `status` and `last_sync_result` are `DISABLED`, `DONE`, `FAILED`, `PARTIALLY_SYNCED`, `PAUSED`, `SYNCING`. Learn more about sync status in our [Help Center](https://help.merge.dev/en/articles/8184193-merge-sync-statuses). + + Parameters + ---------- + cursor : typing.Optional[str] + The pagination cursor value. + + page_size : typing.Optional[int] + Number of results to return per page. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[PaginatedSyncStatusList] + + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/sync-status", + method="GET", + params={ + "cursor": cursor, + "page_size": page_size, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedSyncStatusList, + construct_type( + type_=PaginatedSyncStatusList, # 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) + + +class AsyncRawSyncStatusClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + *, + cursor: typing.Optional[str] = None, + page_size: typing.Optional[int] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[PaginatedSyncStatusList]: + """ + Get sync status for the current sync and the most recently finished sync. `last_sync_start` represents the most recent time any sync began. `last_sync_finished` represents the most recent time any sync completed. These timestamps may correspond to different sync instances which may result in a sync start time being later than a separate sync completed time. To ensure you are retrieving the latest available data reference the `last_sync_finished` timestamp where `last_sync_result` is `DONE`. Possible values for `status` and `last_sync_result` are `DISABLED`, `DONE`, `FAILED`, `PARTIALLY_SYNCED`, `PAUSED`, `SYNCING`. Learn more about sync status in our [Help Center](https://help.merge.dev/en/articles/8184193-merge-sync-statuses). + + Parameters + ---------- + cursor : typing.Optional[str] + The pagination cursor value. + + page_size : typing.Optional[int] + Number of results to return per page. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[PaginatedSyncStatusList] + + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/sync-status", + method="GET", + params={ + "cursor": cursor, + "page_size": page_size, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedSyncStatusList, + construct_type( + type_=PaginatedSyncStatusList, # 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) diff --git a/src/merge/resources/knowledgebase/resources/users/__init__.py b/src/merge/resources/knowledgebase/resources/users/__init__.py new file mode 100644 index 00000000..5cde0202 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/users/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/merge/resources/knowledgebase/resources/users/client.py b/src/merge/resources/knowledgebase/resources/users/client.py new file mode 100644 index 00000000..8ac8e82c --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/users/client.py @@ -0,0 +1,326 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from ...types.paginated_user_list import PaginatedUserList +from ...types.user import User +from .raw_client import AsyncRawUsersClient, RawUsersClient + + +class UsersClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawUsersClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawUsersClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawUsersClient + """ + return self._raw_client + + def list( + self, + *, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, + cursor: typing.Optional[str] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, + page_size: typing.Optional[int] = None, + remote_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedUserList: + """ + Returns a list of `User` objects. + + Parameters + ---------- + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + + cursor : typing.Optional[str] + The pagination cursor value. + + 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). + + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + + page_size : typing.Optional[int] + Number of results to return per page. + + remote_id : typing.Optional[str] + The API provider's ID for the given object. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedUserList + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.users.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ) + """ + _response = self._raw_client.list( + created_after=created_after, + created_before=created_before, + cursor=cursor, + include_deleted_data=include_deleted_data, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + modified_after=modified_after, + modified_before=modified_before, + page_size=page_size, + remote_id=remote_id, + request_options=request_options, + ) + return _response.data + + def retrieve( + self, + id: str, + *, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> User: + """ + Returns a `User` object with the given `id`. + + Parameters + ---------- + id : str + + 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). + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + User + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.users.retrieve( + id="id", + ) + """ + _response = self._raw_client.retrieve( + id, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + request_options=request_options, + ) + return _response.data + + +class AsyncUsersClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawUsersClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawUsersClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawUsersClient + """ + return self._raw_client + + async def list( + self, + *, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, + cursor: typing.Optional[str] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, + page_size: typing.Optional[int] = None, + remote_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> PaginatedUserList: + """ + Returns a list of `User` objects. + + Parameters + ---------- + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + + cursor : typing.Optional[str] + The pagination cursor value. + + 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). + + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + + page_size : typing.Optional[int] + Number of results to return per page. + + remote_id : typing.Optional[str] + The API provider's ID for the given object. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + PaginatedUserList + + + 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.knowledgebase.users.list( + cursor="cD0yMDIxLTAxLTA2KzAzJTNBMjQlM0E1My40MzQzMjYlMkIwMCUzQTAw", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.list( + created_after=created_after, + created_before=created_before, + cursor=cursor, + include_deleted_data=include_deleted_data, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + modified_after=modified_after, + modified_before=modified_before, + page_size=page_size, + remote_id=remote_id, + request_options=request_options, + ) + return _response.data + + async def retrieve( + self, + id: str, + *, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> User: + """ + Returns a `User` object with the given `id`. + + Parameters + ---------- + id : str + + 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). + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + User + + + 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.knowledgebase.users.retrieve( + id="id", + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.retrieve( + id, + include_remote_data=include_remote_data, + include_shell_data=include_shell_data, + request_options=request_options, + ) + return _response.data diff --git a/src/merge/resources/knowledgebase/resources/users/raw_client.py b/src/merge/resources/knowledgebase/resources/users/raw_client.py new file mode 100644 index 00000000..c44e59f5 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/users/raw_client.py @@ -0,0 +1,311 @@ +# This file was auto-generated by Fern from our API Definition. + +import datetime as dt +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.datetime_utils import serialize_datetime +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.jsonable_encoder import jsonable_encoder +from .....core.request_options import RequestOptions +from .....core.unchecked_base_model import construct_type +from ...types.paginated_user_list import PaginatedUserList +from ...types.user import User + + +class RawUsersClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, + *, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, + cursor: typing.Optional[str] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, + page_size: typing.Optional[int] = None, + remote_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[PaginatedUserList]: + """ + Returns a list of `User` objects. + + Parameters + ---------- + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + + cursor : typing.Optional[str] + The pagination cursor value. + + 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). + + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + + page_size : typing.Optional[int] + Number of results to return per page. + + remote_id : typing.Optional[str] + The API provider's ID for the given object. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[PaginatedUserList] + + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/users", + method="GET", + params={ + "created_after": serialize_datetime(created_after) if created_after is not None else None, + "created_before": serialize_datetime(created_before) if created_before is not None else None, + "cursor": cursor, + "include_deleted_data": include_deleted_data, + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + "modified_after": serialize_datetime(modified_after) if modified_after is not None else None, + "modified_before": serialize_datetime(modified_before) if modified_before is not None else None, + "page_size": page_size, + "remote_id": remote_id, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedUserList, + construct_type( + type_=PaginatedUserList, # 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, + *, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[User]: + """ + Returns a `User` object with the given `id`. + + Parameters + ---------- + id : str + + 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). + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[User] + + """ + _response = self._client_wrapper.httpx_client.request( + f"knowledgebase/v1/users/{jsonable_encoder(id)}", + method="GET", + params={ + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + User, + construct_type( + type_=User, # 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) + + +class AsyncRawUsersClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, + *, + created_after: typing.Optional[dt.datetime] = None, + created_before: typing.Optional[dt.datetime] = None, + cursor: typing.Optional[str] = None, + include_deleted_data: typing.Optional[bool] = None, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + modified_after: typing.Optional[dt.datetime] = None, + modified_before: typing.Optional[dt.datetime] = None, + page_size: typing.Optional[int] = None, + remote_id: typing.Optional[str] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[PaginatedUserList]: + """ + Returns a list of `User` objects. + + Parameters + ---------- + created_after : typing.Optional[dt.datetime] + If provided, will only return objects created after this datetime. + + created_before : typing.Optional[dt.datetime] + If provided, will only return objects created before this datetime. + + cursor : typing.Optional[str] + The pagination cursor value. + + 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). + + modified_after : typing.Optional[dt.datetime] + If provided, only objects synced by Merge after this date time will be returned. + + modified_before : typing.Optional[dt.datetime] + If provided, only objects synced by Merge before this date time will be returned. + + page_size : typing.Optional[int] + Number of results to return per page. + + remote_id : typing.Optional[str] + The API provider's ID for the given object. + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[PaginatedUserList] + + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/users", + method="GET", + params={ + "created_after": serialize_datetime(created_after) if created_after is not None else None, + "created_before": serialize_datetime(created_before) if created_before is not None else None, + "cursor": cursor, + "include_deleted_data": include_deleted_data, + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + "modified_after": serialize_datetime(modified_after) if modified_after is not None else None, + "modified_before": serialize_datetime(modified_before) if modified_before is not None else None, + "page_size": page_size, + "remote_id": remote_id, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + PaginatedUserList, + construct_type( + type_=PaginatedUserList, # 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, + *, + include_remote_data: typing.Optional[bool] = None, + include_shell_data: typing.Optional[bool] = None, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[User]: + """ + Returns a `User` object with the given `id`. + + Parameters + ---------- + id : str + + 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). + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[User] + + """ + _response = await self._client_wrapper.httpx_client.request( + f"knowledgebase/v1/users/{jsonable_encoder(id)}", + method="GET", + params={ + "include_remote_data": include_remote_data, + "include_shell_data": include_shell_data, + }, + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + User, + construct_type( + type_=User, # 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) diff --git a/src/merge/resources/knowledgebase/resources/webhook_receivers/__init__.py b/src/merge/resources/knowledgebase/resources/webhook_receivers/__init__.py new file mode 100644 index 00000000..5cde0202 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/webhook_receivers/__init__.py @@ -0,0 +1,4 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + diff --git a/src/merge/resources/knowledgebase/resources/webhook_receivers/client.py b/src/merge/resources/knowledgebase/resources/webhook_receivers/client.py new file mode 100644 index 00000000..f7626d94 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/webhook_receivers/client.py @@ -0,0 +1,201 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.request_options import RequestOptions +from ...types.webhook_receiver import WebhookReceiver +from .raw_client import AsyncRawWebhookReceiversClient, RawWebhookReceiversClient + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class WebhookReceiversClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._raw_client = RawWebhookReceiversClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> RawWebhookReceiversClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + RawWebhookReceiversClient + """ + return self._raw_client + + def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[WebhookReceiver]: + """ + Returns a list of `WebhookReceiver` objects. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[WebhookReceiver] + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.webhook_receivers.list() + """ + _response = self._raw_client.list(request_options=request_options) + return _response.data + + def create( + self, + *, + event: str, + is_active: bool, + key: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> WebhookReceiver: + """ + Creates a `WebhookReceiver` object with the given values. + + Parameters + ---------- + event : str + + is_active : bool + + key : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + WebhookReceiver + + + Examples + -------- + from merge import Merge + + client = Merge( + account_token="YOUR_ACCOUNT_TOKEN", + api_key="YOUR_API_KEY", + ) + client.knowledgebase.webhook_receivers.create( + event="event", + is_active=True, + ) + """ + _response = self._raw_client.create(event=event, is_active=is_active, key=key, request_options=request_options) + return _response.data + + +class AsyncWebhookReceiversClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._raw_client = AsyncRawWebhookReceiversClient(client_wrapper=client_wrapper) + + @property + def with_raw_response(self) -> AsyncRawWebhookReceiversClient: + """ + Retrieves a raw implementation of this client that returns raw responses. + + Returns + ------- + AsyncRawWebhookReceiversClient + """ + return self._raw_client + + async def list(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.List[WebhookReceiver]: + """ + Returns a list of `WebhookReceiver` objects. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + typing.List[WebhookReceiver] + + + 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.knowledgebase.webhook_receivers.list() + + + asyncio.run(main()) + """ + _response = await self._raw_client.list(request_options=request_options) + return _response.data + + async def create( + self, + *, + event: str, + is_active: bool, + key: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> WebhookReceiver: + """ + Creates a `WebhookReceiver` object with the given values. + + Parameters + ---------- + event : str + + is_active : bool + + key : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + WebhookReceiver + + + 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.knowledgebase.webhook_receivers.create( + event="event", + is_active=True, + ) + + + asyncio.run(main()) + """ + _response = await self._raw_client.create( + event=event, is_active=is_active, key=key, request_options=request_options + ) + return _response.data diff --git a/src/merge/resources/knowledgebase/resources/webhook_receivers/raw_client.py b/src/merge/resources/knowledgebase/resources/webhook_receivers/raw_client.py new file mode 100644 index 00000000..cc0f8589 --- /dev/null +++ b/src/merge/resources/knowledgebase/resources/webhook_receivers/raw_client.py @@ -0,0 +1,208 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing +from json.decoder import JSONDecodeError + +from .....core.api_error import ApiError +from .....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper +from .....core.http_response import AsyncHttpResponse, HttpResponse +from .....core.request_options import RequestOptions +from .....core.unchecked_base_model import construct_type +from ...types.webhook_receiver import WebhookReceiver + +# this is used as the default value for optional parameters +OMIT = typing.cast(typing.Any, ...) + + +class RawWebhookReceiversClient: + def __init__(self, *, client_wrapper: SyncClientWrapper): + self._client_wrapper = client_wrapper + + def list( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> HttpResponse[typing.List[WebhookReceiver]]: + """ + Returns a list of `WebhookReceiver` objects. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[typing.List[WebhookReceiver]] + + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/webhook-receivers", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + typing.List[WebhookReceiver], + construct_type( + type_=typing.List[WebhookReceiver], # 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 create( + self, + *, + event: str, + is_active: bool, + key: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> HttpResponse[WebhookReceiver]: + """ + Creates a `WebhookReceiver` object with the given values. + + Parameters + ---------- + event : str + + is_active : bool + + key : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + HttpResponse[WebhookReceiver] + + """ + _response = self._client_wrapper.httpx_client.request( + "knowledgebase/v1/webhook-receivers", + method="POST", + json={ + "event": event, + "is_active": is_active, + "key": key, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + WebhookReceiver, + construct_type( + type_=WebhookReceiver, # 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) + + +class AsyncRawWebhookReceiversClient: + def __init__(self, *, client_wrapper: AsyncClientWrapper): + self._client_wrapper = client_wrapper + + async def list( + self, *, request_options: typing.Optional[RequestOptions] = None + ) -> AsyncHttpResponse[typing.List[WebhookReceiver]]: + """ + Returns a list of `WebhookReceiver` objects. + + Parameters + ---------- + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[typing.List[WebhookReceiver]] + + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/webhook-receivers", + method="GET", + request_options=request_options, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + typing.List[WebhookReceiver], + construct_type( + type_=typing.List[WebhookReceiver], # 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 create( + self, + *, + event: str, + is_active: bool, + key: typing.Optional[str] = OMIT, + request_options: typing.Optional[RequestOptions] = None, + ) -> AsyncHttpResponse[WebhookReceiver]: + """ + Creates a `WebhookReceiver` object with the given values. + + Parameters + ---------- + event : str + + is_active : bool + + key : typing.Optional[str] + + request_options : typing.Optional[RequestOptions] + Request-specific configuration. + + Returns + ------- + AsyncHttpResponse[WebhookReceiver] + + """ + _response = await self._client_wrapper.httpx_client.request( + "knowledgebase/v1/webhook-receivers", + method="POST", + json={ + "event": event, + "is_active": is_active, + "key": key, + }, + headers={ + "content-type": "application/json", + }, + request_options=request_options, + omit=OMIT, + ) + try: + if 200 <= _response.status_code < 300: + _data = typing.cast( + WebhookReceiver, + construct_type( + type_=WebhookReceiver, # 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) diff --git a/src/merge/resources/knowledgebase/types/__init__.py b/src/merge/resources/knowledgebase/types/__init__.py new file mode 100644 index 00000000..fb238bfc --- /dev/null +++ b/src/merge/resources/knowledgebase/types/__init__.py @@ -0,0 +1,374 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from .account_details import AccountDetails + from .account_details_and_actions import AccountDetailsAndActions + from .account_details_and_actions_category import AccountDetailsAndActionsCategory + from .account_details_and_actions_integration import AccountDetailsAndActionsIntegration + from .account_details_and_actions_status import AccountDetailsAndActionsStatus + from .account_details_and_actions_status_enum import AccountDetailsAndActionsStatusEnum + from .account_details_category import AccountDetailsCategory + from .account_integration import AccountIntegration + from .account_token import AccountToken + from .advanced_metadata import AdvancedMetadata + from .article import Article + from .article_attachments_item import ArticleAttachmentsItem + from .article_author import ArticleAuthor + from .article_last_edited_by import ArticleLastEditedBy + from .article_parent_article import ArticleParentArticle + from .article_parent_container import ArticleParentContainer + from .article_permissions_item import ArticlePermissionsItem + from .article_root_container import ArticleRootContainer + from .article_status import ArticleStatus + from .article_type import ArticleType + from .article_type_enum import ArticleTypeEnum + from .article_visibility import ArticleVisibility + from .async_passthrough_reciept import AsyncPassthroughReciept + from .attachment import Attachment + from .audit_log_event import AuditLogEvent + from .audit_log_event_event_type import AuditLogEventEventType + from .audit_log_event_role import AuditLogEventRole + from .available_actions import AvailableActions + from .categories_enum import CategoriesEnum + from .category_enum import CategoryEnum + from .common_model_scope_api import CommonModelScopeApi + from .common_model_scopes_body_request import CommonModelScopesBodyRequest + from .completed_account_initial_screen_enum import CompletedAccountInitialScreenEnum + from .container import Container + from .container_permissions_item import ContainerPermissionsItem + from .container_status import ContainerStatus + from .container_type import ContainerType + from .container_type_enum import ContainerTypeEnum + from .container_visibility import ContainerVisibility + from .data_passthrough_request import DataPassthroughRequest + from .data_passthrough_request_method import DataPassthroughRequestMethod + from .data_passthrough_request_request_format import DataPassthroughRequestRequestFormat + from .debug_mode_log import DebugModeLog + from .debug_model_log_summary import DebugModelLogSummary + from .enabled_actions_enum import EnabledActionsEnum + from .encoding_enum import EncodingEnum + from .error_validation_problem import ErrorValidationProblem + from .event_type_enum import EventTypeEnum + from .external_target_field_api import ExternalTargetFieldApi + from .external_target_field_api_response import ExternalTargetFieldApiResponse + from .field_mapping_api_instance import FieldMappingApiInstance + from .field_mapping_api_instance_remote_field import FieldMappingApiInstanceRemoteField + from .field_mapping_api_instance_remote_field_remote_endpoint_info import ( + FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo, + ) + from .field_mapping_api_instance_response import FieldMappingApiInstanceResponse + from .field_mapping_api_instance_target_field import FieldMappingApiInstanceTargetField + from .field_mapping_instance_response import FieldMappingInstanceResponse + from .field_permission_deserializer import FieldPermissionDeserializer + from .field_permission_deserializer_request import FieldPermissionDeserializerRequest + from .group import Group + from .group_parent_group import GroupParentGroup + from .group_users_item import GroupUsersItem + from .individual_common_model_scope_deserializer import IndividualCommonModelScopeDeserializer + from .individual_common_model_scope_deserializer_request import IndividualCommonModelScopeDeserializerRequest + from .issue import Issue + from .issue_status import IssueStatus + from .issue_status_enum import IssueStatusEnum + from .language_enum import LanguageEnum + from .last_sync_result_enum import LastSyncResultEnum + from .link_token import LinkToken + from .method_enum import MethodEnum + from .model_operation import ModelOperation + from .model_permission_deserializer import ModelPermissionDeserializer + from .model_permission_deserializer_request import ModelPermissionDeserializerRequest + from .multipart_form_field_request import MultipartFormFieldRequest + from .multipart_form_field_request_encoding import MultipartFormFieldRequestEncoding + from .paginated_account_details_and_actions_list import PaginatedAccountDetailsAndActionsList + from .paginated_article_list import PaginatedArticleList + from .paginated_attachment_list import PaginatedAttachmentList + from .paginated_audit_log_event_list import PaginatedAuditLogEventList + from .paginated_container_list import PaginatedContainerList + from .paginated_group_list import PaginatedGroupList + from .paginated_issue_list import PaginatedIssueList + from .paginated_sync_status_list import PaginatedSyncStatusList + from .paginated_user_list import PaginatedUserList + from .permission import Permission + from .permission_group import PermissionGroup + from .permission_type import PermissionType + from .permission_type_enum import PermissionTypeEnum + from .permission_user import PermissionUser + from .remote_data import RemoteData + from .remote_endpoint_info import RemoteEndpointInfo + from .remote_field_api import RemoteFieldApi + from .remote_field_api_advanced_metadata import RemoteFieldApiAdvancedMetadata + from .remote_field_api_coverage import RemoteFieldApiCoverage + from .remote_field_api_response import RemoteFieldApiResponse + from .remote_key import RemoteKey + from .remote_response import RemoteResponse + from .remote_response_response_type import RemoteResponseResponseType + from .request_format_enum import RequestFormatEnum + from .response_type_enum import ResponseTypeEnum + from .role_enum import RoleEnum + from .roles_enum import RolesEnum + from .selective_sync_configurations_usage_enum import SelectiveSyncConfigurationsUsageEnum + from .status_3_c_6_enum import Status3C6Enum + from .status_fd_5_enum import StatusFd5Enum + from .sync_status import SyncStatus + from .sync_status_last_sync_result import SyncStatusLastSyncResult + from .sync_status_status import SyncStatusStatus + from .user import User + from .validation_problem_source import ValidationProblemSource + from .visibility_enum import VisibilityEnum + from .warning_validation_problem import WarningValidationProblem + from .webhook_receiver import WebhookReceiver +_dynamic_imports: typing.Dict[str, str] = { + "AccountDetails": ".account_details", + "AccountDetailsAndActions": ".account_details_and_actions", + "AccountDetailsAndActionsCategory": ".account_details_and_actions_category", + "AccountDetailsAndActionsIntegration": ".account_details_and_actions_integration", + "AccountDetailsAndActionsStatus": ".account_details_and_actions_status", + "AccountDetailsAndActionsStatusEnum": ".account_details_and_actions_status_enum", + "AccountDetailsCategory": ".account_details_category", + "AccountIntegration": ".account_integration", + "AccountToken": ".account_token", + "AdvancedMetadata": ".advanced_metadata", + "Article": ".article", + "ArticleAttachmentsItem": ".article_attachments_item", + "ArticleAuthor": ".article_author", + "ArticleLastEditedBy": ".article_last_edited_by", + "ArticleParentArticle": ".article_parent_article", + "ArticleParentContainer": ".article_parent_container", + "ArticlePermissionsItem": ".article_permissions_item", + "ArticleRootContainer": ".article_root_container", + "ArticleStatus": ".article_status", + "ArticleType": ".article_type", + "ArticleTypeEnum": ".article_type_enum", + "ArticleVisibility": ".article_visibility", + "AsyncPassthroughReciept": ".async_passthrough_reciept", + "Attachment": ".attachment", + "AuditLogEvent": ".audit_log_event", + "AuditLogEventEventType": ".audit_log_event_event_type", + "AuditLogEventRole": ".audit_log_event_role", + "AvailableActions": ".available_actions", + "CategoriesEnum": ".categories_enum", + "CategoryEnum": ".category_enum", + "CommonModelScopeApi": ".common_model_scope_api", + "CommonModelScopesBodyRequest": ".common_model_scopes_body_request", + "CompletedAccountInitialScreenEnum": ".completed_account_initial_screen_enum", + "Container": ".container", + "ContainerPermissionsItem": ".container_permissions_item", + "ContainerStatus": ".container_status", + "ContainerType": ".container_type", + "ContainerTypeEnum": ".container_type_enum", + "ContainerVisibility": ".container_visibility", + "DataPassthroughRequest": ".data_passthrough_request", + "DataPassthroughRequestMethod": ".data_passthrough_request_method", + "DataPassthroughRequestRequestFormat": ".data_passthrough_request_request_format", + "DebugModeLog": ".debug_mode_log", + "DebugModelLogSummary": ".debug_model_log_summary", + "EnabledActionsEnum": ".enabled_actions_enum", + "EncodingEnum": ".encoding_enum", + "ErrorValidationProblem": ".error_validation_problem", + "EventTypeEnum": ".event_type_enum", + "ExternalTargetFieldApi": ".external_target_field_api", + "ExternalTargetFieldApiResponse": ".external_target_field_api_response", + "FieldMappingApiInstance": ".field_mapping_api_instance", + "FieldMappingApiInstanceRemoteField": ".field_mapping_api_instance_remote_field", + "FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo": ".field_mapping_api_instance_remote_field_remote_endpoint_info", + "FieldMappingApiInstanceResponse": ".field_mapping_api_instance_response", + "FieldMappingApiInstanceTargetField": ".field_mapping_api_instance_target_field", + "FieldMappingInstanceResponse": ".field_mapping_instance_response", + "FieldPermissionDeserializer": ".field_permission_deserializer", + "FieldPermissionDeserializerRequest": ".field_permission_deserializer_request", + "Group": ".group", + "GroupParentGroup": ".group_parent_group", + "GroupUsersItem": ".group_users_item", + "IndividualCommonModelScopeDeserializer": ".individual_common_model_scope_deserializer", + "IndividualCommonModelScopeDeserializerRequest": ".individual_common_model_scope_deserializer_request", + "Issue": ".issue", + "IssueStatus": ".issue_status", + "IssueStatusEnum": ".issue_status_enum", + "LanguageEnum": ".language_enum", + "LastSyncResultEnum": ".last_sync_result_enum", + "LinkToken": ".link_token", + "MethodEnum": ".method_enum", + "ModelOperation": ".model_operation", + "ModelPermissionDeserializer": ".model_permission_deserializer", + "ModelPermissionDeserializerRequest": ".model_permission_deserializer_request", + "MultipartFormFieldRequest": ".multipart_form_field_request", + "MultipartFormFieldRequestEncoding": ".multipart_form_field_request_encoding", + "PaginatedAccountDetailsAndActionsList": ".paginated_account_details_and_actions_list", + "PaginatedArticleList": ".paginated_article_list", + "PaginatedAttachmentList": ".paginated_attachment_list", + "PaginatedAuditLogEventList": ".paginated_audit_log_event_list", + "PaginatedContainerList": ".paginated_container_list", + "PaginatedGroupList": ".paginated_group_list", + "PaginatedIssueList": ".paginated_issue_list", + "PaginatedSyncStatusList": ".paginated_sync_status_list", + "PaginatedUserList": ".paginated_user_list", + "Permission": ".permission", + "PermissionGroup": ".permission_group", + "PermissionType": ".permission_type", + "PermissionTypeEnum": ".permission_type_enum", + "PermissionUser": ".permission_user", + "RemoteData": ".remote_data", + "RemoteEndpointInfo": ".remote_endpoint_info", + "RemoteFieldApi": ".remote_field_api", + "RemoteFieldApiAdvancedMetadata": ".remote_field_api_advanced_metadata", + "RemoteFieldApiCoverage": ".remote_field_api_coverage", + "RemoteFieldApiResponse": ".remote_field_api_response", + "RemoteKey": ".remote_key", + "RemoteResponse": ".remote_response", + "RemoteResponseResponseType": ".remote_response_response_type", + "RequestFormatEnum": ".request_format_enum", + "ResponseTypeEnum": ".response_type_enum", + "RoleEnum": ".role_enum", + "RolesEnum": ".roles_enum", + "SelectiveSyncConfigurationsUsageEnum": ".selective_sync_configurations_usage_enum", + "Status3C6Enum": ".status_3_c_6_enum", + "StatusFd5Enum": ".status_fd_5_enum", + "SyncStatus": ".sync_status", + "SyncStatusLastSyncResult": ".sync_status_last_sync_result", + "SyncStatusStatus": ".sync_status_status", + "User": ".user", + "ValidationProblemSource": ".validation_problem_source", + "VisibilityEnum": ".visibility_enum", + "WarningValidationProblem": ".warning_validation_problem", + "WebhookReceiver": ".webhook_receiver", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + result = getattr(module, attr_name) + return result + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = [ + "AccountDetails", + "AccountDetailsAndActions", + "AccountDetailsAndActionsCategory", + "AccountDetailsAndActionsIntegration", + "AccountDetailsAndActionsStatus", + "AccountDetailsAndActionsStatusEnum", + "AccountDetailsCategory", + "AccountIntegration", + "AccountToken", + "AdvancedMetadata", + "Article", + "ArticleAttachmentsItem", + "ArticleAuthor", + "ArticleLastEditedBy", + "ArticleParentArticle", + "ArticleParentContainer", + "ArticlePermissionsItem", + "ArticleRootContainer", + "ArticleStatus", + "ArticleType", + "ArticleTypeEnum", + "ArticleVisibility", + "AsyncPassthroughReciept", + "Attachment", + "AuditLogEvent", + "AuditLogEventEventType", + "AuditLogEventRole", + "AvailableActions", + "CategoriesEnum", + "CategoryEnum", + "CommonModelScopeApi", + "CommonModelScopesBodyRequest", + "CompletedAccountInitialScreenEnum", + "Container", + "ContainerPermissionsItem", + "ContainerStatus", + "ContainerType", + "ContainerTypeEnum", + "ContainerVisibility", + "DataPassthroughRequest", + "DataPassthroughRequestMethod", + "DataPassthroughRequestRequestFormat", + "DebugModeLog", + "DebugModelLogSummary", + "EnabledActionsEnum", + "EncodingEnum", + "ErrorValidationProblem", + "EventTypeEnum", + "ExternalTargetFieldApi", + "ExternalTargetFieldApiResponse", + "FieldMappingApiInstance", + "FieldMappingApiInstanceRemoteField", + "FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo", + "FieldMappingApiInstanceResponse", + "FieldMappingApiInstanceTargetField", + "FieldMappingInstanceResponse", + "FieldPermissionDeserializer", + "FieldPermissionDeserializerRequest", + "Group", + "GroupParentGroup", + "GroupUsersItem", + "IndividualCommonModelScopeDeserializer", + "IndividualCommonModelScopeDeserializerRequest", + "Issue", + "IssueStatus", + "IssueStatusEnum", + "LanguageEnum", + "LastSyncResultEnum", + "LinkToken", + "MethodEnum", + "ModelOperation", + "ModelPermissionDeserializer", + "ModelPermissionDeserializerRequest", + "MultipartFormFieldRequest", + "MultipartFormFieldRequestEncoding", + "PaginatedAccountDetailsAndActionsList", + "PaginatedArticleList", + "PaginatedAttachmentList", + "PaginatedAuditLogEventList", + "PaginatedContainerList", + "PaginatedGroupList", + "PaginatedIssueList", + "PaginatedSyncStatusList", + "PaginatedUserList", + "Permission", + "PermissionGroup", + "PermissionType", + "PermissionTypeEnum", + "PermissionUser", + "RemoteData", + "RemoteEndpointInfo", + "RemoteFieldApi", + "RemoteFieldApiAdvancedMetadata", + "RemoteFieldApiCoverage", + "RemoteFieldApiResponse", + "RemoteKey", + "RemoteResponse", + "RemoteResponseResponseType", + "RequestFormatEnum", + "ResponseTypeEnum", + "RoleEnum", + "RolesEnum", + "SelectiveSyncConfigurationsUsageEnum", + "Status3C6Enum", + "StatusFd5Enum", + "SyncStatus", + "SyncStatusLastSyncResult", + "SyncStatusStatus", + "User", + "ValidationProblemSource", + "VisibilityEnum", + "WarningValidationProblem", + "WebhookReceiver", +] diff --git a/src/merge/resources/knowledgebase/types/account_details.py b/src/merge/resources/knowledgebase/types/account_details.py new file mode 100644 index 00000000..98923cd8 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/account_details.py @@ -0,0 +1,40 @@ +# 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 .account_details_category import AccountDetailsCategory + + +class AccountDetails(UncheckedBaseModel): + id: typing.Optional[str] = None + integration: typing.Optional[str] = None + integration_slug: typing.Optional[str] = None + category: typing.Optional[AccountDetailsCategory] = None + end_user_origin_id: typing.Optional[str] = None + end_user_organization_name: typing.Optional[str] = None + end_user_email_address: typing.Optional[str] = None + status: typing.Optional[str] = None + webhook_listener_url: typing.Optional[str] = None + is_duplicate: typing.Optional[bool] = pydantic.Field(default=None) + """ + Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is `null` for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets. + """ + + account_type: typing.Optional[str] = None + completed_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + The time at which account completes the linking flow. + """ + + 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/knowledgebase/types/account_details_and_actions.py b/src/merge/resources/knowledgebase/types/account_details_and_actions.py new file mode 100644 index 00000000..93c874ed --- /dev/null +++ b/src/merge/resources/knowledgebase/types/account_details_and_actions.py @@ -0,0 +1,54 @@ +# 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 .account_details_and_actions_category import AccountDetailsAndActionsCategory +from .account_details_and_actions_integration import AccountDetailsAndActionsIntegration +from .account_details_and_actions_status import AccountDetailsAndActionsStatus + + +class AccountDetailsAndActions(UncheckedBaseModel): + """ + # The LinkedAccount Object + ### Description + The `LinkedAccount` object is used to represent an end user's link with a specific integration. + + ### Usage Example + View a list of your organization's `LinkedAccount` objects. + """ + + id: str + category: typing.Optional[AccountDetailsAndActionsCategory] = None + status: AccountDetailsAndActionsStatus + status_detail: typing.Optional[str] = None + end_user_origin_id: typing.Optional[str] = None + end_user_organization_name: str + end_user_email_address: str + subdomain: typing.Optional[str] = pydantic.Field(default=None) + """ + The tenant or domain the customer has provided access to. + """ + + webhook_listener_url: str + is_duplicate: typing.Optional[bool] = pydantic.Field(default=None) + """ + Whether a Production Linked Account's credentials match another existing Production Linked Account. This field is `null` for Test Linked Accounts, incomplete Production Linked Accounts, and ignored duplicate Production Linked Account sets. + """ + + integration: typing.Optional[AccountDetailsAndActionsIntegration] = None + account_type: str + completed_at: dt.datetime + integration_specific_fields: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = 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/knowledgebase/types/account_details_and_actions_category.py b/src/merge/resources/knowledgebase/types/account_details_and_actions_category.py new file mode 100644 index 00000000..93b4188b --- /dev/null +++ b/src/merge/resources/knowledgebase/types/account_details_and_actions_category.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .category_enum import CategoryEnum + +AccountDetailsAndActionsCategory = typing.Union[CategoryEnum, str] diff --git a/src/merge/resources/knowledgebase/types/account_details_and_actions_integration.py b/src/merge/resources/knowledgebase/types/account_details_and_actions_integration.py new file mode 100644 index 00000000..73467bbb --- /dev/null +++ b/src/merge/resources/knowledgebase/types/account_details_and_actions_integration.py @@ -0,0 +1,29 @@ +# 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 .categories_enum import CategoriesEnum +from .model_operation import ModelOperation + + +class AccountDetailsAndActionsIntegration(UncheckedBaseModel): + name: str + categories: typing.List[CategoriesEnum] + image: typing.Optional[str] = None + square_image: typing.Optional[str] = None + color: str + slug: str + passthrough_available: bool + available_model_operations: typing.Optional[typing.List[ModelOperation]] = 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/knowledgebase/types/account_details_and_actions_status.py b/src/merge/resources/knowledgebase/types/account_details_and_actions_status.py new file mode 100644 index 00000000..445922f8 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/account_details_and_actions_status.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .account_details_and_actions_status_enum import AccountDetailsAndActionsStatusEnum + +AccountDetailsAndActionsStatus = typing.Union[AccountDetailsAndActionsStatusEnum, str] diff --git a/src/merge/resources/knowledgebase/types/account_details_and_actions_status_enum.py b/src/merge/resources/knowledgebase/types/account_details_and_actions_status_enum.py new file mode 100644 index 00000000..df37f582 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/account_details_and_actions_status_enum.py @@ -0,0 +1,36 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class AccountDetailsAndActionsStatusEnum(str, enum.Enum): + """ + * `COMPLETE` - COMPLETE + * `INCOMPLETE` - INCOMPLETE + * `RELINK_NEEDED` - RELINK_NEEDED + * `IDLE` - IDLE + """ + + COMPLETE = "COMPLETE" + INCOMPLETE = "INCOMPLETE" + RELINK_NEEDED = "RELINK_NEEDED" + IDLE = "IDLE" + + def visit( + self, + complete: typing.Callable[[], T_Result], + incomplete: typing.Callable[[], T_Result], + relink_needed: typing.Callable[[], T_Result], + idle: typing.Callable[[], T_Result], + ) -> T_Result: + if self is AccountDetailsAndActionsStatusEnum.COMPLETE: + return complete() + if self is AccountDetailsAndActionsStatusEnum.INCOMPLETE: + return incomplete() + if self is AccountDetailsAndActionsStatusEnum.RELINK_NEEDED: + return relink_needed() + if self is AccountDetailsAndActionsStatusEnum.IDLE: + return idle() diff --git a/src/merge/resources/knowledgebase/types/account_details_category.py b/src/merge/resources/knowledgebase/types/account_details_category.py new file mode 100644 index 00000000..8a0cc59c --- /dev/null +++ b/src/merge/resources/knowledgebase/types/account_details_category.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .category_enum import CategoryEnum + +AccountDetailsCategory = typing.Union[CategoryEnum, str] diff --git a/src/merge/resources/knowledgebase/types/account_integration.py b/src/merge/resources/knowledgebase/types/account_integration.py new file mode 100644 index 00000000..ef8b260d --- /dev/null +++ b/src/merge/resources/knowledgebase/types/account_integration.py @@ -0,0 +1,67 @@ +# 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 .categories_enum import CategoriesEnum + + +class AccountIntegration(UncheckedBaseModel): + name: str = pydantic.Field() + """ + Company name. + """ + + abbreviated_name: typing.Optional[str] = pydantic.Field(default=None) + """ + Optional. This shortened name appears in places with limited space, usually in conjunction with the platform's logo (e.g., Merge Link menu).

Example: Workforce Now (in lieu of ADP Workforce Now), SuccessFactors (in lieu of SAP SuccessFactors) + """ + + categories: typing.Optional[typing.List[CategoriesEnum]] = pydantic.Field(default=None) + """ + Category or categories this integration belongs to. Multiple categories should be comma separated, i.e. [ats, hris]. + """ + + image: typing.Optional[str] = pydantic.Field(default=None) + """ + Company logo in rectangular shape. + """ + + square_image: typing.Optional[str] = pydantic.Field(default=None) + """ + Company logo in square shape. + """ + + color: typing.Optional[str] = pydantic.Field(default=None) + """ + The color of this integration used for buttons and text throughout the app and landing pages. Choose a darker, saturated color. + """ + + slug: typing.Optional[str] = None + api_endpoints_to_documentation_urls: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = ( + pydantic.Field(default=None) + ) + """ + Mapping of API endpoints to documentation urls for support. Example: {'GET': [['/common-model-scopes', 'https://docs.merge.dev/accounting/common-model-scopes/#common_model_scopes_retrieve'],['/common-model-actions', 'https://docs.merge.dev/accounting/common-model-actions/#common_model_actions_retrieve']], 'POST': []} + """ + + webhook_setup_guide_url: typing.Optional[str] = pydantic.Field(default=None) + """ + Setup guide URL for third party webhook creation. Exposed in Merge Docs. + """ + + category_beta_status: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None) + """ + Category or categories this integration is in beta status for. + """ + + 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/knowledgebase/types/account_token.py b/src/merge/resources/knowledgebase/types/account_token.py new file mode 100644 index 00000000..6e82c8ac --- /dev/null +++ b/src/merge/resources/knowledgebase/types/account_token.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 .account_integration import AccountIntegration + + +class AccountToken(UncheckedBaseModel): + account_token: str + integration: AccountIntegration + id: str + + 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/knowledgebase/types/advanced_metadata.py b/src/merge/resources/knowledgebase/types/advanced_metadata.py new file mode 100644 index 00000000..60b5d072 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/advanced_metadata.py @@ -0,0 +1,25 @@ +# 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 + + +class AdvancedMetadata(UncheckedBaseModel): + id: str + display_name: typing.Optional[str] = None + description: typing.Optional[str] = None + is_required: typing.Optional[bool] = None + is_custom: typing.Optional[bool] = None + field_choices: typing.Optional[typing.List[typing.Optional[typing.Any]]] = 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/knowledgebase/types/article.py b/src/merge/resources/knowledgebase/types/article.py new file mode 100644 index 00000000..32620c78 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/article.py @@ -0,0 +1,159 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import datetime as dt +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ....core.unchecked_base_model import UncheckedBaseModel +from .article_attachments_item import ArticleAttachmentsItem +from .article_author import ArticleAuthor +from .article_last_edited_by import ArticleLastEditedBy +from .article_parent_container import ArticleParentContainer +from .article_permissions_item import ArticlePermissionsItem +from .article_root_container import ArticleRootContainer +from .article_status import ArticleStatus +from .article_type import ArticleType +from .article_visibility import ArticleVisibility +from .remote_data import RemoteData + + +class Article(UncheckedBaseModel): + """ + # The Article Object + ### Description + The `Article` object is used to represent a form of content in the knowledge base, such as an article or page. + ### Usage Example + Fetch from the `GET /api/knowledgebase/v1/articles` endpoint and view their articles. + """ + + 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. + """ + + title: typing.Optional[str] = pydantic.Field(default=None) + """ + The title of the article. + """ + + description: typing.Optional[str] = pydantic.Field(default=None) + """ + Description of the article. + """ + + author: typing.Optional[ArticleAuthor] = pydantic.Field(default=None) + """ + The user who created the article. + """ + + last_edited_by: typing.Optional[ArticleLastEditedBy] = pydantic.Field(default=None) + """ + The user to last update the article. + """ + + visibility: typing.Optional[ArticleVisibility] = pydantic.Field(default=None) + """ + The visibility of the article. + + * `PUBLIC` - PUBLIC + * `INTERNAL` - INTERNAL + * `RESTRICTED` - RESTRICTED + """ + + article_content_download_url: typing.Optional[str] = pydantic.Field(default=None) + """ + The presigned S3 URL to fetch article content. + """ + + checksum: typing.Optional[str] = pydantic.Field(default=None) + """ + The SHA256 checksum of the article content. + """ + + article_url: typing.Optional[str] = pydantic.Field(default=None) + """ + The URL to the webpage of the article. + """ + + status: typing.Optional[ArticleStatus] = pydantic.Field(default=None) + """ + The status of the article. + + * `DRAFT` - DRAFT + * `PUBLISHED` - PUBLISHED + * `ARCHIVED` - ARCHIVED + * `TRASH` - TRASH + """ + + type: typing.Optional[ArticleType] = pydantic.Field(default=None) + """ + The type of the article. + + * `PAGE` - PAGE + * `BLOG_POST` - BLOG_POST + * `SMART_LINK` - SMART_LINK + """ + + remote_created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + When the third party's article was created. + """ + + remote_updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + When the third party's article was updated. + """ + + parent_article: typing.Optional["ArticleParentArticle"] = pydantic.Field(default=None) + """ + The parent article an article is nested within. + """ + + parent_container: typing.Optional[ArticleParentContainer] = pydantic.Field(default=None) + """ + The parent container an article is nested within. + """ + + root_container: typing.Optional[ArticleRootContainer] = pydantic.Field(default=None) + """ + The top-level container in the hierarchy that holds this article. This will reference a container object that will typically be a SPACE or WORKSPACE type. + """ + + permissions: typing.Optional[typing.List[ArticlePermissionsItem]] = None + attachments: typing.Optional[typing.List[typing.Optional[ArticleAttachmentsItem]]] = None + 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/). + """ + + field_mappings: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + remote_data: typing.Optional[typing.List[RemoteData]] = 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 + + +from .group import Group # noqa: E402, F401, I001 +from .article_parent_article import ArticleParentArticle # noqa: E402, F401, I001 + +update_forward_refs(Article) diff --git a/src/merge/resources/knowledgebase/types/article_attachments_item.py b/src/merge/resources/knowledgebase/types/article_attachments_item.py new file mode 100644 index 00000000..7a22e05f --- /dev/null +++ b/src/merge/resources/knowledgebase/types/article_attachments_item.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .attachment import Attachment + +ArticleAttachmentsItem = typing.Union[str, Attachment] diff --git a/src/merge/resources/knowledgebase/types/article_author.py b/src/merge/resources/knowledgebase/types/article_author.py new file mode 100644 index 00000000..db8603d8 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/article_author.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .user import User + +ArticleAuthor = typing.Union[str, User] diff --git a/src/merge/resources/knowledgebase/types/article_last_edited_by.py b/src/merge/resources/knowledgebase/types/article_last_edited_by.py new file mode 100644 index 00000000..9d158df5 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/article_last_edited_by.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .user import User + +ArticleLastEditedBy = typing.Union[str, User] diff --git a/src/merge/resources/knowledgebase/types/article_parent_article.py b/src/merge/resources/knowledgebase/types/article_parent_article.py new file mode 100644 index 00000000..e630834c --- /dev/null +++ b/src/merge/resources/knowledgebase/types/article_parent_article.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +if typing.TYPE_CHECKING: + from .article import Article +ArticleParentArticle = typing.Union[str, "Article"] diff --git a/src/merge/resources/knowledgebase/types/article_parent_container.py b/src/merge/resources/knowledgebase/types/article_parent_container.py new file mode 100644 index 00000000..1aeeae03 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/article_parent_container.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .container import Container + +ArticleParentContainer = typing.Union[str, Container] diff --git a/src/merge/resources/knowledgebase/types/article_permissions_item.py b/src/merge/resources/knowledgebase/types/article_permissions_item.py new file mode 100644 index 00000000..1474bf4d --- /dev/null +++ b/src/merge/resources/knowledgebase/types/article_permissions_item.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .permission import Permission + +ArticlePermissionsItem = typing.Union[str, Permission] diff --git a/src/merge/resources/knowledgebase/types/article_root_container.py b/src/merge/resources/knowledgebase/types/article_root_container.py new file mode 100644 index 00000000..a145d7a3 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/article_root_container.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .container import Container + +ArticleRootContainer = typing.Union[str, Container] diff --git a/src/merge/resources/knowledgebase/types/article_status.py b/src/merge/resources/knowledgebase/types/article_status.py new file mode 100644 index 00000000..ed0aef3e --- /dev/null +++ b/src/merge/resources/knowledgebase/types/article_status.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .status_3_c_6_enum import Status3C6Enum + +ArticleStatus = typing.Union[Status3C6Enum, str] diff --git a/src/merge/resources/knowledgebase/types/article_type.py b/src/merge/resources/knowledgebase/types/article_type.py new file mode 100644 index 00000000..e8ebdcb1 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/article_type.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .article_type_enum import ArticleTypeEnum + +ArticleType = typing.Union[ArticleTypeEnum, str] diff --git a/src/merge/resources/knowledgebase/types/article_type_enum.py b/src/merge/resources/knowledgebase/types/article_type_enum.py new file mode 100644 index 00000000..388245dc --- /dev/null +++ b/src/merge/resources/knowledgebase/types/article_type_enum.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class ArticleTypeEnum(str, enum.Enum): + """ + * `PAGE` - PAGE + * `BLOG_POST` - BLOG_POST + * `SMART_LINK` - SMART_LINK + """ + + PAGE = "PAGE" + BLOG_POST = "BLOG_POST" + SMART_LINK = "SMART_LINK" + + def visit( + self, + page: typing.Callable[[], T_Result], + blog_post: typing.Callable[[], T_Result], + smart_link: typing.Callable[[], T_Result], + ) -> T_Result: + if self is ArticleTypeEnum.PAGE: + return page() + if self is ArticleTypeEnum.BLOG_POST: + return blog_post() + if self is ArticleTypeEnum.SMART_LINK: + return smart_link() diff --git a/src/merge/resources/knowledgebase/types/article_visibility.py b/src/merge/resources/knowledgebase/types/article_visibility.py new file mode 100644 index 00000000..7a152463 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/article_visibility.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .visibility_enum import VisibilityEnum + +ArticleVisibility = typing.Union[VisibilityEnum, str] diff --git a/src/merge/resources/knowledgebase/types/async_passthrough_reciept.py b/src/merge/resources/knowledgebase/types/async_passthrough_reciept.py new file mode 100644 index 00000000..21c95080 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/async_passthrough_reciept.py @@ -0,0 +1,20 @@ +# 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 + + +class AsyncPassthroughReciept(UncheckedBaseModel): + async_passthrough_receipt_id: str + + 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/knowledgebase/types/attachment.py b/src/merge/resources/knowledgebase/types/attachment.py new file mode 100644 index 00000000..ba1cc4ea --- /dev/null +++ b/src/merge/resources/knowledgebase/types/attachment.py @@ -0,0 +1,67 @@ +# 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 .remote_data import RemoteData + + +class Attachment(UncheckedBaseModel): + """ + # The Attachment Object + ### Description + The `Attachment` object is used to represent an attachment to an article or container. + ### Usage Example + Fetch from the `GET /api/knowledgebase/v1/attachments` endpoint and view their attachments. + """ + + 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. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + The attachment's name. + """ + + description: typing.Optional[str] = pydantic.Field(default=None) + """ + The attachment's description. + """ + + attachment_url: typing.Optional[str] = pydantic.Field(default=None) + """ + The attachment's url. + """ + + 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/). + """ + + field_mappings: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + remote_data: typing.Optional[typing.List[RemoteData]] = 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/knowledgebase/types/audit_log_event.py b/src/merge/resources/knowledgebase/types/audit_log_event.py new file mode 100644 index 00000000..ab69fd32 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/audit_log_event.py @@ -0,0 +1,97 @@ +# 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 .audit_log_event_event_type import AuditLogEventEventType +from .audit_log_event_role import AuditLogEventRole + + +class AuditLogEvent(UncheckedBaseModel): + id: typing.Optional[str] = None + user_name: typing.Optional[str] = pydantic.Field(default=None) + """ + The User's full name at the time of this Event occurring. + """ + + user_email: typing.Optional[str] = pydantic.Field(default=None) + """ + The User's email at the time of this Event occurring. + """ + + role: AuditLogEventRole = pydantic.Field() + """ + Designates the role of the user (or SYSTEM/API if action not taken by a user) at the time of this Event occurring. + + * `ADMIN` - ADMIN + * `DEVELOPER` - DEVELOPER + * `MEMBER` - MEMBER + * `API` - API + * `SYSTEM` - SYSTEM + * `MERGE_TEAM` - MERGE_TEAM + """ + + ip_address: str + event_type: AuditLogEventEventType = pydantic.Field() + """ + Designates the type of event that occurred. + + * `CREATED_REMOTE_PRODUCTION_API_KEY` - CREATED_REMOTE_PRODUCTION_API_KEY + * `DELETED_REMOTE_PRODUCTION_API_KEY` - DELETED_REMOTE_PRODUCTION_API_KEY + * `CREATED_TEST_API_KEY` - CREATED_TEST_API_KEY + * `DELETED_TEST_API_KEY` - DELETED_TEST_API_KEY + * `REGENERATED_PRODUCTION_API_KEY` - REGENERATED_PRODUCTION_API_KEY + * `REGENERATED_WEBHOOK_SIGNATURE` - REGENERATED_WEBHOOK_SIGNATURE + * `INVITED_USER` - INVITED_USER + * `TWO_FACTOR_AUTH_ENABLED` - TWO_FACTOR_AUTH_ENABLED + * `TWO_FACTOR_AUTH_DISABLED` - TWO_FACTOR_AUTH_DISABLED + * `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT + * `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT` - DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT + * `CREATED_DESTINATION` - CREATED_DESTINATION + * `DELETED_DESTINATION` - DELETED_DESTINATION + * `CHANGED_DESTINATION` - CHANGED_DESTINATION + * `CHANGED_SCOPES` - CHANGED_SCOPES + * `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION + * `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS + * `ENABLED_INTEGRATION` - ENABLED_INTEGRATION + * `DISABLED_INTEGRATION` - DISABLED_INTEGRATION + * `ENABLED_CATEGORY` - ENABLED_CATEGORY + * `DISABLED_CATEGORY` - DISABLED_CATEGORY + * `CHANGED_PASSWORD` - CHANGED_PASSWORD + * `RESET_PASSWORD` - RESET_PASSWORD + * `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION + * `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT + * `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION + * `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT + * `CREATED_INTEGRATION_WIDE_FIELD_MAPPING` - CREATED_INTEGRATION_WIDE_FIELD_MAPPING + * `CREATED_LINKED_ACCOUNT_FIELD_MAPPING` - CREATED_LINKED_ACCOUNT_FIELD_MAPPING + * `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING` - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING + * `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING` - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING + * `DELETED_INTEGRATION_WIDE_FIELD_MAPPING` - DELETED_INTEGRATION_WIDE_FIELD_MAPPING + * `DELETED_LINKED_ACCOUNT_FIELD_MAPPING` - DELETED_LINKED_ACCOUNT_FIELD_MAPPING + * `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + * `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + * `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + * `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC + * `MUTED_ISSUE` - MUTED_ISSUE + * `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK + * `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK + * `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK + * `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED + * `END_USER_CREDENTIALS_ACCESSED` - END_USER_CREDENTIALS_ACCESSED + """ + + event_description: str + created_at: typing.Optional[dt.datetime] = 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/knowledgebase/types/audit_log_event_event_type.py b/src/merge/resources/knowledgebase/types/audit_log_event_event_type.py new file mode 100644 index 00000000..f9c9d2b3 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/audit_log_event_event_type.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .event_type_enum import EventTypeEnum + +AuditLogEventEventType = typing.Union[EventTypeEnum, str] diff --git a/src/merge/resources/knowledgebase/types/audit_log_event_role.py b/src/merge/resources/knowledgebase/types/audit_log_event_role.py new file mode 100644 index 00000000..fe91ed6f --- /dev/null +++ b/src/merge/resources/knowledgebase/types/audit_log_event_role.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .role_enum import RoleEnum + +AuditLogEventRole = typing.Union[RoleEnum, str] diff --git a/src/merge/resources/knowledgebase/types/available_actions.py b/src/merge/resources/knowledgebase/types/available_actions.py new file mode 100644 index 00000000..8b5019d7 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/available_actions.py @@ -0,0 +1,33 @@ +# 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 .account_integration import AccountIntegration +from .model_operation import ModelOperation + + +class AvailableActions(UncheckedBaseModel): + """ + # The AvailableActions Object + ### Description + The `Activity` object is used to see all available model/operation combinations for an integration. + + ### Usage Example + Fetch all the actions available for the `Zenefits` integration. + """ + + integration: AccountIntegration + passthrough_available: bool + available_model_operations: typing.Optional[typing.List[ModelOperation]] = 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/knowledgebase/types/categories_enum.py b/src/merge/resources/knowledgebase/types/categories_enum.py new file mode 100644 index 00000000..da1e0dc0 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/categories_enum.py @@ -0,0 +1,56 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class CategoriesEnum(str, enum.Enum): + """ + * `hris` - hris + * `ats` - ats + * `accounting` - accounting + * `ticketing` - ticketing + * `crm` - crm + * `mktg` - mktg + * `filestorage` - filestorage + * `knowledgebase` - knowledgebase + """ + + HRIS = "hris" + ATS = "ats" + ACCOUNTING = "accounting" + TICKETING = "ticketing" + CRM = "crm" + MKTG = "mktg" + FILESTORAGE = "filestorage" + KNOWLEDGEBASE = "knowledgebase" + + def visit( + self, + hris: typing.Callable[[], T_Result], + ats: typing.Callable[[], T_Result], + accounting: typing.Callable[[], T_Result], + ticketing: typing.Callable[[], T_Result], + crm: typing.Callable[[], T_Result], + mktg: typing.Callable[[], T_Result], + filestorage: typing.Callable[[], T_Result], + knowledgebase: typing.Callable[[], T_Result], + ) -> T_Result: + if self is CategoriesEnum.HRIS: + return hris() + if self is CategoriesEnum.ATS: + return ats() + if self is CategoriesEnum.ACCOUNTING: + return accounting() + if self is CategoriesEnum.TICKETING: + return ticketing() + if self is CategoriesEnum.CRM: + return crm() + if self is CategoriesEnum.MKTG: + return mktg() + if self is CategoriesEnum.FILESTORAGE: + return filestorage() + if self is CategoriesEnum.KNOWLEDGEBASE: + return knowledgebase() diff --git a/src/merge/resources/knowledgebase/types/category_enum.py b/src/merge/resources/knowledgebase/types/category_enum.py new file mode 100644 index 00000000..1d7cd2c0 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/category_enum.py @@ -0,0 +1,56 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class CategoryEnum(str, enum.Enum): + """ + * `hris` - hris + * `ats` - ats + * `accounting` - accounting + * `ticketing` - ticketing + * `crm` - crm + * `mktg` - mktg + * `filestorage` - filestorage + * `knowledgebase` - knowledgebase + """ + + HRIS = "hris" + ATS = "ats" + ACCOUNTING = "accounting" + TICKETING = "ticketing" + CRM = "crm" + MKTG = "mktg" + FILESTORAGE = "filestorage" + KNOWLEDGEBASE = "knowledgebase" + + def visit( + self, + hris: typing.Callable[[], T_Result], + ats: typing.Callable[[], T_Result], + accounting: typing.Callable[[], T_Result], + ticketing: typing.Callable[[], T_Result], + crm: typing.Callable[[], T_Result], + mktg: typing.Callable[[], T_Result], + filestorage: typing.Callable[[], T_Result], + knowledgebase: typing.Callable[[], T_Result], + ) -> T_Result: + if self is CategoryEnum.HRIS: + return hris() + if self is CategoryEnum.ATS: + return ats() + if self is CategoryEnum.ACCOUNTING: + return accounting() + if self is CategoryEnum.TICKETING: + return ticketing() + if self is CategoryEnum.CRM: + return crm() + if self is CategoryEnum.MKTG: + return mktg() + if self is CategoryEnum.FILESTORAGE: + return filestorage() + if self is CategoryEnum.KNOWLEDGEBASE: + return knowledgebase() diff --git a/src/merge/resources/knowledgebase/types/common_model_scope_api.py b/src/merge/resources/knowledgebase/types/common_model_scope_api.py new file mode 100644 index 00000000..5484808d --- /dev/null +++ b/src/merge/resources/knowledgebase/types/common_model_scope_api.py @@ -0,0 +1,24 @@ +# 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 .individual_common_model_scope_deserializer import IndividualCommonModelScopeDeserializer + + +class CommonModelScopeApi(UncheckedBaseModel): + common_models: typing.List[IndividualCommonModelScopeDeserializer] = pydantic.Field() + """ + The common models you want to update the scopes for + """ + + 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/knowledgebase/types/common_model_scopes_body_request.py b/src/merge/resources/knowledgebase/types/common_model_scopes_body_request.py new file mode 100644 index 00000000..a9fed25b --- /dev/null +++ b/src/merge/resources/knowledgebase/types/common_model_scopes_body_request.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 .enabled_actions_enum import EnabledActionsEnum + + +class CommonModelScopesBodyRequest(UncheckedBaseModel): + model_id: str + enabled_actions: typing.List[EnabledActionsEnum] + disabled_fields: typing.List[str] + + 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/knowledgebase/types/completed_account_initial_screen_enum.py b/src/merge/resources/knowledgebase/types/completed_account_initial_screen_enum.py new file mode 100644 index 00000000..c112dfd1 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/completed_account_initial_screen_enum.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +CompletedAccountInitialScreenEnum = typing.Literal["SELECTIVE_SYNC"] diff --git a/src/merge/resources/knowledgebase/types/container.py b/src/merge/resources/knowledgebase/types/container.py new file mode 100644 index 00000000..2822c45d --- /dev/null +++ b/src/merge/resources/knowledgebase/types/container.py @@ -0,0 +1,130 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import datetime as dt +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ....core.unchecked_base_model import UncheckedBaseModel +from .container_permissions_item import ContainerPermissionsItem +from .container_status import ContainerStatus +from .container_type import ContainerType +from .container_visibility import ContainerVisibility +from .remote_data import RemoteData + + +class Container(UncheckedBaseModel): + """ + # The Container Object + ### Description + The Container object is used to represent a grouping of articles in the knowledge base. This can include Spaces, Folders, Databases, etc. + ### Usage Example + Fetch from the `GET /api/knowledgebase/v1/containers` endpoint and view their containers. + """ + + 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. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + Name of the container. + """ + + description: typing.Optional[str] = pydantic.Field(default=None) + """ + Description of the container. + """ + + status: typing.Optional[ContainerStatus] = pydantic.Field(default=None) + """ + The container's status. + + * `DRAFT` - DRAFT + * `PUBLISHED` - PUBLISHED + * `ARCHIVED` - ARCHIVED + * `TRASH` - TRASH + """ + + container_url: typing.Optional[str] = pydantic.Field(default=None) + """ + The URL to the webpage of the container. + """ + + type: typing.Optional[ContainerType] = pydantic.Field(default=None) + """ + The container's type. + + * `FOLDER` - FOLDER + * `SPACE` - SPACE + * `COLLECTION` - COLLECTION + * `SECTION` - SECTION + * `CATEGORY` - CATEGORY + * `DATABASE` - DATABASE + """ + + visibility: typing.Optional[ContainerVisibility] = pydantic.Field(default=None) + """ + The container's visibility. + + * `PUBLIC` - PUBLIC + * `INTERNAL` - INTERNAL + * `RESTRICTED` - RESTRICTED + """ + + remote_created_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + When the third party's container was created. + """ + + remote_updated_at: typing.Optional[dt.datetime] = pydantic.Field(default=None) + """ + When the third party's container was updated. + """ + + parent_article: typing.Optional[str] = pydantic.Field(default=None) + """ + The parent article a container is nested within. + """ + + parent_container: typing.Optional[str] = pydantic.Field(default=None) + """ + The parent container a container is nested within. + """ + + permissions: typing.Optional[typing.List[ContainerPermissionsItem]] = None + 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/). + """ + + field_mappings: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + remote_data: typing.Optional[typing.List[RemoteData]] = 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 + + +from .group import Group # noqa: E402, F401, I001 + +update_forward_refs(Container) diff --git a/src/merge/resources/knowledgebase/types/container_permissions_item.py b/src/merge/resources/knowledgebase/types/container_permissions_item.py new file mode 100644 index 00000000..6780c597 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/container_permissions_item.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .permission import Permission + +ContainerPermissionsItem = typing.Union[str, Permission] diff --git a/src/merge/resources/knowledgebase/types/container_status.py b/src/merge/resources/knowledgebase/types/container_status.py new file mode 100644 index 00000000..d50b897c --- /dev/null +++ b/src/merge/resources/knowledgebase/types/container_status.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .status_3_c_6_enum import Status3C6Enum + +ContainerStatus = typing.Union[Status3C6Enum, str] diff --git a/src/merge/resources/knowledgebase/types/container_type.py b/src/merge/resources/knowledgebase/types/container_type.py new file mode 100644 index 00000000..fb8f0173 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/container_type.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .container_type_enum import ContainerTypeEnum + +ContainerType = typing.Union[ContainerTypeEnum, str] diff --git a/src/merge/resources/knowledgebase/types/container_type_enum.py b/src/merge/resources/knowledgebase/types/container_type_enum.py new file mode 100644 index 00000000..c38291b0 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/container_type_enum.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class ContainerTypeEnum(str, enum.Enum): + """ + * `FOLDER` - FOLDER + * `SPACE` - SPACE + * `COLLECTION` - COLLECTION + * `SECTION` - SECTION + * `CATEGORY` - CATEGORY + * `DATABASE` - DATABASE + """ + + FOLDER = "FOLDER" + SPACE = "SPACE" + COLLECTION = "COLLECTION" + SECTION = "SECTION" + CATEGORY = "CATEGORY" + DATABASE = "DATABASE" + + def visit( + self, + folder: typing.Callable[[], T_Result], + space: typing.Callable[[], T_Result], + collection: typing.Callable[[], T_Result], + section: typing.Callable[[], T_Result], + category: typing.Callable[[], T_Result], + database: typing.Callable[[], T_Result], + ) -> T_Result: + if self is ContainerTypeEnum.FOLDER: + return folder() + if self is ContainerTypeEnum.SPACE: + return space() + if self is ContainerTypeEnum.COLLECTION: + return collection() + if self is ContainerTypeEnum.SECTION: + return section() + if self is ContainerTypeEnum.CATEGORY: + return category() + if self is ContainerTypeEnum.DATABASE: + return database() diff --git a/src/merge/resources/knowledgebase/types/container_visibility.py b/src/merge/resources/knowledgebase/types/container_visibility.py new file mode 100644 index 00000000..860c8adb --- /dev/null +++ b/src/merge/resources/knowledgebase/types/container_visibility.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .visibility_enum import VisibilityEnum + +ContainerVisibility = typing.Union[VisibilityEnum, str] diff --git a/src/merge/resources/knowledgebase/types/data_passthrough_request.py b/src/merge/resources/knowledgebase/types/data_passthrough_request.py new file mode 100644 index 00000000..5a60bfb6 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/data_passthrough_request.py @@ -0,0 +1,62 @@ +# 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 .data_passthrough_request_method import DataPassthroughRequestMethod +from .data_passthrough_request_request_format import DataPassthroughRequestRequestFormat +from .multipart_form_field_request import MultipartFormFieldRequest + + +class DataPassthroughRequest(UncheckedBaseModel): + """ + # The DataPassthrough Object + ### Description + The `DataPassthrough` object is used to send information to an otherwise-unsupported third-party endpoint. + + ### Usage Example + Create a `DataPassthrough` to get team hierarchies from your Rippling integration. + """ + + method: DataPassthroughRequestMethod + path: str = pydantic.Field() + """ + The path of the request in the third party's platform. + """ + + base_url_override: typing.Optional[str] = pydantic.Field(default=None) + """ + An optional override of the third party's base url for the request. + """ + + data: typing.Optional[str] = pydantic.Field(default=None) + """ + The data with the request. You must include a `request_format` parameter matching the data's format + """ + + multipart_form_data: typing.Optional[typing.List[MultipartFormFieldRequest]] = pydantic.Field(default=None) + """ + Pass an array of `MultipartFormField` objects in here instead of using the `data` param if `request_format` is set to `MULTIPART`. + """ + + headers: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None) + """ + The headers to use for the request (Merge will handle the account's authorization headers). `Content-Type` header is required for passthrough. Choose content type corresponding to expected format of receiving server. + """ + + request_format: typing.Optional[DataPassthroughRequestRequestFormat] = None + normalize_response: typing.Optional[bool] = pydantic.Field(default=None) + """ + Optional. If true, the response will always be an object of the form `{"type": T, "value": ...}` where `T` will be one of `string, boolean, number, null, array, object`. + """ + + 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/knowledgebase/types/data_passthrough_request_method.py b/src/merge/resources/knowledgebase/types/data_passthrough_request_method.py new file mode 100644 index 00000000..58874cbf --- /dev/null +++ b/src/merge/resources/knowledgebase/types/data_passthrough_request_method.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .method_enum import MethodEnum + +DataPassthroughRequestMethod = typing.Union[MethodEnum, str] diff --git a/src/merge/resources/knowledgebase/types/data_passthrough_request_request_format.py b/src/merge/resources/knowledgebase/types/data_passthrough_request_request_format.py new file mode 100644 index 00000000..13dc95f0 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/data_passthrough_request_request_format.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .request_format_enum import RequestFormatEnum + +DataPassthroughRequestRequestFormat = typing.Union[RequestFormatEnum, str] diff --git a/src/merge/resources/knowledgebase/types/debug_mode_log.py b/src/merge/resources/knowledgebase/types/debug_mode_log.py new file mode 100644 index 00000000..9c7d2a3f --- /dev/null +++ b/src/merge/resources/knowledgebase/types/debug_mode_log.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 .debug_model_log_summary import DebugModelLogSummary + + +class DebugModeLog(UncheckedBaseModel): + log_id: str + dashboard_view: str + log_summary: DebugModelLogSummary + + 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/knowledgebase/types/debug_model_log_summary.py b/src/merge/resources/knowledgebase/types/debug_model_log_summary.py new file mode 100644 index 00000000..d7e1d3e6 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/debug_model_log_summary.py @@ -0,0 +1,22 @@ +# 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 + + +class DebugModelLogSummary(UncheckedBaseModel): + url: str + method: str + status_code: int + + 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/knowledgebase/types/enabled_actions_enum.py b/src/merge/resources/knowledgebase/types/enabled_actions_enum.py new file mode 100644 index 00000000..29cf9839 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/enabled_actions_enum.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class EnabledActionsEnum(str, enum.Enum): + """ + * `READ` - READ + * `WRITE` - WRITE + """ + + READ = "READ" + WRITE = "WRITE" + + def visit(self, read: typing.Callable[[], T_Result], write: typing.Callable[[], T_Result]) -> T_Result: + if self is EnabledActionsEnum.READ: + return read() + if self is EnabledActionsEnum.WRITE: + return write() diff --git a/src/merge/resources/knowledgebase/types/encoding_enum.py b/src/merge/resources/knowledgebase/types/encoding_enum.py new file mode 100644 index 00000000..7454647e --- /dev/null +++ b/src/merge/resources/knowledgebase/types/encoding_enum.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class EncodingEnum(str, enum.Enum): + """ + * `RAW` - RAW + * `BASE64` - BASE64 + * `GZIP_BASE64` - GZIP_BASE64 + """ + + RAW = "RAW" + BASE_64 = "BASE64" + GZIP_BASE_64 = "GZIP_BASE64" + + def visit( + self, + raw: typing.Callable[[], T_Result], + base_64: typing.Callable[[], T_Result], + gzip_base_64: typing.Callable[[], T_Result], + ) -> T_Result: + if self is EncodingEnum.RAW: + return raw() + if self is EncodingEnum.BASE_64: + return base_64() + if self is EncodingEnum.GZIP_BASE_64: + return gzip_base_64() diff --git a/src/merge/resources/knowledgebase/types/error_validation_problem.py b/src/merge/resources/knowledgebase/types/error_validation_problem.py new file mode 100644 index 00000000..04f82d05 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/error_validation_problem.py @@ -0,0 +1,24 @@ +# 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 .validation_problem_source import ValidationProblemSource + + +class ErrorValidationProblem(UncheckedBaseModel): + source: typing.Optional[ValidationProblemSource] = None + title: str + detail: str + problem_type: str + + 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/knowledgebase/types/event_type_enum.py b/src/merge/resources/knowledgebase/types/event_type_enum.py new file mode 100644 index 00000000..537cea3f --- /dev/null +++ b/src/merge/resources/knowledgebase/types/event_type_enum.py @@ -0,0 +1,231 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class EventTypeEnum(str, enum.Enum): + """ + * `CREATED_REMOTE_PRODUCTION_API_KEY` - CREATED_REMOTE_PRODUCTION_API_KEY + * `DELETED_REMOTE_PRODUCTION_API_KEY` - DELETED_REMOTE_PRODUCTION_API_KEY + * `CREATED_TEST_API_KEY` - CREATED_TEST_API_KEY + * `DELETED_TEST_API_KEY` - DELETED_TEST_API_KEY + * `REGENERATED_PRODUCTION_API_KEY` - REGENERATED_PRODUCTION_API_KEY + * `REGENERATED_WEBHOOK_SIGNATURE` - REGENERATED_WEBHOOK_SIGNATURE + * `INVITED_USER` - INVITED_USER + * `TWO_FACTOR_AUTH_ENABLED` - TWO_FACTOR_AUTH_ENABLED + * `TWO_FACTOR_AUTH_DISABLED` - TWO_FACTOR_AUTH_DISABLED + * `DELETED_LINKED_ACCOUNT` - DELETED_LINKED_ACCOUNT + * `DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT` - DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT + * `CREATED_DESTINATION` - CREATED_DESTINATION + * `DELETED_DESTINATION` - DELETED_DESTINATION + * `CHANGED_DESTINATION` - CHANGED_DESTINATION + * `CHANGED_SCOPES` - CHANGED_SCOPES + * `CHANGED_PERSONAL_INFORMATION` - CHANGED_PERSONAL_INFORMATION + * `CHANGED_ORGANIZATION_SETTINGS` - CHANGED_ORGANIZATION_SETTINGS + * `ENABLED_INTEGRATION` - ENABLED_INTEGRATION + * `DISABLED_INTEGRATION` - DISABLED_INTEGRATION + * `ENABLED_CATEGORY` - ENABLED_CATEGORY + * `DISABLED_CATEGORY` - DISABLED_CATEGORY + * `CHANGED_PASSWORD` - CHANGED_PASSWORD + * `RESET_PASSWORD` - RESET_PASSWORD + * `ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` - ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION + * `ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` - ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT + * `DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION` - DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION + * `DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT` - DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT + * `CREATED_INTEGRATION_WIDE_FIELD_MAPPING` - CREATED_INTEGRATION_WIDE_FIELD_MAPPING + * `CREATED_LINKED_ACCOUNT_FIELD_MAPPING` - CREATED_LINKED_ACCOUNT_FIELD_MAPPING + * `CHANGED_INTEGRATION_WIDE_FIELD_MAPPING` - CHANGED_INTEGRATION_WIDE_FIELD_MAPPING + * `CHANGED_LINKED_ACCOUNT_FIELD_MAPPING` - CHANGED_LINKED_ACCOUNT_FIELD_MAPPING + * `DELETED_INTEGRATION_WIDE_FIELD_MAPPING` - DELETED_INTEGRATION_WIDE_FIELD_MAPPING + * `DELETED_LINKED_ACCOUNT_FIELD_MAPPING` - DELETED_LINKED_ACCOUNT_FIELD_MAPPING + * `CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + * `CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + * `DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE` - DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE + * `FORCED_LINKED_ACCOUNT_RESYNC` - FORCED_LINKED_ACCOUNT_RESYNC + * `MUTED_ISSUE` - MUTED_ISSUE + * `GENERATED_MAGIC_LINK` - GENERATED_MAGIC_LINK + * `ENABLED_MERGE_WEBHOOK` - ENABLED_MERGE_WEBHOOK + * `DISABLED_MERGE_WEBHOOK` - DISABLED_MERGE_WEBHOOK + * `MERGE_WEBHOOK_TARGET_CHANGED` - MERGE_WEBHOOK_TARGET_CHANGED + * `END_USER_CREDENTIALS_ACCESSED` - END_USER_CREDENTIALS_ACCESSED + """ + + CREATED_REMOTE_PRODUCTION_API_KEY = "CREATED_REMOTE_PRODUCTION_API_KEY" + DELETED_REMOTE_PRODUCTION_API_KEY = "DELETED_REMOTE_PRODUCTION_API_KEY" + CREATED_TEST_API_KEY = "CREATED_TEST_API_KEY" + DELETED_TEST_API_KEY = "DELETED_TEST_API_KEY" + REGENERATED_PRODUCTION_API_KEY = "REGENERATED_PRODUCTION_API_KEY" + REGENERATED_WEBHOOK_SIGNATURE = "REGENERATED_WEBHOOK_SIGNATURE" + INVITED_USER = "INVITED_USER" + TWO_FACTOR_AUTH_ENABLED = "TWO_FACTOR_AUTH_ENABLED" + TWO_FACTOR_AUTH_DISABLED = "TWO_FACTOR_AUTH_DISABLED" + DELETED_LINKED_ACCOUNT = "DELETED_LINKED_ACCOUNT" + DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT = "DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT" + CREATED_DESTINATION = "CREATED_DESTINATION" + DELETED_DESTINATION = "DELETED_DESTINATION" + CHANGED_DESTINATION = "CHANGED_DESTINATION" + CHANGED_SCOPES = "CHANGED_SCOPES" + CHANGED_PERSONAL_INFORMATION = "CHANGED_PERSONAL_INFORMATION" + CHANGED_ORGANIZATION_SETTINGS = "CHANGED_ORGANIZATION_SETTINGS" + ENABLED_INTEGRATION = "ENABLED_INTEGRATION" + DISABLED_INTEGRATION = "DISABLED_INTEGRATION" + ENABLED_CATEGORY = "ENABLED_CATEGORY" + DISABLED_CATEGORY = "DISABLED_CATEGORY" + CHANGED_PASSWORD = "CHANGED_PASSWORD" + RESET_PASSWORD = "RESET_PASSWORD" + ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION = "ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION" + ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT = "ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT" + DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION = "DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION" + DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT = "DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT" + CREATED_INTEGRATION_WIDE_FIELD_MAPPING = "CREATED_INTEGRATION_WIDE_FIELD_MAPPING" + CREATED_LINKED_ACCOUNT_FIELD_MAPPING = "CREATED_LINKED_ACCOUNT_FIELD_MAPPING" + CHANGED_INTEGRATION_WIDE_FIELD_MAPPING = "CHANGED_INTEGRATION_WIDE_FIELD_MAPPING" + CHANGED_LINKED_ACCOUNT_FIELD_MAPPING = "CHANGED_LINKED_ACCOUNT_FIELD_MAPPING" + DELETED_INTEGRATION_WIDE_FIELD_MAPPING = "DELETED_INTEGRATION_WIDE_FIELD_MAPPING" + DELETED_LINKED_ACCOUNT_FIELD_MAPPING = "DELETED_LINKED_ACCOUNT_FIELD_MAPPING" + CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE = "CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE" + CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE = "CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE" + DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE = "DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE" + FORCED_LINKED_ACCOUNT_RESYNC = "FORCED_LINKED_ACCOUNT_RESYNC" + MUTED_ISSUE = "MUTED_ISSUE" + GENERATED_MAGIC_LINK = "GENERATED_MAGIC_LINK" + ENABLED_MERGE_WEBHOOK = "ENABLED_MERGE_WEBHOOK" + DISABLED_MERGE_WEBHOOK = "DISABLED_MERGE_WEBHOOK" + MERGE_WEBHOOK_TARGET_CHANGED = "MERGE_WEBHOOK_TARGET_CHANGED" + END_USER_CREDENTIALS_ACCESSED = "END_USER_CREDENTIALS_ACCESSED" + + def visit( + self, + created_remote_production_api_key: typing.Callable[[], T_Result], + deleted_remote_production_api_key: typing.Callable[[], T_Result], + created_test_api_key: typing.Callable[[], T_Result], + deleted_test_api_key: typing.Callable[[], T_Result], + regenerated_production_api_key: typing.Callable[[], T_Result], + regenerated_webhook_signature: typing.Callable[[], T_Result], + invited_user: typing.Callable[[], T_Result], + two_factor_auth_enabled: typing.Callable[[], T_Result], + two_factor_auth_disabled: typing.Callable[[], T_Result], + deleted_linked_account: typing.Callable[[], T_Result], + deleted_all_common_models_for_linked_account: typing.Callable[[], T_Result], + created_destination: typing.Callable[[], T_Result], + deleted_destination: typing.Callable[[], T_Result], + changed_destination: typing.Callable[[], T_Result], + changed_scopes: typing.Callable[[], T_Result], + changed_personal_information: typing.Callable[[], T_Result], + changed_organization_settings: typing.Callable[[], T_Result], + enabled_integration: typing.Callable[[], T_Result], + disabled_integration: typing.Callable[[], T_Result], + enabled_category: typing.Callable[[], T_Result], + disabled_category: typing.Callable[[], T_Result], + changed_password: typing.Callable[[], T_Result], + reset_password: typing.Callable[[], T_Result], + enabled_redact_unmapped_data_for_organization: typing.Callable[[], T_Result], + enabled_redact_unmapped_data_for_linked_account: typing.Callable[[], T_Result], + disabled_redact_unmapped_data_for_organization: typing.Callable[[], T_Result], + disabled_redact_unmapped_data_for_linked_account: typing.Callable[[], T_Result], + created_integration_wide_field_mapping: typing.Callable[[], T_Result], + created_linked_account_field_mapping: typing.Callable[[], T_Result], + changed_integration_wide_field_mapping: typing.Callable[[], T_Result], + changed_linked_account_field_mapping: typing.Callable[[], T_Result], + deleted_integration_wide_field_mapping: typing.Callable[[], T_Result], + deleted_linked_account_field_mapping: typing.Callable[[], T_Result], + created_linked_account_common_model_override: typing.Callable[[], T_Result], + changed_linked_account_common_model_override: typing.Callable[[], T_Result], + deleted_linked_account_common_model_override: typing.Callable[[], T_Result], + forced_linked_account_resync: typing.Callable[[], T_Result], + muted_issue: typing.Callable[[], T_Result], + generated_magic_link: typing.Callable[[], T_Result], + enabled_merge_webhook: typing.Callable[[], T_Result], + disabled_merge_webhook: typing.Callable[[], T_Result], + merge_webhook_target_changed: typing.Callable[[], T_Result], + end_user_credentials_accessed: typing.Callable[[], T_Result], + ) -> T_Result: + if self is EventTypeEnum.CREATED_REMOTE_PRODUCTION_API_KEY: + return created_remote_production_api_key() + if self is EventTypeEnum.DELETED_REMOTE_PRODUCTION_API_KEY: + return deleted_remote_production_api_key() + if self is EventTypeEnum.CREATED_TEST_API_KEY: + return created_test_api_key() + if self is EventTypeEnum.DELETED_TEST_API_KEY: + return deleted_test_api_key() + if self is EventTypeEnum.REGENERATED_PRODUCTION_API_KEY: + return regenerated_production_api_key() + if self is EventTypeEnum.REGENERATED_WEBHOOK_SIGNATURE: + return regenerated_webhook_signature() + if self is EventTypeEnum.INVITED_USER: + return invited_user() + if self is EventTypeEnum.TWO_FACTOR_AUTH_ENABLED: + return two_factor_auth_enabled() + if self is EventTypeEnum.TWO_FACTOR_AUTH_DISABLED: + return two_factor_auth_disabled() + if self is EventTypeEnum.DELETED_LINKED_ACCOUNT: + return deleted_linked_account() + if self is EventTypeEnum.DELETED_ALL_COMMON_MODELS_FOR_LINKED_ACCOUNT: + return deleted_all_common_models_for_linked_account() + if self is EventTypeEnum.CREATED_DESTINATION: + return created_destination() + if self is EventTypeEnum.DELETED_DESTINATION: + return deleted_destination() + if self is EventTypeEnum.CHANGED_DESTINATION: + return changed_destination() + if self is EventTypeEnum.CHANGED_SCOPES: + return changed_scopes() + if self is EventTypeEnum.CHANGED_PERSONAL_INFORMATION: + return changed_personal_information() + if self is EventTypeEnum.CHANGED_ORGANIZATION_SETTINGS: + return changed_organization_settings() + if self is EventTypeEnum.ENABLED_INTEGRATION: + return enabled_integration() + if self is EventTypeEnum.DISABLED_INTEGRATION: + return disabled_integration() + if self is EventTypeEnum.ENABLED_CATEGORY: + return enabled_category() + if self is EventTypeEnum.DISABLED_CATEGORY: + return disabled_category() + if self is EventTypeEnum.CHANGED_PASSWORD: + return changed_password() + if self is EventTypeEnum.RESET_PASSWORD: + return reset_password() + if self is EventTypeEnum.ENABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION: + return enabled_redact_unmapped_data_for_organization() + if self is EventTypeEnum.ENABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT: + return enabled_redact_unmapped_data_for_linked_account() + if self is EventTypeEnum.DISABLED_REDACT_UNMAPPED_DATA_FOR_ORGANIZATION: + return disabled_redact_unmapped_data_for_organization() + if self is EventTypeEnum.DISABLED_REDACT_UNMAPPED_DATA_FOR_LINKED_ACCOUNT: + return disabled_redact_unmapped_data_for_linked_account() + if self is EventTypeEnum.CREATED_INTEGRATION_WIDE_FIELD_MAPPING: + return created_integration_wide_field_mapping() + if self is EventTypeEnum.CREATED_LINKED_ACCOUNT_FIELD_MAPPING: + return created_linked_account_field_mapping() + if self is EventTypeEnum.CHANGED_INTEGRATION_WIDE_FIELD_MAPPING: + return changed_integration_wide_field_mapping() + if self is EventTypeEnum.CHANGED_LINKED_ACCOUNT_FIELD_MAPPING: + return changed_linked_account_field_mapping() + if self is EventTypeEnum.DELETED_INTEGRATION_WIDE_FIELD_MAPPING: + return deleted_integration_wide_field_mapping() + if self is EventTypeEnum.DELETED_LINKED_ACCOUNT_FIELD_MAPPING: + return deleted_linked_account_field_mapping() + if self is EventTypeEnum.CREATED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE: + return created_linked_account_common_model_override() + if self is EventTypeEnum.CHANGED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE: + return changed_linked_account_common_model_override() + if self is EventTypeEnum.DELETED_LINKED_ACCOUNT_COMMON_MODEL_OVERRIDE: + return deleted_linked_account_common_model_override() + if self is EventTypeEnum.FORCED_LINKED_ACCOUNT_RESYNC: + return forced_linked_account_resync() + if self is EventTypeEnum.MUTED_ISSUE: + return muted_issue() + if self is EventTypeEnum.GENERATED_MAGIC_LINK: + return generated_magic_link() + if self is EventTypeEnum.ENABLED_MERGE_WEBHOOK: + return enabled_merge_webhook() + if self is EventTypeEnum.DISABLED_MERGE_WEBHOOK: + return disabled_merge_webhook() + if self is EventTypeEnum.MERGE_WEBHOOK_TARGET_CHANGED: + return merge_webhook_target_changed() + if self is EventTypeEnum.END_USER_CREDENTIALS_ACCESSED: + return end_user_credentials_accessed() diff --git a/src/merge/resources/knowledgebase/types/external_target_field_api.py b/src/merge/resources/knowledgebase/types/external_target_field_api.py new file mode 100644 index 00000000..c0fea1eb --- /dev/null +++ b/src/merge/resources/knowledgebase/types/external_target_field_api.py @@ -0,0 +1,22 @@ +# 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 + + +class ExternalTargetFieldApi(UncheckedBaseModel): + name: typing.Optional[str] = None + description: typing.Optional[str] = None + is_mapped: typing.Optional[str] = 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/knowledgebase/types/external_target_field_api_response.py b/src/merge/resources/knowledgebase/types/external_target_field_api_response.py new file mode 100644 index 00000000..78a1df72 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/external_target_field_api_response.py @@ -0,0 +1,25 @@ +# 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 .external_target_field_api import ExternalTargetFieldApi + + +class ExternalTargetFieldApiResponse(UncheckedBaseModel): + container: typing.Optional[typing.List[ExternalTargetFieldApi]] = pydantic.Field(alias="Container", default=None) + article: typing.Optional[typing.List[ExternalTargetFieldApi]] = pydantic.Field(alias="Article", default=None) + attachment: typing.Optional[typing.List[ExternalTargetFieldApi]] = pydantic.Field(alias="Attachment", default=None) + user: typing.Optional[typing.List[ExternalTargetFieldApi]] = pydantic.Field(alias="User", default=None) + group: typing.Optional[typing.List[ExternalTargetFieldApi]] = pydantic.Field(alias="Group", default=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/knowledgebase/types/field_mapping_api_instance.py b/src/merge/resources/knowledgebase/types/field_mapping_api_instance.py new file mode 100644 index 00000000..0d257dcb --- /dev/null +++ b/src/merge/resources/knowledgebase/types/field_mapping_api_instance.py @@ -0,0 +1,26 @@ +# 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 .field_mapping_api_instance_remote_field import FieldMappingApiInstanceRemoteField +from .field_mapping_api_instance_target_field import FieldMappingApiInstanceTargetField + + +class FieldMappingApiInstance(UncheckedBaseModel): + id: typing.Optional[str] = None + is_integration_wide: typing.Optional[bool] = None + target_field: typing.Optional[FieldMappingApiInstanceTargetField] = None + remote_field: typing.Optional[FieldMappingApiInstanceRemoteField] = None + jmes_path: typing.Optional[str] = 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/knowledgebase/types/field_mapping_api_instance_remote_field.py b/src/merge/resources/knowledgebase/types/field_mapping_api_instance_remote_field.py new file mode 100644 index 00000000..578a2b10 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/field_mapping_api_instance_remote_field.py @@ -0,0 +1,27 @@ +# 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 .field_mapping_api_instance_remote_field_remote_endpoint_info import ( + FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo, +) + + +class FieldMappingApiInstanceRemoteField(UncheckedBaseModel): + remote_key_name: typing.Optional[str] = None + schema_: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field( + alias="schema", default=None + ) + remote_endpoint_info: FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo + + 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/knowledgebase/types/field_mapping_api_instance_remote_field_remote_endpoint_info.py b/src/merge/resources/knowledgebase/types/field_mapping_api_instance_remote_field_remote_endpoint_info.py new file mode 100644 index 00000000..4171f08b --- /dev/null +++ b/src/merge/resources/knowledgebase/types/field_mapping_api_instance_remote_field_remote_endpoint_info.py @@ -0,0 +1,22 @@ +# 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 + + +class FieldMappingApiInstanceRemoteFieldRemoteEndpointInfo(UncheckedBaseModel): + method: typing.Optional[str] = None + url_path: typing.Optional[str] = None + field_traversal_path: typing.Optional[typing.List[str]] = 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/knowledgebase/types/field_mapping_api_instance_response.py b/src/merge/resources/knowledgebase/types/field_mapping_api_instance_response.py new file mode 100644 index 00000000..a3237ed5 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/field_mapping_api_instance_response.py @@ -0,0 +1,25 @@ +# 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 .field_mapping_api_instance import FieldMappingApiInstance + + +class FieldMappingApiInstanceResponse(UncheckedBaseModel): + container: typing.Optional[typing.List[FieldMappingApiInstance]] = pydantic.Field(alias="Container", default=None) + article: typing.Optional[typing.List[FieldMappingApiInstance]] = pydantic.Field(alias="Article", default=None) + attachment: typing.Optional[typing.List[FieldMappingApiInstance]] = pydantic.Field(alias="Attachment", default=None) + user: typing.Optional[typing.List[FieldMappingApiInstance]] = pydantic.Field(alias="User", default=None) + group: typing.Optional[typing.List[FieldMappingApiInstance]] = pydantic.Field(alias="Group", default=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/knowledgebase/types/field_mapping_api_instance_target_field.py b/src/merge/resources/knowledgebase/types/field_mapping_api_instance_target_field.py new file mode 100644 index 00000000..e6474cba --- /dev/null +++ b/src/merge/resources/knowledgebase/types/field_mapping_api_instance_target_field.py @@ -0,0 +1,22 @@ +# 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 + + +class FieldMappingApiInstanceTargetField(UncheckedBaseModel): + name: str + description: str + is_organization_wide: bool + + 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/knowledgebase/types/field_mapping_instance_response.py b/src/merge/resources/knowledgebase/types/field_mapping_instance_response.py new file mode 100644 index 00000000..f921e641 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/field_mapping_instance_response.py @@ -0,0 +1,27 @@ +# 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 .debug_mode_log import DebugModeLog +from .error_validation_problem import ErrorValidationProblem +from .field_mapping_api_instance import FieldMappingApiInstance +from .warning_validation_problem import WarningValidationProblem + + +class FieldMappingInstanceResponse(UncheckedBaseModel): + model: FieldMappingApiInstance + warnings: typing.List[WarningValidationProblem] + errors: typing.List[ErrorValidationProblem] + logs: typing.Optional[typing.List[DebugModeLog]] = 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/knowledgebase/types/field_permission_deserializer.py b/src/merge/resources/knowledgebase/types/field_permission_deserializer.py new file mode 100644 index 00000000..1d71ae04 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/field_permission_deserializer.py @@ -0,0 +1,21 @@ +# 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 + + +class FieldPermissionDeserializer(UncheckedBaseModel): + enabled_fields: typing.Optional[typing.List[typing.Optional[typing.Any]]] = None + disabled_fields: typing.Optional[typing.List[typing.Optional[typing.Any]]] = 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/knowledgebase/types/field_permission_deserializer_request.py b/src/merge/resources/knowledgebase/types/field_permission_deserializer_request.py new file mode 100644 index 00000000..a4113b46 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/field_permission_deserializer_request.py @@ -0,0 +1,21 @@ +# 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 + + +class FieldPermissionDeserializerRequest(UncheckedBaseModel): + enabled_fields: typing.Optional[typing.List[typing.Optional[typing.Any]]] = None + disabled_fields: typing.Optional[typing.List[typing.Optional[typing.Any]]] = 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/knowledgebase/types/group.py b/src/merge/resources/knowledgebase/types/group.py new file mode 100644 index 00000000..99fce32b --- /dev/null +++ b/src/merge/resources/knowledgebase/types/group.py @@ -0,0 +1,71 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import datetime as dt +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ....core.unchecked_base_model import UncheckedBaseModel +from .group_users_item import GroupUsersItem +from .remote_data import RemoteData + + +class Group(UncheckedBaseModel): + """ + # The Group Object + ### Description + The `Group` object is used to represent any subset of `Users`. This can extend to company domains as well. + ### Usage Example + Fetch from the `GET /api/knowledgebase/v1/groups` endpoint and view their groups. + """ + + 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. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + The group's name. + """ + + parent_group: typing.Optional["GroupParentGroup"] = pydantic.Field(default=None) + """ + The parent group for this group. + """ + + users: typing.Optional[typing.List[GroupUsersItem]] = None + 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/). + """ + + field_mappings: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + remote_data: typing.Optional[typing.List[RemoteData]] = 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 + + +from .group_parent_group import GroupParentGroup # noqa: E402, F401, I001 + +update_forward_refs(Group) diff --git a/src/merge/resources/knowledgebase/types/group_parent_group.py b/src/merge/resources/knowledgebase/types/group_parent_group.py new file mode 100644 index 00000000..4a8aec86 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/group_parent_group.py @@ -0,0 +1,9 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +if typing.TYPE_CHECKING: + from .group import Group +GroupParentGroup = typing.Union[str, "Group"] diff --git a/src/merge/resources/knowledgebase/types/group_users_item.py b/src/merge/resources/knowledgebase/types/group_users_item.py new file mode 100644 index 00000000..969cb173 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/group_users_item.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .user import User + +GroupUsersItem = typing.Union[str, User] diff --git a/src/merge/resources/knowledgebase/types/individual_common_model_scope_deserializer.py b/src/merge/resources/knowledgebase/types/individual_common_model_scope_deserializer.py new file mode 100644 index 00000000..4b1ef6a4 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/individual_common_model_scope_deserializer.py @@ -0,0 +1,24 @@ +# 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 .field_permission_deserializer import FieldPermissionDeserializer +from .model_permission_deserializer import ModelPermissionDeserializer + + +class IndividualCommonModelScopeDeserializer(UncheckedBaseModel): + model_name: str + model_permissions: typing.Optional[typing.Dict[str, ModelPermissionDeserializer]] = None + field_permissions: typing.Optional[FieldPermissionDeserializer] = 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/knowledgebase/types/individual_common_model_scope_deserializer_request.py b/src/merge/resources/knowledgebase/types/individual_common_model_scope_deserializer_request.py new file mode 100644 index 00000000..1dcda203 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/individual_common_model_scope_deserializer_request.py @@ -0,0 +1,24 @@ +# 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 .field_permission_deserializer_request import FieldPermissionDeserializerRequest +from .model_permission_deserializer_request import ModelPermissionDeserializerRequest + + +class IndividualCommonModelScopeDeserializerRequest(UncheckedBaseModel): + model_name: str + model_permissions: typing.Optional[typing.Dict[str, ModelPermissionDeserializerRequest]] = None + field_permissions: typing.Optional[FieldPermissionDeserializerRequest] = 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/knowledgebase/types/issue.py b/src/merge/resources/knowledgebase/types/issue.py new file mode 100644 index 00000000..df31be95 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/issue.py @@ -0,0 +1,36 @@ +# 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 .issue_status import IssueStatus + + +class Issue(UncheckedBaseModel): + id: typing.Optional[str] = None + status: typing.Optional[IssueStatus] = pydantic.Field(default=None) + """ + Status of the issue. Options: ('ONGOING', 'RESOLVED') + + * `ONGOING` - ONGOING + * `RESOLVED` - RESOLVED + """ + + error_description: str + end_user: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + first_incident_time: typing.Optional[dt.datetime] = None + last_incident_time: typing.Optional[dt.datetime] = None + is_muted: typing.Optional[bool] = None + error_details: typing.Optional[typing.List[str]] = 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/knowledgebase/types/issue_status.py b/src/merge/resources/knowledgebase/types/issue_status.py new file mode 100644 index 00000000..8e4d6516 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/issue_status.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .issue_status_enum import IssueStatusEnum + +IssueStatus = typing.Union[IssueStatusEnum, str] diff --git a/src/merge/resources/knowledgebase/types/issue_status_enum.py b/src/merge/resources/knowledgebase/types/issue_status_enum.py new file mode 100644 index 00000000..57eb9618 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/issue_status_enum.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class IssueStatusEnum(str, enum.Enum): + """ + * `ONGOING` - ONGOING + * `RESOLVED` - RESOLVED + """ + + ONGOING = "ONGOING" + RESOLVED = "RESOLVED" + + def visit(self, ongoing: typing.Callable[[], T_Result], resolved: typing.Callable[[], T_Result]) -> T_Result: + if self is IssueStatusEnum.ONGOING: + return ongoing() + if self is IssueStatusEnum.RESOLVED: + return resolved() diff --git a/src/merge/resources/knowledgebase/types/language_enum.py b/src/merge/resources/knowledgebase/types/language_enum.py new file mode 100644 index 00000000..44b693f2 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/language_enum.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class LanguageEnum(str, enum.Enum): + """ + * `en` - en + * `de` - de + """ + + EN = "en" + DE = "de" + + def visit(self, en: typing.Callable[[], T_Result], de: typing.Callable[[], T_Result]) -> T_Result: + if self is LanguageEnum.EN: + return en() + if self is LanguageEnum.DE: + return de() diff --git a/src/merge/resources/knowledgebase/types/last_sync_result_enum.py b/src/merge/resources/knowledgebase/types/last_sync_result_enum.py new file mode 100644 index 00000000..ec777ee6 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/last_sync_result_enum.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class LastSyncResultEnum(str, enum.Enum): + """ + * `SYNCING` - SYNCING + * `DONE` - DONE + * `FAILED` - FAILED + * `DISABLED` - DISABLED + * `PAUSED` - PAUSED + * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED + """ + + SYNCING = "SYNCING" + DONE = "DONE" + FAILED = "FAILED" + DISABLED = "DISABLED" + PAUSED = "PAUSED" + PARTIALLY_SYNCED = "PARTIALLY_SYNCED" + + def visit( + self, + syncing: typing.Callable[[], T_Result], + done: typing.Callable[[], T_Result], + failed: typing.Callable[[], T_Result], + disabled: typing.Callable[[], T_Result], + paused: typing.Callable[[], T_Result], + partially_synced: typing.Callable[[], T_Result], + ) -> T_Result: + if self is LastSyncResultEnum.SYNCING: + return syncing() + if self is LastSyncResultEnum.DONE: + return done() + if self is LastSyncResultEnum.FAILED: + return failed() + if self is LastSyncResultEnum.DISABLED: + return disabled() + if self is LastSyncResultEnum.PAUSED: + return paused() + if self is LastSyncResultEnum.PARTIALLY_SYNCED: + return partially_synced() diff --git a/src/merge/resources/knowledgebase/types/link_token.py b/src/merge/resources/knowledgebase/types/link_token.py new file mode 100644 index 00000000..f78dedeb --- /dev/null +++ b/src/merge/resources/knowledgebase/types/link_token.py @@ -0,0 +1,22 @@ +# 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 + + +class LinkToken(UncheckedBaseModel): + link_token: str + integration_name: typing.Optional[str] = None + magic_link_url: typing.Optional[str] = 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/knowledgebase/types/method_enum.py b/src/merge/resources/knowledgebase/types/method_enum.py new file mode 100644 index 00000000..57bcde10 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/method_enum.py @@ -0,0 +1,51 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class MethodEnum(str, enum.Enum): + """ + * `GET` - GET + * `OPTIONS` - OPTIONS + * `HEAD` - HEAD + * `POST` - POST + * `PUT` - PUT + * `PATCH` - PATCH + * `DELETE` - DELETE + """ + + GET = "GET" + OPTIONS = "OPTIONS" + HEAD = "HEAD" + POST = "POST" + PUT = "PUT" + PATCH = "PATCH" + DELETE = "DELETE" + + def visit( + self, + get: typing.Callable[[], T_Result], + options: typing.Callable[[], T_Result], + head: typing.Callable[[], T_Result], + post: typing.Callable[[], T_Result], + put: typing.Callable[[], T_Result], + patch: typing.Callable[[], T_Result], + delete: typing.Callable[[], T_Result], + ) -> T_Result: + if self is MethodEnum.GET: + return get() + if self is MethodEnum.OPTIONS: + return options() + if self is MethodEnum.HEAD: + return head() + if self is MethodEnum.POST: + return post() + if self is MethodEnum.PUT: + return put() + if self is MethodEnum.PATCH: + return patch() + if self is MethodEnum.DELETE: + return delete() diff --git a/src/merge/resources/knowledgebase/types/model_operation.py b/src/merge/resources/knowledgebase/types/model_operation.py new file mode 100644 index 00000000..c367572d --- /dev/null +++ b/src/merge/resources/knowledgebase/types/model_operation.py @@ -0,0 +1,32 @@ +# 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 + + +class ModelOperation(UncheckedBaseModel): + """ + # The ModelOperation Object + ### Description + The `ModelOperation` object is used to represent the operations that are currently supported for a given model. + + ### Usage Example + View what operations are supported for the `Candidate` endpoint. + """ + + model_name: str + available_operations: typing.List[str] + required_post_parameters: typing.List[str] + supported_fields: typing.List[str] + + 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/knowledgebase/types/model_permission_deserializer.py b/src/merge/resources/knowledgebase/types/model_permission_deserializer.py new file mode 100644 index 00000000..6381814c --- /dev/null +++ b/src/merge/resources/knowledgebase/types/model_permission_deserializer.py @@ -0,0 +1,20 @@ +# 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 + + +class ModelPermissionDeserializer(UncheckedBaseModel): + is_enabled: typing.Optional[bool] = 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/knowledgebase/types/model_permission_deserializer_request.py b/src/merge/resources/knowledgebase/types/model_permission_deserializer_request.py new file mode 100644 index 00000000..cdc2ff4c --- /dev/null +++ b/src/merge/resources/knowledgebase/types/model_permission_deserializer_request.py @@ -0,0 +1,20 @@ +# 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 + + +class ModelPermissionDeserializerRequest(UncheckedBaseModel): + is_enabled: typing.Optional[bool] = 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/knowledgebase/types/multipart_form_field_request.py b/src/merge/resources/knowledgebase/types/multipart_form_field_request.py new file mode 100644 index 00000000..abc37692 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/multipart_form_field_request.py @@ -0,0 +1,57 @@ +# 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 .multipart_form_field_request_encoding import MultipartFormFieldRequestEncoding + + +class MultipartFormFieldRequest(UncheckedBaseModel): + """ + # The MultipartFormField Object + ### Description + The `MultipartFormField` object is used to represent fields in an HTTP request using `multipart/form-data`. + + ### Usage Example + Create a `MultipartFormField` to define a multipart form entry. + """ + + name: str = pydantic.Field() + """ + The name of the form field + """ + + data: str = pydantic.Field() + """ + The data for the form field. + """ + + encoding: typing.Optional[MultipartFormFieldRequestEncoding] = pydantic.Field(default=None) + """ + The encoding of the value of `data`. Defaults to `RAW` if not defined. + + * `RAW` - RAW + * `BASE64` - BASE64 + * `GZIP_BASE64` - GZIP_BASE64 + """ + + file_name: typing.Optional[str] = pydantic.Field(default=None) + """ + The file name of the form field, if the field is for a file. + """ + + content_type: typing.Optional[str] = pydantic.Field(default=None) + """ + The MIME type of the file, if the field is for a file. + """ + + 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/knowledgebase/types/multipart_form_field_request_encoding.py b/src/merge/resources/knowledgebase/types/multipart_form_field_request_encoding.py new file mode 100644 index 00000000..c6513b6b --- /dev/null +++ b/src/merge/resources/knowledgebase/types/multipart_form_field_request_encoding.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .encoding_enum import EncodingEnum + +MultipartFormFieldRequestEncoding = typing.Union[EncodingEnum, str] diff --git a/src/merge/resources/knowledgebase/types/paginated_account_details_and_actions_list.py b/src/merge/resources/knowledgebase/types/paginated_account_details_and_actions_list.py new file mode 100644 index 00000000..d2d16116 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/paginated_account_details_and_actions_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 .account_details_and_actions import AccountDetailsAndActions + + +class PaginatedAccountDetailsAndActionsList(UncheckedBaseModel): + next: typing.Optional[str] = None + previous: typing.Optional[str] = None + results: typing.Optional[typing.List[AccountDetailsAndActions]] = 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/knowledgebase/types/paginated_article_list.py b/src/merge/resources/knowledgebase/types/paginated_article_list.py new file mode 100644 index 00000000..81de40ee --- /dev/null +++ b/src/merge/resources/knowledgebase/types/paginated_article_list.py @@ -0,0 +1,30 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ....core.unchecked_base_model import UncheckedBaseModel + + +class PaginatedArticleList(UncheckedBaseModel): + next: typing.Optional[str] = None + previous: typing.Optional[str] = None + results: typing.Optional[typing.List["Article"]] = 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 + + +from .article import Article # noqa: E402, F401, I001 +from .group import Group # noqa: E402, F401, I001 + +update_forward_refs(PaginatedArticleList) diff --git a/src/merge/resources/knowledgebase/types/paginated_attachment_list.py b/src/merge/resources/knowledgebase/types/paginated_attachment_list.py new file mode 100644 index 00000000..3222cbc0 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/paginated_attachment_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 .attachment import Attachment + + +class PaginatedAttachmentList(UncheckedBaseModel): + next: typing.Optional[str] = None + previous: typing.Optional[str] = None + results: typing.Optional[typing.List[Attachment]] = 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/knowledgebase/types/paginated_audit_log_event_list.py b/src/merge/resources/knowledgebase/types/paginated_audit_log_event_list.py new file mode 100644 index 00000000..24139397 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/paginated_audit_log_event_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 .audit_log_event import AuditLogEvent + + +class PaginatedAuditLogEventList(UncheckedBaseModel): + next: typing.Optional[str] = None + previous: typing.Optional[str] = None + results: typing.Optional[typing.List[AuditLogEvent]] = 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/knowledgebase/types/paginated_container_list.py b/src/merge/resources/knowledgebase/types/paginated_container_list.py new file mode 100644 index 00000000..4a3ab735 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/paginated_container_list.py @@ -0,0 +1,30 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ....core.unchecked_base_model import UncheckedBaseModel +from .container import Container + + +class PaginatedContainerList(UncheckedBaseModel): + next: typing.Optional[str] = None + previous: typing.Optional[str] = None + results: typing.Optional[typing.List[Container]] = 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 + + +from .group import Group # noqa: E402, F401, I001 + +update_forward_refs(PaginatedContainerList) diff --git a/src/merge/resources/knowledgebase/types/paginated_group_list.py b/src/merge/resources/knowledgebase/types/paginated_group_list.py new file mode 100644 index 00000000..ddbf97b2 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/paginated_group_list.py @@ -0,0 +1,29 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ....core.unchecked_base_model import UncheckedBaseModel + + +class PaginatedGroupList(UncheckedBaseModel): + next: typing.Optional[str] = None + previous: typing.Optional[str] = None + results: typing.Optional[typing.List["Group"]] = 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 + + +from .group import Group # noqa: E402, F401, I001 + +update_forward_refs(PaginatedGroupList) diff --git a/src/merge/resources/knowledgebase/types/paginated_issue_list.py b/src/merge/resources/knowledgebase/types/paginated_issue_list.py new file mode 100644 index 00000000..686173e5 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/paginated_issue_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 .issue import Issue + + +class PaginatedIssueList(UncheckedBaseModel): + next: typing.Optional[str] = None + previous: typing.Optional[str] = None + results: typing.Optional[typing.List[Issue]] = 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/knowledgebase/types/paginated_sync_status_list.py b/src/merge/resources/knowledgebase/types/paginated_sync_status_list.py new file mode 100644 index 00000000..cc4bd7a8 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/paginated_sync_status_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 .sync_status import SyncStatus + + +class PaginatedSyncStatusList(UncheckedBaseModel): + next: typing.Optional[str] = None + previous: typing.Optional[str] = None + results: typing.Optional[typing.List[SyncStatus]] = 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/knowledgebase/types/paginated_user_list.py b/src/merge/resources/knowledgebase/types/paginated_user_list.py new file mode 100644 index 00000000..809b285c --- /dev/null +++ b/src/merge/resources/knowledgebase/types/paginated_user_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 .user import User + + +class PaginatedUserList(UncheckedBaseModel): + next: typing.Optional[str] = None + previous: typing.Optional[str] = None + results: typing.Optional[typing.List[User]] = 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/knowledgebase/types/permission.py b/src/merge/resources/knowledgebase/types/permission.py new file mode 100644 index 00000000..25d694be --- /dev/null +++ b/src/merge/resources/knowledgebase/types/permission.py @@ -0,0 +1,77 @@ +# This file was auto-generated by Fern from our API Definition. + +from __future__ import annotations + +import datetime as dt +import typing + +import pydantic +from ....core.pydantic_utilities import IS_PYDANTIC_V2, update_forward_refs +from ....core.unchecked_base_model import UncheckedBaseModel +from .permission_group import PermissionGroup +from .permission_type import PermissionType +from .permission_user import PermissionUser +from .roles_enum import RolesEnum + + +class Permission(UncheckedBaseModel): + """ + # The Permission Object + ### Description + The `Permission` object is used to represent a user's or group's access to an article or container. Permissions are unexpanded by default. + ### Usage Example + """ + + 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. + """ + + user: typing.Optional[PermissionUser] = None + group: typing.Optional[PermissionGroup] = None + type: typing.Optional[PermissionType] = pydantic.Field(default=None) + """ + Denotes what type of people have access to the Article or Container. + + * `USER` - USER + * `GROUP` - GROUP + * `COMPANY` - COMPANY + * `ANYONE` - ANYONE + """ + + roles: typing.Optional[typing.List[typing.Optional[RolesEnum]]] = pydantic.Field(default=None) + """ + The permissions that the user or group has for the Article or Container. It is possible for a user or group to have multiple roles, such as viewing & uploading. + """ + + 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/). + """ + + field_mappings: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = 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 + + +from .group import Group # noqa: E402, F401, I001 + +update_forward_refs(Permission) diff --git a/src/merge/resources/knowledgebase/types/permission_group.py b/src/merge/resources/knowledgebase/types/permission_group.py new file mode 100644 index 00000000..db417995 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/permission_group.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .group import Group + +PermissionGroup = typing.Union[str, Group] diff --git a/src/merge/resources/knowledgebase/types/permission_type.py b/src/merge/resources/knowledgebase/types/permission_type.py new file mode 100644 index 00000000..974034d9 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/permission_type.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .permission_type_enum import PermissionTypeEnum + +PermissionType = typing.Union[PermissionTypeEnum, str] diff --git a/src/merge/resources/knowledgebase/types/permission_type_enum.py b/src/merge/resources/knowledgebase/types/permission_type_enum.py new file mode 100644 index 00000000..be003e46 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/permission_type_enum.py @@ -0,0 +1,36 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class PermissionTypeEnum(str, enum.Enum): + """ + * `USER` - USER + * `GROUP` - GROUP + * `COMPANY` - COMPANY + * `ANYONE` - ANYONE + """ + + USER = "USER" + GROUP = "GROUP" + COMPANY = "COMPANY" + ANYONE = "ANYONE" + + def visit( + self, + user: typing.Callable[[], T_Result], + group: typing.Callable[[], T_Result], + company: typing.Callable[[], T_Result], + anyone: typing.Callable[[], T_Result], + ) -> T_Result: + if self is PermissionTypeEnum.USER: + return user() + if self is PermissionTypeEnum.GROUP: + return group() + if self is PermissionTypeEnum.COMPANY: + return company() + if self is PermissionTypeEnum.ANYONE: + return anyone() diff --git a/src/merge/resources/knowledgebase/types/permission_user.py b/src/merge/resources/knowledgebase/types/permission_user.py new file mode 100644 index 00000000..85fec9a9 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/permission_user.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .user import User + +PermissionUser = typing.Union[str, User] diff --git a/src/merge/resources/knowledgebase/types/remote_data.py b/src/merge/resources/knowledgebase/types/remote_data.py new file mode 100644 index 00000000..b60f53bf --- /dev/null +++ b/src/merge/resources/knowledgebase/types/remote_data.py @@ -0,0 +1,34 @@ +# 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 + + +class RemoteData(UncheckedBaseModel): + """ + # The RemoteData Object + ### Description + The `RemoteData` object is used to represent the full data pulled from the third-party API for an object. + + ### Usage Example + TODO + """ + + path: str = pydantic.Field() + """ + The third-party API path that is being called. + """ + + data: typing.Optional[typing.Optional[typing.Any]] = 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/knowledgebase/types/remote_endpoint_info.py b/src/merge/resources/knowledgebase/types/remote_endpoint_info.py new file mode 100644 index 00000000..07ceff6a --- /dev/null +++ b/src/merge/resources/knowledgebase/types/remote_endpoint_info.py @@ -0,0 +1,22 @@ +# 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 + + +class RemoteEndpointInfo(UncheckedBaseModel): + method: str + url_path: str + field_traversal_path: typing.List[typing.Optional[typing.Any]] + + 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/knowledgebase/types/remote_field_api.py b/src/merge/resources/knowledgebase/types/remote_field_api.py new file mode 100644 index 00000000..0756bfc3 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/remote_field_api.py @@ -0,0 +1,28 @@ +# 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 .remote_endpoint_info import RemoteEndpointInfo +from .remote_field_api_advanced_metadata import RemoteFieldApiAdvancedMetadata +from .remote_field_api_coverage import RemoteFieldApiCoverage + + +class RemoteFieldApi(UncheckedBaseModel): + schema_: typing.Dict[str, typing.Optional[typing.Any]] = pydantic.Field(alias="schema") + remote_key_name: str + remote_endpoint_info: RemoteEndpointInfo + example_values: typing.Optional[typing.List[typing.Optional[typing.Any]]] = None + advanced_metadata: typing.Optional[RemoteFieldApiAdvancedMetadata] = None + coverage: typing.Optional[RemoteFieldApiCoverage] = 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/knowledgebase/types/remote_field_api_advanced_metadata.py b/src/merge/resources/knowledgebase/types/remote_field_api_advanced_metadata.py new file mode 100644 index 00000000..e93da936 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/remote_field_api_advanced_metadata.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .advanced_metadata import AdvancedMetadata + +RemoteFieldApiAdvancedMetadata = typing.Union[AdvancedMetadata, str] diff --git a/src/merge/resources/knowledgebase/types/remote_field_api_coverage.py b/src/merge/resources/knowledgebase/types/remote_field_api_coverage.py new file mode 100644 index 00000000..adcd9be9 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/remote_field_api_coverage.py @@ -0,0 +1,5 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +RemoteFieldApiCoverage = typing.Union[int, float] diff --git a/src/merge/resources/knowledgebase/types/remote_field_api_response.py b/src/merge/resources/knowledgebase/types/remote_field_api_response.py new file mode 100644 index 00000000..13490496 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/remote_field_api_response.py @@ -0,0 +1,25 @@ +# 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 .remote_field_api import RemoteFieldApi + + +class RemoteFieldApiResponse(UncheckedBaseModel): + container: typing.Optional[typing.List[RemoteFieldApi]] = pydantic.Field(alias="Container", default=None) + article: typing.Optional[typing.List[RemoteFieldApi]] = pydantic.Field(alias="Article", default=None) + attachment: typing.Optional[typing.List[RemoteFieldApi]] = pydantic.Field(alias="Attachment", default=None) + user: typing.Optional[typing.List[RemoteFieldApi]] = pydantic.Field(alias="User", default=None) + group: typing.Optional[typing.List[RemoteFieldApi]] = pydantic.Field(alias="Group", default=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/knowledgebase/types/remote_key.py b/src/merge/resources/knowledgebase/types/remote_key.py new file mode 100644 index 00000000..e5d9758c --- /dev/null +++ b/src/merge/resources/knowledgebase/types/remote_key.py @@ -0,0 +1,30 @@ +# 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 + + +class RemoteKey(UncheckedBaseModel): + """ + # The RemoteKey Object + ### Description + The `RemoteKey` object is used to represent a request for a new remote key. + + ### Usage Example + Post a `GenerateRemoteKey` to receive a new `RemoteKey`. + """ + + name: str + key: str + + 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/knowledgebase/types/remote_response.py b/src/merge/resources/knowledgebase/types/remote_response.py new file mode 100644 index 00000000..db01131f --- /dev/null +++ b/src/merge/resources/knowledgebase/types/remote_response.py @@ -0,0 +1,36 @@ +# 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 .remote_response_response_type import RemoteResponseResponseType + + +class RemoteResponse(UncheckedBaseModel): + """ + # The RemoteResponse Object + ### Description + The `RemoteResponse` object is used to represent information returned from a third-party endpoint. + + ### Usage Example + View the `RemoteResponse` returned from your `DataPassthrough`. + """ + + method: str + path: str + status: int + response: typing.Optional[typing.Any] = None + response_headers: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = None + response_type: typing.Optional[RemoteResponseResponseType] = None + headers: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = 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/knowledgebase/types/remote_response_response_type.py b/src/merge/resources/knowledgebase/types/remote_response_response_type.py new file mode 100644 index 00000000..2556417a --- /dev/null +++ b/src/merge/resources/knowledgebase/types/remote_response_response_type.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .response_type_enum import ResponseTypeEnum + +RemoteResponseResponseType = typing.Union[ResponseTypeEnum, str] diff --git a/src/merge/resources/knowledgebase/types/request_format_enum.py b/src/merge/resources/knowledgebase/types/request_format_enum.py new file mode 100644 index 00000000..21c272f2 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/request_format_enum.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class RequestFormatEnum(str, enum.Enum): + """ + * `JSON` - JSON + * `XML` - XML + * `MULTIPART` - MULTIPART + """ + + JSON = "JSON" + XML = "XML" + MULTIPART = "MULTIPART" + + def visit( + self, + json: typing.Callable[[], T_Result], + xml: typing.Callable[[], T_Result], + multipart: typing.Callable[[], T_Result], + ) -> T_Result: + if self is RequestFormatEnum.JSON: + return json() + if self is RequestFormatEnum.XML: + return xml() + if self is RequestFormatEnum.MULTIPART: + return multipart() diff --git a/src/merge/resources/knowledgebase/types/response_type_enum.py b/src/merge/resources/knowledgebase/types/response_type_enum.py new file mode 100644 index 00000000..ef241302 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/response_type_enum.py @@ -0,0 +1,22 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class ResponseTypeEnum(str, enum.Enum): + """ + * `JSON` - JSON + * `BASE64_GZIP` - BASE64_GZIP + """ + + JSON = "JSON" + BASE_64_GZIP = "BASE64_GZIP" + + def visit(self, json: typing.Callable[[], T_Result], base_64_gzip: typing.Callable[[], T_Result]) -> T_Result: + if self is ResponseTypeEnum.JSON: + return json() + if self is ResponseTypeEnum.BASE_64_GZIP: + return base_64_gzip() diff --git a/src/merge/resources/knowledgebase/types/role_enum.py b/src/merge/resources/knowledgebase/types/role_enum.py new file mode 100644 index 00000000..a6cfcc6f --- /dev/null +++ b/src/merge/resources/knowledgebase/types/role_enum.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class RoleEnum(str, enum.Enum): + """ + * `ADMIN` - ADMIN + * `DEVELOPER` - DEVELOPER + * `MEMBER` - MEMBER + * `API` - API + * `SYSTEM` - SYSTEM + * `MERGE_TEAM` - MERGE_TEAM + """ + + ADMIN = "ADMIN" + DEVELOPER = "DEVELOPER" + MEMBER = "MEMBER" + API = "API" + SYSTEM = "SYSTEM" + MERGE_TEAM = "MERGE_TEAM" + + def visit( + self, + admin: typing.Callable[[], T_Result], + developer: typing.Callable[[], T_Result], + member: typing.Callable[[], T_Result], + api: typing.Callable[[], T_Result], + system: typing.Callable[[], T_Result], + merge_team: typing.Callable[[], T_Result], + ) -> T_Result: + if self is RoleEnum.ADMIN: + return admin() + if self is RoleEnum.DEVELOPER: + return developer() + if self is RoleEnum.MEMBER: + return member() + if self is RoleEnum.API: + return api() + if self is RoleEnum.SYSTEM: + return system() + if self is RoleEnum.MERGE_TEAM: + return merge_team() diff --git a/src/merge/resources/knowledgebase/types/roles_enum.py b/src/merge/resources/knowledgebase/types/roles_enum.py new file mode 100644 index 00000000..1176c798 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/roles_enum.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class RolesEnum(str, enum.Enum): + """ + * `READ` - READ + * `WRITE` - WRITE + * `OWNER` - OWNER + """ + + READ = "READ" + WRITE = "WRITE" + OWNER = "OWNER" + + def visit( + self, + read: typing.Callable[[], T_Result], + write: typing.Callable[[], T_Result], + owner: typing.Callable[[], T_Result], + ) -> T_Result: + if self is RolesEnum.READ: + return read() + if self is RolesEnum.WRITE: + return write() + if self is RolesEnum.OWNER: + return owner() diff --git a/src/merge/resources/knowledgebase/types/selective_sync_configurations_usage_enum.py b/src/merge/resources/knowledgebase/types/selective_sync_configurations_usage_enum.py new file mode 100644 index 00000000..9ff43813 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/selective_sync_configurations_usage_enum.py @@ -0,0 +1,24 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class SelectiveSyncConfigurationsUsageEnum(str, enum.Enum): + """ + * `IN_NEXT_SYNC` - IN_NEXT_SYNC + * `IN_LAST_SYNC` - IN_LAST_SYNC + """ + + IN_NEXT_SYNC = "IN_NEXT_SYNC" + IN_LAST_SYNC = "IN_LAST_SYNC" + + def visit( + self, in_next_sync: typing.Callable[[], T_Result], in_last_sync: typing.Callable[[], T_Result] + ) -> T_Result: + if self is SelectiveSyncConfigurationsUsageEnum.IN_NEXT_SYNC: + return in_next_sync() + if self is SelectiveSyncConfigurationsUsageEnum.IN_LAST_SYNC: + return in_last_sync() diff --git a/src/merge/resources/knowledgebase/types/status_3_c_6_enum.py b/src/merge/resources/knowledgebase/types/status_3_c_6_enum.py new file mode 100644 index 00000000..16df5fa6 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/status_3_c_6_enum.py @@ -0,0 +1,36 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class Status3C6Enum(str, enum.Enum): + """ + * `DRAFT` - DRAFT + * `PUBLISHED` - PUBLISHED + * `ARCHIVED` - ARCHIVED + * `TRASH` - TRASH + """ + + DRAFT = "DRAFT" + PUBLISHED = "PUBLISHED" + ARCHIVED = "ARCHIVED" + TRASH = "TRASH" + + def visit( + self, + draft: typing.Callable[[], T_Result], + published: typing.Callable[[], T_Result], + archived: typing.Callable[[], T_Result], + trash: typing.Callable[[], T_Result], + ) -> T_Result: + if self is Status3C6Enum.DRAFT: + return draft() + if self is Status3C6Enum.PUBLISHED: + return published() + if self is Status3C6Enum.ARCHIVED: + return archived() + if self is Status3C6Enum.TRASH: + return trash() diff --git a/src/merge/resources/knowledgebase/types/status_fd_5_enum.py b/src/merge/resources/knowledgebase/types/status_fd_5_enum.py new file mode 100644 index 00000000..d753f77c --- /dev/null +++ b/src/merge/resources/knowledgebase/types/status_fd_5_enum.py @@ -0,0 +1,46 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class StatusFd5Enum(str, enum.Enum): + """ + * `SYNCING` - SYNCING + * `DONE` - DONE + * `FAILED` - FAILED + * `DISABLED` - DISABLED + * `PAUSED` - PAUSED + * `PARTIALLY_SYNCED` - PARTIALLY_SYNCED + """ + + SYNCING = "SYNCING" + DONE = "DONE" + FAILED = "FAILED" + DISABLED = "DISABLED" + PAUSED = "PAUSED" + PARTIALLY_SYNCED = "PARTIALLY_SYNCED" + + def visit( + self, + syncing: typing.Callable[[], T_Result], + done: typing.Callable[[], T_Result], + failed: typing.Callable[[], T_Result], + disabled: typing.Callable[[], T_Result], + paused: typing.Callable[[], T_Result], + partially_synced: typing.Callable[[], T_Result], + ) -> T_Result: + if self is StatusFd5Enum.SYNCING: + return syncing() + if self is StatusFd5Enum.DONE: + return done() + if self is StatusFd5Enum.FAILED: + return failed() + if self is StatusFd5Enum.DISABLED: + return disabled() + if self is StatusFd5Enum.PAUSED: + return paused() + if self is StatusFd5Enum.PARTIALLY_SYNCED: + return partially_synced() diff --git a/src/merge/resources/knowledgebase/types/sync_status.py b/src/merge/resources/knowledgebase/types/sync_status.py new file mode 100644 index 00000000..07ab1dc2 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/sync_status.py @@ -0,0 +1,41 @@ +# 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 .selective_sync_configurations_usage_enum import SelectiveSyncConfigurationsUsageEnum +from .sync_status_last_sync_result import SyncStatusLastSyncResult +from .sync_status_status import SyncStatusStatus + + +class SyncStatus(UncheckedBaseModel): + """ + # The SyncStatus Object + ### Description + The `SyncStatus` object is used to represent the syncing state of an account + + ### Usage Example + View the `SyncStatus` for an account to see how recently its models were synced. + """ + + model_name: str + model_id: str + last_sync_start: typing.Optional[dt.datetime] = None + next_sync_start: typing.Optional[dt.datetime] = None + last_sync_result: typing.Optional[SyncStatusLastSyncResult] = None + last_sync_finished: typing.Optional[dt.datetime] = None + status: SyncStatusStatus + is_initial_sync: bool + selective_sync_configurations_usage: typing.Optional[SelectiveSyncConfigurationsUsageEnum] = 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/knowledgebase/types/sync_status_last_sync_result.py b/src/merge/resources/knowledgebase/types/sync_status_last_sync_result.py new file mode 100644 index 00000000..980e7d94 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/sync_status_last_sync_result.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .last_sync_result_enum import LastSyncResultEnum + +SyncStatusLastSyncResult = typing.Union[LastSyncResultEnum, str] diff --git a/src/merge/resources/knowledgebase/types/sync_status_status.py b/src/merge/resources/knowledgebase/types/sync_status_status.py new file mode 100644 index 00000000..78e4cc47 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/sync_status_status.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import typing + +from .status_fd_5_enum import StatusFd5Enum + +SyncStatusStatus = typing.Union[StatusFd5Enum, str] diff --git a/src/merge/resources/knowledgebase/types/user.py b/src/merge/resources/knowledgebase/types/user.py new file mode 100644 index 00000000..35ec6bf1 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/user.py @@ -0,0 +1,60 @@ +# 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 + + +class User(UncheckedBaseModel): + """ + # The User Object + ### Description + The `User` object is used to represent a user within the Knowledge Base account. + ### Usage Example + Fetch from the `GET /api/knowledgebase/v1/users` endpoint and view their users. + """ + + 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. + """ + + name: typing.Optional[str] = pydantic.Field(default=None) + """ + The user's name. + """ + + email_address: typing.Optional[str] = pydantic.Field(default=None) + """ + The user's email address. + """ + + 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/). + """ + + field_mappings: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = 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/knowledgebase/types/validation_problem_source.py b/src/merge/resources/knowledgebase/types/validation_problem_source.py new file mode 100644 index 00000000..fbebe626 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/validation_problem_source.py @@ -0,0 +1,20 @@ +# 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 + + +class ValidationProblemSource(UncheckedBaseModel): + pointer: str + + 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/knowledgebase/types/visibility_enum.py b/src/merge/resources/knowledgebase/types/visibility_enum.py new file mode 100644 index 00000000..287312d8 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/visibility_enum.py @@ -0,0 +1,31 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class VisibilityEnum(str, enum.Enum): + """ + * `PUBLIC` - PUBLIC + * `INTERNAL` - INTERNAL + * `RESTRICTED` - RESTRICTED + """ + + PUBLIC = "PUBLIC" + INTERNAL = "INTERNAL" + RESTRICTED = "RESTRICTED" + + def visit( + self, + public: typing.Callable[[], T_Result], + internal: typing.Callable[[], T_Result], + restricted: typing.Callable[[], T_Result], + ) -> T_Result: + if self is VisibilityEnum.PUBLIC: + return public() + if self is VisibilityEnum.INTERNAL: + return internal() + if self is VisibilityEnum.RESTRICTED: + return restricted() diff --git a/src/merge/resources/knowledgebase/types/warning_validation_problem.py b/src/merge/resources/knowledgebase/types/warning_validation_problem.py new file mode 100644 index 00000000..4785e836 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/warning_validation_problem.py @@ -0,0 +1,24 @@ +# 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 .validation_problem_source import ValidationProblemSource + + +class WarningValidationProblem(UncheckedBaseModel): + source: typing.Optional[ValidationProblemSource] = None + title: str + detail: str + problem_type: str + + 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/knowledgebase/types/webhook_receiver.py b/src/merge/resources/knowledgebase/types/webhook_receiver.py new file mode 100644 index 00000000..fb49c044 --- /dev/null +++ b/src/merge/resources/knowledgebase/types/webhook_receiver.py @@ -0,0 +1,22 @@ +# 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 + + +class WebhookReceiver(UncheckedBaseModel): + event: str + is_active: bool + key: typing.Optional[str] = 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/tests/integration/test_knowledgebase.py b/tests/integration/test_knowledgebase.py new file mode 100644 index 00000000..411670da --- /dev/null +++ b/tests/integration/test_knowledgebase.py @@ -0,0 +1,177 @@ +import os +import pytest +from merge import Merge +from merge.resources.knowledgebase.resources.articles.types.articles_list_request_expand import ArticlesListRequestExpand +from merge.resources.knowledgebase.resources.articles.types.articles_retrieve_request_expand import ArticlesRetrieveRequestExpand +from merge.resources.knowledgebase.resources.containers.types.containers_list_request_expand import ContainersListRequestExpand +from merge.resources.knowledgebase.resources.containers.types.containers_retrieve_request_expand import ContainersRetrieveRequestExpand +from merge.resources.knowledgebase.resources.groups.types.groups_list_request_expand import GroupsListRequestExpand +from merge.resources.knowledgebase.resources.groups.types.groups_retrieve_request_expand import GroupsRetrieveRequestExpand + + +@pytest.fixture +def client(): + account_token = os.environ["SDK_TESTING_KNOWLEDGEBASE_ACCOUNT_TOKEN"] + api_key = os.environ["SDK_TESTING_KEY"] + + return Merge( + account_token=account_token, + api_key=api_key, + ) + +def test_articles_list(client): + response = client.knowledgebase.articles.list() + assert response is not None + assert hasattr(response, 'results') + assert isinstance(response.results, list) + +def test_articles_list_with_expand_author(client): + response = client.knowledgebase.articles.list(expand=ArticlesListRequestExpand.AUTHOR) + assert response is not None + assert hasattr(response, 'results') + assert isinstance(response.results, list) + +def test_articles_list_with_expand_attachments(client): + response = client.knowledgebase.articles.list(expand=ArticlesListRequestExpand.ATTACHMENTS) + assert response is not None + assert hasattr(response, 'results') + assert isinstance(response.results, list) + +def test_articles_list_with_expand_permissions(client): + response = client.knowledgebase.articles.list(expand=ArticlesListRequestExpand.PERMISSIONS) + assert response is not None + assert hasattr(response, 'results') + assert isinstance(response.results, list) + +def test_attachments_list(client): + response = client.knowledgebase.attachments.list() + assert response is not None + assert hasattr(response, 'results') + assert isinstance(response.results, list) + +def test_attachments_retrieve(client): + attachments_response = client.knowledgebase.attachments.list(page_size=1) + + if attachments_response.results: + attachment_id = attachments_response.results[0].id + attachment = client.knowledgebase.attachments.retrieve(id=attachment_id) + assert attachment is not None + assert attachment.id == attachment_id + +def test_containers_list(client): + response = client.knowledgebase.containers.list() + assert response is not None + assert hasattr(response, 'results') + assert isinstance(response.results, list) + +def test_containers_retrieve(client): + containers_response = client.knowledgebase.containers.list(page_size=1) + + if containers_response.results: + container_id = containers_response.results[0].id + container = client.knowledgebase.containers.retrieve(id=container_id) + assert container is not None + assert container.id == container_id + +def test_containers_list_with_expand_permissions(client): + response = client.knowledgebase.containers.list(expand=ContainersListRequestExpand.PERMISSIONS) + assert response is not None + assert hasattr(response, 'results') + assert isinstance(response.results, list) + +def test_containers_list_with_expand_parent_container(client): + response = client.knowledgebase.containers.list(expand=ContainersListRequestExpand.PARENT_CONTAINER) + assert response is not None + assert hasattr(response, 'results') + assert isinstance(response.results, list) + +def test_containers_retrieve_with_expand_permissions(client): + containers_response = client.knowledgebase.containers.list(page_size=1) + + if containers_response.results: + container_id = containers_response.results[0].id + container = client.knowledgebase.containers.retrieve(id=container_id, expand=ContainersRetrieveRequestExpand.PERMISSIONS) + assert container is not None + assert container.id == container_id + +def test_containers_retrieve_with_expand_parent_container(client): + containers_response = client.knowledgebase.containers.list(page_size=1) + + if containers_response.results: + container_id = containers_response.results[0].id + container = client.knowledgebase.containers.retrieve(id=container_id, expand=ContainersRetrieveRequestExpand.PARENT_CONTAINER) + assert container is not None + assert container.id == container_id + +def test_sync_status_list(client): + response = client.knowledgebase.sync_status.list() + assert response is not None + assert hasattr(response, 'results') + assert isinstance(response.results, list) + +def test_account_details_retrieve(client): + account_details = client.knowledgebase.account_details.retrieve() + assert account_details is not None + assert hasattr(account_details, 'id') + +def test_users_list(client): + response = client.knowledgebase.users.list() + assert response is not None + assert hasattr(response, 'results') + assert isinstance(response.results, list) + +def test_users_retrieve(client): + users_response = client.knowledgebase.users.list(page_size=1) + + if users_response.results: + user_id = users_response.results[0].id + user = client.knowledgebase.users.retrieve(id=user_id) + + assert user is not None + assert user.id == user_id + +def test_groups_list(client): + response = client.knowledgebase.groups.list() + assert response is not None + assert hasattr(response, 'results') + assert isinstance(response.results, list) + +def test_groups_list_with_expand_users(client): + response = client.knowledgebase.groups.list(expand=GroupsListRequestExpand.USERS) + assert response is not None + assert hasattr(response, 'results') + assert isinstance(response.results, list) + +def test_groups_list_with_expand_parent_group(client): + response = client.knowledgebase.groups.list(expand=GroupsListRequestExpand.PARENT_GROUP) + assert response is not None + assert hasattr(response, 'results') + assert isinstance(response.results, list) + +def test_audit_trail_list(client): + response = client.knowledgebase.audit_trail.list() + assert response is not None + assert hasattr(response, 'results') + assert isinstance(response.results, list) + +def test_available_actions_retrieve(client): + available_actions = client.knowledgebase.available_actions.retrieve() + + assert available_actions is not None + +def test_linked_accounts_list(client): + response = client.knowledgebase.linked_accounts.list() + + assert response is not None + assert hasattr(response, 'results') + assert isinstance(response.results, list) + +def test_scopes_default_scopes_retrieve(client): + response = client.knowledgebase.scopes.default_scopes_retrieve() + + assert response is not None + +def test_scopes_linked_account_scopes_retrieve(client): + response = client.knowledgebase.scopes.linked_account_scopes_retrieve() + + assert response is not None \ No newline at end of file